; assembly | /* r2dec pseudo code output */ | /* balxml_encoder.t/assume @ 0x4de340 */ | #include | ; (fcn) method.int_BloombergLP::balxml::Encoder::encode_BloombergLP::s_baltst.MyChoice__BloombergLP::balxml::Formatter__BloombergLP::s_baltst::MyChoice_const_ () | int64_t method_int_BloombergLP::balxml::Encoder::encode_BloombergLP::s_baltst_MyChoice_BloombergLP::balxml::Formatter_BloombergLP::s_baltst::MyChoice_const_ (int64_t arg3, int64_t arg2, int64_t arg1) { | char * var_8h; | size_t var_10h; | int64_t var_20h; | uint32_t var_28h; | char * var_30h; | int64_t var_38h; | int64_t var_40h; | int64_t var_48h; | uint32_t var_68h; | int64_t var_70h; | char * var_78h; | int64_t var_80h; | rdx = arg3; | rsi = arg2; | rdi = arg1; | /* int BloombergLP::balxml::Encoder::encode(BloombergLP::balxml::Formatter&, BloombergLP::s_baltst::MyChoice const&) */ 0x004de340 push rbp | 0x004de341 push r15 | 0x004de343 push r14 | 0x004de345 push r13 | 0x004de347 push r12 | 0x004de349 push rbx | 0x004de34a sub rsp, 0x88 | 0x004de351 mov r14, rdx | r14 = rdx; 0x004de354 mov rbp, rsi | 0x004de357 mov r13, rdi | r13 = rdi; 0x004de35a mov dword [rdi + 0x100], 0 | *((rdi + 0x100)) = 0; 0x004de364 mov rbx, qword [rdi + 0xf8] | rbx = *((rdi + 0xf8)); 0x004de36b test rbx, rbx | | if (rbx != 0) { 0x004de36e je 0x4de38d | 0x004de370 mov rsi, qword [rbx + 0x30] | rsi = *((rbx + 0x30)); 0x004de374 mov rdi, qword [rbx + 0x48] | rdi = *((rbx + 0x48)); 0x004de378 mov rax, qword [rdi] | rax = *(rdi); 0x004de37b call qword [rax + 0x18] | uint64_t (*rax + 0x18)() (); 0x004de37e xorps xmm0, xmm0 | __asm ("xorps xmm0, xmm0"); 0x004de381 movups xmmword [rbx + 0x30], xmm0 | __asm ("movups xmmword [rbx + 0x30], xmm0"); 0x004de385 mov qword [rbx + 0x40], 0 | *((rbx + 0x40)) = 0; | } 0x004de38d lea r12, [rsp + 0x38] | r12 = rsp + 0x38; 0x004de392 mov rdi, r12 | 0x004de395 mov rsi, rbp | 0x004de398 mov rdx, r13 | 0x004de39b call 0x4e4b70 | BloombergLP::balxml::Encoder_Context::Encoder_Context(BloombergLP::balxml::Formatter*,BloombergLP::balxml::Encoder*) (r12, rbp, r13); 0x004de3a0 mov rax, qword [r13] | rax = *(r13); 0x004de3a4 cmp byte [rax + 0xc1], 0 | | if (*((rax + 0xc1)) != 0) { 0x004de3ab je 0x4de3d0 | 0x004de3ad mov qword [rsp + 8], 0x5521e7 | *((rsp + 8)) = "UTF-8"; 0x004de3b6 mov qword [rsp + 0x10], 5 | *((rsp + 0x10)) = 5; 0x004de3bf lea rsi, [rsp + 8] | 0x004de3c4 mov rdi, rbp | 0x004de3c7 call 0x4e77c0 | BloombergLP::balxml::Formatter::addHeader(std::_1::basic_string_view>const&) (rbp, rsp + 8); 0x004de3cc mov rax, qword [r13] | rax = *(r13); | } 0x004de3d0 cmp qword [rax + 0x78], 0 | | if (*((rax + 0x78)) != 0) { 0x004de3d5 je 0x4de3ea | 0x004de3d7 lea r15, [rax + 0x60] | r15 = rax + 0x60; 0x004de3db cmp qword [rax + 0x80], 0x17 | | if (*((rax + 0x80)) == 0x17) { 0x004de3e3 je 0x4de3f0 | goto label_0; | } 0x004de3e5 mov r15, qword [r15] | r15 = *(r15); 0x004de3e8 jmp 0x4de3f0 | | } else { 0x004de3ea mov r15d, 0x55fdf0 | r15d = "MyChoice"; | } | label_0: 0x004de3f0 mov rbp, qword [rsp + 0x38] | rbp = *((rsp + 0x38)); 0x004de3f5 mov qword [rsp + 8], r15 | *((rsp + 8)) = r15; 0x004de3fa mov rdi, r15 | 0x004de3fd call 0x404410 | rax = strlen (r15); 0x004de402 mov qword [rsp + 0x10], rax | *((rsp + 0x10)) = rax; 0x004de407 lea rsi, [rsp + 8] | 0x004de40c mov rdi, rbp | 0x004de40f xor edx, edx | 0x004de411 call 0x4e7510 | BloombergLP::balxml::Formatter::openElement(std::_1::basic_string_view>const&,BloombergLP::balxml::Formatter::WhitespaceType) (rbp, rsp + 8, 0); 0x004de416 mov rdx, qword [r13] | rdx = *(r13); 0x004de41a cmp qword [rdx + 0x18], 0 | | if (*((rdx + 0x18)) != 0) { 0x004de41f je 0x4de51d | 0x004de425 mov rdi, qword [rsp + 0x38] | 0x004de42a mov qword [rsp + 8], 0x5521ed | *((rsp + 8)) = "xmlns"; 0x004de433 mov qword [rsp + 0x10], 5 | *((rsp + 0x10)) = 5; 0x004de43c lea rsi, [rsp + 8] | 0x004de441 xor ecx, ecx | 0x004de443 call 0x452d00 | voidBloombergLP::balxml::Formatter::addAttribute,bsl::allocator>>(std::_1::basic_string_view>const&,bsl::basic_string,bsl::allocator>const&,int) (*((rsp + 0x38)), rsp + 8, rdx, 0); 0x004de448 mov rax, qword [r13] | rax = *(r13); 0x004de44c cmp byte [rax + 0xc2], 0 | | if (*((rax + 0xc2)) == 0) { 0x004de453 je 0x4de54e | goto label_1; | } 0x004de459 mov rdi, qword [rsp + 0x38] | 0x004de45e mov qword [rsp + 8], 0x5521f3 | *((rsp + 8)) = "xmlns:xsi"; 0x004de467 mov qword [rsp + 0x10], 9 | *((rsp + 0x10)) = 9; 0x004de470 lea rsi, [rsp + 8] | 0x004de475 mov edx, 0x5521fd | 0x004de47a xor ecx, ecx | 0x004de47c call 0x453060 | voidBloombergLP::balxml::Formatter::addAttribute(std::_1::basic_string_view>const&,char const(&)[42],int) (*((rsp + 0x38)), rsp + 8, "http://www.w3.org/2001/XMLSchema-instance", 0); 0x004de481 mov rsi, qword [r13] | rsi = *(r13); 0x004de485 cmp qword [rsi + 0x48], 0 | | if (*((rsi + 0x48)) == 0) { 0x004de48a je 0x4de54e | goto label_1; | } 0x004de490 lea rbp, [rsp + 0x48] | rbp = rsp + 0x48; 0x004de495 mov edx, 0x5620cd | 0x004de49a mov rdi, rbp | 0x004de49d call 0x44e6f0 | bsl::basic_string,bsl::allocator>bsl::operator+,bsl::allocator>(bsl::basic_string,bsl::allocator>const&,char const*) (rbp, rsi, 0x5620cd); 0x004de4a2 mov rdx, qword [r13] | 0x004de4a6 add rdx, 0x30 | rdx += 0x30; 0x004de4aa lea rdi, [rsp + 8] | 0x004de4af mov rsi, rbp | 0x004de4b2 call 0x452c20 | bsl::basic_string,bsl::allocator>bsl::operator+,bsl::allocator>(bsl::basic_string,bsl::allocator>const&,bsl::basic_string,bsl::allocator>const&) (rsp + 8, rbp, *(r13)); 0x004de4b7 mov rdi, qword [rsp + 0x38] | 0x004de4bc mov qword [rsp + 0x78], 0x552227 | *((rsp + 0x78)) = "xsi:schemaLocation"; 0x004de4c5 mov qword [rsp + 0x80], 0x12 | *((rsp + 0x80)) = 0x12; 0x004de4d1 lea rsi, [rsp + 0x78] | 0x004de4d6 lea rdx, [rsp + 8] | 0x004de4db xor ecx, ecx | 0x004de4dd call 0x452d00 | voidBloombergLP::balxml::Formatter::addAttribute,bsl::allocator>>(std::_1::basic_string_view>const&,bsl::basic_string,bsl::allocator>const&,int) (*((rsp + 0x38)), rsp + 0x78, rsp + 8, 0); 0x004de4e2 cmp qword [rsp + 0x28], 0x17 | | if (*((rsp + 0x28)) != 0x17) { 0x004de4e8 je 0x4de4fa | 0x004de4ea mov rsi, qword [rsp + 8] | rsi = *((rsp + 8)); 0x004de4ef mov rdi, qword [rsp + 0x30] | rdi = *((rsp + 0x30)); 0x004de4f4 mov rax, qword [rdi] | rax = *(rdi); 0x004de4f7 call qword [rax + 0x18] | uint64_t (*rax + 0x18)() (); | } 0x004de4fa mov qword [rsp + 0x20], 0xffffffffffffffff | *((rsp + 0x20)) = 0xffffffffffffffff; 0x004de503 cmp qword [rsp + 0x68], 0x17 | | if (*((rsp + 0x68)) == 0x17) { 0x004de509 je 0x4de54e | goto label_1; | } 0x004de50b mov rsi, qword [rsp + 0x48] | rsi = *((rsp + 0x48)); 0x004de510 mov rdi, qword [rsp + 0x70] | rdi = *((rsp + 0x70)); 0x004de515 mov rax, qword [rdi] | rax = *(rdi); 0x004de518 call qword [rax + 0x18] | uint64_t (*rax + 0x18)() (); 0x004de51b jmp 0x4de54e | | } else { 0x004de51d cmp byte [rdx + 0xc2], 0 | | if (*((rdx + 0xc2)) == 0) { 0x004de524 je 0x4de54e | goto label_1; | } 0x004de526 mov rdi, qword [rsp + 0x38] | 0x004de52b mov qword [rsp + 8], 0x5521f3 | *((rsp + 8)) = "xmlns:xsi"; 0x004de534 mov qword [rsp + 0x10], 9 | *((rsp + 0x10)) = 9; 0x004de53d lea rsi, [rsp + 8] | 0x004de542 mov edx, 0x5521fd | 0x004de547 xor ecx, ecx | 0x004de549 call 0x453060 | voidBloombergLP::balxml::Formatter::addAttribute(std::_1::basic_string_view>const&,char const(&)[42],int) (*((rsp + 0x38)), rsp + 8, "http://www.w3.org/2001/XMLSchema-instance", 0); | } | label_1: 0x004de54e mov eax, dword [r14 + 0x30] | eax = *((r14 + 0x30)); 0x004de552 cmp eax, 0xffffffff | | if (eax != 0xffffffff) { 0x004de555 je 0x4de599 | 0x004de557 mov qword [rsp + 0x48], r12 | *((rsp + 0x48)) = r12; 0x004de55c test eax, eax | | if (eax != 0) { 0x004de55e je 0x4de5d1 | 0x004de560 mov rax, qword [rip + 0x818c9] | rax = *(str.selection2); 0x004de567 movsxd rcx, dword [rip + 0x818ca] | rcx = *(0x0055fe38); 0x004de56e mov qword [rsp + 8], rax | *((rsp + 8)) = rax; 0x004de573 mov qword [rsp + 0x10], rcx | *((rsp + 0x10)) = rcx; 0x004de578 mov ecx, dword [rip + 0x818ca] | 0x004de57e lea rdi, [rsp + 0x48] | 0x004de583 lea rdx, [rsp + 8] | 0x004de588 mov rsi, r14 | 0x004de58b call 0x4dcfb0 | eax = intBloombergLP::balxml::Encoder_EncodeObject::executeImp,bsl::allocator>,BloombergLP::bdlat_TypeCategory::Simple>(bsl::basic_string,bsl::allocator>const&,std::_1::basic_string_view>const&,int,BloombergLP::bdlat_TypeCategory::Simple) (rsp + 0x48, r14, rsp + 8, *(0x0055fe48)); 0x004de590 test eax, eax | | if (eax != 0) { 0x004de592 jne 0x4de609 | goto label_2; | } 0x004de594 jmp 0x4de6a4 | 0x004de599 mov rax, qword [r13] | rax = *(r13); 0x004de59d mov ecx, dword [rax + 0x90] | 0x004de5a3 mov qword [rsp + 8], 0x5523bf | *((rsp + 8)) = 0x5523bf; 0x004de5ac mov qword [rsp + 0x10], 3 | *((rsp + 0x10)) = 3; 0x004de5b5 mov rdi, qword [rsp + 0x40] | 0x004de5ba lea rdx, [rsp + 8] | 0x004de5bf mov esi, 0x55239b | 0x004de5c4 mov r8d, 0xffffffff | 0x004de5ca call 0x4e4a00 | BloombergLP::balxml::Encoder::logError(char const*,std::_1::basic_string_view>const&,int,int) (*((rsp + 0x40)), "Undefined selection is not allowed ", rsp + 8, *((rax + 0x90)), 0xffffffff); 0x004de5cf jmp 0x4de609 | | } else { | } else { 0x004de5d1 mov rax, qword [rip + 0x81830] | rax = *(str.selection1); 0x004de5d8 movsxd rcx, dword [rip + 0x81831] | rcx = *(0x0055fe10); 0x004de5df mov qword [rsp + 8], rax | *((rsp + 8)) = rax; 0x004de5e4 mov qword [rsp + 0x10], rcx | *((rsp + 0x10)) = rcx; 0x004de5e9 mov ecx, dword [rip + 0x81831] | 0x004de5ef lea rdi, [rsp + 0x48] | 0x004de5f4 lea rdx, [rsp + 8] | 0x004de5f9 mov rsi, r14 | 0x004de5fc call 0x456570 | eax = intBloombergLP::balxml::Encoder_EncodeObject::executeImp(intconst&,std::_1::basic_string_view>const&,int,BloombergLP::bdlat_TypeCategory::Simple) (rsp + 0x48, r14, rsp + 8, *(0x0055fe20)); 0x004de601 test eax, eax | | if (eax == 0) { 0x004de603 je 0x4de6a4 | goto label_3; | } | } | label_2: 0x004de609 mov qword [rsp + 8], r15 | *((rsp + 8)) = r15; 0x004de60e mov rdi, r15 | 0x004de611 call 0x404410 | rax = strlen (r15); 0x004de616 mov qword [rsp + 0x10], rax | *((rsp + 0x10)) = rax; 0x004de61b mov rax, qword [r13] | rax = *(r13); 0x004de61f mov ecx, dword [rax + 0x90] | 0x004de625 lea rdx, [rsp + 8] | 0x004de62a mov r14d, 0xffffffff | r14d = 0xffffffff; 0x004de630 mov esi, 0x55223a | 0x004de635 mov rdi, r13 | 0x004de638 mov r8d, 0xffffffff | 0x004de63e call 0x4e4a00 | BloombergLP::balxml::Encoder::logError(char const*,std::_1::basic_string_view>const&,int,int) (r13, "Failed to encode", rsp + 8, *((rax + 0x90)), 0xffffffff); 0x004de643 mov rbp, qword [rsp + 0x38] | rbp = *((rsp + 0x38)); 0x004de648 cmp dword [rbp + 0xd8], 2 | | if (*((rbp + 0xd8)) == 2) { 0x004de64f jne 0x4de676 | 0x004de651 mov rdi, qword [rbp + 0xa0] | 0x004de658 mov byte [rsp + 8], 0x3e | *((rsp + 8)) = 0x3e; 0x004de65d lea rsi, [rsp + 8] | 0x004de662 mov edx, 1 | 0x004de667 call 0x4521a0 | std::_1::basic_ostream>&std::_1::_put_character_sequence>(std::_1::basic_ostream>&,char const*,unsigned long) (*((rbp + 0xa0)), rsp + 8, 1); 0x004de66c mov dword [rbp + 0xd8], 3 | *((rbp + 0xd8)) = 3; | } 0x004de676 mov eax, dword [rbp + 0xb4] | eax = *((rbp + 0xb4)); 0x004de67c inc eax | eax++; 0x004de67e mov dword [rbp + 0xb0], eax | *((rbp + 0xb0)) = eax; 0x004de684 mov rax, qword [rbp + 0xa0] | rax = *((rbp + 0xa0)); 0x004de68b mov rcx, qword [rax] | rcx = *(rax); 0x004de68e mov rcx, qword [rcx - 0x18] | rcx = *((rcx - 0x18)); 0x004de692 lea rdi, [rax + rcx] | rdi = rax + rcx; 0x004de696 mov esi, dword [rax + rcx + 0x20] | esi = *((rax + rcx + 0x20)); 0x004de69a or esi, 4 | esi |= 4; 0x004de69d call 0x404370 | std::_1::ios_base::clear(unsignedint) (); 0x004de6a2 jmp 0x4de6cb | goto label_4; | } | label_3: 0x004de6a4 mov rbp, qword [rsp + 0x38] | rbp = *((rsp + 0x38)); 0x004de6a9 mov qword [rsp + 8], r15 | *((rsp + 8)) = r15; 0x004de6ae mov rdi, r15 | 0x004de6b1 call 0x404410 | rax = strlen (r15); 0x004de6b6 mov qword [rsp + 0x10], rax | *((rsp + 0x10)) = rax; 0x004de6bb lea rsi, [rsp + 8] | 0x004de6c0 mov rdi, rbp | 0x004de6c3 call 0x4e7630 | BloombergLP::balxml::Formatter::closeElement(std::_1::basic_string_view>const&) (rbp, rsp + 8); 0x004de6c8 xor r14d, r14d | r14d = 0; | label_4: 0x004de6cb mov eax, dword [r13 + 0x100] | eax = *((r13 + 0x100)); 0x004de6d2 test eax, eax | | if (eax != 0) { 0x004de6d4 je 0x4de718 | 0x004de6d6 cmp eax, 1 | | if (eax == 1) { 0x004de6d9 jne 0x4de6e9 | 0x004de6db mov rdi, qword [r13 + 0x110] | rdi = *((r13 + 0x110)); 0x004de6e2 test rdi, rdi | | if (rdi == 0) { 0x004de6e5 jne 0x4de6f5 | 0x004de6e7 jmp 0x4de718 | | } else { 0x004de6e9 mov rdi, qword [r13 + 0x108] | rdi = *((r13 + 0x108)); 0x004de6f0 test rdi, rdi | | if (rdi == 0) { 0x004de6f3 je 0x4de718 | goto label_5; | } | } 0x004de6f5 mov rax, qword [r13 + 0xf8] | rax = *((r13 + 0xf8)); 0x004de6fc test rax, rax | | if (rax != 0) { 0x004de6ff je 0x4de70f | 0x004de701 mov rsi, qword [rax + 0x30] | rsi = *((rax + 0x30)); 0x004de705 mov eax, dword [rax + 0x38] | eax = *((rax + 0x38)); 0x004de708 sub eax, esi | eax -= esi; 0x004de70a movsxd rdx, eax | rdx = (int64_t) eax; 0x004de70d jmp 0x4de713 | | } else { 0x004de70f xor esi, esi | 0x004de711 xor edx, edx | | } 0x004de713 call 0x4521a0 | std::_1::basic_ostream>&std::_1::_put_character_sequence>(std::_1::basic_ostream>&,char const*,unsigned long) (rdi, 0, 0); | } | } | label_5: 0x004de718 mov eax, r14d | eax = r14d; 0x004de71b add rsp, 0x88 | 0x004de722 pop rbx | 0x004de723 pop r12 | 0x004de725 pop r13 | 0x004de727 pop r14 | 0x004de729 pop r15 | 0x004de72b pop rbp | 0x004de72c ret | return rax; | }