; assembly | /* r2dec pseudo code output */ | /* bdlde_charconvertutf16.t/assume @ 0x42ea60 */ | #include | ; (fcn) method.BloombergLP::bdlde::CharConvertUtf16.utf16ToUtf8_std::__1::basic_string_char__std::__1::char_traits_char___std::__1::allocator_char_____wchar_t_const__unsigned_long__char__BloombergLP::bdlde::ByteOrder::Enum_ () | int32_t method_BloombergLP::bdlde::CharConvertUtf16_utf16ToUtf8_std::_1::basic_string_char_std::_1::char_traits_char_std::_1::allocator_char_wchar_t_const_unsigned_long_char_BloombergLP::bdlde::ByteOrder::Enum_ (int64_t arg5, int64_t arg4, int64_t arg3, int64_t arg2, int64_t arg1) { | r8 = arg5; | rcx = arg4; | rdx = arg3; | rsi = arg2; | rdi = arg1; | /* BloombergLP::bdlde::CharConvertUtf16::utf16ToUtf8(std::__1::basic_string, std::__1::allocator >*, wchar_t const*, unsigned long*, char, BloombergLP::bdlde::ByteOrder::Enum) */ 0x0042ea60 push rbp | 0x0042ea61 push r15 | 0x0042ea63 push r14 | 0x0042ea65 push r13 | 0x0042ea67 push r12 | 0x0042ea69 push rbx | 0x0042ea6a push rax | 0x0042ea6b mov r12d, ecx | r12d = ecx; 0x0042ea6e mov r14, rdx | r14 = rdx; 0x0042ea71 mov r15, rsi | r15 = rsi; 0x0042ea74 mov r13, rdi | r13 = rdi; 0x0042ea77 mov eax, dword [rsi] | eax = *(rsi); 0x0042ea79 xor ebp, ebp | ebp = 0; 0x0042ea7b test r8d, r8d | | if (r8d == 0) { 0x0042ea7e je 0x42eb49 | goto label_6; | } 0x0042ea84 test eax, eax | | if (eax == 0) { 0x0042ea86 je 0x42eb1a | goto label_7; | } 0x0042ea8c mov ecx, 0xfc0000 | ecx = 0xfc0000; 0x0042ea91 mov rdx, r15 | rdx = r15; 0x0042ea94 jmp 0x42eab7 | goto label_8; | label_0: 0x0042eaa0 cmp edi, 0x800 | 0x0042eaa6 sbb rbp, 0 | 0x0042eaaa add rbp, 3 | rbp += 3; | do { | label_2: 0x0042eaae mov eax, dword [rsi] | eax = *(rsi); 0x0042eab0 mov rdx, rsi | rdx = rsi; 0x0042eab3 test eax, eax | | if (eax == 0) { 0x0042eab5 je 0x42eb1a | goto label_7; | } | label_8: 0x0042eab7 mov esi, eax | esi = eax; 0x0042eab9 shr esi, 0x18 | esi >>= 0x18; 0x0042eabc mov edi, eax | edi = eax; 0x0042eabe shr edi, 8 | edi >>= 8; 0x0042eac1 and edi, 0xff00 | edi &= 0xff00; 0x0042eac7 or edi, esi | edi |= esi; 0x0042eac9 cmp edi, 0x7f | | if (edi > 0x7f) { 0x0042eacc ja 0x42eae0 | goto label_9; | } 0x0042eace add rdx, 4 | rdx += 4; 0x0042ead2 inc rbp | rbp++; | label_1: 0x0042ead5 mov rsi, rdx | rsi = rdx; 0x0042ead8 jmp 0x42eaae | | } while (1); | label_9: 0x0042eae0 mov ebx, eax | ebx = eax; 0x0042eae2 and ebx, 0xf80000 | ebx &= 0xf80000; 0x0042eae8 lea rsi, [rdx + 4] | rsi = rdx + 4; 0x0042eaec cmp ebx, 0xd80000 | | if (ebx != 0xd80000) { 0x0042eaf2 jne 0x42eaa0 | goto label_0; | } 0x0042eaf4 and eax, 0xfc0000 | eax &= 0xfc0000; 0x0042eaf9 cmp eax, 0xd80000 | | if (eax == 0xd80000) { 0x0042eafe jne 0x42eb15 | 0x0042eb00 mov eax, dword [rsi] | eax = *(rsi); 0x0042eb02 and eax, ecx | eax &= ecx; 0x0042eb04 cmp eax, 0xdc0000 | | if (eax != 0xdc0000) { 0x0042eb09 jne 0x42eb15 | goto label_10; | } 0x0042eb0b add rdx, 8 | rdx += 8; 0x0042eb0f add rbp, 4 | rbp += 4; 0x0042eb13 jmp 0x42ead5 | goto label_1; | } | label_10: 0x0042eb15 inc rbp | rbp++; 0x0042eb18 jmp 0x42eaae | goto label_2; | label_7: 0x0042eb1a inc rbp | rbp++; 0x0042eb1d mov al, byte [r13] | al = *(r13); 0x0042eb21 test al, 1 | | if ((al & 1) != 0) { 0x0042eb23 jne 0x42ebf2 | goto label_11; | } 0x0042eb29 movzx ecx, al | ecx = (int32_t) al; 0x0042eb2c shr rcx, 1 | rcx >>= 1; 0x0042eb2f cmp rbp, rcx | | if (rbp > rcx) { 0x0042eb32 ja 0x42ebff | goto label_12; | } | label_4: 0x0042eb38 test al, 1 | | if ((al & 1) != 0) { 0x0042eb3a jne 0x42ec18 | goto label_13; | } | label_5: 0x0042eb40 lea rdi, [r13 + 1] | rdi = r13 + 1; 0x0042eb44 jmp 0x42ec1c | goto label_14; | label_6: 0x0042eb49 test eax, eax | | if (eax == 0) { 0x0042eb4b je 0x42ebda | goto label_15; | } 0x0042eb51 mov ecx, 0xfc00 | ecx = 0xfc00; 0x0042eb56 mov rdx, r15 | rdx = r15; 0x0042eb59 jmp 0x42eb76 | | while (edi != 0xd800) { 0x0042eb60 cmp eax, 0x800 | 0x0042eb65 sbb rbp, 0 | 0x0042eb69 add rbp, 3 | rbp += 3; | label_3: 0x0042eb6d mov eax, dword [rsi] | eax = *(rsi); 0x0042eb6f mov rdx, rsi | rdx = rsi; 0x0042eb72 test eax, eax | | if (eax == 0) { 0x0042eb74 je 0x42ebda | goto label_15; | } 0x0042eb76 cmp eax, 0x7f | | if (eax <= 0x7f) { 0x0042eb79 ja 0x42eb90 | 0x0042eb7b add rdx, 4 | rdx += 4; 0x0042eb7f inc rbp | rbp++; 0x0042eb82 jmp 0x42ebd0 | goto label_16; | } 0x0042eb90 mov edi, eax | edi = eax; 0x0042eb92 and edi, 0xf800 | edi &= 0xf800; 0x0042eb98 lea rsi, [rdx + 4] | rsi = rdx + 4; 0x0042eb9c cmp edi, 0xd800 | 0x0042eba2 jne 0x42eb60 | | } 0x0042eba4 and eax, 0xfc00 | eax &= 0xfc00; 0x0042eba9 cmp eax, 0xd800 | | if (eax == 0xd800) { 0x0042ebae jne 0x42ebd5 | 0x0042ebb0 mov eax, dword [rsi] | eax = *(rsi); 0x0042ebb2 and eax, ecx | eax &= ecx; 0x0042ebb4 cmp eax, 0xdc00 | | if (eax != 0xdc00) { 0x0042ebb9 jne 0x42ebd5 | goto label_17; | } 0x0042ebbb add rdx, 8 | rdx += 8; 0x0042ebbf add rbp, 4 | rbp += 4; 0x0042ebc3 nop word cs:[rax + rax] | 0x0042ebcd nop dword [rax] | | label_16: 0x0042ebd0 mov rsi, rdx | rsi = rdx; 0x0042ebd3 jmp 0x42eb6d | goto label_3; | } | label_17: 0x0042ebd5 inc rbp | rbp++; 0x0042ebd8 jmp 0x42eb6d | goto label_3; | label_15: 0x0042ebda inc rbp | rbp++; 0x0042ebdd mov al, byte [r13] | al = *(r13); 0x0042ebe1 test al, 1 | | if ((al & 1) != 0) { 0x0042ebe3 jne 0x42ec30 | goto label_18; | } 0x0042ebe5 movzx ecx, al | ecx = (int32_t) al; 0x0042ebe8 shr rcx, 1 | rcx >>= 1; 0x0042ebeb cmp rbp, rcx | | if (rbp > rcx) { 0x0042ebee ja 0x42ec39 | goto label_19; | } 0x0042ebf0 jmp 0x42ec4a | goto label_20; | label_11: 0x0042ebf2 mov rcx, qword [r13 + 8] | rcx = *((r13 + 8)); 0x0042ebf6 cmp rbp, rcx | | if (rbp <= rcx) { 0x0042ebf9 jbe 0x42eb38 | goto label_4; | } | label_12: 0x0042ebff mov rdi, r13 | rdi = r13; 0x0042ec02 mov rsi, rbp | rsi = rbp; 0x0042ec05 xor edx, edx | edx = 0; 0x0042ec07 call 0x403a30 | std::_1::basic_string,std::_1::allocator>::resize(unsigned long,char) (); 0x0042ec0c mov al, byte [r13] | al = *(r13); 0x0042ec10 test al, 1 | | if ((al & 1) == 0) { 0x0042ec12 je 0x42eb40 | goto label_5; | } | label_13: 0x0042ec18 mov rdi, qword [r13 + 0x10] | rdi = *((r13 + 0x10)); | label_14: 0x0042ec1c movsx r8d, r12b | r8d = (int32_t) r12b; 0x0042ec20 mov rcx, rsp | rcx = rsp; 0x0042ec23 mov rsi, r15 | rsi = r15; 0x0042ec26 mov rdx, r14 | rdx = r14; 0x0042ec29 call 0x433900 | int(anonymousnamespace)::localUtf16ToUtf8,(anonymousnamespace)::Swapper>(char*,(anonymousnamespace)::NoOpCapacity,wchar_tconst*,(anonymousnamespace)::Utf16::ZeroBasedEnd,(anonymousnamespace)::Swapper,unsigned long*,unsigned long*,char) (); 0x0042ec2e jmp 0x42ec6a | goto label_21; | label_18: 0x0042ec30 mov rcx, qword [r13 + 8] | rcx = *((r13 + 8)); 0x0042ec34 cmp rbp, rcx | | if (rbp > rcx) { 0x0042ec37 jbe 0x42ec4a | | label_19: 0x0042ec39 mov rdi, r13 | rdi = r13; 0x0042ec3c mov rsi, rbp | rsi = rbp; 0x0042ec3f xor edx, edx | edx = 0; 0x0042ec41 call 0x403a30 | std::_1::basic_string,std::_1::allocator>::resize(unsigned long,char) (); 0x0042ec46 mov al, byte [r13] | al = *(r13); | } | label_20: 0x0042ec4a test al, 1 | | if ((al & 1) == 0) { 0x0042ec4c jne 0x42ec54 | 0x0042ec4e lea rdi, [r13 + 1] | rdi = r13 + 1; 0x0042ec52 jmp 0x42ec58 | | } else { 0x0042ec54 mov rdi, qword [r13 + 0x10] | rdi = *((r13 + 0x10)); | } 0x0042ec58 movsx r8d, r12b | r8d = (int32_t) r12b; 0x0042ec5c mov rcx, rsp | rcx = rsp; 0x0042ec5f mov rsi, r15 | rsi = r15; 0x0042ec62 mov rdx, r14 | rdx = r14; 0x0042ec65 call 0x433750 | eax = int(anonymousnamespace)::localUtf16ToUtf8,(anonymousnamespace)::NoOpSwapper>(char*,(anonymousnamespace)::NoOpCapacity,wchar_tconst*,(anonymousnamespace)::Utf16::ZeroBasedEnd,(anonymousnamespace)::NoOpSwapper,unsigned long*,unsigned long*,char) (); | label_21: 0x0042ec6a mov ebx, eax | ebx = eax; 0x0042ec6c mov rsi, qword [rsp] | rsi = *(rsp); 0x0042ec70 cmp rsi, rbp | 0x0042ec73 dec rsi | rsi--; 0x0042ec76 mov rdi, r13 | rdi = r13; 0x0042ec79 xor edx, edx | edx = 0; 0x0042ec7b call 0x403a30 | std::_1::basic_string,std::_1::allocator>::resize(unsigned long,char) (); 0x0042ec80 mov eax, ebx | eax = ebx; 0x0042ec82 add rsp, 8 | 0x0042ec86 pop rbx | 0x0042ec87 pop r12 | 0x0042ec89 pop r13 | 0x0042ec8b pop r14 | 0x0042ec8d pop r15 | 0x0042ec8f pop rbp | 0x0042ec90 ret | return eax; | }