; assembly | /* r2dec pseudo code output */ | /* baljsn_encoder.t/none @ 0x4640b0 */ | #include | ; (fcn) sym._ZN11BloombergLP6baljsn22Encoder_EncodeImplUtil12encodeMemberINS_8s_baltst26MySequenceWithChoiceChoiceENS_18bdlat_TypeCategory () | uint64_t ZN11BloombergLP6baljsn22Encoder_EncodeImplUtil12encodeMemberINS_8s_baltst26MySequenceWithChoiceChoiceENS_18bdlat_TypeCategory (int64_t arg_80h, int64_t arg_88h, int64_t arg6, int64_t arg5, int64_t arg4, int64_t arg3, int64_t arg2, int64_t arg1) { | int64_t var_8h; | int64_t var_10h; | int64_t var_18h; | int64_t var_20h; | int64_t var_28h; | int64_t var_30h; | int64_t var_38h; | int64_t var_40h; | r9 = arg6; | r8 = arg5; | rcx = arg4; | rdx = arg3; | rsi = arg2; | rdi = arg1; 0x004640b0 push rbp | 0x004640b1 push r15 | 0x004640b3 push r14 | 0x004640b5 push r13 | 0x004640b7 push r12 | 0x004640b9 push rbx | 0x004640ba sub rsp, 0x48 | 0x004640be mov r15d, r9d | r15d = r9d; 0x004640c1 mov r14, r8 | r14 = r8; 0x004640c4 mov r12, rcx | r12 = rcx; 0x004640c7 mov rbp, rdx | 0x004640ca mov r13, rsi | r13 = rsi; 0x004640cd mov qword [rsp], rdi | *(rsp) = rdi; 0x004640d1 mov rdi, rdx | 0x004640d4 mov rsi, r8 | rsi = r8; 0x004640d7 call 0x4642b0 | eax = intBloombergLP::baljsn::Encoder_EncodeImplUtil::validateChoice(std::_1::basic_ostream>*,BloombergLP::s_baltst::MySequenceWithChoiceChoiceconst&) (rdx); 0x004640dc mov ebx, eax | ebx = eax; 0x004640de test eax, eax | | if (eax != 0) { 0x004640e0 jne 0x46424c | goto label_0; | } 0x004640e6 test r15d, 0x10000 | | if ((r15d & 0x10000) == 0) { 0x004640ed jne 0x46410f | 0x004640ef movzx ecx, byte [rsp + 0x88] | ecx = *((rsp + 0x88)); 0x004640f7 mov rdi, r13 | 0x004640fa mov rsi, rbp | 0x004640fd mov rdx, r12 | 0x00464100 call 0x464340 | eax = BloombergLP::baljsn::Encoder_EncodeImplUtil::encodeMemberPrefix(BloombergLP::baljsn::Formatter*,std::_1::basic_ostream>*,std::_1::basic_string_view>const&,bool) (r13, rbp, r12, rcx); 0x00464105 mov ebx, eax | ebx = eax; 0x00464107 test eax, eax | | if (eax != 0) { 0x00464109 jne 0x46424c | goto label_0; | } | } 0x0046410f mov rdi, rbp | 0x00464112 mov rsi, r14 | rsi = r14; 0x00464115 call 0x4642b0 | eax = intBloombergLP::baljsn::Encoder_EncodeImplUtil::validateChoice(std::_1::basic_ostream>*,BloombergLP::s_baltst::MySequenceWithChoiceChoiceconst&) (rbp); 0x0046411a mov ebx, eax | ebx = eax; 0x0046411c test eax, eax | | if (eax == 0) { 0x0046411e jne 0x4641af | 0x00464124 test r15d, 0x10000 | 0x0046412b sete al | al = ((r15d & 0x10000) == 0) ? 1 : 0; 0x0046412e test r15d, 0x10000 | | if ((r15d & 0x10000) == 0) { 0x00464135 jne 0x464143 | 0x00464137 mov rdi, r13 | 0x0046413a call 0x48c6b0 | BloombergLP::baljsn::Formatter::openObject() (r13); 0x0046413f mov al, 1 | al = 1; 0x00464141 jmp 0x46414a | | } else { 0x00464143 or al, byte [rsp + 0x88] | al |= *((rsp + 0x88)); | } 0x0046414a mov ebx, 0xffffffff | ebx = 0xffffffff; 0x0046414f cmp dword [r14 + 4], 0 | | if (*((r14 + 4)) != 0) { 0x00464154 jne 0x4641af | goto label_1; | } 0x00464156 mov rcx, qword [rsp + 0x80] | rcx = *((rsp + 0x80)); 0x0046415e mov rdx, qword [rip + 0x1e4ae3] | rdx = *(str.choiceA); 0x00464165 movsxd rsi, dword [rip + 0x1e4ae4] | rsi = *(0x00648c50); 0x0046416c mov edi, dword [rip + 0x1e4aee] | edi = *(0x00648c60); 0x00464172 mov byte [rsp + 8], 0 | *((rsp + 8)) = 0; 0x00464177 mov qword [rsp + 0x10], r13 | *((rsp + 0x10)) = r13; 0x0046417c mov qword [rsp + 0x18], rbp | *((rsp + 0x18)) = rbp; 0x00464181 mov qword [rsp + 0x20], rdx | *((rsp + 0x20)) = rdx; 0x00464186 mov qword [rsp + 0x28], rsi | *((rsp + 0x28)) = rsi; 0x0046418b mov dword [rsp + 0x30], edi | *((rsp + 0x30)) = edi; 0x0046418f mov qword [rsp + 0x38], rcx | *((rsp + 0x38)) = rcx; 0x00464194 mov byte [rsp + 0x40], al | *((rsp + 0x40)) = al; 0x00464198 lea rsi, [rsp + 8] | 0x0046419d mov rdi, r14 | 0x004641a0 call 0x464420 | eax = intBloombergLP::bdlat_TypeCategoryUtil::accessByCategory(intconst&,BloombergLP::baljsn::Encoder_SelectionDispatcher&) (r14, rsp + 8); 0x004641a5 test eax, eax | | if (eax == 0) { 0x004641a7 je 0x46425d | goto label_2; | } 0x004641ad mov ebx, eax | ebx = eax; | } | label_1: 0x004641af mov esi, 0x5441fb | 0x004641b4 mov edx, 0x22 | 0x004641b9 mov rdi, rbp | 0x004641bc call 0x428ba0 | rax = std::_1::basic_ostream>&std::_1::_put_character_sequence>(std::_1::basic_ostream>&,char const*,unsigned long) (rbp, "Unable to encode value of element ", 0x22); 0x004641c1 mov esi, 0x54421e | 0x004641c6 mov edx, 8 | 0x004641cb mov rdi, rax | 0x004641ce call 0x428ba0 | rax = std::_1::basic_ostream>&std::_1::_put_character_sequence>(std::_1::basic_ostream>&,char const*,unsigned long) (rax, "named: ', 8); 0x004641d3 mov rsi, qword [r12] | 0x004641d7 mov rdx, qword [r12 + 8] | 0x004641dc mov rdi, rax | 0x004641df call 0x428ba0 | rax = std::_1::basic_ostream>&std::_1::_put_character_sequence>(std::_1::basic_ostream>&,char const*,unsigned long) (rax, *(r12), *((r12 + 8))); 0x004641e4 mov esi, 0x6675eb | 0x004641e9 mov edx, 2 | 0x004641ee mov rdi, rax | 0x004641f1 call 0x428ba0 | rax = std::_1::basic_ostream>&std::_1::_put_character_sequence>(std::_1::basic_ostream>&,char const*,unsigned long) (rax, 0x6675eb, 2); 0x004641f6 mov rbp, rax | 0x004641f9 mov rax, qword [rax] | rax = *(rax); 0x004641fc mov rsi, qword [rax - 0x18] | rsi = *((rax - 0x18)); 0x00464200 add rsi, rbp | rsi += rbp; 0x00464203 lea r14, [rsp + 8] | r14 = rsp + 8; 0x00464208 mov rdi, r14 | rdi = r14; 0x0046420b call 0x405930 | std::_1::ios_base::getloc()const (); 0x00464210 mov esi, 0x8cce50 | esi = std::__1::ctype::id; 0x00464215 mov rdi, r14 | rdi = r14; 0x00464218 call 0x405a20 | rax = std::_1::locale::use_facet(std::_1::locale::id&)const (); 0x0046421d mov rcx, qword [rax] | rcx = *(rax); 0x00464220 mov rdi, rax | rdi = rax; 0x00464223 mov esi, 0xa | esi = 0xa; 0x00464228 call qword [rcx + 0x38] | eax = uint64_t (*rcx + 0x38)() (); 0x0046422b mov r14d, eax | r14d = eax; 0x0046422e lea rdi, [rsp + 8] | rdi = rsp + 8; 0x00464233 call 0x405ac0 | std::_1::locale::~locale() (); 0x00464238 movsx esi, r14b | esi = (int32_t) r14b; 0x0046423c mov rdi, rbp | rdi = rbp; 0x0046423f call 0x4056b0 | std::_1::basic_ostream>::put(char) (); 0x00464244 mov rdi, rbp | rdi = rbp; 0x00464247 call 0x4058f0 | std::_1::basic_ostream>::flush() (); | do { | label_0: 0x0046424c mov eax, ebx | eax = ebx; 0x0046424e add rsp, 0x48 | 0x00464252 pop rbx | 0x00464253 pop r12 | 0x00464255 pop r13 | 0x00464257 pop r14 | 0x00464259 pop r15 | 0x0046425b pop rbp | 0x0046425c ret | return rax; | label_2: 0x0046425d mov bpl, byte [rsp + 8] | bpl = *((rsp + 8)); 0x00464262 mov al, 1 | al = 1; 0x00464264 test r15d, 0x10000 | | if ((r15d & 0x10000) == 0) { 0x0046426b jne 0x464277 | 0x0046426d mov rdi, r13 | 0x00464270 call 0x48c760 | eax = BloombergLP::baljsn::Formatter::closeObject() (r13); 0x00464275 xor eax, eax | eax = 0; | } 0x00464277 and r15d, 0x10000 | r15d &= 0x10000; 0x0046427e xor ebx, ebx | ebx = 0; 0x00464280 test bpl, bpl | 0x00464283 movzx eax, al | eax = (int32_t) al; | if (bpl == 0) { 0x00464286 cmove eax, ebx | eax = ebx; | } 0x00464289 test r15d, r15d | | if (r15d == 0) { 0x0046428c cmove eax, r15d | eax = r15d; | } 0x00464290 mov rcx, qword [rsp] | rcx = *(rsp); 0x00464294 mov byte [rcx], al | *(rcx) = al; 0x00464296 jmp 0x46424c | | } while (1); | }