; assembly | /* r2dec pseudo code output */ | /* balber_berdecoder.t/none @ 0x44b350 */ | #include | ; (fcn) method.int_BloombergLP::balber::BerDecoder_Node::decodeChoice_BloombergLP::s_baltst.MySequenceWithAnonymousChoiceChoice__BloombergLP::s_baltst::MySequenceWithAnonymousChoiceChoice_ () | int64_t method_int_BloombergLP::balber::BerDecoder_Node::decodeChoice_BloombergLP::s_baltst_MySequenceWithAnonymousChoiceChoice_BloombergLP::s_baltst::MySequenceWithAnonymousChoiceChoice_ (int64_t arg2, int64_t arg1) { | int64_t var_8h; | uint32_t var_10h; | uint32_t var_14h; | int64_t var_18h; | int64_t var_1ch; | int64_t var_20h; | int64_t var_24h; | int64_t var_28h; | int64_t var_2ch; | int64_t var_30h; | rsi = arg2; | rdi = arg1; | /* int BloombergLP::balber::BerDecoder_Node::decodeChoice(BloombergLP::s_baltst::MySequenceWithAnonymousChoiceChoice*) */ 0x0044b350 push rbp | 0x0044b351 push r15 | 0x0044b353 push r14 | 0x0044b355 push r13 | 0x0044b357 push r12 | 0x0044b359 push rbx | 0x0044b35a sub rsp, 0x38 | 0x0044b35e mov r15, rsi | r15 = rsi; 0x0044b361 mov rbx, rdi | rbx = rdi; 0x0044b364 mov rax, qword [rdi] | rax = *(rdi); 0x0044b367 mov qword [rsp], rax | *(rsp) = rax; 0x0044b36b mov rcx, qword [rax + 0x118] | rcx = *((rax + 0x118)); 0x0044b372 mov qword [rsp + 8], rcx | *((rsp + 8)) = rcx; 0x0044b377 xorps xmm0, xmm0 | __asm ("xorps xmm0, xmm0"); 0x0044b37a movups xmmword [rsp + 0x10], xmm0 | __asm ("movups xmmword [rsp + 0x10], xmm0"); 0x0044b37f movups xmmword [rsp + 0x20], xmm0 | __asm ("movups xmmword [rsp + 0x20], xmm0"); 0x0044b384 mov qword [rsp + 0x30], 0 | *((rsp + 0x30)) = 0; 0x0044b38d inc dword [rax + 0x110] | *((rax + 0x110))++; 0x0044b393 test rcx, rcx | | if (rcx != 0) { 0x0044b396 je 0x44b39f | 0x0044b398 mov ecx, dword [rcx + 0x2c] | ecx = *((rcx + 0x2c)); 0x0044b39b mov dword [rsp + 0x2c], ecx | *((rsp + 0x2c)) = ecx; | } 0x0044b39f mov rdi, rsp | 0x0044b3a2 mov qword [rax + 0x118], rdi | *((rax + 0x118)) = rdi; 0x0044b3a9 call 0x450990 | eax = BloombergLP::balber::BerDecoder_Node::readTagHeader() (rsp); 0x0044b3ae test eax, eax | | if (eax != 0) { 0x0044b3b0 jne 0x44b459 | goto label_3; | } 0x0044b3b6 cmp dword [rsp + 0x10], 0x80 | | if (*((rsp + 0x10)) == 0x80) { 0x0044b3be jne 0x44b3ed | 0x0044b3c0 mov edi, dword [rsp + 0x18] | 0x0044b3c4 call 0x45c560 | rax = BloombergLP::s_baltst::MySequenceWithAnonymousChoiceChoice::lookupSelectionInfo(int) (*((rsp + 0x18))); 0x0044b3c9 test rax, rax | | if (rax == 0) { 0x0044b3cc je 0x44b3fc | goto label_4; | } 0x0044b3ce mov esi, dword [rsp + 0x18] | 0x0044b3d2 mov rdi, r15 | 0x0044b3d5 call 0x45cc50 | eax = BloombergLP::s_baltst::MySequenceWithAnonymousChoiceChoice::makeSelection(int) (r15, *((rsp + 0x18))); 0x0044b3da test eax, eax | | if (eax == 0) { 0x0044b3dc je 0x44b41b | goto label_5; | } 0x0044b3de mov rdi, rsp | 0x0044b3e1 mov esi, 0x49ab4f | 0x0044b3e6 call 0x450230 | BloombergLP::balber::BerDecoder_Node::logError(char const*) (rsp, "Unable to make choice selection"); 0x0044b3eb jmp 0x44b459 | goto label_3; | } 0x0044b3ed mov rdi, rsp | 0x0044b3f0 mov esi, 0x49ab20 | 0x0044b3f5 call 0x450230 | BloombergLP::balber::BerDecoder_Node::logError(char const*) (rsp, "Expected CONTEXT tag class for internal choice"); 0x0044b3fa jmp 0x44b459 | goto label_3; | label_4: 0x0044b3fc mov rdi, rsp | 0x0044b3ff call 0x450d80 | eax = BloombergLP::balber::BerDecoder_Node::skipField() (rsp); 0x0044b404 mov rcx, qword [rbx] | rcx = *(rbx); 0x0044b407 inc dword [rcx + 0x114] | *((rcx + 0x114))++; | do { | label_0: 0x0044b40d test eax, eax | | if (eax != 0) { 0x0044b40f jne 0x44b459 | goto label_3; | } | label_2: 0x0044b411 mov rdi, rsp | 0x0044b414 call 0x450bd0 | BloombergLP::balber::BerDecoder_Node::readTagTrailer() (rsp); 0x0044b419 jmp 0x44b459 | goto label_3; | label_5: 0x0044b41b mov ecx, dword [r15 + 0x30] | ecx = *((r15 + 0x30)); 0x0044b41f cmp ecx, 1 | | if (ecx == 1) { 0x0044b422 je 0x44b492 | goto label_6; | } 0x0044b424 mov eax, 0xffffffff | eax = 0xffffffff; 0x0044b429 test ecx, ecx | | if (ecx != 0) { 0x0044b42b jne 0x44b459 | goto label_3; | } 0x0044b42d mov eax, dword [rip + 0x50eed] | eax = *(0x0049c320); 0x0044b433 mov dword [rsp + 0x2c], eax | *((rsp + 0x2c)) = eax; 0x0044b437 mov rax, qword [rip + 0x50eca] | rax = *(str.myChoice1); 0x0044b43e mov qword [rsp + 0x30], rax | *((rsp + 0x30)) = rax; 0x0044b443 cmp dword [rsp + 0x14], 0 | | if (*((rsp + 0x14)) == 0) { 0x0044b448 je 0x44b4c1 | goto label_7; | } 0x0044b44a mov rdi, rsp | 0x0044b44d mov esi, 0x49a92b | 0x0044b452 call 0x450230 | BloombergLP::balber::BerDecoder_Node::logError(char const*) (rsp, "Expected PRIMITIVE tag type for simple type"); 0x0044b457 jmp 0x44b40d | | } while (1); | label_3: 0x0044b459 mov rcx, qword [rsp + 8] | rcx = *((rsp + 8)); 0x0044b45e test rcx, rcx | | if (rcx != 0) { 0x0044b461 je 0x44b472 | 0x0044b463 mov edx, dword [rsp + 0x24] | edx = *((rsp + 0x24)); 0x0044b467 add edx, dword [rsp + 0x20] | edx += *((rsp + 0x20)); 0x0044b46b add edx, dword [rsp + 0x28] | edx += *((rsp + 0x28)); 0x0044b46f add dword [rcx + 0x24], edx | *((rcx + 0x24)) += edx; | } 0x0044b472 mov rdx, qword [rsp] | rdx = *(rsp); 0x0044b476 mov qword [rdx + 0x118], rcx | *((rdx + 0x118)) = rcx; 0x0044b47d dec dword [rdx + 0x110] | *((rdx + 0x110))--; 0x0044b483 add rsp, 0x38 | 0x0044b487 pop rbx | 0x0044b488 pop r12 | 0x0044b48a pop r13 | 0x0044b48c pop r14 | 0x0044b48e pop r15 | 0x0044b490 pop rbp | 0x0044b491 ret | return rax; | label_6: 0x0044b492 mov eax, dword [rip + 0x50eb0] | eax = *(0x0049c348); 0x0044b498 mov dword [rsp + 0x2c], eax | *((rsp + 0x2c)) = eax; 0x0044b49c mov rax, qword [rip + 0x50e8d] | rax = *(str.myChoice2); 0x0044b4a3 mov qword [rsp + 0x30], rax | *((rsp + 0x30)) = rax; 0x0044b4a8 cmp dword [rsp + 0x14], 0 | | if (*((rsp + 0x14)) != 0) { 0x0044b4ad je 0x44b4ea | 0x0044b4af mov rdi, rsp | 0x0044b4b2 mov esi, 0x49a92b | 0x0044b4b7 call 0x450230 | BloombergLP::balber::BerDecoder_Node::logError(char const*) (rsp, "Expected PRIMITIVE tag type for simple type"); 0x0044b4bc jmp 0x44b40d | goto label_0; | label_7: 0x0044b4c1 mov r12d, dword [rsp + 0x1c] | r12d = *((rsp + 0x1c)); 0x0044b4c6 cmp r12d, 4 | | if (r12d > 4) { 0x0044b4ca ja 0x44b590 | goto label_8; | } 0x0044b4d0 mov rax, qword [rsp] | rax = *(rsp); 0x0044b4d4 mov r14, qword [rax + 0x108] | r14 = *((rax + 0x108)); 0x0044b4db mov rax, qword [r14 + 0x18] | rax = *((r14 + 0x18)); 0x0044b4df cmp rax, qword [r14 + 0x20] | | if (rax != *((r14 + 0x20))) { 0x0044b4e3 je 0x44b51e | 0x0044b4e5 movzx eax, byte [rax] | eax = *(rax); 0x0044b4e8 jmp 0x44b527 | | } else { 0x0044b4ea mov rax, qword [rsp] | rax = *(rsp); 0x0044b4ee mov rcx, qword [rax] | 0x0044b4f1 mov rsi, qword [rax + 0x108] | 0x0044b4f8 mov edx, dword [rsp + 0x1c] | 0x0044b4fc mov rdi, r15 | 0x0044b4ff call 0x454b10 | eax = BloombergLP::balber::BerUtil_StringImpUtil::getStringValue(bsl::basic_string,bsl::allocator>*,std::_1::basic_streambuf>*,int,BloombergLP::balber::BerDecoderOptionsconst&) (r15, *((rax + 0x108)), *((rsp + 0x1c)), *(rax)); 0x0044b504 test eax, eax | | if (eax == 0) { 0x0044b506 je 0x44b5a2 | goto label_9; | } 0x0044b50c mov rdi, rsp | 0x0044b50f mov esi, 0x49a957 | 0x0044b514 call 0x450230 | BloombergLP::balber::BerDecoder_Node::logError(char const*) (rsp, "Error reading value for simple type"); 0x0044b519 jmp 0x44b40d | goto label_0; | } 0x0044b51e mov rax, qword [r14] | rax = *(r14); 0x0044b521 mov rdi, r14 | rdi = r14; 0x0044b524 call qword [rax + 0x48] | al = uint64_t (*rax + 0x48)() (); | } 0x0044b527 sar al, 7 | al >>= 7; 0x0044b52a movsx eax, al | eax = (int32_t) al; 0x0044b52d mov dword [r15], eax | *(r15) = eax; 0x0044b530 test r12d, r12d | | if (r12d <= 0) { 0x0044b533 jle 0x44b5a2 | goto label_9; | } 0x0044b535 mov r13d, r12d | r13d = r12d; 0x0044b538 neg r13d | r13d = -r13d; 0x0044b53b mov bl, 1 | bl = 1; 0x0044b53d mov ebp, 1 | 0x0044b542 jmp 0x44b573 | | while (rax != *((r14 + 0x20))) { 0x0044b544 lea rcx, [rax + 1] | rcx = rax + 1; 0x0044b548 mov qword [r14 + 0x18], rcx | *((r14 + 0x18)) = rcx; 0x0044b54c movzx eax, byte [rax] | eax = *(rax); | label_1: 0x0044b54f mov ecx, dword [r15] | ecx = *(r15); 0x0044b552 shl ecx, 8 | ecx <<= 8; 0x0044b555 movzx eax, al | eax = (int32_t) al; 0x0044b558 or eax, ecx | eax |= ecx; 0x0044b55a mov dword [r15], eax | *(r15) = eax; 0x0044b55d cmp ebp, r12d | 0x0044b560 setl bl | bl = (ebp < r12d) ? 1 : 0; 0x0044b563 lea eax, [r13 + rbp + 1] | eax = r13 + rbp + 1; 0x0044b568 mov ecx, ebp | ecx = ebp; 0x0044b56a inc ecx | ecx++; 0x0044b56c mov ebp, ecx | 0x0044b56e cmp eax, 1 | | if (eax == 1) { 0x0044b571 je 0x44b58b | goto label_10; | } 0x0044b573 mov rax, qword [r14 + 0x18] | rax = *((r14 + 0x18)); 0x0044b577 cmp rax, qword [r14 + 0x20] | 0x0044b57b jne 0x44b544 | | } 0x0044b57d mov rax, qword [r14] | rax = *(r14); 0x0044b580 mov rdi, r14 | rdi = r14; 0x0044b583 call qword [rax + 0x50] | eax = uint64_t (*rax + 0x50)() (); 0x0044b586 cmp eax, 0xffffffff | | if (eax != 0xffffffff) { 0x0044b589 jne 0x44b54f | goto label_1; | } | label_10: 0x0044b58b test bl, 1 | | if ((bl & 1) != 0) { 0x0044b58e je 0x44b5a2 | | label_8: 0x0044b590 mov rdi, rsp | 0x0044b593 mov esi, 0x49a957 | 0x0044b598 call 0x450230 | BloombergLP::balber::BerDecoder_Node::logError(char const*) (rsp, "Error reading value for simple type"); 0x0044b59d jmp 0x44b40d | goto label_0; | } | label_9: 0x0044b5a2 mov eax, dword [rsp + 0x1c] | eax = *((rsp + 0x1c)); 0x0044b5a6 mov dword [rsp + 0x24], eax | *((rsp + 0x24)) = eax; 0x0044b5aa jmp 0x44b411 | goto label_2; | }