; assembly | /* r2dec pseudo code output */ | /* bdlde_charconvertutf16.t/assume @ 0x42eca0 */ | #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_bsl::vector_char__bsl::allocator_char_____unsigned_short_const__unsigned_long__char__BloombergLP::bdlde::ByteOrder::Enum_ () | uint64_t method_BloombergLP::bdlde::CharConvertUtf16_utf16ToUtf8_bsl::vector_char_bsl::allocator_char_unsigned_short_const_unsigned_long_char_BloombergLP::bdlde::ByteOrder::Enum_ (int64_t arg5, uint32_t arg4, char * arg3, uint32_t arg2, char * arg1) { | r8 = arg5; | rcx = arg4; | rdx = arg3; | rsi = arg2; | rdi = arg1; | /* BloombergLP::bdlde::CharConvertUtf16::utf16ToUtf8(bsl::vector >*, unsigned short const*, unsigned long*, char, BloombergLP::bdlde::ByteOrder::Enum) */ 0x0042eca0 push rbp | 0x0042eca1 push r15 | 0x0042eca3 push r14 | 0x0042eca5 push r13 | 0x0042eca7 push r12 | 0x0042eca9 push rbx | 0x0042ecaa push rax | 0x0042ecab mov r12d, ecx | r12d = ecx; 0x0042ecae mov r14, rdx | r14 = rdx; 0x0042ecb1 mov r15, rsi | r15 = rsi; 0x0042ecb4 mov r13, rdi | r13 = rdi; 0x0042ecb7 movzx eax, word [rsi] | eax = *(rsi); 0x0042ecba xor ebp, ebp | ebp = 0; 0x0042ecbc test r8d, r8d | | if (r8d == 0) { 0x0042ecbf je 0x42ed7d | goto label_4; | } 0x0042ecc5 test ax, ax | | if (ax == 0) { 0x0042ecc8 je 0x42ed44 | goto label_5; | } 0x0042ecca mov rcx, r15 | rcx = r15; 0x0042eccd jmp 0x42ece8 | goto label_6; | label_0: 0x0042ecd0 cmp eax, 0x800 | 0x0042ecd5 sbb rbp, 0 | 0x0042ecd9 add rbp, 3 | rbp += 3; | do { | label_2: 0x0042ecdd movzx eax, word [rdx] | eax = *(rdx); 0x0042ece0 mov rcx, rdx | rcx = rdx; 0x0042ece3 test ax, ax | | if (ax == 0) { 0x0042ece6 je 0x42ed44 | goto label_5; | } | label_6: 0x0042ece8 rol ax, 8 | ax = rotate_left16 (ax, 8); 0x0042ecec cmp ax, 0x7f | | if (ax > 0x7f) { 0x0042ecf0 ja 0x42ed00 | goto label_7; | } 0x0042ecf2 add rcx, 2 | rcx += 2; 0x0042ecf6 inc rbp | rbp++; | label_1: 0x0042ecf9 mov rdx, rcx | rdx = rcx; 0x0042ecfc jmp 0x42ecdd | | } while (1); | label_7: 0x0042ed00 movzx eax, ax | eax = (int32_t) ax; 0x0042ed03 mov esi, eax | esi = eax; 0x0042ed05 and esi, 0xf800 | esi &= 0xf800; 0x0042ed0b lea rdx, [rcx + 2] | rdx = rcx + 2; 0x0042ed0f cmp esi, 0xd800 | | if (esi != 0xd800) { 0x0042ed15 jne 0x42ecd0 | goto label_0; | } 0x0042ed17 and eax, 0xfc00 | eax &= 0xfc00; 0x0042ed1c cmp eax, 0xd800 | | if (eax == 0xd800) { 0x0042ed21 jne 0x42ed3f | 0x0042ed23 movzx eax, word [rdx] | eax = *(rdx); 0x0042ed26 and eax, 0xfc | eax &= 0xfc; 0x0042ed2b movzx eax, ax | eax = (int32_t) ax; 0x0042ed2e cmp eax, 0xdc | | if (eax != 0xdc) { 0x0042ed33 jne 0x42ed3f | goto label_8; | } 0x0042ed35 add rcx, 4 | rcx += 4; 0x0042ed39 add rbp, 4 | rbp += 4; 0x0042ed3d jmp 0x42ecf9 | goto label_1; | } | label_8: 0x0042ed3f inc rbp | rbp++; 0x0042ed42 jmp 0x42ecdd | goto label_2; | label_5: 0x0042ed44 inc rbp | rbp++; 0x0042ed47 mov rdi, qword [r13] | rdi = *(r13); 0x0042ed4b mov rax, qword [r13 + 8] | rax = *((r13 + 8)); 0x0042ed4f sub rax, rdi | rax -= rdi; 0x0042ed52 cmp rbp, rax | | if (rbp > rax) { 0x0042ed55 jbe 0x42ed66 | 0x0042ed57 mov rdi, r13 | 0x0042ed5a mov rsi, rbp | 0x0042ed5d call 0x443080 | bsl::vector>::resize(unsigned long) (r13, rbp); 0x0042ed62 mov rdi, qword [r13] | rdi = *(r13); | } 0x0042ed66 movsx r8d, r12b | r8d = (int32_t) r12b; 0x0042ed6a mov rcx, rsp | rcx = rsp; 0x0042ed6d mov rsi, r15 | rsi = r15; 0x0042ed70 mov rdx, r14 | rdx = r14; 0x0042ed73 call 0x432f50 | ax = int(anonymousnamespace)::localUtf16ToUtf8,(anonymousnamespace)::Swapper>(char*,(anonymousnamespace)::NoOpCapacity,unsignedshortconst*,(anonymousnamespace)::Utf16::ZeroBasedEnd,(anonymousnamespace)::Swapper,unsigned long*,unsigned long*,char) (); 0x0042ed78 jmp 0x42ee3e | goto label_9; | label_4: 0x0042ed7d test ax, ax | | if (ax == 0) { 0x0042ed80 je 0x42ee0a | goto label_10; | } 0x0042ed86 mov rcx, r15 | rcx = r15; 0x0042ed89 jmp 0x42eda8 | | while (esi != 0xd800) { 0x0042ed90 cmp eax, 0x800 | 0x0042ed95 sbb rbp, 0 | 0x0042ed99 add rbp, 3 | rbp += 3; | label_3: 0x0042ed9d movzx eax, word [rdx] | eax = *(rdx); 0x0042eda0 mov rcx, rdx | rcx = rdx; 0x0042eda3 test ax, ax | | if (ax == 0) { 0x0042eda6 je 0x42ee0a | goto label_10; | } 0x0042eda8 cmp ax, 0x7f | | if (ax <= 0x7f) { 0x0042edac ja 0x42edc0 | 0x0042edae add rcx, 2 | rcx += 2; 0x0042edb2 inc rbp | rbp++; 0x0042edb5 jmp 0x42ee00 | goto label_11; | } 0x0042edc0 movzx eax, ax | eax = (int32_t) ax; 0x0042edc3 mov esi, eax | esi = eax; 0x0042edc5 and esi, 0xf800 | esi &= 0xf800; 0x0042edcb lea rdx, [rcx + 2] | rdx = rcx + 2; 0x0042edcf cmp esi, 0xd800 | 0x0042edd5 jne 0x42ed90 | | } 0x0042edd7 and eax, 0xfc00 | eax &= 0xfc00; 0x0042eddc cmp eax, 0xd800 | | if (eax == 0xd800) { 0x0042ede1 jne 0x42ee05 | 0x0042ede3 movzx eax, word [rdx] | eax = *(rdx); 0x0042ede6 and eax, 0xfc00 | eax &= 0xfc00; 0x0042edeb movzx eax, ax | eax = (int32_t) ax; 0x0042edee cmp eax, 0xdc00 | | if (eax != 0xdc00) { 0x0042edf3 jne 0x42ee05 | goto label_12; | } 0x0042edf5 add rcx, 4 | rcx += 4; 0x0042edf9 add rbp, 4 | rbp += 4; 0x0042edfd nop dword [rax] | | label_11: 0x0042ee00 mov rdx, rcx | rdx = rcx; 0x0042ee03 jmp 0x42ed9d | goto label_3; | } | label_12: 0x0042ee05 inc rbp | rbp++; 0x0042ee08 jmp 0x42ed9d | goto label_3; | label_10: 0x0042ee0a inc rbp | rbp++; 0x0042ee0d mov rdi, qword [r13] | rdi = *(r13); 0x0042ee11 mov rax, qword [r13 + 8] | rax = *((r13 + 8)); 0x0042ee15 sub rax, rdi | rax -= rdi; 0x0042ee18 cmp rbp, rax | | if (rbp > rax) { 0x0042ee1b jbe 0x42ee2c | 0x0042ee1d mov rdi, r13 | 0x0042ee20 mov rsi, rbp | 0x0042ee23 call 0x443080 | bsl::vector>::resize(unsigned long) (r13, rbp); 0x0042ee28 mov rdi, qword [r13] | rdi = *(r13); | } 0x0042ee2c movsx r8d, r12b | r8d = (int32_t) r12b; 0x0042ee30 mov rcx, rsp | rcx = rsp; 0x0042ee33 mov rsi, r15 | rsi = r15; 0x0042ee36 mov rdx, r14 | rdx = r14; 0x0042ee39 call 0x432dc0 | eax = int(anonymousnamespace)::localUtf16ToUtf8,(anonymousnamespace)::NoOpSwapper>(char*,(anonymousnamespace)::NoOpCapacity,unsignedshortconst*,(anonymousnamespace)::Utf16::ZeroBasedEnd,(anonymousnamespace)::NoOpSwapper,unsigned long*,unsigned long*,char) (); | label_9: 0x0042ee3e mov ebx, eax | ebx = eax; 0x0042ee40 mov rsi, qword [rsp] | rsi = *(rsp); 0x0042ee44 cmp rsi, rbp | 0x0042ee47 mov rax, qword [r13 + 8] | rax = *((r13 + 8)); 0x0042ee4b sub rax, qword [r13] | rax -= *(r13); 0x0042ee4f cmp rax, rsi | | if (rax != rsi) { 0x0042ee52 je 0x42ee5c | 0x0042ee54 mov rdi, r13 | 0x0042ee57 call 0x443080 | bsl::vector>::resize(unsigned long) (r13, rsi); | } 0x0042ee5c mov eax, ebx | eax = ebx; 0x0042ee5e add rsp, 8 | 0x0042ee62 pop rbx | 0x0042ee63 pop r12 | 0x0042ee65 pop r13 | 0x0042ee67 pop r14 | 0x0042ee69 pop r15 | 0x0042ee6b pop rbp | 0x0042ee6c ret | return rax; | }