; assembly | /* r2dec pseudo code output */ | /* bblb_schedulegenerationutil.t/assume @ 0x40b6a0 */ | #include | ; (fcn) method.BloombergLP::bblb::ScheduleGenerationUtil.generateFromDayOfMonth_bsl::vector_BloombergLP::bdlt::Date__bsl::allocator_BloombergLP::bdlt::Date_____BloombergLP::bdlt::Date_const__BloombergLP::bdlt::Date_const__int__int__int__int__int_ () | int64_t method_BloombergLP::bblb::ScheduleGenerationUtil_generateFromDayOfMonth_bsl::vector_BloombergLP::bdlt::Date_bsl::allocator_BloombergLP::bdlt::Date_BloombergLP::bdlt::Date_const_BloombergLP::bdlt::Date_const_int_int_int_int_int_ (int64_t arg_60h, int64_t arg_68h, int64_t arg6, int64_t arg5, int64_t arg4, int64_t arg3, int64_t arg2, uint32_t arg1) { | int64_t var_8h; | int64_t var_ch; | uint32_t var_10h; | uint32_t var_14h; | uint32_t var_18h; | uint32_t var_1ch; | uint32_t var_20h; | r9 = arg6; | r8 = arg5; | rcx = arg4; | rdx = arg3; | rsi = arg2; | rdi = arg1; | /* BloombergLP::bblb::ScheduleGenerationUtil::generateFromDayOfMonth(bsl::vector >*, BloombergLP::bdlt::Date const&, BloombergLP::bdlt::Date const&, int, int, int, int, int) */ 0x0040b6a0 push rbp | 0x0040b6a1 push r15 | 0x0040b6a3 push r14 | 0x0040b6a5 push r13 | 0x0040b6a7 push r12 | 0x0040b6a9 push rbx | 0x0040b6aa sub rsp, 0x28 | 0x0040b6ae mov r15d, r9d | r15d = r9d; 0x0040b6b1 mov ebx, r8d | ebx = r8d; 0x0040b6b4 mov r14d, ecx | r14d = ecx; 0x0040b6b7 mov r12, rdx | r12 = rdx; 0x0040b6ba dec ebx | ebx--; 0x0040b6bc mov rax, qword [rdi] | rax = *(rdi); 0x0040b6bf cmp qword [rdi + 8], rax | | if (*((rdi + 8)) != rax) { 0x0040b6c3 je 0x40b6c9 | 0x0040b6c5 mov qword [rdi + 8], rax | *((rdi + 8)) = rax; | } 0x0040b6c9 mov qword [rsp + 0x20], rdi | *((rsp + 0x20)) = rdi; 0x0040b6ce mov ecx, dword [rsi] | 0x0040b6d0 mov rdi, rsp | 0x0040b6d3 lea rsi, [rsp + 8] | 0x0040b6d8 lea rdx, [rsp + 0x1c] | 0x0040b6dd call 0x414270 | BloombergLP::bdlt::PosixDateImpUtil::serialToYmd(int*,int*,int*,int) (rsp, rsp + 8, rsp + 0x1c, *(rsi)); 0x0040b6e2 mov eax, dword [rsp] | eax = *(rsp); 0x0040b6e5 lea eax, [rax + rax*2] | eax = rax * 3; 0x0040b6e8 mov ecx, dword [rsp + 8] | ecx = *((rsp + 8)); 0x0040b6ec lea ebp, [rcx + rax*4 - 1] | ebp = rcx + rax*4 - 1; 0x0040b6f0 mov ecx, dword [r12] | 0x0040b6f4 mov rdi, rsp | 0x0040b6f7 lea rsi, [rsp + 8] | 0x0040b6fc lea rdx, [rsp + 0x18] | 0x0040b701 call 0x414270 | BloombergLP::bdlt::PosixDateImpUtil::serialToYmd(int*,int*,int*,int) (rsp, rsp + 8, rsp + 0x18, *(r12)); 0x0040b706 mov eax, dword [rsp] | eax = *(rsp); 0x0040b709 lea eax, [rax + rax*2] | eax = rax * 3; 0x0040b70c mov ecx, dword [rsp + 8] | ecx = *((rsp + 8)); 0x0040b710 lea edi, [rcx + rax*4 - 1] | edi = rcx + rax*4 - 1; 0x0040b714 lea eax, [r14 + r14*2] | eax = r14 * 3; 0x0040b718 lea esi, [rbx + rax*4] | esi = rbx + rax*4; 0x0040b71b mov dword [rsp + 0x14], ebp | *((rsp + 0x14)) = ebp; 0x0040b71f mov ecx, ebp | ecx = ebp; 0x0040b721 sub ecx, esi | ecx -= esi; | if (ecx > 0) { 0x0040b723 jle 0x40b738 | 0x0040b725 mov eax, ecx | eax = ecx; 0x0040b727 xor edx, edx | edx = 0; 0x0040b729 div r15d | eax = edx:eax / r15d; | edx = edx:eax % r15d; 0x0040b72c test edx, edx | | if (edx != 0) { 0x0040b72e je 0x40b738 | 0x0040b730 mov r12d, eax | r12d = eax; 0x0040b733 inc r12d | r12d++; 0x0040b736 jmp 0x40b741 | | } | } else { 0x0040b738 mov eax, ecx | eax = ecx; 0x0040b73a cdq | edx:eax = (int64_t) eax; 0x0040b73b idiv r15d | eax = edx:eax / r15d; | edx = edx:eax % r15d; 0x0040b73e mov r12d, eax | r12d = eax; | } 0x0040b741 mov ecx, edi | ecx = edi; 0x0040b743 sub ecx, esi | ecx -= esi; 0x0040b745 js 0x40b752 | | while (edx == 0) { 0x0040b747 mov eax, ecx | eax = ecx; 0x0040b749 cdq | edx:eax = (int64_t) eax; 0x0040b74a idiv r15d | eax = edx:eax / r15d; | edx = edx:eax % r15d; 0x0040b74d mov r13d, eax | r13d = eax; 0x0040b750 jmp 0x40b765 | goto label_0; 0x0040b752 mov eax, ecx | eax = ecx; 0x0040b754 neg eax | eax = -eax; 0x0040b756 xor edx, edx | edx = 0; 0x0040b758 div r15d | eax = edx:eax / r15d; | edx = edx:eax % r15d; 0x0040b75b test edx, edx | 0x0040b75d je 0x40b747 | | } 0x0040b75f mov r13d, eax | r13d = eax; 0x0040b762 not r13d | r13d = ~r13d; | label_0: 0x0040b765 imul r12d, r15d | r12d *= r15d; 0x0040b769 add r12d, esi | r12d += esi; 0x0040b76c cmp r12d, 0x1d4bf | | if (r12d > 0x1d4bf) { 0x0040b773 jg 0x40b92e | goto label_1; | } 0x0040b779 imul r13d, r15d | r13d *= r15d; 0x0040b77d add r13d, esi | r13d += esi; 0x0040b780 cmp r13d, 0xc | | if (r13d < 0xc) { 0x0040b784 jl 0x40b92e | goto label_1; | } 0x0040b78a mov r14d, dword [rsp + 0x68] | r14d = *((rsp + 0x68)); 0x0040b78f movsxd rax, r12d | rax = (int64_t) r12d; 0x0040b792 imul rbp, rax, 0x2aaaaaab | rbp = rax * 0x2aaaaaab; 0x0040b799 mov rax, rbp | rax = rbp; 0x0040b79c shr rax, 0x3f | rax >>= 0x3f; 0x0040b7a0 sar rbp, 0x21 | rbp >>= 0x21; 0x0040b7a4 add ebp, eax | ebp += eax; 0x0040b7a6 lea eax, [rbp*4] | eax = rbp*4; 0x0040b7ad lea eax, [rax + rax*2] | eax = rax * 3; 0x0040b7b0 neg eax | eax = -eax; 0x0040b7b2 lea ebx, [r12 + rax + 1] | ebx = r12 + rax + 1; 0x0040b7b7 mov dword [rsp + 0x10], edi | *((rsp + 0x10)) = edi; 0x0040b7bb mov edi, ebp | 0x0040b7bd mov esi, ebx | 0x0040b7bf call 0x413a90 | BloombergLP::bdlt::PosixDateImpUtil::lastDayOfMonth(int,int) (ebp, ebx); 0x0040b7c4 cmp ebx, 2 | 0x0040b7c7 mov esi, ebx | esi = ebx; 0x0040b7c9 mov edx, r14d | edx = r14d; 0x0040b7cc mov edi, dword [rsp + 0x60] | edi = *((rsp + 0x60)); | if (ebx != 2) { 0x0040b7d0 cmovne edx, edi | edx = edi; | } 0x0040b7d3 mov ecx, r13d | ecx = r13d; 0x0040b7d6 mov ebx, 0xaaaaaaab | ebx = 0xaaaaaaab; 0x0040b7db imul rbx, rcx | rbx *= rcx; 0x0040b7df shr rbx, 0x23 | rbx >>= 0x23; 0x0040b7e3 lea ecx, [rbx*4] | ecx = rbx*4; 0x0040b7ea lea ecx, [rcx + rcx*2] | ecx = rcx * 3; 0x0040b7ed neg ecx | ecx = -ecx; 0x0040b7ef mov dword [rsp + 0xc], r15d | *((rsp + 0xc)) = r15d; 0x0040b7f4 lea r15d, [r13 + rcx + 1] | r15d = r13 + rcx + 1; 0x0040b7f9 cmp r15d, 2 | 0x0040b7fd mov ecx, r14d | ecx = r14d; | if (r15d != 2) { 0x0040b800 cmovne r14d, edi | r14d = edi; | } 0x0040b804 test ecx, ecx | | if (ecx == 0) { 0x0040b806 cmove edx, edi | edx = edi; | } | if (ecx == 0) { 0x0040b809 cmove r14d, edi | r14d = edi; | } 0x0040b80d cmp edx, eax | | if (edx >= eax) { 0x0040b80f cmovge edx, eax | edx = eax; | } 0x0040b812 mov edi, ebp | 0x0040b814 call 0x413db0 | eax = BloombergLP::bdlt::PosixDateImpUtil::ymdToSerial(int,int,int) (ebp, rsi, rdx, rcx); 0x0040b819 mov edi, eax | 0x0040b81b call 0x4141b0 | eax = BloombergLP::bdlt::PosixDateImpUtil::serialToDay(int) (eax, rsi); 0x0040b820 mov ebp, eax | 0x0040b822 mov edi, ebx | 0x0040b824 mov esi, r15d | 0x0040b827 call 0x413a90 | eax = BloombergLP::bdlt::PosixDateImpUtil::lastDayOfMonth(int,int) (ebx, r15d); 0x0040b82c cmp r14d, eax | | if (r14d >= eax) { 0x0040b82f cmovge r14d, eax | r14d = eax; | } 0x0040b833 mov edi, ebx | 0x0040b835 mov esi, r15d | 0x0040b838 mov ebx, dword [rsp + 0xc] | ebx = *((rsp + 0xc)); 0x0040b83c mov edx, r14d | 0x0040b83f call 0x413db0 | eax = BloombergLP::bdlt::PosixDateImpUtil::ymdToSerial(int,int,int) (ebx, r15d, r14d, rcx); 0x0040b844 mov edi, eax | 0x0040b846 call 0x4141b0 | eax = BloombergLP::bdlt::PosixDateImpUtil::serialToDay(int) (eax, rsi); 0x0040b84b xor ecx, ecx | ecx = 0; 0x0040b84d cmp ebp, dword [rsp + 0x1c] | 0x0040b851 mov ebp, 0 | | if (ebp < *((rsp + 0x1c))) { 0x0040b856 cmovl ebp, ebx | | } 0x0040b859 cmp r12d, dword [rsp + 0x14] | | if (r12d != *((rsp + 0x14))) { 0x0040b85e cmovne ebp, ecx | | } 0x0040b861 add ebp, r12d | ebp += r12d; 0x0040b864 mov r12d, dword [rsp + 0x68] | r12d = *((rsp + 0x68)); 0x0040b869 cmp eax, dword [rsp + 0x18] | 0x0040b86d mov eax, 0 | eax = 0; | if (eax > *((rsp + 0x18))) { 0x0040b872 cmovg eax, ebx | eax = ebx; | } 0x0040b875 cmp r13d, dword [rsp + 0x10] | | if (r13d != *((rsp + 0x10))) { 0x0040b87a cmovne eax, ecx | eax = ecx; | } 0x0040b87d cmp ebp, 0x1d4bf | | if (ebp > 0x1d4bf) { 0x0040b883 jg 0x40b92e | goto label_1; | } 0x0040b889 sub r13d, eax | r13d -= eax; 0x0040b88c cmp r13d, 0xc | | if (r13d < 0xc) { 0x0040b890 jl 0x40b92e | goto label_1; | } 0x0040b896 mov eax, r13d | eax = r13d; 0x0040b899 sub eax, ebp | eax -= ebp; 0x0040b89b cdq | edx:eax = (int64_t) eax; 0x0040b89c idiv ebx | eax = edx:eax / ebx; | edx = edx:eax % ebx; 0x0040b89e inc eax | eax++; 0x0040b8a0 movsxd rsi, eax | rsi = (int64_t) eax; 0x0040b8a3 mov rdi, qword [rsp + 0x20] | 0x0040b8a8 call 0x40c170 | bsl::vector>::reserve(unsigned long) (*((rsp + 0x20)), rsi); 0x0040b8ad cmp r13d, ebp | | if (r13d < ebp) { 0x0040b8b0 jl 0x40b92e | goto label_1; | } 0x0040b8b2 mov r14, rsp | r14 = rsp; 0x0040b8b5 nop word cs:[rax + rax] | 0x0040b8bf nop | | do { 0x0040b8c0 movsxd rbp, ebp | rbp = (int64_t) ebp; 0x0040b8c3 imul rbx, rbp, 0x2aaaaaab | rbx = rbp * 0x2aaaaaab; 0x0040b8ca mov rax, rbx | rax = rbx; 0x0040b8cd shr rax, 0x3f | rax >>= 0x3f; 0x0040b8d1 sar rbx, 0x21 | rbx >>= 0x21; 0x0040b8d5 add ebx, eax | ebx += eax; 0x0040b8d7 lea eax, [rbx*4] | eax = rbx*4; 0x0040b8de lea eax, [rax + rax*2] | eax = rax * 3; 0x0040b8e1 neg eax | eax = -eax; 0x0040b8e3 lea r15d, [rbp + rax + 1] | r15d = rbp + rax + 1; 0x0040b8e8 mov edi, ebx | 0x0040b8ea mov esi, r15d | 0x0040b8ed call 0x413a90 | eax = BloombergLP::bdlt::PosixDateImpUtil::lastDayOfMonth(int,int) (ebx, r15d); 0x0040b8f2 cmp r15d, 2 | 0x0040b8f6 mov edx, r12d | edx = r12d; 0x0040b8f9 mov ecx, dword [rsp + 0x60] | ecx = *((rsp + 0x60)); | if (r15d != 2) { 0x0040b8fd cmovne edx, ecx | edx = ecx; | } 0x0040b900 test r12d, r12d | | if (r12d == 0) { 0x0040b903 cmove edx, ecx | edx = ecx; | } 0x0040b906 cmp edx, eax | | if (edx >= eax) { 0x0040b908 cmovge edx, eax | edx = eax; | } 0x0040b90b mov edi, ebx | 0x0040b90d mov esi, r15d | 0x0040b910 call 0x413db0 | eax = BloombergLP::bdlt::PosixDateImpUtil::ymdToSerial(int,int,int) (ebx, r15d, rdx, rcx); 0x0040b915 mov dword [rsp], eax | *(rsp) = eax; 0x0040b918 mov rdi, qword [rsp + 0x20] | 0x0040b91d mov rsi, r14 | 0x0040b920 call 0x40a680 | bsl::vector>::push_back(BloombergLP::bdlt::Date&&) (*((rsp + 0x20)), r14); 0x0040b925 add ebp, dword [rsp + 0xc] | ebp += *((rsp + 0xc)); 0x0040b929 cmp ebp, r13d | 0x0040b92c jle 0x40b8c0 | | } while (ebp <= r13d); | label_1: 0x0040b92e add rsp, 0x28 | 0x0040b932 pop rbx | 0x0040b933 pop r12 | 0x0040b935 pop r13 | 0x0040b937 pop r14 | 0x0040b939 pop r15 | 0x0040b93b pop rbp | 0x0040b93c ret | return rax; | }