; assembly | /* r2dec pseudo code output */ | /* baljsn_datumutil.t/assume @ 0x44f340 */ | #include | | #define SWAP32(n) ((uint32_t) (((n & 0x000000ff) << 24) | \ | ((n & 0x0000ff00) << 8) | \ | ((n & 0x00ff0000) >> 8) | \ | ((n & 0xff000000) >> 24))) | ; (fcn) method.BloombergLP::bdlde::CharConvertUtf32.utf32ToUtf8_std::__1::basic_string_char__std::__1::char_traits_char___std::__1::allocator_char_____unsigned_int_const__unsigned_long__unsigned_char__BloombergLP::bdlde::ByteOrder::Enum_ () | int32_t method_BloombergLP::bdlde::CharConvertUtf32_utf32ToUtf8_std::_1::basic_string_char_std::_1::char_traits_char_std::_1::allocator_char_unsigned_int_const_unsigned_long_unsigned_char_BloombergLP::bdlde::ByteOrder::Enum_ (int64_t arg5, int64_t arg4, int64_t arg3, int64_t arg2, int64_t arg1) { | int64_t var_8h; | int64_t var_10h; | r8 = arg5; | rcx = arg4; | rdx = arg3; | rsi = arg2; | rdi = arg1; | /* BloombergLP::bdlde::CharConvertUtf32::utf32ToUtf8(std::__1::basic_string, std::__1::allocator >*, unsigned int const*, unsigned long*, unsigned char, BloombergLP::bdlde::ByteOrder::Enum) */ 0x0044f340 push rbp | 0x0044f341 push r15 | 0x0044f343 push r14 | 0x0044f345 push r13 | 0x0044f347 push r12 | 0x0044f349 push rbx | 0x0044f34a sub rsp, 0x18 | 0x0044f34e mov r13d, r8d | r13d = r8d; 0x0044f351 mov r12d, ecx | r12d = ecx; 0x0044f354 mov rbp, rdx | 0x0044f357 mov r15, rsi | r15 = rsi; 0x0044f35a mov r14, rdi | r14 = rdi; 0x0044f35d xor eax, eax | eax = 0; 0x0044f35f test r12b, r12b | 0x0044f362 setne al | al = (r12b != 0) ? 1 : 0; 0x0044f365 mov ecx, dword [rsi] | ecx = *(rsi); 0x0044f367 test r8d, r8d | | if (r8d == 0) { 0x0044f36a je 0x44f3e9 | goto label_3; | } 0x0044f36c test ecx, ecx | | if (ecx == 0) { 0x0044f36e je 0x44f460 | goto label_4; | } 0x0044f374 lea rdx, [r15 + 4] | rdx = r15 + 4; 0x0044f378 xor ebx, ebx | ebx = 0; 0x0044f37a jmp 0x44f393 | | while (ecx < 0x80) { | label_0: 0x0044f380 mov ecx, esi | ecx = esi; 0x0044f382 add rbx, rcx | rbx += rcx; 0x0044f385 mov ecx, dword [rdx] | ecx = *(rdx); 0x0044f387 add rdx, 4 | rdx += 4; 0x0044f38b test ecx, ecx | | if (ecx == 0) { 0x0044f38d je 0x44f45b | goto label_5; | } 0x0044f393 bswap ecx | ecx = SWAP32 (ecx); 0x0044f395 mov esi, 1 | esi = 1; 0x0044f39a cmp ecx, 0x80 | 0x0044f3a0 jb 0x44f380 | | } 0x0044f3a2 mov esi, 2 | esi = 2; 0x0044f3a7 cmp ecx, 0x800 | | if (ecx < 0x800) { 0x0044f3ad jb 0x44f380 | goto label_0; | } 0x0044f3af cmp ecx, 0xffff | | if (ecx > 0xffff) { 0x0044f3b5 ja 0x44f3ce | goto label_6; | } 0x0044f3b7 and ecx, 0xfffff800 | ecx &= 0xfffff800; 0x0044f3bd mov esi, eax | esi = eax; 0x0044f3bf cmp ecx, 0xd800 | | if (ecx == 0xd800) { 0x0044f3c5 je 0x44f380 | goto label_0; | } 0x0044f3c7 mov esi, 3 | esi = 3; 0x0044f3cc jmp 0x44f380 | goto label_0; | label_6: 0x0044f3ce mov esi, eax | esi = eax; 0x0044f3d0 cmp ecx, 0x1fffff | | if (ecx > 0x1fffff) { 0x0044f3d6 ja 0x44f380 | goto label_0; | } 0x0044f3d8 mov esi, eax | esi = eax; 0x0044f3da cmp ecx, 0x10ffff | | if (ecx > 0x10ffff) { 0x0044f3e0 ja 0x44f380 | goto label_0; | } 0x0044f3e2 mov esi, 4 | esi = 4; 0x0044f3e7 jmp 0x44f380 | goto label_0; | label_3: 0x0044f3e9 test ecx, ecx | | if (ecx == 0) { 0x0044f3eb je 0x44f460 | goto label_4; | } 0x0044f3ed lea rdx, [r15 + 4] | rdx = r15 + 4; 0x0044f3f1 xor ebx, ebx | ebx = 0; 0x0044f3f3 jmp 0x44f41f | goto label_7; | label_2: 0x0044f3f5 and ecx, 0xfffff800 | ecx &= 0xfffff800; 0x0044f3fb cmp ecx, 0xd800 | 0x0044f401 mov esi, 3 | esi = 3; | if (ecx == 0xd800) { 0x0044f406 cmove esi, eax | esi = eax; | } 0x0044f409 nop dword [rax] | | do { | label_1: 0x0044f410 mov ecx, esi | ecx = esi; 0x0044f412 add rbx, rcx | rbx += rcx; 0x0044f415 mov ecx, dword [rdx] | ecx = *(rdx); 0x0044f417 add rdx, 4 | rdx += 4; 0x0044f41b test ecx, ecx | | if (ecx == 0) { 0x0044f41d je 0x44f45b | goto label_5; | } | label_7: 0x0044f41f mov esi, 1 | esi = 1; 0x0044f424 cmp ecx, 0x80 | 0x0044f42a jb 0x44f410 | | } while (ecx < 0x80); 0x0044f42c mov esi, 2 | esi = 2; 0x0044f431 cmp ecx, 0x800 | | if (ecx < 0x800) { 0x0044f437 jb 0x44f410 | goto label_1; | } 0x0044f439 cmp ecx, 0xffff | | if (ecx <= 0xffff) { 0x0044f43f jbe 0x44f3f5 | goto label_2; | } 0x0044f441 mov esi, eax | esi = eax; 0x0044f443 cmp ecx, 0x1fffff | | if (ecx > 0x1fffff) { 0x0044f449 ja 0x44f410 | goto label_1; | } 0x0044f44b cmp ecx, 0x10ffff | 0x0044f451 mov esi, 4 | esi = 4; | if (ecx > 0x10ffff) { 0x0044f456 cmova esi, eax | esi = eax; | } 0x0044f459 jmp 0x44f410 | goto label_1; | label_5: 0x0044f45b inc rbx | rbx++; 0x0044f45e jmp 0x44f465 | goto label_8; | label_4: 0x0044f460 mov ebx, 1 | ebx = 1; | label_8: 0x0044f465 mov rdi, r14 | rdi = r14; 0x0044f468 mov rsi, rbx | rsi = rbx; 0x0044f46b xor edx, edx | edx = 0; 0x0044f46d call 0x404d00 | std::_1::basic_string,std::_1::allocator>::resize(unsigned long,char) (); 0x0044f472 test rbp, rbp | 0x0044f475 lea rdx, [rsp + 0x10] | rdx = rsp + 0x10; | if (rbp != 0) { 0x0044f47a cmovne rdx, rbp | rdx = rbp; | } 0x0044f47e test byte [r14], 1 | | if ((*(r14) & 1) == 0) { 0x0044f482 jne 0x44f48a | 0x0044f484 lea rdi, [r14 + 1] | rdi = r14 + 1; 0x0044f488 jmp 0x44f48e | | } else { 0x0044f48a mov rdi, qword [r14 + 0x10] | rdi = *((r14 + 0x10)); | } 0x0044f48e movsx r8d, r12b | r8d = (int32_t) r12b; 0x0044f492 lea rcx, [rsp + 8] | rcx = rsp + 8; 0x0044f497 mov rsi, r15 | rsi = r15; 0x0044f49a test r13d, r13d | | if (r13d != 0) { 0x0044f49d je 0x44f4a6 | 0x0044f49f call 0x450f50 | (anonymousnamespace)::Utf32ToUtf8Translator<(anonymousnamespace)::NoopCapacity,(anonymousnamespace)::Utf32ZeroBasedEnd,(anonymousnamespace)::Swapper>::translate(char*,unsigned long,(anonymousnamespace)::Utf32ZeroBasedEnd,unsignedintconst*,unsigned long*,unsigned long*,char) (); 0x0044f4a4 jmp 0x44f4ab | | } else { 0x0044f4a6 call 0x450e20 | eax = (anonymousnamespace)::Utf32ToUtf8Translator<(anonymousnamespace)::NoopCapacity,(anonymousnamespace)::Utf32ZeroBasedEnd,(anonymousnamespace)::NoopSwapper>::translate(char*,unsigned long,(anonymousnamespace)::Utf32ZeroBasedEnd,unsignedintconst*,unsigned long*,unsigned long*,char) (); | } 0x0044f4ab mov ebp, eax | 0x0044f4ad dec rbx | rbx--; 0x0044f4b0 mov rdi, r14 | rdi = r14; 0x0044f4b3 mov rsi, rbx | rsi = rbx; 0x0044f4b6 xor edx, edx | edx = 0; 0x0044f4b8 call 0x404d00 | std::_1::basic_string,std::_1::allocator>::resize(unsigned long,char) (); 0x0044f4bd mov eax, ebp | eax = ebp; 0x0044f4bf add rsp, 0x18 | 0x0044f4c3 pop rbx | 0x0044f4c4 pop r12 | 0x0044f4c6 pop r13 | 0x0044f4c8 pop r14 | 0x0044f4ca pop r15 | 0x0044f4cc pop rbp | 0x0044f4cd ret | return eax; | }