; assembly | /* r2dec pseudo code output */ | /* baljsn_datumutil.t/none @ 0x44f970 */ | #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; | 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) */ 0x0044f970 push rbp | 0x0044f971 push r15 | 0x0044f973 push r14 | 0x0044f975 push r12 | 0x0044f977 push rbx | 0x0044f978 sub rsp, 0x10 | 0x0044f97c mov r12d, r8d | r12d = r8d; 0x0044f97f mov r15d, ecx | r15d = ecx; 0x0044f982 mov rbp, rdx | 0x0044f985 mov r14, rsi | r14 = rsi; 0x0044f988 mov rbx, rdi | rbx = rdi; 0x0044f98b xor eax, eax | eax = 0; 0x0044f98d test r15b, r15b | 0x0044f990 setne al | al = (r15b != 0) ? 1 : 0; 0x0044f993 mov ecx, dword [rsi] | ecx = *(rsi); 0x0044f995 test r8d, r8d | | if (r8d == 0) { 0x0044f998 je 0x44fa19 | goto label_3; | } 0x0044f99a test ecx, ecx | | if (ecx == 0) { 0x0044f99c je 0x44fa90 | goto label_4; | } 0x0044f9a2 lea rdx, [r14 + 4] | rdx = r14 + 4; 0x0044f9a6 xor esi, esi | esi = 0; 0x0044f9a8 jmp 0x44f9c3 | | while (ecx < 0x80) { | label_0: 0x0044f9b0 mov ecx, edi | ecx = edi; 0x0044f9b2 add rsi, rcx | rsi += rcx; 0x0044f9b5 mov ecx, dword [rdx] | ecx = *(rdx); 0x0044f9b7 add rdx, 4 | rdx += 4; 0x0044f9bb test ecx, ecx | | if (ecx == 0) { 0x0044f9bd je 0x44fa8b | goto label_5; | } 0x0044f9c3 bswap ecx | ecx = SWAP32 (ecx); 0x0044f9c5 mov edi, 1 | edi = 1; 0x0044f9ca cmp ecx, 0x80 | 0x0044f9d0 jb 0x44f9b0 | | } 0x0044f9d2 mov edi, 2 | edi = 2; 0x0044f9d7 cmp ecx, 0x800 | | if (ecx < 0x800) { 0x0044f9dd jb 0x44f9b0 | goto label_0; | } 0x0044f9df cmp ecx, 0xffff | | if (ecx > 0xffff) { 0x0044f9e5 ja 0x44f9fe | goto label_6; | } 0x0044f9e7 and ecx, 0xfffff800 | ecx &= 0xfffff800; 0x0044f9ed mov edi, eax | edi = eax; 0x0044f9ef cmp ecx, 0xd800 | | if (ecx == 0xd800) { 0x0044f9f5 je 0x44f9b0 | goto label_0; | } 0x0044f9f7 mov edi, 3 | edi = 3; 0x0044f9fc jmp 0x44f9b0 | goto label_0; | label_6: 0x0044f9fe mov edi, eax | edi = eax; 0x0044fa00 cmp ecx, 0x1fffff | | if (ecx > 0x1fffff) { 0x0044fa06 ja 0x44f9b0 | goto label_0; | } 0x0044fa08 mov edi, eax | edi = eax; 0x0044fa0a cmp ecx, 0x10ffff | | if (ecx > 0x10ffff) { 0x0044fa10 ja 0x44f9b0 | goto label_0; | } 0x0044fa12 mov edi, 4 | edi = 4; 0x0044fa17 jmp 0x44f9b0 | goto label_0; | label_3: 0x0044fa19 test ecx, ecx | | if (ecx == 0) { 0x0044fa1b je 0x44fa90 | goto label_4; | } 0x0044fa1d lea rdx, [r14 + 4] | rdx = r14 + 4; 0x0044fa21 xor esi, esi | esi = 0; 0x0044fa23 jmp 0x44fa4f | goto label_7; | label_2: 0x0044fa25 and ecx, 0xfffff800 | ecx &= 0xfffff800; 0x0044fa2b cmp ecx, 0xd800 | 0x0044fa31 mov edi, 3 | edi = 3; | if (ecx == 0xd800) { 0x0044fa36 cmove edi, eax | edi = eax; | } 0x0044fa39 nop dword [rax] | | do { | label_1: 0x0044fa40 mov ecx, edi | ecx = edi; 0x0044fa42 add rsi, rcx | rsi += rcx; 0x0044fa45 mov ecx, dword [rdx] | ecx = *(rdx); 0x0044fa47 add rdx, 4 | rdx += 4; 0x0044fa4b test ecx, ecx | | if (ecx == 0) { 0x0044fa4d je 0x44fa8b | goto label_5; | } | label_7: 0x0044fa4f mov edi, 1 | edi = 1; 0x0044fa54 cmp ecx, 0x80 | 0x0044fa5a jb 0x44fa40 | | } while (ecx < 0x80); 0x0044fa5c mov edi, 2 | edi = 2; 0x0044fa61 cmp ecx, 0x800 | | if (ecx < 0x800) { 0x0044fa67 jb 0x44fa40 | goto label_1; | } 0x0044fa69 cmp ecx, 0xffff | | if (ecx <= 0xffff) { 0x0044fa6f jbe 0x44fa25 | goto label_2; | } 0x0044fa71 mov edi, eax | edi = eax; 0x0044fa73 cmp ecx, 0x1fffff | | if (ecx > 0x1fffff) { 0x0044fa79 ja 0x44fa40 | goto label_1; | } 0x0044fa7b cmp ecx, 0x10ffff | 0x0044fa81 mov edi, 4 | edi = 4; | if (ecx > 0x10ffff) { 0x0044fa86 cmova edi, eax | edi = eax; | } 0x0044fa89 jmp 0x44fa40 | goto label_1; | label_5: 0x0044fa8b inc rsi | rsi++; 0x0044fa8e jmp 0x44fa95 | goto label_8; | label_4: 0x0044fa90 mov esi, 1 | esi = 1; | label_8: 0x0044fa95 mov rdi, rbx | rdi = rbx; 0x0044fa98 xor edx, edx | edx = 0; 0x0044fa9a call 0x404d00 | std::_1::basic_string,std::_1::allocator>::resize(unsigned long,char) (); 0x0044fa9f test rbp, rbp | 0x0044faa2 lea rdx, [rsp + 8] | rdx = rsp + 8; | if (rbp != 0) { 0x0044faa7 cmovne rdx, rbp | rdx = rbp; | } 0x0044faab test byte [rbx], 1 | | if ((*(rbx) & 1) == 0) { 0x0044faae jne 0x44fab6 | 0x0044fab0 lea rdi, [rbx + 1] | rdi = rbx + 1; 0x0044fab4 jmp 0x44faba | | } else { 0x0044fab6 mov rdi, qword [rbx + 0x10] | rdi = *((rbx + 0x10)); | } 0x0044faba movsx r8d, r15b | r8d = (int32_t) r15b; 0x0044fabe mov rcx, rsp | rcx = rsp; 0x0044fac1 mov rsi, r14 | rsi = r14; 0x0044fac4 test r12d, r12d | | if (r12d != 0) { 0x0044fac7 je 0x44fad0 | 0x0044fac9 call 0x451560 | (anonymousnamespace)::Utf32ToUtf8Translator<(anonymousnamespace)::NoopCapacity,(anonymousnamespace)::Utf32ZeroBasedEnd,(anonymousnamespace)::Swapper>::translate(char*,unsigned long,(anonymousnamespace)::Utf32ZeroBasedEnd,unsignedintconst*,unsigned long*,unsigned long*,char) (); 0x0044face jmp 0x44fad5 | | } else { 0x0044fad0 call 0x451430 | eax = (anonymousnamespace)::Utf32ToUtf8Translator<(anonymousnamespace)::NoopCapacity,(anonymousnamespace)::Utf32ZeroBasedEnd,(anonymousnamespace)::NoopSwapper>::translate(char*,unsigned long,(anonymousnamespace)::Utf32ZeroBasedEnd,unsignedintconst*,unsigned long*,unsigned long*,char) (); | } 0x0044fad5 mov ebp, eax | 0x0044fad7 mov rsi, qword [rsp] | rsi = *(rsp); 0x0044fadb dec rsi | rsi--; 0x0044fade mov rdi, rbx | rdi = rbx; 0x0044fae1 xor edx, edx | edx = 0; 0x0044fae3 call 0x404d00 | std::_1::basic_string,std::_1::allocator>::resize(unsigned long,char) (); 0x0044fae8 mov eax, ebp | eax = ebp; 0x0044faea add rsp, 0x10 | 0x0044faee pop rbx | 0x0044faef pop r12 | 0x0044faf1 pop r14 | 0x0044faf3 pop r15 | 0x0044faf5 pop rbp | 0x0044faf6 ret | return eax; | }