; assembly | /* r2dec pseudo code output */ | /* balxml_encoder.t/none @ 0x4dead0 */ | #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&) */ 0x004dead0 push rbp | 0x004dead1 push r15 | 0x004dead3 push r14 | 0x004dead5 push r13 | 0x004dead7 push r12 | 0x004dead9 push rbx | 0x004deada sub rsp, 0x88 | 0x004deae1 mov r14, rdx | r14 = rdx; 0x004deae4 mov rbp, rsi | 0x004deae7 mov r13, rdi | r13 = rdi; 0x004deaea mov dword [rdi + 0x100], 0 | *((rdi + 0x100)) = 0; 0x004deaf4 mov rbx, qword [rdi + 0xf8] | rbx = *((rdi + 0xf8)); 0x004deafb test rbx, rbx | | if (rbx != 0) { 0x004deafe je 0x4deb1d | 0x004deb00 mov rsi, qword [rbx + 0x30] | rsi = *((rbx + 0x30)); 0x004deb04 mov rdi, qword [rbx + 0x48] | rdi = *((rbx + 0x48)); 0x004deb08 mov rax, qword [rdi] | rax = *(rdi); 0x004deb0b call qword [rax + 0x18] | uint64_t (*rax + 0x18)() (); 0x004deb0e xorps xmm0, xmm0 | __asm ("xorps xmm0, xmm0"); 0x004deb11 movups xmmword [rbx + 0x30], xmm0 | __asm ("movups xmmword [rbx + 0x30], xmm0"); 0x004deb15 mov qword [rbx + 0x40], 0 | *((rbx + 0x40)) = 0; | } 0x004deb1d lea r12, [rsp + 0x38] | r12 = rsp + 0x38; 0x004deb22 mov rdi, r12 | 0x004deb25 mov rsi, rbp | 0x004deb28 mov rdx, r13 | 0x004deb2b call 0x4e5340 | BloombergLP::balxml::Encoder_Context::Encoder_Context(BloombergLP::balxml::Formatter*,BloombergLP::balxml::Encoder*) (r12, rbp, r13); 0x004deb30 mov rax, qword [r13] | rax = *(r13); 0x004deb34 cmp byte [rax + 0xc1], 0 | | if (*((rax + 0xc1)) != 0) { 0x004deb3b je 0x4deb60 | 0x004deb3d mov qword [rsp + 8], 0x552bd3 | *((rsp + 8)) = "UTF-8"; 0x004deb46 mov qword [rsp + 0x10], 5 | *((rsp + 0x10)) = 5; 0x004deb4f lea rsi, [rsp + 8] | 0x004deb54 mov rdi, rbp | 0x004deb57 call 0x4e7fc0 | BloombergLP::balxml::Formatter::addHeader(std::_1::basic_string_view>const&) (rbp, rsp + 8); 0x004deb5c mov rax, qword [r13] | rax = *(r13); | } 0x004deb60 cmp qword [rax + 0x78], 0 | | if (*((rax + 0x78)) != 0) { 0x004deb65 je 0x4deb7a | 0x004deb67 lea r15, [rax + 0x60] | r15 = rax + 0x60; 0x004deb6b cmp qword [rax + 0x80], 0x17 | | if (*((rax + 0x80)) == 0x17) { 0x004deb73 je 0x4deb80 | goto label_0; | } 0x004deb75 mov r15, qword [r15] | r15 = *(r15); 0x004deb78 jmp 0x4deb80 | | } else { 0x004deb7a mov r15d, 0x5607d0 | r15d = "MyChoice"; | } | label_0: 0x004deb80 mov rbp, qword [rsp + 0x38] | rbp = *((rsp + 0x38)); 0x004deb85 mov qword [rsp + 8], r15 | *((rsp + 8)) = r15; 0x004deb8a mov rdi, r15 | 0x004deb8d call 0x404410 | rax = strlen (r15); 0x004deb92 mov qword [rsp + 0x10], rax | *((rsp + 0x10)) = rax; 0x004deb97 lea rsi, [rsp + 8] | 0x004deb9c mov rdi, rbp | 0x004deb9f xor edx, edx | 0x004deba1 call 0x4e7d10 | BloombergLP::balxml::Formatter::openElement(std::_1::basic_string_view>const&,BloombergLP::balxml::Formatter::WhitespaceType) (rbp, rsp + 8, 0); 0x004deba6 mov rdx, qword [r13] | rdx = *(r13); 0x004debaa cmp qword [rdx + 0x18], 0 | | if (*((rdx + 0x18)) != 0) { 0x004debaf je 0x4decad | 0x004debb5 mov rdi, qword [rsp + 0x38] | 0x004debba mov qword [rsp + 8], 0x552bd9 | *((rsp + 8)) = "xmlns"; 0x004debc3 mov qword [rsp + 0x10], 5 | *((rsp + 0x10)) = 5; 0x004debcc lea rsi, [rsp + 8] | 0x004debd1 xor ecx, ecx | 0x004debd3 call 0x453510 | 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); 0x004debd8 mov rax, qword [r13] | rax = *(r13); 0x004debdc cmp byte [rax + 0xc2], 0 | | if (*((rax + 0xc2)) == 0) { 0x004debe3 je 0x4decde | goto label_1; | } 0x004debe9 mov rdi, qword [rsp + 0x38] | 0x004debee mov qword [rsp + 8], 0x552bdf | *((rsp + 8)) = "xmlns:xsi"; 0x004debf7 mov qword [rsp + 0x10], 9 | *((rsp + 0x10)) = 9; 0x004dec00 lea rsi, [rsp + 8] | 0x004dec05 mov edx, 0x552be9 | 0x004dec0a xor ecx, ecx | 0x004dec0c call 0x453870 | 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); 0x004dec11 mov rsi, qword [r13] | rsi = *(r13); 0x004dec15 cmp qword [rsi + 0x48], 0 | | if (*((rsi + 0x48)) == 0) { 0x004dec1a je 0x4decde | goto label_1; | } 0x004dec20 lea rbp, [rsp + 0x48] | rbp = rsp + 0x48; 0x004dec25 mov edx, 0x562b2d | 0x004dec2a mov rdi, rbp | 0x004dec2d call 0x44ef90 | bsl::basic_string,bsl::allocator>bsl::operator+,bsl::allocator>(bsl::basic_string,bsl::allocator>const&,char const*) (rbp, rsi, 0x562b2d); 0x004dec32 mov rdx, qword [r13] | 0x004dec36 add rdx, 0x30 | rdx += 0x30; 0x004dec3a lea rdi, [rsp + 8] | 0x004dec3f mov rsi, rbp | 0x004dec42 call 0x453430 | 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)); 0x004dec47 mov rdi, qword [rsp + 0x38] | 0x004dec4c mov qword [rsp + 0x78], 0x552c13 | *((rsp + 0x78)) = "xsi:schemaLocation"; 0x004dec55 mov qword [rsp + 0x80], 0x12 | *((rsp + 0x80)) = 0x12; 0x004dec61 lea rsi, [rsp + 0x78] | 0x004dec66 lea rdx, [rsp + 8] | 0x004dec6b xor ecx, ecx | 0x004dec6d call 0x453510 | 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); 0x004dec72 cmp qword [rsp + 0x28], 0x17 | | if (*((rsp + 0x28)) != 0x17) { 0x004dec78 je 0x4dec8a | 0x004dec7a mov rsi, qword [rsp + 8] | rsi = *((rsp + 8)); 0x004dec7f mov rdi, qword [rsp + 0x30] | rdi = *((rsp + 0x30)); 0x004dec84 mov rax, qword [rdi] | rax = *(rdi); 0x004dec87 call qword [rax + 0x18] | uint64_t (*rax + 0x18)() (); | } 0x004dec8a mov qword [rsp + 0x20], 0xffffffffffffffff | *((rsp + 0x20)) = 0xffffffffffffffff; 0x004dec93 cmp qword [rsp + 0x68], 0x17 | | if (*((rsp + 0x68)) == 0x17) { 0x004dec99 je 0x4decde | goto label_1; | } 0x004dec9b mov rsi, qword [rsp + 0x48] | rsi = *((rsp + 0x48)); 0x004deca0 mov rdi, qword [rsp + 0x70] | rdi = *((rsp + 0x70)); 0x004deca5 mov rax, qword [rdi] | rax = *(rdi); 0x004deca8 call qword [rax + 0x18] | uint64_t (*rax + 0x18)() (); 0x004decab jmp 0x4decde | | } else { 0x004decad cmp byte [rdx + 0xc2], 0 | | if (*((rdx + 0xc2)) == 0) { 0x004decb4 je 0x4decde | goto label_1; | } 0x004decb6 mov rdi, qword [rsp + 0x38] | 0x004decbb mov qword [rsp + 8], 0x552bdf | *((rsp + 8)) = "xmlns:xsi"; 0x004decc4 mov qword [rsp + 0x10], 9 | *((rsp + 0x10)) = 9; 0x004deccd lea rsi, [rsp + 8] | 0x004decd2 mov edx, 0x552be9 | 0x004decd7 xor ecx, ecx | 0x004decd9 call 0x453870 | 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: 0x004decde mov eax, dword [r14 + 0x30] | eax = *((r14 + 0x30)); 0x004dece2 cmp eax, 0xffffffff | | if (eax != 0xffffffff) { 0x004dece5 je 0x4ded32 | 0x004dece7 mov qword [rsp + 0x48], r12 | *((rsp + 0x48)) = r12; 0x004decec test eax, eax | | if (eax == 0) { 0x004decee je 0x4ded6a | goto label_2; | } 0x004decf0 cmp eax, 1 | | if (eax != 1) { 0x004decf3 jne 0x4deda2 | goto label_3; | } 0x004decf9 mov rax, qword [rip + 0x81b10] | rax = *(str.selection2); 0x004ded00 movsxd rcx, dword [rip + 0x81b11] | rcx = *(0x00560818); 0x004ded07 mov qword [rsp + 8], rax | *((rsp + 8)) = rax; 0x004ded0c mov qword [rsp + 0x10], rcx | *((rsp + 0x10)) = rcx; 0x004ded11 mov ecx, dword [rip + 0x81b11] | 0x004ded17 lea rdi, [rsp + 0x48] | 0x004ded1c lea rdx, [rsp + 8] | 0x004ded21 mov rsi, r14 | 0x004ded24 call 0x4dd740 | 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, *(0x00560828)); 0x004ded29 test eax, eax | | if (eax != 0) { 0x004ded2b jne 0x4deda2 | goto label_3; | } 0x004ded2d jmp 0x4dee7f | goto label_4; | } 0x004ded32 mov rax, qword [r13] | rax = *(r13); 0x004ded36 mov ecx, dword [rax + 0x90] | 0x004ded3c mov qword [rsp + 8], 0x552dab | *((rsp + 8)) = 0x552dab; 0x004ded45 mov qword [rsp + 0x10], 3 | *((rsp + 0x10)) = 3; 0x004ded4e mov rdi, qword [rsp + 0x40] | 0x004ded53 lea rdx, [rsp + 8] | 0x004ded58 mov esi, 0x552d87 | 0x004ded5d mov r8d, 0xffffffff | 0x004ded63 call 0x4e51d0 | 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); 0x004ded68 jmp 0x4deda2 | goto label_3; | label_2: 0x004ded6a mov rax, qword [rip + 0x81a77] | rax = *(str.selection1); 0x004ded71 movsxd rcx, dword [rip + 0x81a78] | rcx = *(0x005607f0); 0x004ded78 mov qword [rsp + 8], rax | *((rsp + 8)) = rax; 0x004ded7d mov qword [rsp + 0x10], rcx | *((rsp + 0x10)) = rcx; 0x004ded82 mov ecx, dword [rip + 0x81a78] | 0x004ded88 lea rdi, [rsp + 0x48] | 0x004ded8d lea rdx, [rsp + 8] | 0x004ded92 mov rsi, r14 | 0x004ded95 call 0x456de0 | eax = intBloombergLP::balxml::Encoder_EncodeObject::executeImp(intconst&,std::_1::basic_string_view>const&,int,BloombergLP::bdlat_TypeCategory::Simple) (rsp + 0x48, r14, rsp + 8, *(0x00560800)); 0x004ded9a test eax, eax | | if (eax == 0) { 0x004ded9c je 0x4dee7f | goto label_4; | } | label_3: 0x004deda2 mov qword [rsp + 8], r15 | *((rsp + 8)) = r15; 0x004deda7 mov rdi, r15 | 0x004dedaa call 0x404410 | rax = strlen (r15); 0x004dedaf mov qword [rsp + 0x10], rax | *((rsp + 0x10)) = rax; 0x004dedb4 mov rax, qword [r13] | rax = *(r13); 0x004dedb8 mov ecx, dword [rax + 0x90] | 0x004dedbe lea rdx, [rsp + 8] | 0x004dedc3 mov r14d, 0xffffffff | r14d = 0xffffffff; 0x004dedc9 mov esi, 0x552c26 | 0x004dedce mov rdi, r13 | 0x004dedd1 mov r8d, 0xffffffff | 0x004dedd7 call 0x4e51d0 | BloombergLP::balxml::Encoder::logError(char const*,std::_1::basic_string_view>const&,int,int) (r13, "Failed to encode", rsp + 8, *((rax + 0x90)), 0xffffffff); 0x004deddc mov rbp, qword [rsp + 0x38] | rbp = *((rsp + 0x38)); 0x004dede1 cmp dword [rbp + 0xd8], 2 | | if (*((rbp + 0xd8)) == 2) { 0x004dede8 jne 0x4dee0f | 0x004dedea mov rdi, qword [rbp + 0xa0] | 0x004dedf1 mov byte [rsp + 8], 0x3e | *((rsp + 8)) = 0x3e; 0x004dedf6 lea rsi, [rsp + 8] | 0x004dedfb mov edx, 1 | 0x004dee00 call 0x4529b0 | std::_1::basic_ostream>&std::_1::_put_character_sequence>(std::_1::basic_ostream>&,char const*,unsigned long) (*((rbp + 0xa0)), rsp + 8, 1); 0x004dee05 mov dword [rbp + 0xd8], 3 | *((rbp + 0xd8)) = 3; | } 0x004dee0f mov eax, dword [rbp + 0xb4] | eax = *((rbp + 0xb4)); 0x004dee15 inc eax | eax++; 0x004dee17 mov dword [rbp + 0xb0], eax | *((rbp + 0xb0)) = eax; 0x004dee1d mov rax, qword [rbp + 0xa0] | rax = *((rbp + 0xa0)); 0x004dee24 mov rcx, qword [rax] | rcx = *(rax); 0x004dee27 mov rcx, qword [rcx - 0x18] | rcx = *((rcx - 0x18)); 0x004dee2b lea rdi, [rax + rcx] | rdi = rax + rcx; 0x004dee2f mov esi, dword [rax + rcx + 0x20] | esi = *((rax + rcx + 0x20)); 0x004dee33 or esi, 4 | esi |= 4; 0x004dee36 call 0x404370 | std::_1::ios_base::clear(unsignedint) (); | do { 0x004dee3b mov eax, dword [r13 + 0x100] | eax = *((r13 + 0x100)); 0x004dee42 test eax, eax | | if (eax == 0) { 0x004dee44 je 0x4deeb1 | goto label_5; | } 0x004dee46 cmp eax, 1 | | if (eax == 1) { 0x004dee49 jne 0x4dee59 | 0x004dee4b mov rdi, qword [r13 + 0x110] | rdi = *((r13 + 0x110)); 0x004dee52 test rdi, rdi | | if (rdi != 0) { 0x004dee55 jne 0x4dee65 | goto label_6; | } 0x004dee57 jmp 0x4deeb1 | goto label_5; | } 0x004dee59 mov rdi, qword [r13 + 0x108] | rdi = *((r13 + 0x108)); 0x004dee60 test rdi, rdi | | if (rdi == 0) { 0x004dee63 je 0x4deeb1 | goto label_5; | } | label_6: 0x004dee65 mov rax, qword [r13 + 0xf8] | rax = *((r13 + 0xf8)); 0x004dee6c test rax, rax | | if (rax == 0) { 0x004dee6f je 0x4deea8 | goto label_7; | } 0x004dee71 mov rsi, qword [rax + 0x30] | rsi = *((rax + 0x30)); 0x004dee75 mov eax, dword [rax + 0x38] | eax = *((rax + 0x38)); 0x004dee78 sub eax, esi | eax -= esi; 0x004dee7a movsxd rdx, eax | rdx = (int64_t) eax; 0x004dee7d jmp 0x4deeac | goto label_8; | label_4: 0x004dee7f mov rbp, qword [rsp + 0x38] | rbp = *((rsp + 0x38)); 0x004dee84 mov qword [rsp + 8], r15 | *((rsp + 8)) = r15; 0x004dee89 mov rdi, r15 | 0x004dee8c call 0x404410 | rax = strlen (r15); 0x004dee91 mov qword [rsp + 0x10], rax | *((rsp + 0x10)) = rax; 0x004dee96 lea rsi, [rsp + 8] | 0x004dee9b mov rdi, rbp | 0x004dee9e call 0x4e7e30 | BloombergLP::balxml::Formatter::closeElement(std::_1::basic_string_view>const&) (rbp, rsp + 8); 0x004deea3 xor r14d, r14d | r14d = 0; 0x004deea6 jmp 0x4dee3b | | } while (1); | label_7: 0x004deea8 xor esi, esi | 0x004deeaa xor edx, edx | | label_8: 0x004deeac call 0x4529b0 | std::_1::basic_ostream>&std::_1::_put_character_sequence>(std::_1::basic_ostream>&,char const*,unsigned long) (rdi, 0, 0); | label_5: 0x004deeb1 mov eax, r14d | eax = r14d; 0x004deeb4 add rsp, 0x88 | 0x004deebb pop rbx | 0x004deebc pop r12 | 0x004deebe pop r13 | 0x004deec0 pop r14 | 0x004deec2 pop r15 | 0x004deec4 pop rbp | 0x004deec5 ret | return rax; | }