; assembly | /* r2dec pseudo code output */ | /* bdlde_charconvertutf16.t/none @ 0x42e490 */ | #include | ; (fcn) method.BloombergLP::bdlde::CharConvertUtf16.utf16ToUtf8_std::__1::basic_string_char__std::__1::char_traits_char___std::__1::allocator_char_____std::__1::basic_string_view_wchar_t__std::__1::char_traits_wchar_t____const__unsigned_long__char__BloombergL () | int64_t method_BloombergLP::bdlde::CharConvertUtf16_utf16ToUtf8_std::_1::basic_string_char_std::_1::char_traits_char_std::_1::allocator_char_std::_1::basic_string_view_wchar_t_std::_1::char_traits_wchar_t_const_unsigned_long_char_BloombergL (int64_t arg5, int64_t arg4, uint32_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 >*, std::__1::basic_string_view > const&, unsigned long*, char, BloombergLP::bdlde::ByteOrder::Enum) */ 0x0042e490 push rbp | 0x0042e491 push r15 | 0x0042e493 push r14 | 0x0042e495 push r13 | 0x0042e497 push r12 | 0x0042e499 push rbx | 0x0042e49a push rax | 0x0042e49b mov r13d, ecx | r13d = ecx; 0x0042e49e mov r14, rdx | r14 = rdx; 0x0042e4a1 mov r12, rdi | r12 = rdi; 0x0042e4a4 mov r15, qword [rsi] | r15 = *(rsi); 0x0042e4a7 mov rax, qword [rsi + 8] | rax = *((rsi + 8)); 0x0042e4ab lea rbx, [r15 + rax*4] | rbx = r15 + rax*4; 0x0042e4af xor esi, esi | esi = 0; 0x0042e4b1 test r8d, r8d | | if (r8d == 0) { 0x0042e4b4 je 0x42e580 | goto label_8; | } 0x0042e4ba test rax, rax | | if (rax <= 0) { 0x0042e4bd jle 0x42e550 | goto label_9; | } 0x0042e4c3 mov r8d, 0xfc0000 | r8d = 0xfc0000; 0x0042e4c9 mov rcx, r15 | rcx = r15; 0x0042e4cc jmp 0x42e4e6 | goto label_10; | label_0: 0x0042e4d0 cmp edi, 0x800 | 0x0042e4d6 sbb rsi, 0 | 0x0042e4da add rsi, 3 | rsi += 3; | do { | label_2: 0x0042e4de mov rcx, rdx | rcx = rdx; 0x0042e4e1 cmp rdx, rbx | | if (rdx >= rbx) { 0x0042e4e4 jae 0x42e550 | goto label_9; | } | label_10: 0x0042e4e6 mov ebp, dword [rcx] | ebp = *(rcx); 0x0042e4e8 mov edx, ebp | edx = *(rcx); 0x0042e4ea shr edx, 0x18 | edx >>= 0x18; 0x0042e4ed mov edi, ebp | edi = ebp; 0x0042e4ef shr edi, 8 | edi >>= 8; 0x0042e4f2 and edi, 0xff00 | edi &= 0xff00; 0x0042e4f8 or edi, edx | edi |= edx; 0x0042e4fa cmp edi, 0x7f | | if (edi > 0x7f) { 0x0042e4fd ja 0x42e510 | goto label_11; | } 0x0042e4ff add rcx, 4 | rcx += 4; 0x0042e503 inc rsi | rsi++; | label_1: 0x0042e506 mov rdx, rcx | rdx = rcx; 0x0042e509 jmp 0x42e4de | | } while (1); | label_11: 0x0042e510 mov eax, ebp | eax = ebp; 0x0042e512 and eax, 0xf80000 | eax &= 0xf80000; 0x0042e517 lea rdx, [rcx + 4] | rdx = rcx + 4; 0x0042e51b cmp eax, 0xd80000 | | if (eax != 0xd80000) { 0x0042e520 jne 0x42e4d0 | goto label_0; | } 0x0042e522 cmp rdx, rbx | | if (rdx < rbx) { 0x0042e525 jae 0x42e54b | 0x0042e527 and ebp, 0xfc0000 | ebp &= 0xfc0000; 0x0042e52d cmp ebp, 0xd80000 | | if (ebp != 0xd80000) { 0x0042e533 jne 0x42e54b | goto label_12; | } 0x0042e535 mov eax, dword [rdx] | eax = *(rdx); 0x0042e537 and eax, r8d | eax &= r8d; 0x0042e53a cmp eax, 0xdc0000 | | if (eax != 0xdc0000) { 0x0042e53f jne 0x42e54b | goto label_12; | } 0x0042e541 add rcx, 8 | rcx += 8; 0x0042e545 add rsi, 4 | rsi += 4; 0x0042e549 jmp 0x42e506 | goto label_1; | } | label_12: 0x0042e54b inc rsi | rsi++; 0x0042e54e jmp 0x42e4de | goto label_2; | label_9: 0x0042e550 inc rsi | rsi++; 0x0042e553 mov al, byte [r12] | al = *(r12); 0x0042e557 test al, 1 | | if ((al & 1) != 0) { 0x0042e559 jne 0x42e61a | goto label_13; | } 0x0042e55f movzx ecx, al | ecx = (int32_t) al; 0x0042e562 shr rcx, 1 | rcx >>= 1; 0x0042e565 cmp rsi, rcx | | if (rsi > rcx) { 0x0042e568 ja 0x42e628 | goto label_14; | } | label_6: 0x0042e56e test al, 1 | | if ((al & 1) != 0) { 0x0042e570 jne 0x42e63e | goto label_15; | } | label_7: 0x0042e576 lea rdi, [r12 + 1] | rdi = r12 + 1; 0x0042e57b jmp 0x42e643 | goto label_16; | label_8: 0x0042e580 test rax, rax | | if (rax <= 0) { 0x0042e583 jle 0x42e602 | goto label_17; | } 0x0042e585 mov eax, 0xfc00 | eax = 0xfc00; 0x0042e58a mov rcx, r15 | rcx = r15; 0x0042e58d jmp 0x42e5a6 | goto label_18; | label_3: 0x0042e590 cmp edi, 0x800 | 0x0042e596 sbb rsi, 0 | 0x0042e59a add rsi, 3 | rsi += 3; | do { | label_5: 0x0042e59e mov rcx, rdx | rcx = rdx; 0x0042e5a1 cmp rdx, rbx | | if (rdx >= rbx) { 0x0042e5a4 jae 0x42e602 | goto label_17; | } | label_18: 0x0042e5a6 mov edi, dword [rcx] | edi = *(rcx); 0x0042e5a8 cmp edi, 0x7f | | if (edi > 0x7f) { 0x0042e5ab ja 0x42e5c0 | goto label_19; | } 0x0042e5ad add rcx, 4 | rcx += 4; 0x0042e5b1 inc rsi | rsi++; | label_4: 0x0042e5b4 mov rdx, rcx | rdx = rcx; 0x0042e5b7 jmp 0x42e59e | | } while (1); | label_19: 0x0042e5c0 mov ebp, edi | 0x0042e5c2 and ebp, 0xf800 | ebp &= 0xf800; 0x0042e5c8 lea rdx, [rcx + 4] | rdx = rcx + 4; 0x0042e5cc cmp ebp, 0xd800 | | if (ebp != 0xd800) { 0x0042e5d2 jne 0x42e590 | goto label_3; | } 0x0042e5d4 cmp rdx, rbx | | if (rdx < rbx) { 0x0042e5d7 jae 0x42e5fd | 0x0042e5d9 and edi, 0xfc00 | edi &= 0xfc00; 0x0042e5df cmp edi, 0xd800 | | if (edi != 0xd800) { 0x0042e5e5 jne 0x42e5fd | goto label_20; | } 0x0042e5e7 mov edi, dword [rdx] | edi = *(rdx); 0x0042e5e9 and edi, eax | edi &= eax; 0x0042e5eb cmp edi, 0xdc00 | | if (edi != 0xdc00) { 0x0042e5f1 jne 0x42e5fd | goto label_20; | } 0x0042e5f3 add rcx, 8 | rcx += 8; 0x0042e5f7 add rsi, 4 | rsi += 4; 0x0042e5fb jmp 0x42e5b4 | goto label_4; | } | label_20: 0x0042e5fd inc rsi | rsi++; 0x0042e600 jmp 0x42e59e | goto label_5; | label_17: 0x0042e602 inc rsi | rsi++; 0x0042e605 mov al, byte [r12] | al = *(r12); 0x0042e609 test al, 1 | | if ((al & 1) != 0) { 0x0042e60b jne 0x42e65a | goto label_21; | } 0x0042e60d movzx ecx, al | ecx = (int32_t) al; 0x0042e610 shr rcx, 1 | rcx >>= 1; 0x0042e613 cmp rsi, rcx | | if (rsi > rcx) { 0x0042e616 ja 0x42e664 | goto label_22; | } 0x0042e618 jmp 0x42e672 | goto label_23; | label_13: 0x0042e61a mov rcx, qword [r12 + 8] | rcx = *((r12 + 8)); 0x0042e61f cmp rsi, rcx | | if (rsi <= rcx) { 0x0042e622 jbe 0x42e56e | goto label_6; | } | label_14: 0x0042e628 mov rdi, r12 | rdi = r12; 0x0042e62b xor edx, edx | edx = 0; 0x0042e62d call 0x403a30 | std::_1::basic_string,std::_1::allocator>::resize(unsigned long,char) (); 0x0042e632 mov al, byte [r12] | al = *(r12); 0x0042e636 test al, 1 | | if ((al & 1) == 0) { 0x0042e638 je 0x42e576 | goto label_7; | } | label_15: 0x0042e63e mov rdi, qword [r12 + 0x10] | rdi = *((r12 + 0x10)); | label_16: 0x0042e643 movsx r9d, r13b | r9d = (int32_t) r13b; 0x0042e647 mov r8, rsp | r8 = rsp; 0x0042e64a mov rsi, r15 | rsi = r15; 0x0042e64d mov rdx, rbx | rdx = rbx; 0x0042e650 mov rcx, r14 | rcx = r14; 0x0042e653 call 0x433380 | int(anonymousnamespace)::localUtf16ToUtf8,(anonymousnamespace)::Swapper>(char*,(anonymousnamespace)::NoOpCapacity,wchar_tconst*,(anonymousnamespace)::Utf16::PtrBasedEnd,(anonymousnamespace)::Swapper,unsigned long*,unsigned long*,char) (); 0x0042e658 jmp 0x42e697 | goto label_24; | label_21: 0x0042e65a mov rcx, qword [r12 + 8] | rcx = *((r12 + 8)); 0x0042e65f cmp rsi, rcx | | if (rsi > rcx) { 0x0042e662 jbe 0x42e672 | | label_22: 0x0042e664 mov rdi, r12 | rdi = r12; 0x0042e667 xor edx, edx | edx = 0; 0x0042e669 call 0x403a30 | std::_1::basic_string,std::_1::allocator>::resize(unsigned long,char) (); 0x0042e66e mov al, byte [r12] | al = *(r12); | } | label_23: 0x0042e672 test al, 1 | | if ((al & 1) == 0) { 0x0042e674 jne 0x42e67d | 0x0042e676 lea rdi, [r12 + 1] | rdi = r12 + 1; 0x0042e67b jmp 0x42e682 | | } else { 0x0042e67d mov rdi, qword [r12 + 0x10] | rdi = *((r12 + 0x10)); | } 0x0042e682 movsx r9d, r13b | r9d = (int32_t) r13b; 0x0042e686 mov r8, rsp | r8 = rsp; 0x0042e689 mov rsi, r15 | rsi = r15; 0x0042e68c mov rdx, rbx | rdx = rbx; 0x0042e68f mov rcx, r14 | rcx = r14; 0x0042e692 call 0x4331f0 | eax = int(anonymousnamespace)::localUtf16ToUtf8,(anonymousnamespace)::NoOpSwapper>(char*,(anonymousnamespace)::NoOpCapacity,wchar_tconst*,(anonymousnamespace)::Utf16::PtrBasedEnd,(anonymousnamespace)::NoOpSwapper,unsigned long*,unsigned long*,char) (); | label_24: 0x0042e697 mov ebx, eax | ebx = eax; 0x0042e699 mov rsi, qword [rsp] | rsi = *(rsp); 0x0042e69d dec rsi | rsi--; 0x0042e6a0 mov rdi, r12 | rdi = r12; 0x0042e6a3 xor edx, edx | edx = 0; 0x0042e6a5 call 0x403a30 | std::_1::basic_string,std::_1::allocator>::resize(unsigned long,char) (); 0x0042e6aa mov eax, ebx | eax = ebx; 0x0042e6ac add rsp, 8 | 0x0042e6b0 pop rbx | 0x0042e6b1 pop r12 | 0x0042e6b3 pop r13 | 0x0042e6b5 pop r14 | 0x0042e6b7 pop r15 | 0x0042e6b9 pop rbp | 0x0042e6ba ret | return rax; | }