; assembly | /* r2dec pseudo code output */ | /* bdlde_charconvertutf16.t/assume @ 0x42e850 */ | #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) { | 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) */ 0x0042e850 push rbp | 0x0042e851 push r15 | 0x0042e853 push r14 | 0x0042e855 push r13 | 0x0042e857 push r12 | 0x0042e859 push rbx | 0x0042e85a push rax | 0x0042e85b mov r12d, ecx | r12d = ecx; 0x0042e85e mov r14, rdx | r14 = rdx; 0x0042e861 mov r15, rsi | r15 = rsi; 0x0042e864 mov r13, rdi | r13 = rdi; 0x0042e867 mov eax, dword [rsi] | eax = *(rsi); 0x0042e869 xor ebp, ebp | ebp = 0; 0x0042e86b test r8d, r8d | | if (r8d == 0) { 0x0042e86e je 0x42e93d | goto label_4; | } 0x0042e874 test eax, eax | | if (eax == 0) { 0x0042e876 je 0x42e90a | goto label_5; | } 0x0042e87c mov ecx, 0xfc0000 | ecx = 0xfc0000; 0x0042e881 mov rdx, r15 | rdx = r15; 0x0042e884 jmp 0x42e8a7 | goto label_6; | label_0: 0x0042e890 cmp edi, 0x800 | 0x0042e896 sbb rbp, 0 | 0x0042e89a add rbp, 3 | rbp += 3; | do { | label_2: 0x0042e89e mov eax, dword [rsi] | eax = *(rsi); 0x0042e8a0 mov rdx, rsi | rdx = rsi; 0x0042e8a3 test eax, eax | | if (eax == 0) { 0x0042e8a5 je 0x42e90a | goto label_5; | } | label_6: 0x0042e8a7 mov esi, eax | esi = eax; 0x0042e8a9 shr esi, 0x18 | esi >>= 0x18; 0x0042e8ac mov edi, eax | edi = eax; 0x0042e8ae shr edi, 8 | edi >>= 8; 0x0042e8b1 and edi, 0xff00 | edi &= 0xff00; 0x0042e8b7 or edi, esi | edi |= esi; 0x0042e8b9 cmp edi, 0x7f | | if (edi > 0x7f) { 0x0042e8bc ja 0x42e8d0 | goto label_7; | } 0x0042e8be add rdx, 4 | rdx += 4; 0x0042e8c2 inc rbp | rbp++; | label_1: 0x0042e8c5 mov rsi, rdx | rsi = rdx; 0x0042e8c8 jmp 0x42e89e | | } while (1); | label_7: 0x0042e8d0 mov ebx, eax | ebx = eax; 0x0042e8d2 and ebx, 0xf80000 | ebx &= 0xf80000; 0x0042e8d8 lea rsi, [rdx + 4] | rsi = rdx + 4; 0x0042e8dc cmp ebx, 0xd80000 | | if (ebx != 0xd80000) { 0x0042e8e2 jne 0x42e890 | goto label_0; | } 0x0042e8e4 and eax, 0xfc0000 | eax &= 0xfc0000; 0x0042e8e9 cmp eax, 0xd80000 | | if (eax == 0xd80000) { 0x0042e8ee jne 0x42e905 | 0x0042e8f0 mov eax, dword [rsi] | eax = *(rsi); 0x0042e8f2 and eax, ecx | eax &= ecx; 0x0042e8f4 cmp eax, 0xdc0000 | | if (eax != 0xdc0000) { 0x0042e8f9 jne 0x42e905 | goto label_8; | } 0x0042e8fb add rdx, 8 | rdx += 8; 0x0042e8ff add rbp, 4 | rbp += 4; 0x0042e903 jmp 0x42e8c5 | goto label_1; | } | label_8: 0x0042e905 inc rbp | rbp++; 0x0042e908 jmp 0x42e89e | goto label_2; | label_5: 0x0042e90a inc rbp | rbp++; 0x0042e90d cmp rbp, qword [r13 + 0x18] | | if (rbp > *((r13 + 0x18))) { 0x0042e911 jbe 0x42e92a | 0x0042e913 cmp rbp, 0xffffffffffffffff | | if (rbp == -1) { 0x0042e917 je 0x42ea4c | goto label_9; | } 0x0042e91d mov rdi, r13 | 0x0042e920 mov rsi, rbp | 0x0042e923 xor edx, edx | 0x0042e925 call 0x437da0 | eax = bsl::basic_string,bsl::allocator>::privateResizeRaw(unsigned long,char) (r13, rbp, 0); | } 0x0042e92a cmp qword [r13 + 0x20], 0x17 | | if (*((r13 + 0x20)) != 0x17) { 0x0042e92f jne 0x42e9f2 | goto label_10; | } 0x0042e935 mov rdi, r13 | rdi = r13; 0x0042e938 jmp 0x42e9f6 | goto label_11; | label_4: 0x0042e93d test eax, eax | | if (eax == 0) { 0x0042e93f je 0x42e9ca | goto label_12; | } 0x0042e945 mov ecx, 0xfc00 | ecx = 0xfc00; 0x0042e94a mov rdx, r15 | rdx = r15; 0x0042e94d jmp 0x42e966 | | while (edi != 0xd800) { 0x0042e950 cmp eax, 0x800 | 0x0042e955 sbb rbp, 0 | 0x0042e959 add rbp, 3 | rbp += 3; | label_3: 0x0042e95d mov eax, dword [rsi] | eax = *(rsi); 0x0042e95f mov rdx, rsi | rdx = rsi; 0x0042e962 test eax, eax | | if (eax == 0) { 0x0042e964 je 0x42e9ca | goto label_12; | } 0x0042e966 cmp eax, 0x7f | | if (eax <= 0x7f) { 0x0042e969 ja 0x42e980 | 0x0042e96b add rdx, 4 | rdx += 4; 0x0042e96f inc rbp | rbp++; 0x0042e972 jmp 0x42e9c0 | goto label_13; | } 0x0042e980 mov edi, eax | edi = eax; 0x0042e982 and edi, 0xf800 | edi &= 0xf800; 0x0042e988 lea rsi, [rdx + 4] | rsi = rdx + 4; 0x0042e98c cmp edi, 0xd800 | 0x0042e992 jne 0x42e950 | | } 0x0042e994 and eax, 0xfc00 | eax &= 0xfc00; 0x0042e999 cmp eax, 0xd800 | | if (eax == 0xd800) { 0x0042e99e jne 0x42e9c5 | 0x0042e9a0 mov eax, dword [rsi] | eax = *(rsi); 0x0042e9a2 and eax, ecx | eax &= ecx; 0x0042e9a4 cmp eax, 0xdc00 | | if (eax != 0xdc00) { 0x0042e9a9 jne 0x42e9c5 | goto label_14; | } 0x0042e9ab add rdx, 8 | rdx += 8; 0x0042e9af add rbp, 4 | rbp += 4; 0x0042e9b3 nop word cs:[rax + rax] | 0x0042e9bd nop dword [rax] | | label_13: 0x0042e9c0 mov rsi, rdx | rsi = rdx; 0x0042e9c3 jmp 0x42e95d | goto label_3; | } | label_14: 0x0042e9c5 inc rbp | rbp++; 0x0042e9c8 jmp 0x42e95d | goto label_3; | label_12: 0x0042e9ca inc rbp | rbp++; 0x0042e9cd cmp rbp, qword [r13 + 0x18] | | if (rbp > *((r13 + 0x18))) { 0x0042e9d1 jbe 0x42e9e6 | 0x0042e9d3 cmp rbp, 0xffffffffffffffff | | if (rbp == -1) { 0x0042e9d7 je 0x42ea4c | goto label_9; | } 0x0042e9d9 mov rdi, r13 | 0x0042e9dc mov rsi, rbp | 0x0042e9df xor edx, edx | 0x0042e9e1 call 0x437da0 | bsl::basic_string,bsl::allocator>::privateResizeRaw(unsigned long,char) (r13, rbp, 0); | } 0x0042e9e6 cmp qword [r13 + 0x20], 0x17 | | if (*((r13 + 0x20)) == 0x17) { 0x0042e9eb jne 0x42ea0a | 0x0042e9ed mov rdi, r13 | rdi = r13; 0x0042e9f0 jmp 0x42ea0e | goto label_15; | label_10: 0x0042e9f2 mov rdi, qword [r13] | rdi = *(r13); | label_11: 0x0042e9f6 movsx r8d, r12b | r8d = (int32_t) r12b; 0x0042e9fa mov rcx, rsp | rcx = rsp; 0x0042e9fd mov rsi, r15 | rsi = r15; 0x0042ea00 mov rdx, r14 | rdx = r14; 0x0042ea03 call 0x433900 | int(anonymousnamespace)::localUtf16ToUtf8,(anonymousnamespace)::Swapper>(char*,(anonymousnamespace)::NoOpCapacity,wchar_tconst*,(anonymousnamespace)::Utf16::ZeroBasedEnd,(anonymousnamespace)::Swapper,unsigned long*,unsigned long*,char) (); 0x0042ea08 jmp 0x42ea20 | | } else { 0x0042ea0a mov rdi, qword [r13] | rdi = *(r13); | label_15: 0x0042ea0e movsx r8d, r12b | r8d = (int32_t) r12b; 0x0042ea12 mov rcx, rsp | rcx = rsp; 0x0042ea15 mov rsi, r15 | rsi = r15; 0x0042ea18 mov rdx, r14 | rdx = r14; 0x0042ea1b call 0x433750 | eax = int(anonymousnamespace)::localUtf16ToUtf8,(anonymousnamespace)::NoOpSwapper>(char*,(anonymousnamespace)::NoOpCapacity,wchar_tconst*,(anonymousnamespace)::Utf16::ZeroBasedEnd,(anonymousnamespace)::NoOpSwapper,unsigned long*,unsigned long*,char) (); | } 0x0042ea20 mov ebx, eax | ebx = eax; 0x0042ea22 mov rsi, qword [rsp] | rsi = *(rsp); 0x0042ea26 cmp rsi, rbp | 0x0042ea29 test rsi, rsi | | if (rsi != 0) { 0x0042ea2c je 0x42ea4c | 0x0042ea2e dec rsi | rsi--; 0x0042ea31 mov rdi, r13 | 0x0042ea34 xor edx, edx | 0x0042ea36 call 0x437da0 | bsl::basic_string,bsl::allocator>::privateResizeRaw(unsigned long,char) (r13, rsi, 0); 0x0042ea3b mov eax, ebx | eax = ebx; 0x0042ea3d add rsp, 8 | 0x0042ea41 pop rbx | 0x0042ea42 pop r12 | 0x0042ea44 pop r13 | 0x0042ea46 pop r14 | 0x0042ea48 pop r15 | 0x0042ea4a pop rbp | 0x0042ea4b ret | return eax; | } | label_9: 0x0042ea4c mov edi, 0x45f5e2 | 0x0042ea51 call 0x435460 | return BloombergLP::bslstl::StdExceptUtil::throwLengthError(char const*) ("string<...>::resize(n): string too long"); | }