; assembly | /* r2dec pseudo code output */ | /* bdlde_charconvertutf16.t/assume @ 0x42e3e0 */ | #include | ; (fcn) method.BloombergLP::bdlde::CharConvertUtf16.utf16ToUtf8_bsl::basic_string_char__std::__1::char_traits_char___bsl::allocator_char_____std::__1::basic_string_view_wchar_t__std::__1::char_traits_wchar_t____const__unsigned_long__char__BloombergLP::bdlde:: () | int64_t method_BloombergLP::bdlde::CharConvertUtf16_utf16ToUtf8_bsl::basic_string_char_std::_1::char_traits_char_bsl::allocator_char_std::_1::basic_string_view_wchar_t_std::_1::char_traits_wchar_t_const_unsigned_long_char_BloombergLP::bdlde:: (int64_t arg5, uint32_t arg4, uint32_t arg3, uint32_t arg2, char * arg1) { | r8 = arg5; | rcx = arg4; | rdx = arg3; | rsi = arg2; | rdi = arg1; | /* BloombergLP::bdlde::CharConvertUtf16::utf16ToUtf8(bsl::basic_string, bsl::allocator >*, std::__1::basic_string_view > const&, unsigned long*, char, BloombergLP::bdlde::ByteOrder::Enum) */ 0x0042e3e0 push rbp | 0x0042e3e1 push r15 | 0x0042e3e3 push r14 | 0x0042e3e5 push r13 | 0x0042e3e7 push r12 | 0x0042e3e9 push rbx | 0x0042e3ea push rax | 0x0042e3eb mov r13d, ecx | r13d = ecx; 0x0042e3ee mov r14, rdx | r14 = rdx; 0x0042e3f1 mov r12, rdi | r12 = rdi; 0x0042e3f4 mov r15, qword [rsi] | r15 = *(rsi); 0x0042e3f7 mov rax, qword [rsi + 8] | rax = *((rsi + 8)); 0x0042e3fb lea rbx, [r15 + rax*4] | rbx = r15 + rax*4; 0x0042e3ff xor ebp, ebp | ebp = 0; 0x0042e401 test r8d, r8d | | if (r8d == 0) { 0x0042e404 je 0x42e4da | goto label_6; | } 0x0042e40a test rax, rax | | if (rax <= 0) { 0x0042e40d jle 0x42e4a5 | goto label_7; | } 0x0042e413 mov r8d, 0xfc0000 | r8d = 0xfc0000; 0x0042e419 mov rcx, r15 | rcx = r15; 0x0042e41c jmp 0x42e436 | goto label_8; | label_0: 0x0042e420 cmp edi, 0x800 | 0x0042e426 sbb rbp, 0 | 0x0042e42a add rbp, 3 | rbp += 3; | do { | label_2: 0x0042e42e mov rcx, rdx | rcx = rdx; 0x0042e431 cmp rdx, rbx | | if (rdx >= rbx) { 0x0042e434 jae 0x42e4a5 | goto label_7; | } | label_8: 0x0042e436 mov esi, dword [rcx] | esi = *(rcx); 0x0042e438 mov edx, esi | edx = *(rcx); 0x0042e43a shr edx, 0x18 | edx >>= 0x18; 0x0042e43d mov edi, esi | edi = esi; 0x0042e43f shr edi, 8 | edi >>= 8; 0x0042e442 and edi, 0xff00 | edi &= 0xff00; 0x0042e448 or edi, edx | edi |= edx; 0x0042e44a cmp edi, 0x7f | | if (edi > 0x7f) { 0x0042e44d ja 0x42e460 | goto label_9; | } 0x0042e44f add rcx, 4 | rcx += 4; 0x0042e453 inc rbp | rbp++; | label_1: 0x0042e456 mov rdx, rcx | rdx = rcx; 0x0042e459 jmp 0x42e42e | | } while (1); | label_9: 0x0042e460 mov eax, esi | eax = esi; 0x0042e462 and eax, 0xf80000 | eax &= 0xf80000; 0x0042e467 lea rdx, [rcx + 4] | rdx = rcx + 4; 0x0042e46b cmp eax, 0xd80000 | | if (eax != 0xd80000) { 0x0042e470 jne 0x42e420 | goto label_0; | } 0x0042e472 cmp rdx, rbx | | if (rdx < rbx) { 0x0042e475 jae 0x42e4a0 | 0x0042e477 and esi, 0xfc0000 | esi &= 0xfc0000; 0x0042e47d cmp esi, 0xd80000 | | if (esi != 0xd80000) { 0x0042e483 jne 0x42e4a0 | goto label_10; | } 0x0042e485 mov eax, dword [rdx] | eax = *(rdx); 0x0042e487 and eax, r8d | eax &= r8d; 0x0042e48a cmp eax, 0xdc0000 | | if (eax != 0xdc0000) { 0x0042e48f jne 0x42e4a0 | goto label_10; | } 0x0042e491 add rcx, 8 | rcx += 8; 0x0042e495 add rbp, 4 | rbp += 4; 0x0042e499 jmp 0x42e456 | goto label_1; | } | label_10: 0x0042e4a0 inc rbp | rbp++; 0x0042e4a3 jmp 0x42e42e | goto label_2; | label_7: 0x0042e4a5 inc rbp | rbp++; 0x0042e4a8 cmp rbp, qword [r12 + 0x18] | | if (rbp > *((r12 + 0x18))) { 0x0042e4ad jbe 0x42e4c6 | 0x0042e4af cmp rbp, 0xffffffffffffffff | | if (rbp == -1) { 0x0042e4b3 je 0x42e5ef | goto label_11; | } 0x0042e4b9 mov rdi, r12 | 0x0042e4bc mov rsi, rbp | 0x0042e4bf xor edx, edx | 0x0042e4c1 call 0x437da0 | rax = bsl::basic_string,bsl::allocator>::privateResizeRaw(unsigned long,char) (r12, rbp, 0); | } 0x0042e4c6 cmp qword [r12 + 0x20], 0x17 | | if (*((r12 + 0x20)) != 0x17) { 0x0042e4cc jne 0x42e58f | goto label_12; | } 0x0042e4d2 mov rdi, r12 | rdi = r12; 0x0042e4d5 jmp 0x42e593 | goto label_13; | label_6: 0x0042e4da test rax, rax | | if (rax <= 0) { 0x0042e4dd jle 0x42e565 | goto label_14; | } 0x0042e4e3 mov eax, 0xfc00 | eax = 0xfc00; 0x0042e4e8 mov rcx, r15 | rcx = r15; 0x0042e4eb jmp 0x42e506 | goto label_15; | label_3: 0x0042e4f0 cmp esi, 0x800 | 0x0042e4f6 sbb rbp, 0 | 0x0042e4fa add rbp, 3 | rbp += 3; | do { | label_5: 0x0042e4fe mov rcx, rdx | rcx = rdx; 0x0042e501 cmp rdx, rbx | | if (rdx >= rbx) { 0x0042e504 jae 0x42e565 | goto label_14; | } | label_15: 0x0042e506 mov esi, dword [rcx] | esi = *(rcx); 0x0042e508 cmp esi, 0x7f | | if (esi > 0x7f) { 0x0042e50b ja 0x42e520 | goto label_16; | } 0x0042e50d add rcx, 4 | rcx += 4; 0x0042e511 inc rbp | rbp++; | label_4: 0x0042e514 mov rdx, rcx | rdx = rcx; 0x0042e517 jmp 0x42e4fe | | } while (1); | label_16: 0x0042e520 mov edi, esi | edi = esi; 0x0042e522 and edi, 0xf800 | edi &= 0xf800; 0x0042e528 lea rdx, [rcx + 4] | rdx = rcx + 4; 0x0042e52c cmp edi, 0xd800 | | if (edi != 0xd800) { 0x0042e532 jne 0x42e4f0 | goto label_3; | } 0x0042e534 cmp rdx, rbx | | if (rdx < rbx) { 0x0042e537 jae 0x42e560 | 0x0042e539 and esi, 0xfc00 | esi &= 0xfc00; 0x0042e53f cmp esi, 0xd800 | | if (esi != 0xd800) { 0x0042e545 jne 0x42e560 | goto label_17; | } 0x0042e547 mov esi, dword [rdx] | esi = *(rdx); 0x0042e549 and esi, eax | esi &= eax; 0x0042e54b cmp esi, 0xdc00 | | if (esi != 0xdc00) { 0x0042e551 jne 0x42e560 | goto label_17; | } 0x0042e553 add rcx, 8 | rcx += 8; 0x0042e557 add rbp, 4 | rbp += 4; 0x0042e55b jmp 0x42e514 | goto label_4; | } | label_17: 0x0042e560 inc rbp | rbp++; 0x0042e563 jmp 0x42e4fe | goto label_5; | label_14: 0x0042e565 inc rbp | rbp++; 0x0042e568 cmp rbp, qword [r12 + 0x18] | | if (rbp > *((r12 + 0x18))) { 0x0042e56d jbe 0x42e582 | 0x0042e56f cmp rbp, 0xffffffffffffffff | | if (rbp == -1) { 0x0042e573 je 0x42e5ef | goto label_11; | } 0x0042e575 mov rdi, r12 | 0x0042e578 mov rsi, rbp | 0x0042e57b xor edx, edx | 0x0042e57d call 0x437da0 | bsl::basic_string,bsl::allocator>::privateResizeRaw(unsigned long,char) (r12, rbp, 0); | } 0x0042e582 cmp qword [r12 + 0x20], 0x17 | | if (*((r12 + 0x20)) == 0x17) { 0x0042e588 jne 0x42e5aa | 0x0042e58a mov rdi, r12 | rdi = r12; 0x0042e58d jmp 0x42e5ae | goto label_18; | label_12: 0x0042e58f mov rdi, qword [r12] | rdi = *(r12); | label_13: 0x0042e593 movsx r9d, r13b | r9d = (int32_t) r13b; 0x0042e597 mov r8, rsp | r8 = rsp; 0x0042e59a mov rsi, r15 | rsi = r15; 0x0042e59d mov rdx, rbx | rdx = rbx; 0x0042e5a0 mov rcx, r14 | rcx = r14; 0x0042e5a3 call 0x4335a0 | int(anonymousnamespace)::localUtf16ToUtf8,(anonymousnamespace)::Swapper>(char*,(anonymousnamespace)::NoOpCapacity,wchar_tconst*,(anonymousnamespace)::Utf16::PtrBasedEnd,(anonymousnamespace)::Swapper,unsigned long*,unsigned long*,char) (); 0x0042e5a8 jmp 0x42e5c3 | | } else { 0x0042e5aa mov rdi, qword [r12] | rdi = *(r12); | label_18: 0x0042e5ae movsx r9d, r13b | r9d = (int32_t) r13b; 0x0042e5b2 mov r8, rsp | r8 = rsp; 0x0042e5b5 mov rsi, r15 | rsi = r15; 0x0042e5b8 mov rdx, rbx | rdx = rbx; 0x0042e5bb mov rcx, r14 | rcx = r14; 0x0042e5be call 0x433410 | eax = int(anonymousnamespace)::localUtf16ToUtf8,(anonymousnamespace)::NoOpSwapper>(char*,(anonymousnamespace)::NoOpCapacity,wchar_tconst*,(anonymousnamespace)::Utf16::PtrBasedEnd,(anonymousnamespace)::NoOpSwapper,unsigned long*,unsigned long*,char) (); | } 0x0042e5c3 mov ebx, eax | ebx = eax; 0x0042e5c5 mov rsi, qword [rsp] | rsi = *(rsp); 0x0042e5c9 cmp rsi, rbp | 0x0042e5cc test rsi, rsi | | if (rsi != 0) { 0x0042e5cf je 0x42e5ef | 0x0042e5d1 dec rsi | rsi--; 0x0042e5d4 mov rdi, r12 | 0x0042e5d7 xor edx, edx | 0x0042e5d9 call 0x437da0 | bsl::basic_string,bsl::allocator>::privateResizeRaw(unsigned long,char) (r12, rsi, 0); 0x0042e5de mov eax, ebx | eax = ebx; 0x0042e5e0 add rsp, 8 | 0x0042e5e4 pop rbx | 0x0042e5e5 pop r12 | 0x0042e5e7 pop r13 | 0x0042e5e9 pop r14 | 0x0042e5eb pop r15 | 0x0042e5ed pop rbp | 0x0042e5ee ret | return rax; | } | label_11: 0x0042e5ef mov edi, 0x45f5e2 | 0x0042e5f4 call 0x435460 | return BloombergLP::bslstl::StdExceptUtil::throwLengthError(char const*) ("string<...>::resize(n): string too long"); | }