; assembly | /* r2dec pseudo code output */ | /* bdlde_charconvertutf16.t/none @ 0x42e6c0 */ | #include | ; (fcn) method.BloombergLP::bdlde::CharConvertUtf16.utf16ToUtf8_bsl::basic_string_char__std::__1::char_traits_char___bsl::allocator_char_____wchar_t_const__unsigned_long__char__BloombergLP::bdlde::ByteOrder::Enum_ () | int32_t method_BloombergLP::bdlde::CharConvertUtf16_utf16ToUtf8_bsl::basic_string_char_std::_1::char_traits_char_bsl::allocator_char_wchar_t_const_unsigned_long_char_BloombergLP::bdlde::ByteOrder::Enum_ (int64_t arg5, uint32_t arg4, uint32_t arg3, int64_t arg2, char * arg1) { | int64_t var_8h; | r8 = arg5; | rcx = arg4; | rdx = arg3; | rsi = arg2; | rdi = arg1; | /* BloombergLP::bdlde::CharConvertUtf16::utf16ToUtf8(bsl::basic_string, bsl::allocator >*, wchar_t const*, unsigned long*, char, BloombergLP::bdlde::ByteOrder::Enum) */ 0x0042e6c0 push rbp | 0x0042e6c1 push r15 | 0x0042e6c3 push r14 | 0x0042e6c5 push r12 | 0x0042e6c7 push rbx | 0x0042e6c8 sub rsp, 0x10 | 0x0042e6cc mov r12d, ecx | r12d = ecx; 0x0042e6cf mov r14, rdx | r14 = rdx; 0x0042e6d2 mov r15, rsi | r15 = rsi; 0x0042e6d5 mov rbx, rdi | rbx = rdi; 0x0042e6d8 mov ebp, dword [rsi] | ebp = *(rsi); 0x0042e6da xor esi, esi | esi = 0; 0x0042e6dc test r8d, r8d | | if (r8d == 0) { 0x0042e6df je 0x42e7ad | goto label_4; | } 0x0042e6e5 test ebp, ebp | | if (ebp == 0) { 0x0042e6e7 je 0x42e77d | goto label_5; | } 0x0042e6ed mov r8d, 0xfc0000 | r8d = 0xfc0000; 0x0042e6f3 mov rdx, r15 | rdx = r15; 0x0042e6f6 jmp 0x42e716 | goto label_6; | label_0: 0x0042e700 cmp eax, 0x800 | 0x0042e705 sbb rsi, 0 | 0x0042e709 add rsi, 3 | rsi += 3; | do { | label_2: 0x0042e70d mov ebp, dword [rdi] | ebp = *(rdi); 0x0042e70f mov rdx, rdi | rdx = rdi; 0x0042e712 test ebp, ebp | | if (ebp == 0) { 0x0042e714 je 0x42e77d | goto label_5; | } | label_6: 0x0042e716 mov edi, ebp | edi = ebp; 0x0042e718 shr edi, 0x18 | edi >>= 0x18; 0x0042e71b mov eax, ebp | eax = ebp; 0x0042e71d shr eax, 8 | eax >>= 8; 0x0042e720 and eax, 0xff00 | eax &= 0xff00; 0x0042e725 or eax, edi | eax |= edi; 0x0042e727 cmp eax, 0x7f | | if (eax > 0x7f) { 0x0042e72a ja 0x42e740 | goto label_7; | } 0x0042e72c add rdx, 4 | rdx += 4; 0x0042e730 inc rsi | rsi++; | label_1: 0x0042e733 mov rdi, rdx | rdi = rdx; 0x0042e736 jmp 0x42e70d | | } while (1); | label_7: 0x0042e740 mov ecx, ebp | ecx = ebp; 0x0042e742 and ecx, 0xf80000 | ecx &= 0xf80000; 0x0042e748 lea rdi, [rdx + 4] | rdi = rdx + 4; 0x0042e74c cmp ecx, 0xd80000 | | if (ecx != 0xd80000) { 0x0042e752 jne 0x42e700 | goto label_0; | } 0x0042e754 and ebp, 0xfc0000 | ebp &= 0xfc0000; 0x0042e75a cmp ebp, 0xd80000 | | if (ebp == 0xd80000) { 0x0042e760 jne 0x42e778 | 0x0042e762 mov eax, dword [rdi] | eax = *(rdi); 0x0042e764 and eax, r8d | eax &= r8d; 0x0042e767 cmp eax, 0xdc0000 | | if (eax != 0xdc0000) { 0x0042e76c jne 0x42e778 | goto label_8; | } 0x0042e76e add rdx, 8 | rdx += 8; 0x0042e772 add rsi, 4 | rsi += 4; 0x0042e776 jmp 0x42e733 | goto label_1; | } | label_8: 0x0042e778 inc rsi | rsi++; 0x0042e77b jmp 0x42e70d | goto label_2; | label_5: 0x0042e77d inc rsi | rsi++; 0x0042e780 cmp rsi, qword [rbx + 0x18] | | if (rsi > *((rbx + 0x18))) { 0x0042e784 jbe 0x42e79a | 0x0042e786 cmp rsi, 0xffffffffffffffff | | if (rsi == -1) { 0x0042e78a je 0x42e8b7 | goto label_9; | } 0x0042e790 mov rdi, rbx | 0x0042e793 xor edx, edx | 0x0042e795 call 0x437b80 | bsl::basic_string,bsl::allocator>::privateResizeRaw(unsigned long,char) (rbx, rsi, 0); | } 0x0042e79a cmp qword [rbx + 0x20], 0x17 | | if (*((rbx + 0x20)) != 0x17) { 0x0042e79f jne 0x42e85f | goto label_10; | } 0x0042e7a5 mov rdi, rbx | rdi = rbx; 0x0042e7a8 jmp 0x42e862 | goto label_11; | label_4: 0x0042e7ad test ebp, ebp | | if (ebp == 0) { 0x0042e7af je 0x42e83a | goto label_12; | } 0x0042e7b5 mov ecx, 0xfc00 | ecx = 0xfc00; 0x0042e7ba mov rdx, r15 | rdx = r15; 0x0042e7bd jmp 0x42e7d7 | | while (eax != 0xd800) { 0x0042e7c0 cmp ebp, 0x800 | 0x0042e7c6 sbb rsi, 0 | 0x0042e7ca add rsi, 3 | rsi += 3; | label_3: 0x0042e7ce mov ebp, dword [rdi] | ebp = *(rdi); 0x0042e7d0 mov rdx, rdi | rdx = rdi; 0x0042e7d3 test ebp, ebp | | if (ebp == 0) { 0x0042e7d5 je 0x42e83a | goto label_12; | } 0x0042e7d7 cmp ebp, 0x7f | | if (ebp <= 0x7f) { 0x0042e7da ja 0x42e7f0 | 0x0042e7dc add rdx, 4 | rdx += 4; 0x0042e7e0 inc rsi | rsi++; 0x0042e7e3 jmp 0x42e830 | goto label_13; | } 0x0042e7f0 mov eax, ebp | eax = ebp; 0x0042e7f2 and eax, 0xf800 | eax &= 0xf800; 0x0042e7f7 lea rdi, [rdx + 4] | rdi = rdx + 4; 0x0042e7fb cmp eax, 0xd800 | 0x0042e800 jne 0x42e7c0 | | } 0x0042e802 and ebp, 0xfc00 | ebp &= 0xfc00; 0x0042e808 cmp ebp, 0xd800 | | if (ebp == 0xd800) { 0x0042e80e jne 0x42e835 | 0x0042e810 mov eax, dword [rdi] | eax = *(rdi); 0x0042e812 and eax, ecx | eax &= ecx; 0x0042e814 cmp eax, 0xdc00 | | if (eax != 0xdc00) { 0x0042e819 jne 0x42e835 | goto label_14; | } 0x0042e81b add rdx, 8 | rdx += 8; 0x0042e81f add rsi, 4 | rsi += 4; 0x0042e823 nop word cs:[rax + rax] | 0x0042e82d nop dword [rax] | | label_13: 0x0042e830 mov rdi, rdx | rdi = rdx; 0x0042e833 jmp 0x42e7ce | goto label_3; | } | label_14: 0x0042e835 inc rsi | rsi++; 0x0042e838 jmp 0x42e7ce | goto label_3; | label_12: 0x0042e83a inc rsi | rsi++; 0x0042e83d cmp rsi, qword [rbx + 0x18] | | if (rsi > *((rbx + 0x18))) { 0x0042e841 jbe 0x42e853 | 0x0042e843 cmp rsi, 0xffffffffffffffff | | if (rsi == -1) { 0x0042e847 je 0x42e8b7 | goto label_9; | } 0x0042e849 mov rdi, rbx | 0x0042e84c xor edx, edx | 0x0042e84e call 0x437b80 | bsl::basic_string,bsl::allocator>::privateResizeRaw(unsigned long,char) (rbx, rsi, 0); | } 0x0042e853 cmp qword [rbx + 0x20], 0x17 | | if (*((rbx + 0x20)) == 0x17) { 0x0042e858 jne 0x42e878 | 0x0042e85a mov rdi, rbx | rdi = rbx; 0x0042e85d jmp 0x42e87b | goto label_15; | label_10: 0x0042e85f mov rdi, qword [rbx] | rdi = *(rbx); | label_11: 0x0042e862 movsx r8d, r12b | r8d = (int32_t) r12b; 0x0042e866 lea rcx, [rsp + 8] | rcx = rsp + 8; 0x0042e86b mov rsi, r15 | rsi = r15; 0x0042e86e mov rdx, r14 | rdx = r14; 0x0042e871 call 0x4336e0 | int(anonymousnamespace)::localUtf16ToUtf8,(anonymousnamespace)::Swapper>(char*,(anonymousnamespace)::NoOpCapacity,wchar_tconst*,(anonymousnamespace)::Utf16::ZeroBasedEnd,(anonymousnamespace)::Swapper,unsigned long*,unsigned long*,char) (); 0x0042e876 jmp 0x42e88f | | } else { 0x0042e878 mov rdi, qword [rbx] | rdi = *(rbx); | label_15: 0x0042e87b movsx r8d, r12b | r8d = (int32_t) r12b; 0x0042e87f lea rcx, [rsp + 8] | rcx = rsp + 8; 0x0042e884 mov rsi, r15 | rsi = r15; 0x0042e887 mov rdx, r14 | rdx = r14; 0x0042e88a call 0x433530 | eax = int(anonymousnamespace)::localUtf16ToUtf8,(anonymousnamespace)::NoOpSwapper>(char*,(anonymousnamespace)::NoOpCapacity,wchar_tconst*,(anonymousnamespace)::Utf16::ZeroBasedEnd,(anonymousnamespace)::NoOpSwapper,unsigned long*,unsigned long*,char) (); | } 0x0042e88f mov rsi, qword [rsp + 8] | rsi = *((rsp + 8)); 0x0042e894 test rsi, rsi | | if (rsi != 0) { 0x0042e897 je 0x42e8b7 | 0x0042e899 mov ebp, eax | 0x0042e89b dec rsi | rsi--; 0x0042e89e mov rdi, rbx | 0x0042e8a1 xor edx, edx | 0x0042e8a3 call 0x437b80 | bsl::basic_string,bsl::allocator>::privateResizeRaw(unsigned long,char) (rbx, rsi, 0); 0x0042e8a8 mov eax, ebp | eax = ebp; 0x0042e8aa add rsp, 0x10 | 0x0042e8ae pop rbx | 0x0042e8af pop r12 | 0x0042e8b1 pop r14 | 0x0042e8b3 pop r15 | 0x0042e8b5 pop rbp | 0x0042e8b6 ret | return eax; | } | label_9: 0x0042e8b7 mov edi, 0x45f3de | 0x0042e8bc call 0x435240 | return BloombergLP::bslstl::StdExceptUtil::throwLengthError(char const*) ("string<...>::resize(n): string too long"); | }