; assembly | /* r2dec pseudo code output */ | /* bdlde_charconvertutf16.t/none @ 0x42f810 */ | #include | ; (fcn) method.BloombergLP::bdlde::CharConvertUtf16.utf16ToUtf8_std::__1::vector_char__std::__1::allocator_char_____wchar_t_const__unsigned_long__char__BloombergLP::bdlde::ByteOrder::Enum_ () | int64_t method_BloombergLP::bdlde::CharConvertUtf16_utf16ToUtf8_std::_1::vector_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) { | int64_t var_8h; | r8 = arg5; | rcx = arg4; | rdx = arg3; | rsi = arg2; | rdi = arg1; | /* BloombergLP::bdlde::CharConvertUtf16::utf16ToUtf8(std::__1::vector >*, wchar_t const*, unsigned long*, char, BloombergLP::bdlde::ByteOrder::Enum) */ 0x0042f810 push rbp | 0x0042f811 push r15 | 0x0042f813 push r14 | 0x0042f815 push r12 | 0x0042f817 push rbx | 0x0042f818 sub rsp, 0x10 | 0x0042f81c mov r12d, ecx | r12d = ecx; 0x0042f81f mov r14, rdx | r14 = rdx; 0x0042f822 mov r15, rsi | r15 = rsi; 0x0042f825 mov rbx, rdi | rbx = rdi; 0x0042f828 mov ebp, dword [rsi] | ebp = *(rsi); 0x0042f82a xor esi, esi | esi = 0; 0x0042f82c test r8d, r8d | | if (r8d == 0) { 0x0042f82f je 0x42f903 | goto label_4; | } 0x0042f835 test ebp, ebp | | if (ebp == 0) { 0x0042f837 je 0x42f8cd | goto label_5; | } 0x0042f83d mov r8d, 0xfc0000 | r8d = 0xfc0000; 0x0042f843 mov rdx, r15 | rdx = r15; 0x0042f846 jmp 0x42f866 | goto label_6; | label_0: 0x0042f850 cmp eax, 0x800 | 0x0042f855 sbb rsi, 0 | 0x0042f859 add rsi, 3 | rsi += 3; | do { | label_2: 0x0042f85d mov ebp, dword [rdi] | ebp = *(rdi); 0x0042f85f mov rdx, rdi | rdx = rdi; 0x0042f862 test ebp, ebp | | if (ebp == 0) { 0x0042f864 je 0x42f8cd | goto label_5; | } | label_6: 0x0042f866 mov edi, ebp | edi = ebp; 0x0042f868 shr edi, 0x18 | edi >>= 0x18; 0x0042f86b mov eax, ebp | eax = ebp; 0x0042f86d shr eax, 8 | eax >>= 8; 0x0042f870 and eax, 0xff00 | eax &= 0xff00; 0x0042f875 or eax, edi | eax |= edi; 0x0042f877 cmp eax, 0x7f | | if (eax > 0x7f) { 0x0042f87a ja 0x42f890 | goto label_7; | } 0x0042f87c add rdx, 4 | rdx += 4; 0x0042f880 inc rsi | rsi++; | label_1: 0x0042f883 mov rdi, rdx | rdi = rdx; 0x0042f886 jmp 0x42f85d | | } while (1); | label_7: 0x0042f890 mov ecx, ebp | ecx = ebp; 0x0042f892 and ecx, 0xf80000 | ecx &= 0xf80000; 0x0042f898 lea rdi, [rdx + 4] | rdi = rdx + 4; 0x0042f89c cmp ecx, 0xd80000 | | if (ecx != 0xd80000) { 0x0042f8a2 jne 0x42f850 | goto label_0; | } 0x0042f8a4 and ebp, 0xfc0000 | ebp &= 0xfc0000; 0x0042f8aa cmp ebp, 0xd80000 | | if (ebp == 0xd80000) { 0x0042f8b0 jne 0x42f8c8 | 0x0042f8b2 mov eax, dword [rdi] | eax = *(rdi); 0x0042f8b4 and eax, r8d | eax &= r8d; 0x0042f8b7 cmp eax, 0xdc0000 | | if (eax != 0xdc0000) { 0x0042f8bc jne 0x42f8c8 | goto label_8; | } 0x0042f8be add rdx, 8 | rdx += 8; 0x0042f8c2 add rsi, 4 | rsi += 4; 0x0042f8c6 jmp 0x42f883 | goto label_1; | } | label_8: 0x0042f8c8 inc rsi | rsi++; 0x0042f8cb jmp 0x42f85d | goto label_2; | label_5: 0x0042f8cd inc rsi | rsi++; 0x0042f8d0 mov rdi, qword [rbx] | rdi = *(rbx); 0x0042f8d3 mov rax, qword [rbx + 8] | rax = *((rbx + 8)); 0x0042f8d7 sub rax, rdi | rax -= rdi; 0x0042f8da cmp rsi, rax | | if (rsi > rax) { 0x0042f8dd jbe 0x42f8ea | 0x0042f8df mov rdi, rbx | 0x0042f8e2 call 0x433890 | std::_1::vector>::resize(unsigned long) (rbx, rsi); 0x0042f8e7 mov rdi, qword [rbx] | rdi = *(rbx); | } 0x0042f8ea movsx r8d, r12b | r8d = (int32_t) r12b; 0x0042f8ee lea rcx, [rsp + 8] | rcx = rsp + 8; 0x0042f8f3 mov rsi, r15 | rsi = r15; 0x0042f8f6 mov rdx, r14 | rdx = r14; 0x0042f8f9 call 0x4336e0 | int(anonymousnamespace)::localUtf16ToUtf8,(anonymousnamespace)::Swapper>(char*,(anonymousnamespace)::NoOpCapacity,wchar_tconst*,(anonymousnamespace)::Utf16::ZeroBasedEnd,(anonymousnamespace)::Swapper,unsigned long*,unsigned long*,char) (); 0x0042f8fe jmp 0x42f9cb | goto label_9; | label_4: 0x0042f903 test ebp, ebp | | if (ebp == 0) { 0x0042f905 je 0x42f99a | goto label_10; | } 0x0042f90b mov ecx, 0xfc00 | ecx = 0xfc00; 0x0042f910 mov rdx, r15 | rdx = r15; 0x0042f913 jmp 0x42f937 | | while (eax != 0xd800) { 0x0042f920 cmp ebp, 0x800 | 0x0042f926 sbb rsi, 0 | 0x0042f92a add rsi, 3 | rsi += 3; | label_3: 0x0042f92e mov ebp, dword [rdi] | ebp = *(rdi); 0x0042f930 mov rdx, rdi | rdx = rdi; 0x0042f933 test ebp, ebp | | if (ebp == 0) { 0x0042f935 je 0x42f99a | goto label_10; | } 0x0042f937 cmp ebp, 0x7f | | if (ebp <= 0x7f) { 0x0042f93a ja 0x42f950 | 0x0042f93c add rdx, 4 | rdx += 4; 0x0042f940 inc rsi | rsi++; 0x0042f943 jmp 0x42f990 | goto label_11; | } 0x0042f950 mov eax, ebp | eax = ebp; 0x0042f952 and eax, 0xf800 | eax &= 0xf800; 0x0042f957 lea rdi, [rdx + 4] | rdi = rdx + 4; 0x0042f95b cmp eax, 0xd800 | 0x0042f960 jne 0x42f920 | | } 0x0042f962 and ebp, 0xfc00 | ebp &= 0xfc00; 0x0042f968 cmp ebp, 0xd800 | | if (ebp == 0xd800) { 0x0042f96e jne 0x42f995 | 0x0042f970 mov eax, dword [rdi] | eax = *(rdi); 0x0042f972 and eax, ecx | eax &= ecx; 0x0042f974 cmp eax, 0xdc00 | | if (eax != 0xdc00) { 0x0042f979 jne 0x42f995 | goto label_12; | } 0x0042f97b add rdx, 8 | rdx += 8; 0x0042f97f add rsi, 4 | rsi += 4; 0x0042f983 nop word cs:[rax + rax] | 0x0042f98d nop dword [rax] | | label_11: 0x0042f990 mov rdi, rdx | rdi = rdx; 0x0042f993 jmp 0x42f92e | goto label_3; | } | label_12: 0x0042f995 inc rsi | rsi++; 0x0042f998 jmp 0x42f92e | goto label_3; | label_10: 0x0042f99a inc rsi | rsi++; 0x0042f99d mov rdi, qword [rbx] | rdi = *(rbx); 0x0042f9a0 mov rax, qword [rbx + 8] | rax = *((rbx + 8)); 0x0042f9a4 sub rax, rdi | rax -= rdi; 0x0042f9a7 cmp rsi, rax | | if (rsi > rax) { 0x0042f9aa jbe 0x42f9b7 | 0x0042f9ac mov rdi, rbx | 0x0042f9af call 0x433890 | std::_1::vector>::resize(unsigned long) (rbx, rsi); 0x0042f9b4 mov rdi, qword [rbx] | rdi = *(rbx); | } 0x0042f9b7 movsx r8d, r12b | r8d = (int32_t) r12b; 0x0042f9bb lea rcx, [rsp + 8] | rcx = rsp + 8; 0x0042f9c0 mov rsi, r15 | rsi = r15; 0x0042f9c3 mov rdx, r14 | rdx = r14; 0x0042f9c6 call 0x433530 | eax = int(anonymousnamespace)::localUtf16ToUtf8,(anonymousnamespace)::NoOpSwapper>(char*,(anonymousnamespace)::NoOpCapacity,wchar_tconst*,(anonymousnamespace)::Utf16::ZeroBasedEnd,(anonymousnamespace)::NoOpSwapper,unsigned long*,unsigned long*,char) (); | label_9: 0x0042f9cb mov ebp, eax | 0x0042f9cd mov rsi, qword [rsp + 8] | rsi = *((rsp + 8)); 0x0042f9d2 mov rax, qword [rbx + 8] | rax = *((rbx + 8)); 0x0042f9d6 sub rax, qword [rbx] | rax -= *(rbx); 0x0042f9d9 cmp rax, rsi | | if (rax != rsi) { 0x0042f9dc je 0x42f9e6 | 0x0042f9de mov rdi, rbx | 0x0042f9e1 call 0x433890 | std::_1::vector>::resize(unsigned long) (rbx, rsi); | } 0x0042f9e6 mov eax, ebp | eax = ebp; 0x0042f9e8 add rsp, 0x10 | 0x0042f9ec pop rbx | 0x0042f9ed pop r12 | 0x0042f9ef pop r14 | 0x0042f9f1 pop r15 | 0x0042f9f3 pop rbp | 0x0042f9f4 ret | return rax; | }