; assembly | /* r2dec pseudo code output */ | /* baljsn_datumutil.t/assume @ 0x44ece0 */ | #include | | #define SWAP32(n) ((uint32_t) (((n & 0x000000ff) << 24) | \ | ((n & 0x0000ff00) << 8) | \ | ((n & 0x00ff0000) >> 8) | \ | ((n & 0xff000000) >> 24))) | ; (fcn) method.BloombergLP::bdlde::CharConvertUtf32.utf8ToUtf32_unsigned_int__unsigned_long__std::__1::basic_string_view_char__std::__1::char_traits_char____const__unsigned_long__unsigned_int__BloombergLP::bdlde::ByteOrder::Enum_ () | int64_t method_BloombergLP::bdlde::CharConvertUtf32_utf8ToUtf32_unsigned_int_unsigned_long_std::_1::basic_string_view_char_std::_1::char_traits_char_const_unsigned_long_unsigned_int_BloombergLP::bdlde::ByteOrder::Enum_ (int64_t arg6, int64_t arg5, int64_t arg4, int64_t arg3, uint32_t arg2, int64_t arg1) { | r9 = arg6; | r8 = arg5; | rcx = arg4; | rdx = arg3; | rsi = arg2; | rdi = arg1; | /* BloombergLP::bdlde::CharConvertUtf32::utf8ToUtf32(unsigned int*, unsigned long, std::__1::basic_string_view > const&, unsigned long*, unsigned int, BloombergLP::bdlde::ByteOrder::Enum) */ 0x0044ece0 push rbp | 0x0044ece1 push r15 | 0x0044ece3 push r14 | 0x0044ece5 push r13 | 0x0044ece7 push r12 | 0x0044ece9 push rbx | 0x0044ecea test rcx, rcx | 0x0044eced lea rbp, [rsp - 8] | rbp = rsp - 8; | if (rcx != 0) { 0x0044ecf2 cmovne rbp, rcx | | } 0x0044ecf6 test rsi, rsi | | if (rsi == 0) { 0x0044ecf9 je 0x44ef1f | goto label_6; | } 0x0044ecff mov rax, qword [rdx] | rax = *(rdx); 0x0044ed02 mov rdx, qword [rdx + 8] | rdx = *((rdx + 8)); 0x0044ed06 lea r10, [rax + rdx] | r10 = rax + rdx; 0x0044ed0a test r9d, r9d | 0x0044ed0d mov qword [rsp - 0x18], rbp | *((rsp - 0x18)) = rbp; | if (r9d == 0) { 0x0044ed12 je 0x44ef31 | goto label_7; | } 0x0044ed18 xor r9d, r9d | r9d = 0; 0x0044ed1b test rdx, rdx | 0x0044ed1e mov qword [rsp - 0x10], rdi | *((rsp - 0x10)) = rdi; | if (rdx <= 0) { 0x0044ed23 jle 0x44f12f | goto label_8; | } 0x0044ed29 mov rdx, rdi | rdx = rdi; 0x0044ed2c mov r11d, r8d | r11d = r8d; 0x0044ed2f bswap r11d | r11d = SWAP32 (r11d); 0x0044ed32 xor r14d, r14d | r14d = 0; 0x0044ed35 jmp 0x44ed5d | goto label_9; | label_1: 0x0044ed40 mov r14b, 1 | r14b = 1; 0x0044ed43 mov ebx, r11d | ebx = r11d; 0x0044ed46 test r8d, r8d | 0x0044ed49 je 0x44ed54 | | while (1) { 0x0044ed4b mov dword [rdx], ebx | *(rdx) = ebx; 0x0044ed4d add rdx, 4 | rdx += 4; 0x0044ed51 dec rsi | rsi--; 0x0044ed54 cmp rax, r10 | | if (rax >= r10) { 0x0044ed57 jae 0x44f13d | goto label_10; | } | label_9: 0x0044ed5d cmp rsi, 2 | | if (rsi < 2) { 0x0044ed61 jb 0x44f137 | goto label_11; | } 0x0044ed67 movzx ebx, byte [rax] | ebx = *(rax); 0x0044ed6a test bl, bl | | if (bl < 0) { 0x0044ed6c js 0x44ed80 | goto label_12; | } 0x0044ed6e mov ebp, 1 | | label_0: 0x0044ed73 add rax, rbp | rax += rbp; 0x0044ed76 bswap ebx | ebx = SWAP32 (ebx); 0x0044ed78 jmp 0x44ed4b | | } | label_12: 0x0044ed80 mov ecx, ebx | ecx = ebx; 0x0044ed82 and cl, 0xe0 | cl &= 0xe0; 0x0044ed85 cmp cl, 0xc0 | | if (cl != 0xc0) { 0x0044ed88 jne 0x44edc9 | goto label_13; | } 0x0044ed8a lea rcx, [rax + 2] | rcx = rax + 2; 0x0044ed8e mov r12d, 1 | r12d = 1; 0x0044ed94 cmp rcx, r10 | | if (rcx > r10) { 0x0044ed97 ja 0x44eee0 | goto label_14; | } 0x0044ed9d movzx ebp, byte [rax + 1] | ebp = *((rax + 1)); 0x0044eda1 mov ecx, ebp | ecx = ebp; 0x0044eda3 and cl, 0xc0 | cl &= 0xc0; 0x0044eda6 cmp cl, 0x80 | | if (cl != 0x80) { 0x0044eda9 jne 0x44eee0 | goto label_14; | } 0x0044edaf and ebp, 0x3f | ebp &= 0x3f; 0x0044edb2 and ebx, 0x1f | ebx &= 0x1f; 0x0044edb5 shl ebx, 6 | ebx <<= 6; 0x0044edb8 or ebx, ebp | ebx |= ebp; 0x0044edba mov ebp, 2 | 0x0044edbf cmp ebx, 0x7f | | if (ebx > 0x7f) { 0x0044edc2 ja 0x44ed73 | goto label_0; | } 0x0044edc4 jmp 0x44eee0 | goto label_14; | label_13: 0x0044edc9 mov ecx, ebx | ecx = ebx; 0x0044edcb and cl, 0xf0 | cl &= 0xf0; 0x0044edce cmp cl, 0xe0 | | if (cl != 0xe0) { 0x0044edd1 jne 0x44ee4b | goto label_15; | } 0x0044edd3 lea rcx, [rax + 3] | rcx = rax + 3; 0x0044edd7 mov r12d, 2 | r12d = 2; 0x0044eddd cmp rcx, r10 | | if (rcx > r10) { 0x0044ede0 ja 0x44eee0 | goto label_14; | } 0x0044ede6 movzx ebp, byte [rax + 1] | ebp = *((rax + 1)); 0x0044edea mov ecx, ebp | ecx = ebp; 0x0044edec and cl, 0xc0 | cl &= 0xc0; 0x0044edef cmp cl, 0x80 | | if (cl != 0x80) { 0x0044edf2 jne 0x44eee0 | goto label_14; | } 0x0044edf8 movzx r15d, byte [rax + 2] | r15d = *((rax + 2)); 0x0044edfd mov ecx, r15d | ecx = r15d; 0x0044ee00 and cl, 0xc0 | cl &= 0xc0; 0x0044ee03 cmp cl, 0x80 | | if (cl != 0x80) { 0x0044ee06 jne 0x44eee0 | goto label_14; | } 0x0044ee0c and ebp, 0x3f | ebp &= 0x3f; 0x0044ee0f shl ebp, 6 | ebp <<= 6; 0x0044ee12 and ebx, 0xf | ebx &= 0xf; 0x0044ee15 shl ebx, 0xc | ebx <<= 0xc; 0x0044ee18 or ebx, ebp | ebx |= ebp; 0x0044ee1a mov ecx, ebx | ecx = ebx; 0x0044ee1c and ecx, 0xf800 | ecx &= 0xf800; 0x0044ee22 cmp ecx, 0xd800 | | if (ecx == 0xd800) { 0x0044ee28 je 0x44eee0 | goto label_14; | } 0x0044ee2e and r15d, 0x3f | r15d &= 0x3f; 0x0044ee32 or ebx, r15d | ebx |= r15d; 0x0044ee35 mov ebp, 3 | 0x0044ee3a cmp ebx, 0x800 | | if (ebx >= 0x800) { 0x0044ee40 jae 0x44ed73 | goto label_0; | } 0x0044ee46 jmp 0x44eee0 | goto label_14; | label_15: 0x0044ee4b mov ecx, ebx | ecx = ebx; 0x0044ee4d and cl, 0xf8 | cl &= 0xf8; 0x0044ee50 mov r12d, 4 | r12d = 4; 0x0044ee56 cmp cl, 0xf0 | | if (cl == 0xf0) { 0x0044ee59 jne 0x44eee0 | 0x0044ee5f lea rcx, [rax + 4] | rcx = rax + 4; 0x0044ee63 mov r12d, 3 | r12d = 3; 0x0044ee69 cmp rcx, r10 | | if (rcx > r10) { 0x0044ee6c ja 0x44eee0 | goto label_14; | } 0x0044ee6e movzx r15d, byte [rax + 1] | r15d = *((rax + 1)); 0x0044ee73 mov ecx, r15d | ecx = r15d; 0x0044ee76 and cl, 0xc0 | cl &= 0xc0; 0x0044ee79 cmp cl, 0x80 | | if (cl != 0x80) { 0x0044ee7c jne 0x44eee0 | goto label_14; | } 0x0044ee7e movzx r13d, byte [rax + 2] | r13d = *((rax + 2)); 0x0044ee83 mov ecx, r13d | ecx = r13d; 0x0044ee86 and cl, 0xc0 | cl &= 0xc0; 0x0044ee89 cmp cl, 0x80 | | if (cl != 0x80) { 0x0044ee8c jne 0x44eee0 | goto label_14; | } 0x0044ee8e movzx ebp, byte [rax + 3] | ebp = *((rax + 3)); 0x0044ee92 mov ecx, ebp | ecx = ebp; 0x0044ee94 and cl, 0xc0 | cl &= 0xc0; 0x0044ee97 cmp cl, 0x80 | | if (cl != 0x80) { 0x0044ee9a jne 0x44eee0 | goto label_14; | } 0x0044ee9c and ebp, 0x3f | ebp &= 0x3f; 0x0044ee9f and r13d, 0x3f | r13d &= 0x3f; 0x0044eea3 shl r13d, 6 | r13d <<= 6; 0x0044eea7 and r15d, 0x3f | r15d &= 0x3f; 0x0044eeab shl r15d, 0xc | r15d <<= 0xc; 0x0044eeaf and ebx, 7 | ebx &= 7; 0x0044eeb2 shl ebx, 0x12 | ebx <<= 0x12; 0x0044eeb5 or ebx, r15d | ebx |= r15d; 0x0044eeb8 or ebx, r13d | ebx |= r13d; 0x0044eebb lea ecx, [rbp + rbx - 0x10000] | ecx = rbp + rbx - 0x10000; 0x0044eec2 cmp ecx, 0x100000 | | if (ecx >= 0x100000) { 0x0044eec8 jae 0x44eee0 | goto label_14; | } 0x0044eeca or ebx, ebp | ebx |= ebp; 0x0044eecc mov ebp, 4 | 0x0044eed1 jmp 0x44ed73 | goto label_0; | } | label_14: 0x0044eee0 lea rbx, [rax + r12 + 1] | rbx = rax + r12 + 1; 0x0044eee5 inc rax | rax++; 0x0044eee8 cmp rbx, r10 | | if (rbx >= r10) { 0x0044eeeb cmovae rbx, r10 | rbx = r10; | } 0x0044eeef cmp rbx, rax | | if (rbx <= rax) { 0x0044eef2 jbe 0x44ed40 | goto label_1; | } 0x0044eef8 nop dword [rax + rax] | | label_2: 0x0044ef00 movzx ecx, byte [rax] | ecx = *(rax); 0x0044ef03 and cl, 0xc0 | cl &= 0xc0; 0x0044ef06 cmp cl, 0x80 | | if (cl != 0x80) { 0x0044ef09 jne 0x44ed40 | goto label_1; | } 0x0044ef0f inc rax | rax++; 0x0044ef12 cmp rbx, rax | | if (rbx != rax) { 0x0044ef15 jne 0x44ef00 | goto label_2; | } 0x0044ef17 mov rax, rbx | rax = rbx; 0x0044ef1a jmp 0x44ed40 | goto label_1; | label_6: 0x0044ef1f mov qword [rbp], 0 | *(rbp) = 0; 0x0044ef27 mov eax, 2 | eax = 2; 0x0044ef2c jmp 0x44f18e | goto label_16; | label_7: 0x0044ef31 mov rcx, rdi | rcx = rdi; 0x0044ef34 xor r9d, r9d | r9d = 0; 0x0044ef37 xor r11d, r11d | r11d = 0; 0x0044ef3a test rdx, rdx | | if (rdx <= 0) { 0x0044ef3d jle 0x44f15f | goto label_17; | } 0x0044ef43 mov rdx, rcx | rdx = rcx; 0x0044ef46 jmp 0x44ef6d | goto label_18; | label_4: 0x0044ef50 mov r11b, 1 | r11b = 1; 0x0044ef53 mov ebp, r8d | 0x0044ef56 test r8d, r8d | 0x0044ef59 je 0x44ef64 | | while (1) { 0x0044ef5b mov dword [rdx], ebp | *(rdx) = ebp; 0x0044ef5d add rdx, 4 | rdx += 4; 0x0044ef61 dec rsi | rsi--; 0x0044ef64 cmp rax, r10 | | if (rax >= r10) { 0x0044ef67 jae 0x44f16a | goto label_19; | } | label_18: 0x0044ef6d cmp rsi, 2 | | if (rsi < 2) { 0x0044ef71 jb 0x44f164 | goto label_20; | } 0x0044ef77 movzx ebp, byte [rax] | ebp = *(rax); 0x0044ef7a test bpl, bpl | | if (bpl < 0) { 0x0044ef7d js 0x44ef90 | goto label_21; | } 0x0044ef7f mov ebx, 1 | ebx = 1; | label_3: 0x0044ef84 add rax, rbx | rax += rbx; 0x0044ef87 jmp 0x44ef5b | | } | label_21: 0x0044ef90 mov ebx, ebp | ebx = ebp; 0x0044ef92 and bl, 0xe0 | bl &= 0xe0; 0x0044ef95 cmp bl, 0xc0 | | if (bl != 0xc0) { 0x0044ef98 jne 0x44efdd | goto label_22; | } 0x0044ef9a lea rbx, [rax + 2] | rbx = rax + 2; 0x0044ef9e mov r13d, 1 | r13d = 1; 0x0044efa4 cmp rbx, r10 | | if (rbx > r10) { 0x0044efa7 ja 0x44f0f0 | goto label_23; | } 0x0044efad movzx r14d, byte [rax + 1] | r14d = *((rax + 1)); 0x0044efb2 mov ebx, r14d | ebx = r14d; 0x0044efb5 and bl, 0xc0 | bl &= 0xc0; 0x0044efb8 cmp bl, 0x80 | | if (bl != 0x80) { 0x0044efbb jne 0x44f0f0 | goto label_23; | } 0x0044efc1 and r14d, 0x3f | r14d &= 0x3f; 0x0044efc5 and ebp, 0x1f | ebp &= 0x1f; 0x0044efc8 shl ebp, 6 | ebp <<= 6; 0x0044efcb or ebp, r14d | ebp |= r14d; 0x0044efce mov ebx, 2 | ebx = 2; 0x0044efd3 cmp ebp, 0x7f | | if (ebp > 0x7f) { 0x0044efd6 ja 0x44ef84 | goto label_3; | } 0x0044efd8 jmp 0x44f0f0 | goto label_23; | label_22: 0x0044efdd mov ebx, ebp | ebx = ebp; 0x0044efdf and bl, 0xf0 | bl &= 0xf0; 0x0044efe2 cmp bl, 0xe0 | | if (bl != 0xe0) { 0x0044efe5 jne 0x44f064 | goto label_24; | } 0x0044efe7 lea rbx, [rax + 3] | rbx = rax + 3; 0x0044efeb mov r13d, 2 | r13d = 2; 0x0044eff1 cmp rbx, r10 | | if (rbx > r10) { 0x0044eff4 ja 0x44f0f0 | goto label_23; | } 0x0044effa movzx r15d, byte [rax + 1] | r15d = *((rax + 1)); 0x0044efff mov ebx, r15d | ebx = r15d; 0x0044f002 and bl, 0xc0 | bl &= 0xc0; 0x0044f005 cmp bl, 0x80 | | if (bl != 0x80) { 0x0044f008 jne 0x44f0f0 | goto label_23; | } 0x0044f00e movzx r14d, byte [rax + 2] | r14d = *((rax + 2)); 0x0044f013 mov ebx, r14d | ebx = r14d; 0x0044f016 and bl, 0xc0 | bl &= 0xc0; 0x0044f019 cmp bl, 0x80 | | if (bl != 0x80) { 0x0044f01c jne 0x44f0f0 | goto label_23; | } 0x0044f022 and r15d, 0x3f | r15d &= 0x3f; 0x0044f026 shl r15d, 6 | r15d <<= 6; 0x0044f02a and ebp, 0xf | ebp &= 0xf; 0x0044f02d shl ebp, 0xc | ebp <<= 0xc; 0x0044f030 or ebp, r15d | ebp |= r15d; 0x0044f033 mov ebx, ebp | ebx = ebp; 0x0044f035 and ebx, 0xf800 | ebx &= 0xf800; 0x0044f03b cmp ebx, 0xd800 | | if (ebx == 0xd800) { 0x0044f041 je 0x44f0f0 | goto label_23; | } 0x0044f047 and r14d, 0x3f | r14d &= 0x3f; 0x0044f04b or ebp, r14d | ebp |= r14d; 0x0044f04e mov ebx, 3 | ebx = 3; 0x0044f053 cmp ebp, 0x800 | | if (ebp >= 0x800) { 0x0044f059 jae 0x44ef84 | goto label_3; | } 0x0044f05f jmp 0x44f0f0 | goto label_23; | label_24: 0x0044f064 mov ebx, ebp | ebx = ebp; 0x0044f066 and bl, 0xf8 | bl &= 0xf8; 0x0044f069 mov r13d, 4 | r13d = 4; 0x0044f06f cmp bl, 0xf0 | | if (bl == 0xf0) { 0x0044f072 jne 0x44f0f0 | 0x0044f074 lea rbx, [rax + 4] | rbx = rax + 4; 0x0044f078 mov r13d, 3 | r13d = 3; 0x0044f07e cmp rbx, r10 | | if (rbx > r10) { 0x0044f081 ja 0x44f0f0 | goto label_23; | } 0x0044f083 movzx r14d, byte [rax + 1] | r14d = *((rax + 1)); 0x0044f088 mov ebx, r14d | ebx = r14d; 0x0044f08b and bl, 0xc0 | bl &= 0xc0; 0x0044f08e cmp bl, 0x80 | | if (bl != 0x80) { 0x0044f091 jne 0x44f0f0 | goto label_23; | } 0x0044f093 movzx r12d, byte [rax + 2] | r12d = *((rax + 2)); 0x0044f098 mov ebx, r12d | ebx = r12d; 0x0044f09b and bl, 0xc0 | bl &= 0xc0; 0x0044f09e cmp bl, 0x80 | | if (bl != 0x80) { 0x0044f0a1 jne 0x44f0f0 | goto label_23; | } 0x0044f0a3 movzx r15d, byte [rax + 3] | r15d = *((rax + 3)); 0x0044f0a8 mov ebx, r15d | ebx = r15d; 0x0044f0ab and bl, 0xc0 | bl &= 0xc0; 0x0044f0ae cmp bl, 0x80 | | if (bl != 0x80) { 0x0044f0b1 jne 0x44f0f0 | goto label_23; | } 0x0044f0b3 and r15d, 0x3f | r15d &= 0x3f; 0x0044f0b7 and r12d, 0x3f | r12d &= 0x3f; 0x0044f0bb shl r12d, 6 | r12d <<= 6; 0x0044f0bf and r14d, 0x3f | r14d &= 0x3f; 0x0044f0c3 shl r14d, 0xc | r14d <<= 0xc; 0x0044f0c7 and ebp, 7 | ebp &= 7; 0x0044f0ca shl ebp, 0x12 | ebp <<= 0x12; 0x0044f0cd or ebp, r14d | ebp |= r14d; 0x0044f0d0 or ebp, r12d | ebp |= r12d; 0x0044f0d3 lea ebx, [r15 + rbp - 0x10000] | ebx = r15 + rbp - 0x10000; 0x0044f0db cmp ebx, 0x100000 | | if (ebx >= 0x100000) { 0x0044f0e1 jae 0x44f0f0 | goto label_23; | } 0x0044f0e3 or ebp, r15d | ebp |= r15d; 0x0044f0e6 mov ebx, 4 | ebx = 4; 0x0044f0eb jmp 0x44ef84 | goto label_3; | } | label_23: 0x0044f0f0 lea rbp, [rax + r13 + 1] | rbp = rax + r13 + 1; 0x0044f0f5 inc rax | rax++; 0x0044f0f8 cmp rbp, r10 | | if (rbp >= r10) { 0x0044f0fb cmovae rbp, r10 | | } 0x0044f0ff cmp rbp, rax | | if (rbp <= rax) { 0x0044f102 jbe 0x44ef50 | goto label_4; | } 0x0044f108 nop dword [rax + rax] | | label_5: 0x0044f110 movzx ebx, byte [rax] | ebx = *(rax); 0x0044f113 and bl, 0xc0 | bl &= 0xc0; 0x0044f116 cmp bl, 0x80 | | if (bl != 0x80) { 0x0044f119 jne 0x44ef50 | goto label_4; | } 0x0044f11f inc rax | rax++; 0x0044f122 cmp rbp, rax | | if (rbp != rax) { 0x0044f125 jne 0x44f110 | goto label_5; | } 0x0044f127 mov rax, rbp | rax = rbp; 0x0044f12a jmp 0x44ef50 | goto label_4; | label_8: 0x0044f12f xor r14d, r14d | r14d = 0; 0x0044f132 mov rdx, rdi | rdx = rdi; 0x0044f135 jmp 0x44f13d | goto label_10; | label_11: 0x0044f137 mov r9d, 2 | r9d = 2; | label_10: 0x0044f13d mov dword [rdx], 0 | *(rdx) = 0; 0x0044f143 sub rdx, qword [rsp - 0x10] | rdx -= *((rsp - 0x10)); 0x0044f148 add rdx, 4 | rdx += 4; 0x0044f14c sar rdx, 2 | rdx >>= 2; 0x0044f150 mov rax, qword [rsp - 0x18] | rax = *((rsp - 0x18)); 0x0044f155 mov qword [rax], rdx | *(rax) = rdx; 0x0044f158 xor eax, eax | eax = 0; 0x0044f15a test r14b, r14b | 0x0044f15d jmp 0x44f188 | goto label_25; | label_17: 0x0044f15f mov rdx, rcx | rdx = rcx; 0x0044f162 jmp 0x44f16a | goto label_19; | label_20: 0x0044f164 mov r9d, 2 | r9d = 2; | label_19: 0x0044f16a mov dword [rdx], 0 | *(rdx) = 0; 0x0044f170 sub rdx, rcx | rdx -= rcx; 0x0044f173 add rdx, 4 | rdx += 4; 0x0044f177 sar rdx, 2 | rdx >>= 2; 0x0044f17b mov rax, qword [rsp - 0x18] | rax = *((rsp - 0x18)); 0x0044f180 mov qword [rax], rdx | *(rax) = rdx; 0x0044f183 xor eax, eax | eax = 0; 0x0044f185 test r11b, r11b | | label_25: 0x0044f188 setne al | al = (r11b != 0) ? 1 : 0; 0x0044f18b or eax, r9d | eax |= r9d; | label_16: 0x0044f18e pop rbx | 0x0044f18f pop r12 | r12 = rbx; 0x0044f191 pop r13 | r13 = rbx; 0x0044f193 pop r14 | r14 = rbx; 0x0044f195 pop r15 | r15 = rbx; 0x0044f197 pop rbp | 0x0044f198 ret | return rax; | }