; assembly | /* r2dec pseudo code output */ | /* bdlde_charconvertutf16.t/none @ 0x42eb00 */ | #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) */ 0x0042eb00 push rbp | 0x0042eb01 push r15 | 0x0042eb03 push r14 | 0x0042eb05 push rbx | 0x0042eb06 push rax | 0x0042eb07 mov ebp, ecx | 0x0042eb09 mov r14, rdx | r14 = rdx; 0x0042eb0c mov r15, rsi | r15 = rsi; 0x0042eb0f mov rbx, rdi | rbx = rdi; 0x0042eb12 movzx eax, word [rsi] | eax = *(rsi); 0x0042eb15 xor esi, esi | esi = 0; 0x0042eb17 test r8d, r8d | | if (r8d == 0) { 0x0042eb1a je 0x42ebd8 | goto label_4; | } 0x0042eb20 test ax, ax | | if (ax == 0) { 0x0042eb23 je 0x42eba4 | goto label_5; | } 0x0042eb29 mov rcx, r15 | rcx = r15; 0x0042eb2c jmp 0x42eb48 | goto label_6; | label_0: 0x0042eb30 cmp eax, 0x800 | 0x0042eb35 sbb rsi, 0 | 0x0042eb39 add rsi, 3 | rsi += 3; | do { | label_2: 0x0042eb3d movzx eax, word [rdx] | eax = *(rdx); 0x0042eb40 mov rcx, rdx | rcx = rdx; 0x0042eb43 test ax, ax | | if (ax == 0) { 0x0042eb46 je 0x42eba4 | goto label_5; | } | label_6: 0x0042eb48 rol ax, 8 | ax = rotate_left16 (ax, 8); 0x0042eb4c cmp ax, 0x7f | | if (ax > 0x7f) { 0x0042eb50 ja 0x42eb60 | goto label_7; | } 0x0042eb52 add rcx, 2 | rcx += 2; 0x0042eb56 inc rsi | rsi++; | label_1: 0x0042eb59 mov rdx, rcx | rdx = rcx; 0x0042eb5c jmp 0x42eb3d | | } while (1); | label_7: 0x0042eb60 movzx eax, ax | eax = (int32_t) ax; 0x0042eb63 mov edi, eax | edi = eax; 0x0042eb65 and edi, 0xf800 | edi &= 0xf800; 0x0042eb6b lea rdx, [rcx + 2] | rdx = rcx + 2; 0x0042eb6f cmp edi, 0xd800 | | if (edi != 0xd800) { 0x0042eb75 jne 0x42eb30 | goto label_0; | } 0x0042eb77 and eax, 0xfc00 | eax &= 0xfc00; 0x0042eb7c cmp eax, 0xd800 | | if (eax == 0xd800) { 0x0042eb81 jne 0x42eb9f | 0x0042eb83 movzx eax, word [rdx] | eax = *(rdx); 0x0042eb86 and eax, 0xfc | eax &= 0xfc; 0x0042eb8b movzx eax, ax | eax = (int32_t) ax; 0x0042eb8e cmp eax, 0xdc | | if (eax != 0xdc) { 0x0042eb93 jne 0x42eb9f | goto label_8; | } 0x0042eb95 add rcx, 4 | rcx += 4; 0x0042eb99 add rsi, 4 | rsi += 4; 0x0042eb9d jmp 0x42eb59 | goto label_1; | } | label_8: 0x0042eb9f inc rsi | rsi++; 0x0042eba2 jmp 0x42eb3d | goto label_2; | label_5: 0x0042eba4 inc rsi | rsi++; 0x0042eba7 mov rdi, qword [rbx] | rdi = *(rbx); 0x0042ebaa mov rax, qword [rbx + 8] | rax = *((rbx + 8)); 0x0042ebae sub rax, rdi | rax -= rdi; 0x0042ebb1 cmp rsi, rax | | if (rsi > rax) { 0x0042ebb4 jbe 0x42ebc1 | 0x0042ebb6 mov rdi, rbx | 0x0042ebb9 call 0x442e60 | bsl::vector>::resize(unsigned long) (rbx, rsi); 0x0042ebbe mov rdi, qword [rbx] | rdi = *(rbx); | } 0x0042ebc1 movsx r8d, bpl | r8d = (int32_t) bpl; 0x0042ebc5 mov rcx, rsp | rcx = rsp; 0x0042ebc8 mov rsi, r15 | rsi = r15; 0x0042ebcb mov rdx, r14 | rdx = r14; 0x0042ebce call 0x432d30 | ax = int(anonymousnamespace)::localUtf16ToUtf8,(anonymousnamespace)::Swapper>(char*,(anonymousnamespace)::NoOpCapacity,unsignedshortconst*,(anonymousnamespace)::Utf16::ZeroBasedEnd,(anonymousnamespace)::Swapper,unsigned long*,unsigned long*,char) (); 0x0042ebd3 jmp 0x42ec99 | goto label_9; | label_4: 0x0042ebd8 test ax, ax | | if (ax == 0) { 0x0042ebdb je 0x42ec6a | goto label_10; | } 0x0042ebe1 mov rcx, r15 | rcx = r15; 0x0042ebe4 jmp 0x42ec08 | | while (edi != 0xd800) { 0x0042ebf0 cmp eax, 0x800 | 0x0042ebf5 sbb rsi, 0 | 0x0042ebf9 add rsi, 3 | rsi += 3; | label_3: 0x0042ebfd movzx eax, word [rdx] | eax = *(rdx); 0x0042ec00 mov rcx, rdx | rcx = rdx; 0x0042ec03 test ax, ax | | if (ax == 0) { 0x0042ec06 je 0x42ec6a | goto label_10; | } 0x0042ec08 cmp ax, 0x7f | | if (ax <= 0x7f) { 0x0042ec0c ja 0x42ec20 | 0x0042ec0e add rcx, 2 | rcx += 2; 0x0042ec12 inc rsi | rsi++; 0x0042ec15 jmp 0x42ec60 | goto label_11; | } 0x0042ec20 movzx eax, ax | eax = (int32_t) ax; 0x0042ec23 mov edi, eax | edi = eax; 0x0042ec25 and edi, 0xf800 | edi &= 0xf800; 0x0042ec2b lea rdx, [rcx + 2] | rdx = rcx + 2; 0x0042ec2f cmp edi, 0xd800 | 0x0042ec35 jne 0x42ebf0 | | } 0x0042ec37 and eax, 0xfc00 | eax &= 0xfc00; 0x0042ec3c cmp eax, 0xd800 | | if (eax == 0xd800) { 0x0042ec41 jne 0x42ec65 | 0x0042ec43 movzx eax, word [rdx] | eax = *(rdx); 0x0042ec46 and eax, 0xfc00 | eax &= 0xfc00; 0x0042ec4b movzx eax, ax | eax = (int32_t) ax; 0x0042ec4e cmp eax, 0xdc00 | | if (eax != 0xdc00) { 0x0042ec53 jne 0x42ec65 | goto label_12; | } 0x0042ec55 add rcx, 4 | rcx += 4; 0x0042ec59 add rsi, 4 | rsi += 4; 0x0042ec5d nop dword [rax] | | label_11: 0x0042ec60 mov rdx, rcx | rdx = rcx; 0x0042ec63 jmp 0x42ebfd | goto label_3; | } | label_12: 0x0042ec65 inc rsi | rsi++; 0x0042ec68 jmp 0x42ebfd | goto label_3; | label_10: 0x0042ec6a inc rsi | rsi++; 0x0042ec6d mov rdi, qword [rbx] | rdi = *(rbx); 0x0042ec70 mov rax, qword [rbx + 8] | rax = *((rbx + 8)); 0x0042ec74 sub rax, rdi | rax -= rdi; 0x0042ec77 cmp rsi, rax | | if (rsi > rax) { 0x0042ec7a jbe 0x42ec87 | 0x0042ec7c mov rdi, rbx | 0x0042ec7f call 0x442e60 | bsl::vector>::resize(unsigned long) (rbx, rsi); 0x0042ec84 mov rdi, qword [rbx] | rdi = *(rbx); | } 0x0042ec87 movsx r8d, bpl | r8d = (int32_t) bpl; 0x0042ec8b mov rcx, rsp | rcx = rsp; 0x0042ec8e mov rsi, r15 | rsi = r15; 0x0042ec91 mov rdx, r14 | rdx = r14; 0x0042ec94 call 0x432ba0 | eax = int(anonymousnamespace)::localUtf16ToUtf8,(anonymousnamespace)::NoOpSwapper>(char*,(anonymousnamespace)::NoOpCapacity,unsignedshortconst*,(anonymousnamespace)::Utf16::ZeroBasedEnd,(anonymousnamespace)::NoOpSwapper,unsigned long*,unsigned long*,char) (); | label_9: 0x0042ec99 mov ebp, eax | 0x0042ec9b mov rsi, qword [rsp] | rsi = *(rsp); 0x0042ec9f mov rax, qword [rbx + 8] | rax = *((rbx + 8)); 0x0042eca3 sub rax, qword [rbx] | rax -= *(rbx); 0x0042eca6 cmp rax, rsi | | if (rax != rsi) { 0x0042eca9 je 0x42ecb3 | 0x0042ecab mov rdi, rbx | 0x0042ecae call 0x442e60 | bsl::vector>::resize(unsigned long) (rbx, rsi); | } 0x0042ecb3 mov eax, ebp | eax = ebp; 0x0042ecb5 add rsp, 8 | 0x0042ecb9 pop rbx | 0x0042ecba pop r14 | 0x0042ecbc pop r15 | 0x0042ecbe pop rbp | 0x0042ecbf ret | return rax; | }