; assembly | /* r2dec pseudo code output */ | /* baljsn_encoder.t/assume @ 0x4ca380 */ | #include | ; (fcn) method.void_BloombergLP::bslalg::ArrayPrimitives_Imp::insert_BloombergLP::s_baltst::Choice1__BloombergLP::s_baltst::Choice1_const__bsl::allocator_BloombergLP::s_baltst.Choice1____BloombergLP::s_baltst::Choice1__BloombergLP::s_baltst::Choice1__Bloomber () | int64_t method_void_BloombergLP::bslalg::ArrayPrimitives_Imp::insert_BloombergLP::s_baltst::Choice1_BloombergLP::s_baltst::Choice1_const_bsl::allocator_BloombergLP::s_baltst_Choice1_BloombergLP::s_baltst::Choice1_BloombergLP::s_baltst::Choice1_Bloomber (int64_t arg6, uint32_t arg5, 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; | int64_t var_48h; | uint32_t var_50h; | r9 = arg6; | r8 = arg5; | rdx = arg3; | rsi = arg2; | rdi = arg1; | /* void BloombergLP::bslalg::ArrayPrimitives_Imp::insert >(BloombergLP::s_baltst::Choice1*, BloombergLP::s_baltst::Choice1*, BloombergLP::s_baltst::Choice1 const*, BloombergLP::s_baltst::Choice1 const*, unsigned long, bsl::allocator, BloombergLP::bslmf::MetaInt<1>*) */ 0x004ca380 push rbp | 0x004ca381 push r15 | 0x004ca383 push r14 | 0x004ca385 push r13 | 0x004ca387 push r12 | 0x004ca389 push rbx | 0x004ca38a sub rsp, 0x58 | 0x004ca38e test r8, r8 | | if (r8 == 0) { 0x004ca391 je 0x4ca4fe | goto label_0; | } 0x004ca397 mov r15, r9 | r15 = r9; 0x004ca39a mov r12, r8 | r12 = r8; 0x004ca39d mov rbx, rdx | rbx = rdx; 0x004ca3a0 mov r13, rsi | r13 = rsi; 0x004ca3a3 mov rbp, rdi | 0x004ca3a6 mov rdx, rsi | rdx = rsi; 0x004ca3a9 sub rdx, rdi | rdx -= rdi; 0x004ca3ac mov rax, rdx | rax = rdx; 0x004ca3af sar rax, 3 | rax >>= 3; 0x004ca3b3 movabs rcx, 0xaaaaaaaaaaaaaaab | rcx = 0xaaaaaaaaaaaaaaab; 0x004ca3bd imul rcx, rax | rcx *= rax; 0x004ca3c1 cmp rcx, r8 | 0x004ca3c4 mov rsi, r8 | rsi = r8; 0x004ca3c7 mov qword [rsp + 0x50], rcx | *((rsp + 0x50)) = rcx; | if (rcx < r8) { 0x004ca3cc cmovb rsi, rcx | rsi = rcx; | } 0x004ca3d0 lea rax, [r8 + r8*2] | rax = r8 * 3; 0x004ca3d4 mov qword [rsp + 0x20], rax | *((rsp + 0x20)) = rax; 0x004ca3d9 lea r14, [rdi + rax*8] | r14 = rdi + rax*8; 0x004ca3dd test rdx, rdx | 0x004ca3e0 mov qword [rsp + 0x28], r13 | *((rsp + 0x28)) = r13; | if (rdx != 0) { 0x004ca3e5 je 0x4ca3fd | 0x004ca3e7 mov rdi, r14 | 0x004ca3ea mov r13, rsi | r13 = rsi; 0x004ca3ed mov rsi, rbp | 0x004ca3f0 call 0x405810 | memmove (r14, rbp, rdx); 0x004ca3f5 mov rsi, r13 | rsi = r13; 0x004ca3f8 mov r13, qword [rsp + 0x28] | r13 = *((rsp + 0x28)); | } 0x004ca3fd mov rax, qword [rsp + 0x20] | rax = *((rsp + 0x20)); 0x004ca402 lea rdi, [r13 + rax*8] | rdi = r13 + rax*8; 0x004ca407 test rsi, rsi | 0x004ca40a mov qword [rsp + 0x18], rdi | *((rsp + 0x18)) = rdi; 0x004ca40f mov qword [rsp + 0x10], r14 | *((rsp + 0x10)) = r14; | if (rsi == 0) { 0x004ca414 je 0x4ca488 | goto label_1; | } 0x004ca416 mov qword [rsp + 0x48], r12 | *((rsp + 0x48)) = r12; 0x004ca41b mov rax, rsi | rax = rsi; 0x004ca41e neg rax | rax = -rax; 0x004ca421 lea rax, [rax + rax*2] | rax *= 3; 0x004ca425 lea rax, [rdi + rax*8] | rax = rdi + rax*8; 0x004ca429 mov qword [rsp + 0x38], rax | *((rsp + 0x38)) = rax; 0x004ca42e mov rdx, qword [r15] | 0x004ca431 mov qword [rsp + 0x40], rsi | *((rsp + 0x40)) = rsi; 0x004ca436 lea rax, [rsi + rsi*2] | rax = rsi * 3; 0x004ca43a lea r12, [rax*8 - 0x18] | r12 = rax*8 - 0x18; 0x004ca442 xor r14d, r14d | r14d = 0; 0x004ca445 mov qword [rsp + 0x30], rdx | *((rsp + 0x30)) = rdx; 0x004ca44a nop word [rax + rax] | | do { 0x004ca450 lea rsi, [rbx + r14] | 0x004ca454 lea r13, [rbp + r14] | r13 = rbp + r14; 0x004ca459 mov rdi, r13 | 0x004ca45c call 0x4b6950 | BloombergLP::s_baltst::Choice1::Choice1(BloombergLP::s_baltst::Choice1const&,BloombergLP::bslma::Allocator*) (r13, rbx + r14, *(r15)); 0x004ca461 cmp r12, r14 | | if (r12 == r14) { 0x004ca464 je 0x4ca46f | goto label_2; | } 0x004ca466 mov rdx, qword [r15] | rdx = *(r15); 0x004ca469 add r14, 0x18 | r14 += 0x18; 0x004ca46d jmp 0x4ca450 | | } while (1); | label_2: 0x004ca46f lea rbx, [rbx + r14 + 0x18] | rbx = rbx + r14 + 0x18; 0x004ca474 mov r13, qword [rsp + 0x28] | r13 = *((rsp + 0x28)); 0x004ca479 mov rdi, qword [rsp + 0x18] | rdi = *((rsp + 0x18)); 0x004ca47e mov r14, qword [rsp + 0x10] | r14 = *((rsp + 0x10)); 0x004ca483 mov r12, qword [rsp + 0x48] | r12 = *((rsp + 0x48)); | label_1: 0x004ca488 cmp qword [rsp + 0x50], r12 | | if (*((rsp + 0x50)) >= r12) { 0x004ca48d jae 0x4ca4fe | goto label_0; | } 0x004ca48f mov r12, qword [r15] | r12 = *(r15); 0x004ca492 cmp r14, r13 | | if (r14 == r13) { 0x004ca495 je 0x4ca4d7 | goto label_3; | } 0x004ca497 mov rax, qword [rsp + 0x20] | rax = *((rsp + 0x20)); 0x004ca49c lea r14, [rbp + rax*8 - 0x18] | r14 = rbp + rax*8 - 0x18; 0x004ca4a1 mov rdx, r12 | 0x004ca4a4 mov rbp, r13 | 0x004ca4a7 nop word [rax + rax] | | do { 0x004ca4b0 mov rdi, rbp | 0x004ca4b3 mov rsi, rbx | 0x004ca4b6 call 0x4b6950 | BloombergLP::s_baltst::Choice1::Choice1(BloombergLP::s_baltst::Choice1const&,BloombergLP::bslma::Allocator*) (rbp, rbx, r12); 0x004ca4bb cmp r14, rbp | | if (r14 == rbp) { 0x004ca4be je 0x4ca4cd | goto label_4; | } 0x004ca4c0 add rbp, 0x18 | rbp += 0x18; 0x004ca4c4 add rbx, 0x18 | rbx += 0x18; 0x004ca4c8 mov rdx, qword [r15] | rdx = *(r15); 0x004ca4cb jmp 0x4ca4b0 | | } while (1); | label_4: 0x004ca4cd mov r13, qword [rsp + 0x10] | r13 = *((rsp + 0x10)); 0x004ca4d2 mov rdi, qword [rsp + 0x18] | | label_3: 0x004ca4d7 mov qword [rsp + 8], r12 | *((rsp + 8)) = r12; 0x004ca4dc lea rdx, [rsp + 8] | rdx = rsp + 8; 0x004ca4e1 mov rsi, rdi | 0x004ca4e4 call 0x4c9aa0 | voidBloombergLP::bslalg::ArrayDestructionPrimitives::destroy>(BloombergLP::s_baltst::Choice1*,BloombergLP::s_baltst::Choice1*,bsl::allocator,bsl::integral_constant) (*((rsp + 0x18)), rdi); 0x004ca4e9 mov qword [rsp + 8], r12 | *((rsp + 8)) = r12; 0x004ca4ee lea rdx, [rsp + 8] | rdx = rsp + 8; 0x004ca4f3 mov rdi, r13 | rdi = r13; 0x004ca4f6 mov rsi, r13 | 0x004ca4f9 call 0x4c9aa0 | voidBloombergLP::bslalg::ArrayDestructionPrimitives::destroy>(BloombergLP::s_baltst::Choice1*,BloombergLP::s_baltst::Choice1*,bsl::allocator,bsl::integral_constant) (rdi, r13); | label_0: 0x004ca4fe add rsp, 0x58 | 0x004ca502 pop rbx | 0x004ca503 pop r12 | 0x004ca505 pop r13 | 0x004ca507 pop r14 | 0x004ca509 pop r15 | 0x004ca50b pop rbp | 0x004ca50c ret | return rax; | }