; assembly | /* r2dec pseudo code output */ | /* ball_recordjsonformatter.t/assume @ 0x418520 */ | #include | ; (fcn) method.BloombergLP::ball::RecordJsonFormatter.setFormat_std::__1::basic_string_view_char__std::__1::char_traits_char____const_ () | int64_t method_BloombergLP::ball::RecordJsonFormatter_setFormat_std::_1::basic_string_view_char_std::_1::char_traits_char_const_ (char * arg2, char * arg1) { | int64_t var_10h; | int64_t var_1ch; | int64_t var_20h; | int64_t var_28h; | int64_t var_30h; | int64_t var_31h; | int64_t var_38h; | int64_t var_40h; | int64_t var_48h; | int64_t var_50h; | int64_t var_58h; | int64_t var_60h; | int64_t var_80h; | int64_t var_88h; | int64_t var_90h; | int64_t var_98h; | int64_t var_a0h; | int64_t var_b0h; | int64_t var_b8h; | int64_t var_beh; | int64_t var_c0h; | int64_t var_d8h; | int64_t var_e0h; | int64_t var_e8h; | uint32_t var_f0h; | rsi = arg2; | rdi = arg1; | /* BloombergLP::ball::RecordJsonFormatter::setFormat(std::__1::basic_string_view > const&) */ 0x00418520 push rbp | 0x00418521 push r15 | 0x00418523 push r14 | 0x00418525 push r13 | 0x00418527 push r12 | 0x00418529 push rbx | 0x0041852a sub rsp, 0xf8 | 0x00418531 cmp qword [rsi + 8], 0 | | if (*((rsi + 8)) != 0) { 0x00418536 je 0x418664 | 0x0041853c mov r15, rsi | r15 = rsi; 0x0041853f mov r14, rdi | r14 = rdi; 0x00418542 movabs rax, 0x2000000000000 | rax = 0x2000000000000; 0x0041854c mov qword [rsp + 0xb8], rax | *((rsp + 0xb8)) = rax; 0x00418554 mov rax, qword [rip + 0x2d35c5] | rax = BloombergLP::bslma::Default::s_defaultAllocator; 0x0041855b test rax, rax | | if (rax == 0) { 0x0041855e jne 0x418565 | 0x00418560 call 0x4712e0 | rax = BloombergLP::bslma::Default::determineAndReturnDefaultAllocator() (); | } 0x00418565 mov qword [rsp + 0xc0], rax | *((rsp + 0xc0)) = rax; 0x0041856d lea rdi, [rsp + 0x20] | 0x00418572 call 0x41c6b0 | BloombergLP::baljsn::DatumDecoderOptions::DatumDecoderOptions() (rsp + 0x20); 0x00418577 mov rbx, qword [r15] | rbx = *(r15); 0x0041857a mov rbp, qword [r15 + 8] | rbp = *((r15 + 8)); 0x0041857e lea rdi, [rsp + 0x40] | rdi = rsp + 0x40; 0x00418583 call 0x404890 | std::_1::basic_streambuf>::basic_streambuf() (); 0x00418588 mov qword [rsp + 0x40], 0x49e410 | *((rsp + 0x40)) = sym.imp.std::__1::basic_streambuf_char__std::__1::char_traits_char___::basic_streambuf__; 0x00418591 mov qword [rsp + 0x80], rbx | *((rsp + 0x80)) = rbx; 0x00418599 mov qword [rsp + 0x88], rbp | *((rsp + 0x88)) = rbp; 0x004185a1 add rbp, rbx | rbp += rbx; 0x004185a4 mov qword [rsp + 0x50], rbx | *((rsp + 0x50)) = rbx; 0x004185a9 mov qword [rsp + 0x58], rbx | *((rsp + 0x58)) = rbx; 0x004185ae mov qword [rsp + 0x60], rbp | *((rsp + 0x60)) = rbp; 0x004185b3 lea rdi, [rsp + 0xb0] | 0x004185bb lea rdx, [rsp + 0x40] | 0x004185c0 lea rcx, [rsp + 0x20] | 0x004185c5 xor esi, esi | 0x004185c7 call 0x41c7d0 | eax = BloombergLP::baljsn::DatumUtil::decode(BloombergLP::bdld::ManagedDatum*,std::_1::basic_ostream>*,std::_1::basic_streambuf>*,BloombergLP::baljsn::DatumDecoderOptionsconst&) (rsp + 0xb0, 0, rsp + 0x40, rsp + 0x20, r8, r9); 0x004185cc mov ebx, eax | ebx = eax; 0x004185ce lea rdi, [rsp + 0x40] | rdi = rsp + 0x40; 0x004185d3 call 0x4045b0 | std::_1::basic_streambuf>::~basic_streambuf() (); 0x004185d8 lea rdi, [rsp + 0x20] | rdi = rsp + 0x20; 0x004185dd call 0x41c6d0 | BloombergLP::baljsn::DatumDecoderOptions::~DatumDecoderOptions() (); 0x004185e2 test ebx, ebx | | if (ebx != 0) { 0x004185e4 jne 0x418963 | goto label_2; | } 0x004185ea xorps xmm0, xmm0 | __asm ("xorps xmm0, xmm0"); 0x004185ed movaps xmmword [rsp + 0x90], xmm0 | *((rsp + 0x90)) = xmm0; 0x004185f5 mov r13, qword [r14 + 0x28] | r13 = *((r14 + 0x28)); 0x004185f9 mov qword [rsp + 0xa0], r13 | *((rsp + 0xa0)) = r13; 0x00418601 movaps xmmword [rsp + 0x40], xmm0 | *((rsp + 0x40)) = xmm0; 0x00418606 mov qword [rsp + 0x50], 0 | *((rsp + 0x50)) = 0; 0x0041860f mov qword [rsp + 0x58], r13 | *((rsp + 0x58)) = r13; 0x00418614 movsx rax, word [rsp + 0xbe] | rax = *((rsp + 0xbe)); 0x0041861d mov ecx, eax | ecx = eax; 0x0041861f and ecx, 0xfffffffd | ecx &= 0xfffffffd; 0x00418622 mov dword [rsp + 0x1c], 0xffffffff | *((rsp + 0x1c)) = 0xffffffff; 0x0041862a cmp ecx, 0xd | | if (ecx != 0xd) { 0x0041862d jne 0x4188e5 | goto label_3; | } 0x00418633 mov qword [rsp + 0xe0], r15 | *((rsp + 0xe0)) = r15; 0x0041863b mov r12, qword [rsp + 0xb0] | r12 = *((rsp + 0xb0)); 0x00418643 cmp ax, 0xd | | if (ax != 0xd) { 0x00418647 jne 0x41866e | goto label_4; | } 0x00418649 test r12, r12 | | if (r12 == 0) { 0x0041864c je 0x4188a4 | goto label_5; | } 0x00418652 mov rcx, qword [r12] | rcx = *(r12); 0x00418656 add r12, 0x10 | r12 += 0x10; 0x0041865a test rcx, rcx | | if (rcx != 0) { 0x0041865d jne 0x41867f | goto label_6; | } 0x0041865f jmp 0x4188a4 | goto label_5; | } 0x00418664 mov ebx, 0xffffffff | ebx = 0xffffffff; 0x00418669 jmp 0x418978 | goto label_7; | label_4: 0x0041866e movsxd rcx, dword [rsp + 0xb8] | rcx = *((rsp + 0xb8)); 0x00418676 test rcx, rcx | | if (rcx == 0) { 0x00418679 je 0x4188a4 | goto label_5; | } | label_6: 0x0041867f mov qword [rsp + 0xd8], r14 | *((rsp + 0xd8)) = r14; 0x00418687 mov rax, rcx | rax = rcx; 0x0041868a neg rax | rax = -rax; 0x0041868d mov qword [rsp + 0xe8], rax | *((rsp + 0xe8)) = rax; 0x00418695 mov al, 1 | al = 1; 0x00418697 mov r14d, 1 | r14d = 1; 0x0041869d mov qword [rsp + 0xf0], rcx | *((rsp + 0xf0)) = rcx; 0x004186a5 jmp 0x4186d9 | | while (1) { | label_0: 0x004186b0 cmp r14, qword [rsp + 0xf0] | 0x004186b8 setb al | al = (r14 < *((rsp + 0xf0))) ? 1 : 0; 0x004186bb add r12, 0x10 | r12 += 0x10; 0x004186bf mov rcx, qword [rsp + 0xe8] | rcx = *((rsp + 0xe8)); 0x004186c7 lea rcx, [rcx + r14 + 1] | rcx = rcx + r14 + 1; 0x004186cc inc r14 | r14++; 0x004186cf cmp rcx, 1 | | if (rcx == 1) { 0x004186d3 je 0x418898 | goto label_8; | } 0x004186d9 movsx rcx, word [r12 + 0xe] | rcx = *((r12 + 0xe)); 0x004186df mov edx, 0x4030 | edx = 0x4030; 0x004186e4 bt rdx, rcx | | if (((rdx >> rcx) & 1) >= 0) { 0x004186e8 jb 0x4187b0 | 0x004186ee mov ecx, ecx | 0x004186f0 add rcx, 0xffffffffffffffef | rcx += 0xffffffffffffffef; 0x004186f4 cmp rcx, 1 | | if (rcx > 1) { 0x004186f8 ja 0x418898 | goto label_8; | } 0x004186fe mov rbp, qword [r12] | rbp = *(r12); 0x00418702 test rbp, rbp | | if (rbp == 0) { 0x00418705 je 0x418860 | goto label_9; | } 0x0041870b cmp qword [rbp], 1 | | if (*(rbp) != 1) { 0x00418710 jne 0x418860 | goto label_9; | } 0x00418716 movsx rax, word [rbp + 0x3e] | rax = *((rbp + 0x3e)); 0x0041871b mov eax, eax | 0x0041871d add rax, 0xffffffffffffffef | rax += 0xffffffffffffffef; 0x00418721 cmp rax, 1 | | if (rax > 1) { 0x00418725 ja 0x418860 | goto label_9; | } 0x0041872b lea rsi, [rbp + 0x20] | 0x0041872f lea rdi, [rsp + 0x90] | 0x00418737 call 0x418c80 | rax = BloombergLP::ball::(anonymousnamespace)::DatumParser::make(BloombergLP::bslstl::StringRefImpconst&) (rsp + 0x90, rbp + 0x20); 0x0041873c mov rbx, rax | rbx = rax; 0x0041873f mov r13, qword [rsp + 0xa0] | r13 = *((rsp + 0xa0)); 0x00418747 mov rax, r13 | rax = *((rsp + 0xa0)); 0x0041874a test rbx, rbx | | if (rbx == 0) { 0x0041874d cmove rax, rbx | rax = rbx; | } 0x00418751 mov qword [rsp + 0x38], rax | *((rsp + 0x38)) = rax; 0x00418756 mov r15d, 0x41b430 | r15d = BloombergLP::bslma::ManagedPtr_FactoryDeleter::deleter(void*, void*); | if (rbx == 0) { 0x0041875c cmove r15, rbx | r15 = rbx; | } | if (rbx == 0) { 0x00418760 je 0x418860 | goto label_9; | } 0x00418766 mov rax, qword [rbp + 0x30] | rax = *((rbp + 0x30)); 0x0041876a test rax, rax | | if (rax == 0) { 0x0041876d je 0x418816 | goto label_10; | } 0x00418773 lea rcx, [rax + 0x20] | rcx = rax + 0x20; 0x00418777 mov rdx, qword [rax] | rdx = *(rax); 0x0041877a movzx esi, byte [rax + 8] | esi = *((rax + 8)); 0x0041877e movzx eax, byte [rax + 9] | eax = *((rax + 9)); 0x00418782 mov qword [rsp + 0x20], rcx | *((rsp + 0x20)) = rcx; 0x00418787 mov qword [rsp + 0x28], rdx | *((rsp + 0x28)) = rdx; 0x0041878c mov byte [rsp + 0x30], sil | *((rsp + 0x30)) = sil; 0x00418791 test rdx, rdx | 0x00418794 mov ecx, 0 | ecx = 0; | if (rdx == 0) { 0x00418799 cmove eax, ecx | eax = ecx; | } 0x0041879c mov byte [rsp + 0x31], al | *((rsp + 0x31)) = al; 0x004187a0 jmp 0x418825 | goto label_11; | } 0x004187b0 cmp ecx, 0xe | | if (ecx != 0xe) { 0x004187b3 je 0x4187ba | 0x004187b5 cmp ecx, 5 | | if (ecx != 5) { 0x004187b8 jne 0x4187c5 | goto label_12; | } | } 0x004187ba mov rax, qword [r12] | rax = *(r12); 0x004187be movsxd rcx, dword [r12 + 8] | rcx = *((r12 + 8)); 0x004187c3 jmp 0x4187cf | goto label_13; | label_12: 0x004187c5 lea rax, [r12 + 1] | rax = r12 + 1; 0x004187ca movsx rcx, byte [r12] | rcx = *(r12); | label_13: 0x004187cf mov qword [rsp + 0x20], rax | *((rsp + 0x20)) = rax; 0x004187d4 mov qword [rsp + 0x28], rcx | *((rsp + 0x28)) = rcx; 0x004187d9 lea rdi, [rsp + 0x90] | 0x004187e1 lea rsi, [rsp + 0x20] | 0x004187e6 call 0x418c80 | rax = BloombergLP::ball::(anonymousnamespace)::DatumParser::make(BloombergLP::bslstl::StringRefImpconst&) (rsp + 0x90, rsp + 0x20); 0x004187eb mov rbx, rax | rbx = rax; 0x004187ee mov r13, qword [rsp + 0xa0] | r13 = *((rsp + 0xa0)); 0x004187f6 test rax, rax | 0x004187f9 mov rbp, r13 | | if (rax == 0) { 0x004187fc cmove rbp, rax | | } 0x00418800 mov r15, rax | r15 = rax; 0x00418803 mov eax, 0x41b430 | eax = BloombergLP::bslma::ManagedPtr_FactoryDeleter::deleter(void*, void*); | if (rax != 0) { 0x00418808 cmovne r15, rax | r15 = rax; | } 0x0041880c test rbx, rbx | | if (rbx != 0) { 0x0041880f jne 0x41887f | goto label_14; | } 0x00418811 jmp 0x4186b0 | | } | label_10: 0x00418816 xorps xmm0, xmm0 | __asm ("xorps xmm0, xmm0"); 0x00418819 movaps xmmword [rsp + 0x20], xmm0 | *((rsp + 0x20)) = xmm0; 0x0041881e mov word [rsp + 0x30], 0 | *((rsp + 0x30)) = 0; | label_11: 0x00418825 mov rax, qword [rbx] | rax = *(rbx); 0x00418828 mov rax, qword [rax + 0x18] | rax = *((rax + 0x18)); 0x0041882c mov rcx, qword [rsp + 0x30] | rcx = *((rsp + 0x30)); 0x00418831 mov qword [rsp + 0x10], rcx | *((rsp + 0x10)) = rcx; 0x00418836 movaps xmm0, xmmword [rsp + 0x20] | xmm0 = *((rsp + 0x20)); 0x0041883b movups xmmword [rsp], xmm0 | __asm ("movups xmmword [rsp], xmm0"); 0x0041883f mov rdi, rbx | rdi = rbx; 0x00418842 call rax | eax = void (*rax)() (); 0x00418844 test eax, eax | | if (eax != 0) { 0x00418846 je 0x418862 | 0x00418848 mov rdi, rbx | rdi = rbx; 0x0041884b mov rsi, qword [rsp + 0x38] | rsi = *((rsp + 0x38)); 0x00418850 call r15 | rax = void (*r15)() (); 0x00418853 nop word cs:[rax + rax] | 0x0041885d nop dword [rax] | | label_9: 0x00418860 xor ebx, ebx | ebx = 0; | } 0x00418862 test rbx, rbx | 0x00418865 mov rbp, r13 | | if (rbx == 0) { 0x00418868 cmove rbp, rbx | | } 0x0041886c mov r15d, 0x41b430 | r15d = BloombergLP::bslma::ManagedPtr_FactoryDeleter::deleter(void*, void*); | if (rbx == 0) { 0x00418872 cmove r15, rbx | r15 = rbx; | } 0x00418876 test rbx, rbx | | if (rbx == 0) { 0x00418879 je 0x4186b0 | goto label_0; | } | label_14: 0x0041887f mov qword [rsp + 0x20], rbx | *((rsp + 0x20)) = rbx; 0x00418884 lea rdi, [rsp + 0x40] | 0x00418889 lea rsi, [rsp + 0x20] | 0x0041888e call 0x41c2f0 | al = unsigned long&bsl::vector>::emplace_back(unsigned long&&) (rsp + 0x40, rsp + 0x20); 0x00418893 jmp 0x4186b0 | goto label_0; | label_8: 0x00418898 test al, 1 | 0x0041889a mov r14, qword [rsp + 0xd8] | r14 = *((rsp + 0xd8)); | if ((al & 1) == 0) { 0x004188a2 jne 0x4188e5 | | label_5: 0x004188a4 mov rax, qword [rsp + 0xe0] | rax = *((rsp + 0xe0)); 0x004188ac mov rsi, qword [rax] | 0x004188af mov rdx, qword [rax + 8] | 0x004188b3 mov rbx, qword [r14 + 0x18] | rbx = *((r14 + 0x18)); 0x004188b7 mov qword [r14 + 0x18], 0 | *((r14 + 0x18)) = 0; 0x004188bf mov ecx, 0x49a434 | 0x004188c4 mov rdi, r14 | 0x004188c7 call 0x4753c0 | bsl::basic_string,bsl::allocator>::privateAppend(char const*,unsigned long,char const*) (r14, *(rax), *((rax + 8)), "string<>::operator=(basic_string_view&): string too long"); 0x004188cc add r14, 0x30 | r14 += 0x30; 0x004188d0 mov dword [rsp + 0x1c], 0 | *((rsp + 0x1c)) = 0; 0x004188d8 lea rsi, [rsp + 0x40] | 0x004188dd mov rdi, r14 | 0x004188e0 call 0x48b240 | bsl::vector>::swap(bsl::vector>&) (r14, rsp + 0x40); | } | label_3: 0x004188e5 mov rbx, qword [rsp + 0x40] | rbx = *((rsp + 0x40)); 0x004188ea mov rcx, qword [rsp + 0x48] | rcx = *((rsp + 0x48)); 0x004188ef cmp rbx, rcx | | if (rbx != rcx) { 0x004188f2 jne 0x41890e | goto label_15; | } 0x004188f4 test rbx, rbx | | if (rbx != 0) { 0x004188f7 jne 0x41893f | goto label_16; | } 0x004188f9 jmp 0x41894d | goto label_17; | label_1: 0x00418900 mov rcx, qword [rsp + 0x48] | rcx = *((rsp + 0x48)); | do { 0x00418905 add rbx, 8 | rbx += 8; 0x00418909 cmp rbx, rcx | | if (rbx == rcx) { 0x0041890c je 0x418935 | goto label_18; | } | label_15: 0x0041890e mov rdi, qword [rbx] | rdi = *(rbx); 0x00418911 test rdi, rdi | 0x00418914 je 0x418905 | | } while (rdi == 0); 0x00418916 mov r14, qword [rsp + 0x58] | r14 = *((rsp + 0x58)); 0x0041891b mov rax, qword [rdi] | rax = *(rdi); 0x0041891e mov rbp, qword [rax - 0x10] | rbp = *((rax - 0x10)); 0x00418922 add rbp, rdi | rbp += rdi; 0x00418925 call qword [rax] | uint64_t (*rax)() (); 0x00418927 mov rax, qword [r14] | rax = *(r14); 0x0041892a mov rdi, r14 | rdi = r14; 0x0041892d mov rsi, rbp | rsi = rbp; 0x00418930 call qword [rax + 0x18] | uint64_t (*rax + 0x18)() (); 0x00418933 jmp 0x418900 | goto label_1; | label_18: 0x00418935 mov rbx, qword [rsp + 0x40] | rbx = *((rsp + 0x40)); 0x0041893a test rbx, rbx | | if (rbx != 0) { 0x0041893d je 0x41894d | | label_16: 0x0041893f mov rdi, qword [rsp + 0x58] | rdi = *((rsp + 0x58)); 0x00418944 mov rax, qword [rdi] | rax = *(rdi); 0x00418947 mov rsi, rbx | rsi = rbx; 0x0041894a call qword [rax + 0x18] | uint64_t (*rax + 0x18)() (); | } | label_17: 0x0041894d mov rdi, qword [rsp + 0x98] | rdi = *((rsp + 0x98)); 0x00418955 test rdi, rdi | 0x00418958 mov ebx, dword [rsp + 0x1c] | ebx = *((rsp + 0x1c)); | if (rdi != 0) { 0x0041895c je 0x418963 | 0x0041895e call 0x471c00 | BloombergLP::bslma::SharedPtrRep::releaseRef() (rdi); | } | label_2: 0x00418963 mov rsi, qword [rsp + 0xc0] | 0x0041896b lea rdi, [rsp + 0xb0] | 0x00418973 call 0x42a130 | BloombergLP::bdld::Datum::destroy(BloombergLP::bdld::Datumconst&,BloombergLP::bslma::Allocator*) (rsp + 0xb0, *((rsp + 0xc0))); | label_7: 0x00418978 mov eax, ebx | eax = ebx; 0x0041897a add rsp, 0xf8 | 0x00418981 pop rbx | 0x00418982 pop r12 | 0x00418984 pop r13 | 0x00418986 pop r14 | 0x00418988 pop r15 | 0x0041898a pop rbp | 0x0041898b ret | return rax; | }