; assembly | /* r2dec pseudo code output */ | /* bdlde_charconvertutf16.t/assume @ 0x42ee70 */ | #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) */ 0x0042ee70 push rbp | 0x0042ee71 push r15 | 0x0042ee73 push r14 | 0x0042ee75 push r13 | 0x0042ee77 push r12 | 0x0042ee79 push rbx | 0x0042ee7a push rax | 0x0042ee7b mov r12d, ecx | r12d = ecx; 0x0042ee7e mov r14, rdx | r14 = rdx; 0x0042ee81 mov r15, rsi | r15 = rsi; 0x0042ee84 mov r13, rdi | r13 = rdi; 0x0042ee87 movzx eax, word [rsi] | eax = *(rsi); 0x0042ee8a xor ebp, ebp | ebp = 0; 0x0042ee8c test r8d, r8d | | if (r8d == 0) { 0x0042ee8f je 0x42ef4d | goto label_4; | } 0x0042ee95 test ax, ax | | if (ax == 0) { 0x0042ee98 je 0x42ef14 | goto label_5; | } 0x0042ee9a mov rcx, r15 | rcx = r15; 0x0042ee9d jmp 0x42eeb8 | goto label_6; | label_0: 0x0042eea0 cmp eax, 0x800 | 0x0042eea5 sbb rbp, 0 | 0x0042eea9 add rbp, 3 | rbp += 3; | do { | label_2: 0x0042eead movzx eax, word [rdx] | eax = *(rdx); 0x0042eeb0 mov rcx, rdx | rcx = rdx; 0x0042eeb3 test ax, ax | | if (ax == 0) { 0x0042eeb6 je 0x42ef14 | goto label_5; | } | label_6: 0x0042eeb8 rol ax, 8 | ax = rotate_left16 (ax, 8); 0x0042eebc cmp ax, 0x7f | | if (ax > 0x7f) { 0x0042eec0 ja 0x42eed0 | goto label_7; | } 0x0042eec2 add rcx, 2 | rcx += 2; 0x0042eec6 inc rbp | rbp++; | label_1: 0x0042eec9 mov rdx, rcx | rdx = rcx; 0x0042eecc jmp 0x42eead | | } while (1); | label_7: 0x0042eed0 movzx eax, ax | eax = (int32_t) ax; 0x0042eed3 mov esi, eax | esi = eax; 0x0042eed5 and esi, 0xf800 | esi &= 0xf800; 0x0042eedb lea rdx, [rcx + 2] | rdx = rcx + 2; 0x0042eedf cmp esi, 0xd800 | | if (esi != 0xd800) { 0x0042eee5 jne 0x42eea0 | goto label_0; | } 0x0042eee7 and eax, 0xfc00 | eax &= 0xfc00; 0x0042eeec cmp eax, 0xd800 | | if (eax == 0xd800) { 0x0042eef1 jne 0x42ef0f | 0x0042eef3 movzx eax, word [rdx] | eax = *(rdx); 0x0042eef6 and eax, 0xfc | eax &= 0xfc; 0x0042eefb movzx eax, ax | eax = (int32_t) ax; 0x0042eefe cmp eax, 0xdc | | if (eax != 0xdc) { 0x0042ef03 jne 0x42ef0f | goto label_8; | } 0x0042ef05 add rcx, 4 | rcx += 4; 0x0042ef09 add rbp, 4 | rbp += 4; 0x0042ef0d jmp 0x42eec9 | goto label_1; | } | label_8: 0x0042ef0f inc rbp | rbp++; 0x0042ef12 jmp 0x42eead | goto label_2; | label_5: 0x0042ef14 inc rbp | rbp++; 0x0042ef17 mov rdi, qword [r13] | rdi = *(r13); 0x0042ef1b mov rax, qword [r13 + 8] | rax = *((r13 + 8)); 0x0042ef1f sub rax, rdi | rax -= rdi; 0x0042ef22 cmp rbp, rax | | if (rbp > rax) { 0x0042ef25 jbe 0x42ef36 | 0x0042ef27 mov rdi, r13 | 0x0042ef2a mov rsi, rbp | 0x0042ef2d call 0x433ab0 | std::_1::vector>::resize(unsigned long) (r13, rbp); 0x0042ef32 mov rdi, qword [r13] | rdi = *(r13); | } 0x0042ef36 movsx r8d, r12b | r8d = (int32_t) r12b; 0x0042ef3a mov rcx, rsp | rcx = rsp; 0x0042ef3d mov rsi, r15 | rsi = r15; 0x0042ef40 mov rdx, r14 | rdx = r14; 0x0042ef43 call 0x432f50 | ax = int(anonymousnamespace)::localUtf16ToUtf8,(anonymousnamespace)::Swapper>(char*,(anonymousnamespace)::NoOpCapacity,unsignedshortconst*,(anonymousnamespace)::Utf16::ZeroBasedEnd,(anonymousnamespace)::Swapper,unsigned long*,unsigned long*,char) (); 0x0042ef48 jmp 0x42f00e | goto label_9; | label_4: 0x0042ef4d test ax, ax | | if (ax == 0) { 0x0042ef50 je 0x42efda | goto label_10; | } 0x0042ef56 mov rcx, r15 | rcx = r15; 0x0042ef59 jmp 0x42ef78 | | while (esi != 0xd800) { 0x0042ef60 cmp eax, 0x800 | 0x0042ef65 sbb rbp, 0 | 0x0042ef69 add rbp, 3 | rbp += 3; | label_3: 0x0042ef6d movzx eax, word [rdx] | eax = *(rdx); 0x0042ef70 mov rcx, rdx | rcx = rdx; 0x0042ef73 test ax, ax | | if (ax == 0) { 0x0042ef76 je 0x42efda | goto label_10; | } 0x0042ef78 cmp ax, 0x7f | | if (ax <= 0x7f) { 0x0042ef7c ja 0x42ef90 | 0x0042ef7e add rcx, 2 | rcx += 2; 0x0042ef82 inc rbp | rbp++; 0x0042ef85 jmp 0x42efd0 | goto label_11; | } 0x0042ef90 movzx eax, ax | eax = (int32_t) ax; 0x0042ef93 mov esi, eax | esi = eax; 0x0042ef95 and esi, 0xf800 | esi &= 0xf800; 0x0042ef9b lea rdx, [rcx + 2] | rdx = rcx + 2; 0x0042ef9f cmp esi, 0xd800 | 0x0042efa5 jne 0x42ef60 | | } 0x0042efa7 and eax, 0xfc00 | eax &= 0xfc00; 0x0042efac cmp eax, 0xd800 | | if (eax == 0xd800) { 0x0042efb1 jne 0x42efd5 | 0x0042efb3 movzx eax, word [rdx] | eax = *(rdx); 0x0042efb6 and eax, 0xfc00 | eax &= 0xfc00; 0x0042efbb movzx eax, ax | eax = (int32_t) ax; 0x0042efbe cmp eax, 0xdc00 | | if (eax != 0xdc00) { 0x0042efc3 jne 0x42efd5 | goto label_12; | } 0x0042efc5 add rcx, 4 | rcx += 4; 0x0042efc9 add rbp, 4 | rbp += 4; 0x0042efcd nop dword [rax] | | label_11: 0x0042efd0 mov rdx, rcx | rdx = rcx; 0x0042efd3 jmp 0x42ef6d | goto label_3; | } | label_12: 0x0042efd5 inc rbp | rbp++; 0x0042efd8 jmp 0x42ef6d | goto label_3; | label_10: 0x0042efda inc rbp | rbp++; 0x0042efdd mov rdi, qword [r13] | rdi = *(r13); 0x0042efe1 mov rax, qword [r13 + 8] | rax = *((r13 + 8)); 0x0042efe5 sub rax, rdi | rax -= rdi; 0x0042efe8 cmp rbp, rax | | if (rbp > rax) { 0x0042efeb jbe 0x42effc | 0x0042efed mov rdi, r13 | 0x0042eff0 mov rsi, rbp | 0x0042eff3 call 0x433ab0 | std::_1::vector>::resize(unsigned long) (r13, rbp); 0x0042eff8 mov rdi, qword [r13] | rdi = *(r13); | } 0x0042effc movsx r8d, r12b | r8d = (int32_t) r12b; 0x0042f000 mov rcx, rsp | rcx = rsp; 0x0042f003 mov rsi, r15 | rsi = r15; 0x0042f006 mov rdx, r14 | rdx = r14; 0x0042f009 call 0x432dc0 | eax = int(anonymousnamespace)::localUtf16ToUtf8,(anonymousnamespace)::NoOpSwapper>(char*,(anonymousnamespace)::NoOpCapacity,unsignedshortconst*,(anonymousnamespace)::Utf16::ZeroBasedEnd,(anonymousnamespace)::NoOpSwapper,unsigned long*,unsigned long*,char) (); | label_9: 0x0042f00e mov ebx, eax | ebx = eax; 0x0042f010 mov rsi, qword [rsp] | rsi = *(rsp); 0x0042f014 cmp rsi, rbp | 0x0042f017 mov rax, qword [r13 + 8] | rax = *((r13 + 8)); 0x0042f01b sub rax, qword [r13] | rax -= *(r13); 0x0042f01f cmp rax, rsi | | if (rax != rsi) { 0x0042f022 je 0x42f02c | 0x0042f024 mov rdi, r13 | 0x0042f027 call 0x433ab0 | std::_1::vector>::resize(unsigned long) (r13, rsi); | } 0x0042f02c mov eax, ebx | eax = ebx; 0x0042f02e add rsp, 8 | 0x0042f032 pop rbx | 0x0042f033 pop r12 | 0x0042f035 pop r13 | 0x0042f037 pop r14 | 0x0042f039 pop r15 | 0x0042f03b pop rbp | 0x0042f03c ret | return rax; | }