; assembly | /* r2dec pseudo code output */ | /* balber_berdecoder.t/assume @ 0x44b450 */ | #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*) */ 0x0044b450 push rbp | 0x0044b451 push r15 | 0x0044b453 push r14 | 0x0044b455 push r13 | 0x0044b457 push r12 | 0x0044b459 push rbx | 0x0044b45a sub rsp, 0x38 | 0x0044b45e mov r15, rsi | r15 = rsi; 0x0044b461 mov rbx, rdi | rbx = rdi; 0x0044b464 mov rax, qword [rdi] | rax = *(rdi); 0x0044b467 mov qword [rsp], rax | *(rsp) = rax; 0x0044b46b mov rcx, qword [rax + 0x118] | rcx = *((rax + 0x118)); 0x0044b472 mov qword [rsp + 8], rcx | *((rsp + 8)) = rcx; 0x0044b477 xorps xmm0, xmm0 | __asm ("xorps xmm0, xmm0"); 0x0044b47a movups xmmword [rsp + 0x10], xmm0 | __asm ("movups xmmword [rsp + 0x10], xmm0"); 0x0044b47f movups xmmword [rsp + 0x20], xmm0 | __asm ("movups xmmword [rsp + 0x20], xmm0"); 0x0044b484 mov qword [rsp + 0x30], 0 | *((rsp + 0x30)) = 0; 0x0044b48d inc dword [rax + 0x110] | *((rax + 0x110))++; 0x0044b493 test rcx, rcx | | if (rcx != 0) { 0x0044b496 je 0x44b49f | 0x0044b498 mov ecx, dword [rcx + 0x2c] | ecx = *((rcx + 0x2c)); 0x0044b49b mov dword [rsp + 0x2c], ecx | *((rsp + 0x2c)) = ecx; | } 0x0044b49f mov rdi, rsp | 0x0044b4a2 mov qword [rax + 0x118], rdi | *((rax + 0x118)) = rdi; 0x0044b4a9 call 0x4509e0 | eax = BloombergLP::balber::BerDecoder_Node::readTagHeader() (rsp); 0x0044b4ae mov ecx, eax | ecx = eax; 0x0044b4b0 test eax, eax | | if (eax != 0) { 0x0044b4b2 jne 0x44b4fa | goto label_0; | } 0x0044b4b4 cmp dword [rsp + 0x10], 0x80 | | if (*((rsp + 0x10)) == 0x80) { 0x0044b4bc jne 0x44b4eb | 0x0044b4be mov edi, dword [rsp + 0x18] | 0x0044b4c2 call 0x45c650 | rax = BloombergLP::s_baltst::MySequenceWithAnonymousChoiceChoice::lookupSelectionInfo(int) (*((rsp + 0x18))); 0x0044b4c7 test rax, rax | | if (rax == 0) { 0x0044b4ca je 0x44b535 | goto label_3; | } 0x0044b4cc mov esi, dword [rsp + 0x18] | 0x0044b4d0 mov rdi, r15 | 0x0044b4d3 call 0x45cd70 | eax = BloombergLP::s_baltst::MySequenceWithAnonymousChoiceChoice::makeSelection(int) (r15, *((rsp + 0x18))); 0x0044b4d8 test eax, eax | | if (eax == 0) { 0x0044b4da je 0x44b551 | goto label_4; | } 0x0044b4dc mov rdi, rsp | 0x0044b4df mov esi, 0x49a77b | 0x0044b4e4 call 0x450280 | BloombergLP::balber::BerDecoder_Node::logError(char const*) (rsp, "Unable to make choice selection"); 0x0044b4e9 jmp 0x44b4f8 | | } else { 0x0044b4eb mov rdi, rsp | 0x0044b4ee mov esi, 0x49a74c | 0x0044b4f3 call 0x450280 | eax = BloombergLP::balber::BerDecoder_Node::logError(char const*) (rsp, "Expected CONTEXT tag class for internal choice"); | } | label_2: 0x0044b4f8 mov ecx, eax | ecx = eax; | do { | label_0: 0x0044b4fa mov rax, qword [rsp + 8] | rax = *((rsp + 8)); 0x0044b4ff test rax, rax | | if (rax != 0) { 0x0044b502 je 0x44b513 | 0x0044b504 mov edx, dword [rsp + 0x24] | edx = *((rsp + 0x24)); 0x0044b508 add edx, dword [rsp + 0x20] | edx += *((rsp + 0x20)); 0x0044b50c add edx, dword [rsp + 0x28] | edx += *((rsp + 0x28)); 0x0044b510 add dword [rax + 0x24], edx | *((rax + 0x24)) += edx; | } 0x0044b513 mov rdx, qword [rsp] | rdx = *(rsp); 0x0044b517 mov qword [rdx + 0x118], rax | *((rdx + 0x118)) = rax; 0x0044b51e dec dword [rdx + 0x110] | *((rdx + 0x110))--; 0x0044b524 mov eax, ecx | eax = ecx; 0x0044b526 add rsp, 0x38 | 0x0044b52a pop rbx | 0x0044b52b pop r12 | 0x0044b52d pop r13 | 0x0044b52f pop r14 | 0x0044b531 pop r15 | 0x0044b533 pop rbp | 0x0044b534 ret | return rax; | label_3: 0x0044b535 mov rdi, rsp | 0x0044b538 call 0x450dd0 | eax = BloombergLP::balber::BerDecoder_Node::skipField() (rsp); 0x0044b53d mov ecx, eax | ecx = eax; 0x0044b53f mov rax, qword [rbx] | rax = *(rbx); 0x0044b542 inc dword [rax + 0x114] | *((rax + 0x114))++; 0x0044b548 test ecx, ecx | 0x0044b54a jne 0x44b4fa | | } while (ecx != 0); 0x0044b54c jmp 0x44b6b3 | goto label_5; | label_4: 0x0044b551 mov eax, dword [r15 + 0x30] | eax = *((r15 + 0x30)); 0x0044b555 cmp eax, 1 | | if (eax != 1) { 0x0044b558 je 0x44b58d | 0x0044b55a test eax, eax | | if (eax != 0) { 0x0044b55c jne 0x44b5bc | goto label_6; | } 0x0044b55e mov eax, dword [rip + 0x509ec] | eax = *(0x0049bf50); 0x0044b564 mov dword [rsp + 0x2c], eax | *((rsp + 0x2c)) = eax; 0x0044b568 mov rax, qword [rip + 0x509c9] | rax = *(str.myChoice1); 0x0044b56f mov qword [rsp + 0x30], rax | *((rsp + 0x30)) = rax; 0x0044b574 cmp dword [rsp + 0x14], 0 | | if (*((rsp + 0x14)) == 0) { 0x0044b579 je 0x44b5c6 | goto label_7; | } 0x0044b57b mov rdi, rsp | 0x0044b57e mov esi, 0x49a555 | 0x0044b583 call 0x450280 | BloombergLP::balber::BerDecoder_Node::logError(char const*) (rsp, "Expected PRIMITIVE tag type for simple type"); 0x0044b588 jmp 0x44b69f | goto label_8; | } 0x0044b58d mov eax, dword [rip + 0x509e5] | eax = *(0x0049bf78); 0x0044b593 mov dword [rsp + 0x2c], eax | *((rsp + 0x2c)) = eax; 0x0044b597 mov rax, qword [rip + 0x509c2] | rax = *(str.myChoice2); 0x0044b59e mov qword [rsp + 0x30], rax | *((rsp + 0x30)) = rax; 0x0044b5a3 cmp dword [rsp + 0x14], 0 | | if (*((rsp + 0x14)) != 0) { 0x0044b5a8 je 0x44b5ef | 0x0044b5aa mov rdi, rsp | 0x0044b5ad mov esi, 0x49a555 | 0x0044b5b2 call 0x450280 | BloombergLP::balber::BerDecoder_Node::logError(char const*) (rsp, "Expected PRIMITIVE tag type for simple type"); 0x0044b5b7 jmp 0x44b69f | goto label_8; | label_6: 0x0044b5bc mov ecx, 0xffffffff | ecx = 0xffffffff; 0x0044b5c1 jmp 0x44b4fa | goto label_0; | label_7: 0x0044b5c6 mov r12d, dword [rsp + 0x1c] | r12d = *((rsp + 0x1c)); 0x0044b5cb cmp r12d, 4 | | if (r12d > 4) { 0x0044b5cf ja 0x44b692 | goto label_9; | } 0x0044b5d5 mov rax, qword [rsp] | rax = *(rsp); 0x0044b5d9 mov r14, qword [rax + 0x108] | r14 = *((rax + 0x108)); 0x0044b5e0 mov rax, qword [r14 + 0x18] | rax = *((r14 + 0x18)); 0x0044b5e4 cmp rax, qword [r14 + 0x20] | | if (rax != *((r14 + 0x20))) { 0x0044b5e8 je 0x44b620 | 0x0044b5ea movzx eax, byte [rax] | eax = *(rax); 0x0044b5ed jmp 0x44b629 | | } else { 0x0044b5ef mov rax, qword [rsp] | rax = *(rsp); 0x0044b5f3 mov rcx, qword [rax] | 0x0044b5f6 mov rsi, qword [rax + 0x108] | 0x0044b5fd mov edx, dword [rsp + 0x1c] | 0x0044b601 mov rdi, r15 | 0x0044b604 call 0x454b40 | 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)); 0x0044b609 test eax, eax | | if (eax == 0) { 0x0044b60b je 0x44b6ab | goto label_10; | } 0x0044b611 mov rdi, rsp | 0x0044b614 mov esi, 0x49a581 | 0x0044b619 call 0x450280 | BloombergLP::balber::BerDecoder_Node::logError(char const*) (rsp, "Error reading value for simple type"); 0x0044b61e jmp 0x44b69f | goto label_8; | } 0x0044b620 mov rax, qword [r14] | rax = *(r14); 0x0044b623 mov rdi, r14 | rdi = r14; 0x0044b626 call qword [rax + 0x48] | al = uint64_t (*rax + 0x48)() (); | } 0x0044b629 sar al, 7 | al >>= 7; 0x0044b62c movsx eax, al | eax = (int32_t) al; 0x0044b62f mov dword [r15], eax | *(r15) = eax; 0x0044b632 test r12d, r12d | | if (r12d <= 0) { 0x0044b635 jle 0x44b6ab | goto label_10; | } 0x0044b637 mov r13d, r12d | r13d = r12d; 0x0044b63a neg r13d | r13d = -r13d; 0x0044b63d mov bl, 1 | bl = 1; 0x0044b63f mov ebp, 1 | 0x0044b644 jmp 0x44b675 | | while (rax != *((r14 + 0x20))) { 0x0044b646 lea rcx, [rax + 1] | rcx = rax + 1; 0x0044b64a mov qword [r14 + 0x18], rcx | *((r14 + 0x18)) = rcx; 0x0044b64e movzx eax, byte [rax] | eax = *(rax); | label_1: 0x0044b651 mov ecx, dword [r15] | ecx = *(r15); 0x0044b654 shl ecx, 8 | ecx <<= 8; 0x0044b657 movzx eax, al | eax = (int32_t) al; 0x0044b65a or eax, ecx | eax |= ecx; 0x0044b65c mov dword [r15], eax | *(r15) = eax; 0x0044b65f cmp ebp, r12d | 0x0044b662 setl bl | bl = (ebp < r12d) ? 1 : 0; 0x0044b665 lea eax, [r13 + rbp + 1] | eax = r13 + rbp + 1; 0x0044b66a mov ecx, ebp | ecx = ebp; 0x0044b66c inc ecx | ecx++; 0x0044b66e mov ebp, ecx | 0x0044b670 cmp eax, 1 | | if (eax == 1) { 0x0044b673 je 0x44b68d | goto label_11; | } 0x0044b675 mov rax, qword [r14 + 0x18] | rax = *((r14 + 0x18)); 0x0044b679 cmp rax, qword [r14 + 0x20] | 0x0044b67d jne 0x44b646 | | } 0x0044b67f mov rax, qword [r14] | rax = *(r14); 0x0044b682 mov rdi, r14 | rdi = r14; 0x0044b685 call qword [rax + 0x50] | eax = uint64_t (*rax + 0x50)() (); 0x0044b688 cmp eax, 0xffffffff | | if (eax != 0xffffffff) { 0x0044b68b jne 0x44b651 | goto label_1; | } | label_11: 0x0044b68d test bl, 1 | | if ((bl & 1) == 0) { 0x0044b690 je 0x44b6ab | goto label_10; | } | label_9: 0x0044b692 mov rdi, rsp | 0x0044b695 mov esi, 0x49a581 | 0x0044b69a call 0x450280 | eax = BloombergLP::balber::BerDecoder_Node::logError(char const*) (rsp, "Error reading value for simple type"); | label_8: 0x0044b69f mov ecx, eax | ecx = eax; 0x0044b6a1 test ecx, ecx | | if (ecx != 0) { 0x0044b6a3 jne 0x44b4fa | goto label_0; | } 0x0044b6a9 jmp 0x44b6b3 | goto label_5; | label_10: 0x0044b6ab mov eax, dword [rsp + 0x1c] | eax = *((rsp + 0x1c)); 0x0044b6af mov dword [rsp + 0x24], eax | *((rsp + 0x24)) = eax; | label_5: 0x0044b6b3 mov rdi, rsp | 0x0044b6b6 call 0x450c20 | BloombergLP::balber::BerDecoder_Node::readTagTrailer() (rsp); 0x0044b6bb jmp 0x44b4f8 | goto label_2; | }