; assembly | /* r2dec pseudo code output */ | /* bdlde_charconvertutf16.t/none @ 0x42ecc0 */ | #include | | uint16_t rotate_left16 (uint16_t value, uint32_t count) { | const uint16_t mask = (CHAR_BIT * sizeof (value)) - 1; | count &= mask; | return (value << count) | (value >> (-count & mask)); | } | ; (fcn) method.BloombergLP::bdlde::CharConvertUtf16.utf16ToUtf8_std::__1::vector_char__std::__1::allocator_char_____unsigned_short_const__unsigned_long__char__BloombergLP::bdlde::ByteOrder::Enum_ () | uint64_t method_BloombergLP::bdlde::CharConvertUtf16_utf16ToUtf8_std::_1::vector_char_std::_1::allocator_char_unsigned_short_const_unsigned_long_char_BloombergLP::bdlde::ByteOrder::Enum_ (int64_t arg5, int64_t arg4, int64_t arg3, int64_t arg2, size_t arg1) { | r8 = arg5; | rcx = arg4; | rdx = arg3; | rsi = arg2; | rdi = arg1; | /* BloombergLP::bdlde::CharConvertUtf16::utf16ToUtf8(std::__1::vector >*, unsigned short const*, unsigned long*, char, BloombergLP::bdlde::ByteOrder::Enum) */ 0x0042ecc0 push rbp | 0x0042ecc1 push r15 | 0x0042ecc3 push r14 | 0x0042ecc5 push rbx | 0x0042ecc6 push rax | 0x0042ecc7 mov ebp, ecx | 0x0042ecc9 mov r14, rdx | r14 = rdx; 0x0042eccc mov r15, rsi | r15 = rsi; 0x0042eccf mov rbx, rdi | rbx = rdi; 0x0042ecd2 movzx eax, word [rsi] | eax = *(rsi); 0x0042ecd5 xor esi, esi | esi = 0; 0x0042ecd7 test r8d, r8d | | if (r8d == 0) { 0x0042ecda je 0x42ed98 | goto label_4; | } 0x0042ece0 test ax, ax | | if (ax == 0) { 0x0042ece3 je 0x42ed64 | goto label_5; | } 0x0042ece9 mov rcx, r15 | rcx = r15; 0x0042ecec jmp 0x42ed08 | goto label_6; | label_0: 0x0042ecf0 cmp eax, 0x800 | 0x0042ecf5 sbb rsi, 0 | 0x0042ecf9 add rsi, 3 | rsi += 3; | do { | label_2: 0x0042ecfd movzx eax, word [rdx] | eax = *(rdx); 0x0042ed00 mov rcx, rdx | rcx = rdx; 0x0042ed03 test ax, ax | | if (ax == 0) { 0x0042ed06 je 0x42ed64 | goto label_5; | } | label_6: 0x0042ed08 rol ax, 8 | ax = rotate_left16 (ax, 8); 0x0042ed0c cmp ax, 0x7f | | if (ax > 0x7f) { 0x0042ed10 ja 0x42ed20 | goto label_7; | } 0x0042ed12 add rcx, 2 | rcx += 2; 0x0042ed16 inc rsi | rsi++; | label_1: 0x0042ed19 mov rdx, rcx | rdx = rcx; 0x0042ed1c jmp 0x42ecfd | | } while (1); | label_7: 0x0042ed20 movzx eax, ax | eax = (int32_t) ax; 0x0042ed23 mov edi, eax | edi = eax; 0x0042ed25 and edi, 0xf800 | edi &= 0xf800; 0x0042ed2b lea rdx, [rcx + 2] | rdx = rcx + 2; 0x0042ed2f cmp edi, 0xd800 | | if (edi != 0xd800) { 0x0042ed35 jne 0x42ecf0 | goto label_0; | } 0x0042ed37 and eax, 0xfc00 | eax &= 0xfc00; 0x0042ed3c cmp eax, 0xd800 | | if (eax == 0xd800) { 0x0042ed41 jne 0x42ed5f | 0x0042ed43 movzx eax, word [rdx] | eax = *(rdx); 0x0042ed46 and eax, 0xfc | eax &= 0xfc; 0x0042ed4b movzx eax, ax | eax = (int32_t) ax; 0x0042ed4e cmp eax, 0xdc | | if (eax != 0xdc) { 0x0042ed53 jne 0x42ed5f | goto label_8; | } 0x0042ed55 add rcx, 4 | rcx += 4; 0x0042ed59 add rsi, 4 | rsi += 4; 0x0042ed5d jmp 0x42ed19 | goto label_1; | } | label_8: 0x0042ed5f inc rsi | rsi++; 0x0042ed62 jmp 0x42ecfd | goto label_2; | label_5: 0x0042ed64 inc rsi | rsi++; 0x0042ed67 mov rdi, qword [rbx] | rdi = *(rbx); 0x0042ed6a mov rax, qword [rbx + 8] | rax = *((rbx + 8)); 0x0042ed6e sub rax, rdi | rax -= rdi; 0x0042ed71 cmp rsi, rax | | if (rsi > rax) { 0x0042ed74 jbe 0x42ed81 | 0x0042ed76 mov rdi, rbx | 0x0042ed79 call 0x433890 | std::_1::vector>::resize(unsigned long) (rbx, rsi); 0x0042ed7e mov rdi, qword [rbx] | rdi = *(rbx); | } 0x0042ed81 movsx r8d, bpl | r8d = (int32_t) bpl; 0x0042ed85 mov rcx, rsp | rcx = rsp; 0x0042ed88 mov rsi, r15 | rsi = r15; 0x0042ed8b mov rdx, r14 | rdx = r14; 0x0042ed8e call 0x432d30 | ax = int(anonymousnamespace)::localUtf16ToUtf8,(anonymousnamespace)::Swapper>(char*,(anonymousnamespace)::NoOpCapacity,unsignedshortconst*,(anonymousnamespace)::Utf16::ZeroBasedEnd,(anonymousnamespace)::Swapper,unsigned long*,unsigned long*,char) (); 0x0042ed93 jmp 0x42ee59 | goto label_9; | label_4: 0x0042ed98 test ax, ax | | if (ax == 0) { 0x0042ed9b je 0x42ee2a | goto label_10; | } 0x0042eda1 mov rcx, r15 | rcx = r15; 0x0042eda4 jmp 0x42edc8 | | while (edi != 0xd800) { 0x0042edb0 cmp eax, 0x800 | 0x0042edb5 sbb rsi, 0 | 0x0042edb9 add rsi, 3 | rsi += 3; | label_3: 0x0042edbd movzx eax, word [rdx] | eax = *(rdx); 0x0042edc0 mov rcx, rdx | rcx = rdx; 0x0042edc3 test ax, ax | | if (ax == 0) { 0x0042edc6 je 0x42ee2a | goto label_10; | } 0x0042edc8 cmp ax, 0x7f | | if (ax <= 0x7f) { 0x0042edcc ja 0x42ede0 | 0x0042edce add rcx, 2 | rcx += 2; 0x0042edd2 inc rsi | rsi++; 0x0042edd5 jmp 0x42ee20 | goto label_11; | } 0x0042ede0 movzx eax, ax | eax = (int32_t) ax; 0x0042ede3 mov edi, eax | edi = eax; 0x0042ede5 and edi, 0xf800 | edi &= 0xf800; 0x0042edeb lea rdx, [rcx + 2] | rdx = rcx + 2; 0x0042edef cmp edi, 0xd800 | 0x0042edf5 jne 0x42edb0 | | } 0x0042edf7 and eax, 0xfc00 | eax &= 0xfc00; 0x0042edfc cmp eax, 0xd800 | | if (eax == 0xd800) { 0x0042ee01 jne 0x42ee25 | 0x0042ee03 movzx eax, word [rdx] | eax = *(rdx); 0x0042ee06 and eax, 0xfc00 | eax &= 0xfc00; 0x0042ee0b movzx eax, ax | eax = (int32_t) ax; 0x0042ee0e cmp eax, 0xdc00 | | if (eax != 0xdc00) { 0x0042ee13 jne 0x42ee25 | goto label_12; | } 0x0042ee15 add rcx, 4 | rcx += 4; 0x0042ee19 add rsi, 4 | rsi += 4; 0x0042ee1d nop dword [rax] | | label_11: 0x0042ee20 mov rdx, rcx | rdx = rcx; 0x0042ee23 jmp 0x42edbd | goto label_3; | } | label_12: 0x0042ee25 inc rsi | rsi++; 0x0042ee28 jmp 0x42edbd | goto label_3; | label_10: 0x0042ee2a inc rsi | rsi++; 0x0042ee2d mov rdi, qword [rbx] | rdi = *(rbx); 0x0042ee30 mov rax, qword [rbx + 8] | rax = *((rbx + 8)); 0x0042ee34 sub rax, rdi | rax -= rdi; 0x0042ee37 cmp rsi, rax | | if (rsi > rax) { 0x0042ee3a jbe 0x42ee47 | 0x0042ee3c mov rdi, rbx | 0x0042ee3f call 0x433890 | std::_1::vector>::resize(unsigned long) (rbx, rsi); 0x0042ee44 mov rdi, qword [rbx] | rdi = *(rbx); | } 0x0042ee47 movsx r8d, bpl | r8d = (int32_t) bpl; 0x0042ee4b mov rcx, rsp | rcx = rsp; 0x0042ee4e mov rsi, r15 | rsi = r15; 0x0042ee51 mov rdx, r14 | rdx = r14; 0x0042ee54 call 0x432ba0 | eax = int(anonymousnamespace)::localUtf16ToUtf8,(anonymousnamespace)::NoOpSwapper>(char*,(anonymousnamespace)::NoOpCapacity,unsignedshortconst*,(anonymousnamespace)::Utf16::ZeroBasedEnd,(anonymousnamespace)::NoOpSwapper,unsigned long*,unsigned long*,char) (); | label_9: 0x0042ee59 mov ebp, eax | 0x0042ee5b mov rsi, qword [rsp] | rsi = *(rsp); 0x0042ee5f mov rax, qword [rbx + 8] | rax = *((rbx + 8)); 0x0042ee63 sub rax, qword [rbx] | rax -= *(rbx); 0x0042ee66 cmp rax, rsi | | if (rax != rsi) { 0x0042ee69 je 0x42ee73 | 0x0042ee6b mov rdi, rbx | 0x0042ee6e call 0x433890 | std::_1::vector>::resize(unsigned long) (rbx, rsi); | } 0x0042ee73 mov eax, ebp | eax = ebp; 0x0042ee75 add rsp, 8 | 0x0042ee79 pop rbx | 0x0042ee7a pop r14 | 0x0042ee7c pop r15 | 0x0042ee7e pop rbp | 0x0042ee7f ret | return rax; | }