; assembly | /* r2dec pseudo code output */ | /* bblb_schedulegenerationutil.t/none @ 0x40bf70 */ | #include | ; (fcn) method.BloombergLP::bblb::ScheduleGenerationUtil.generateFromDayOfWeekInMonth_bsl::vector_BloombergLP::bdlt::Date__bsl::allocator_BloombergLP::bdlt::Date_____BloombergLP::bdlt::Date_const__BloombergLP::bdlt::Date_const__int__int__int__BloombergLP::bdl () | int64_t method_BloombergLP::bblb::ScheduleGenerationUtil_generateFromDayOfWeekInMonth_bsl::vector_BloombergLP::bdlt::Date_bsl::allocator_BloombergLP::bdlt::Date_BloombergLP::bdlt::Date_const_BloombergLP::bdlt::Date_const_int_int_int_BloombergLP::bdl (int64_t arg_50h, int64_t arg_58h, int64_t arg6, int64_t arg5, int64_t arg4, int64_t arg3, int64_t arg2, uint32_t arg1) { | int64_t var_4h; | uint32_t var_8h; | uint32_t var_ch; | uint32_t var_10h; | uint32_t var_14h; | r9 = arg6; | r8 = arg5; | rcx = arg4; | rdx = arg3; | rsi = arg2; | rdi = arg1; | /* BloombergLP::bblb::ScheduleGenerationUtil::generateFromDayOfWeekInMonth(bsl::vector >*, BloombergLP::bdlt::Date const&, BloombergLP::bdlt::Date const&, int, int, int, BloombergLP::bdlt::DayOfWeek::Enum, int) */ 0x0040bf70 push rbp | 0x0040bf71 push r15 | 0x0040bf73 push r14 | 0x0040bf75 push r13 | 0x0040bf77 push r12 | 0x0040bf79 push rbx | 0x0040bf7a sub rsp, 0x18 | 0x0040bf7e mov r13d, r9d | r13d = r9d; 0x0040bf81 mov r15d, r8d | r15d = r8d; 0x0040bf84 mov r12d, ecx | r12d = ecx; 0x0040bf87 mov rbx, rdx | rbx = rdx; 0x0040bf8a mov r14, rdi | r14 = rdi; 0x0040bf8d mov rax, qword [rdi] | rax = *(rdi); 0x0040bf90 cmp qword [rdi + 8], rax | | if (*((rdi + 8)) != rax) { 0x0040bf94 je 0x40bf9a | 0x0040bf96 mov qword [r14 + 8], rax | *((r14 + 8)) = rax; | } 0x0040bf9a mov ecx, dword [rsi] | 0x0040bf9c mov rdi, rsp | 0x0040bf9f lea rsi, [rsp + 4] | 0x0040bfa4 lea rdx, [rsp + 0x14] | 0x0040bfa9 call 0x414310 | BloombergLP::bdlt::PosixDateImpUtil::serialToYmd(int*,int*,int*,int) (rsp, rsp + 4, rsp + 0x14, *(rsi)); 0x0040bfae mov eax, dword [rsp] | eax = *(rsp); 0x0040bfb1 lea eax, [rax + rax*2] | eax = rax * 3; 0x0040bfb4 mov ecx, dword [rsp + 4] | ecx = *((rsp + 4)); 0x0040bfb8 lea ebp, [rcx + rax*4 - 1] | ebp = rcx + rax*4 - 1; 0x0040bfbc mov ecx, dword [rbx] | 0x0040bfbe mov rdi, rsp | 0x0040bfc1 lea rsi, [rsp + 4] | 0x0040bfc6 lea rdx, [rsp + 0x10] | 0x0040bfcb call 0x414310 | BloombergLP::bdlt::PosixDateImpUtil::serialToYmd(int*,int*,int*,int) (rsp, rsp + 4, rsp + 0x10, *(rbx)); 0x0040bfd0 mov eax, dword [rsp] | eax = *(rsp); 0x0040bfd3 lea eax, [rax + rax*2] | eax = rax * 3; 0x0040bfd6 mov ecx, dword [rsp + 4] | ecx = *((rsp + 4)); 0x0040bfda lea edi, [rcx + rax*4 - 1] | edi = rcx + rax*4 - 1; 0x0040bfde lea eax, [r12 + r12*2] | eax = r12 * 3; 0x0040bfe2 lea esi, [r15 + rax*4 - 1] | esi = r15 + rax*4 - 1; 0x0040bfe7 mov dword [rsp + 0xc], ebp | *((rsp + 0xc)) = ebp; 0x0040bfeb mov ecx, ebp | ecx = ebp; 0x0040bfed sub ecx, esi | ecx -= esi; | if (ecx > 0) { 0x0040bfef jle 0x40c009 | 0x0040bff1 mov eax, ecx | eax = ecx; 0x0040bff3 cdq | edx:eax = (int64_t) eax; 0x0040bff4 idiv r13d | eax = edx:eax / r13d; | edx = edx:eax % r13d; 0x0040bff7 test edx, edx | | if (edx != 0) { 0x0040bff9 je 0x40c009 | 0x0040bffb mov eax, ecx | eax = ecx; 0x0040bffd cdq | edx:eax = (int64_t) eax; 0x0040bffe idiv r13d | eax = edx:eax / r13d; | edx = edx:eax % r13d; 0x0040c001 mov r12d, eax | r12d = eax; 0x0040c004 inc r12d | r12d++; 0x0040c007 jmp 0x40c012 | | } | } else { 0x0040c009 mov eax, ecx | eax = ecx; 0x0040c00b cdq | edx:eax = (int64_t) eax; 0x0040c00c idiv r13d | eax = edx:eax / r13d; | edx = edx:eax % r13d; 0x0040c00f mov r12d, eax | r12d = eax; | } 0x0040c012 mov ecx, edi | ecx = edi; 0x0040c014 sub ecx, esi | ecx -= esi; 0x0040c016 js 0x40c022 | | while (edx == 0) { 0x0040c018 mov eax, ecx | eax = ecx; 0x0040c01a cdq | edx:eax = (int64_t) eax; 0x0040c01b idiv r13d | eax = edx:eax / r13d; | edx = edx:eax % r13d; 0x0040c01e mov ebx, eax | ebx = eax; 0x0040c020 jmp 0x40c036 | goto label_0; 0x0040c022 mov eax, ecx | eax = ecx; 0x0040c024 cdq | edx:eax = (int64_t) eax; 0x0040c025 idiv r13d | eax = edx:eax / r13d; | edx = edx:eax % r13d; 0x0040c028 test edx, edx | 0x0040c02a je 0x40c018 | | } 0x0040c02c mov eax, ecx | eax = ecx; 0x0040c02e cdq | edx:eax = (int64_t) eax; 0x0040c02f idiv r13d | eax = edx:eax / r13d; | edx = edx:eax % r13d; 0x0040c032 mov ebx, eax | ebx = eax; 0x0040c034 dec ebx | ebx--; | label_0: 0x0040c036 imul r12d, r13d | r12d *= r13d; 0x0040c03a add r12d, esi | r12d += esi; 0x0040c03d cmp r12d, 0x1d4bf | | if (r12d > 0x1d4bf) { 0x0040c044 jg 0x40c188 | goto label_1; | } 0x0040c04a imul ebx, r13d | ebx *= r13d; 0x0040c04e add ebx, esi | ebx += esi; 0x0040c050 cmp ebx, 0xc | | if (ebx < 0xc) { 0x0040c053 jl 0x40c188 | goto label_1; | } 0x0040c059 mov ebp, dword [rsp + 0x58] | ebp = *((rsp + 0x58)); 0x0040c05d mov ecx, dword [rsp + 0x50] | 0x0040c061 movsxd rax, r12d | rax = (int64_t) r12d; 0x0040c064 imul rsi, rax, 0x2aaaaaab | rsi = rax * 0x2aaaaaab; 0x0040c06b mov rax, rsi | rax = rsi; 0x0040c06e shr rax, 0x3f | rax >>= 0x3f; 0x0040c072 sar rsi, 0x21 | rsi >>= 0x21; 0x0040c076 add esi, eax | esi += eax; 0x0040c078 lea eax, [rsi*4] | eax = rsi*4; 0x0040c07f lea eax, [rax + rax*2] | eax = rax * 3; 0x0040c082 neg eax | eax = -eax; 0x0040c084 lea edx, [r12 + rax + 1] | 0x0040c089 mov dword [rsp + 8], edi | *((rsp + 8)) = edi; 0x0040c08d mov rdi, rsp | 0x0040c090 mov r8d, ebp | 0x0040c093 call 0x40e600 | BloombergLP::bdlt::DateUtil::nthDayOfWeekInMonth(int,int,BloombergLP::bdlt::DayOfWeek::Enum,int) (rsp, rsi, r12 + rax + 1, *((rsp + 0x50)), ebp); 0x0040c098 mov edi, dword [rsp] | 0x0040c09b call 0x414250 | eax = BloombergLP::bdlt::PosixDateImpUtil::serialToDay(int) (*(rsp), rsi); 0x0040c0a0 mov r15d, eax | r15d = eax; 0x0040c0a3 mov eax, ebx | eax = ebx; 0x0040c0a5 mov esi, 0xaaaaaaab | 0x0040c0aa imul rsi, rax | rsi *= rax; 0x0040c0ae shr rsi, 0x23 | rsi >>= 0x23; 0x0040c0b2 lea eax, [rsi*4] | eax = rsi*4; 0x0040c0b9 lea eax, [rax + rax*2] | eax = rax * 3; 0x0040c0bc neg eax | eax = -eax; 0x0040c0be lea edx, [rbx + rax + 1] | 0x0040c0c2 mov rdi, rsp | 0x0040c0c5 mov ecx, dword [rsp + 0x50] | 0x0040c0c9 mov r8d, ebp | 0x0040c0cc call 0x40e600 | BloombergLP::bdlt::DateUtil::nthDayOfWeekInMonth(int,int,BloombergLP::bdlt::DayOfWeek::Enum,int) (rsp, 0xaaaaaaab, rbx + rax + 1, *((rsp + 0x50)), ebp); 0x0040c0d1 mov edi, dword [rsp] | 0x0040c0d4 call 0x414250 | eax = BloombergLP::bdlt::PosixDateImpUtil::serialToDay(int) (*(rsp), rsi); 0x0040c0d9 xor ecx, ecx | ecx = 0; 0x0040c0db cmp r15d, dword [rsp + 0x14] | 0x0040c0e0 mov ebp, 0 | | if (r15d < *((rsp + 0x14))) { 0x0040c0e5 cmovl ebp, r13d | | } 0x0040c0e9 cmp r12d, dword [rsp + 0xc] | | if (r12d != *((rsp + 0xc))) { 0x0040c0ee cmovne ebp, ecx | | } 0x0040c0f1 add ebp, r12d | ebp += r12d; 0x0040c0f4 mov r12d, dword [rsp + 0x58] | r12d = *((rsp + 0x58)); 0x0040c0f9 cmp eax, dword [rsp + 0x10] | 0x0040c0fd mov eax, 0 | eax = 0; | if (eax > *((rsp + 0x10))) { 0x0040c102 cmovg eax, r13d | eax = r13d; | } 0x0040c106 cmp ebx, dword [rsp + 8] | | if (ebx != *((rsp + 8))) { 0x0040c10a cmovne eax, ecx | eax = ecx; | } 0x0040c10d cmp ebp, 0x1d4bf | | if (ebp > 0x1d4bf) { 0x0040c113 jg 0x40c188 | goto label_1; | } 0x0040c115 sub ebx, eax | ebx -= eax; 0x0040c117 cmp ebx, 0xc | | if (ebx < 0xc) { 0x0040c11a jl 0x40c188 | goto label_1; | } 0x0040c11c mov eax, ebx | eax = ebx; 0x0040c11e sub eax, ebp | eax -= ebp; 0x0040c120 cdq | edx:eax = (int64_t) eax; 0x0040c121 idiv r13d | eax = edx:eax / r13d; | edx = edx:eax % r13d; 0x0040c124 inc eax | eax++; 0x0040c126 movsxd rsi, eax | rsi = (int64_t) eax; 0x0040c129 mov rdi, r14 | 0x0040c12c call 0x40c1a0 | bsl::vector>::reserve(unsigned long) (r14, rsi); 0x0040c131 cmp ebx, ebp | | if (ebx < ebp) { 0x0040c133 jl 0x40c188 | goto label_1; | } 0x0040c135 mov r15, rsp | r15 = rsp; 0x0040c138 nop dword [rax + rax] | | do { 0x0040c140 movsxd rbp, ebp | rbp = (int64_t) ebp; 0x0040c143 imul rsi, rbp, 0x2aaaaaab | rsi = rbp * 0x2aaaaaab; 0x0040c14a mov rax, rsi | rax = rsi; 0x0040c14d shr rax, 0x3f | rax >>= 0x3f; 0x0040c151 sar rsi, 0x21 | rsi >>= 0x21; 0x0040c155 add esi, eax | esi += eax; 0x0040c157 lea eax, [rsi*4] | eax = rsi*4; 0x0040c15e lea eax, [rax + rax*2] | eax = rax * 3; 0x0040c161 neg eax | eax = -eax; 0x0040c163 lea edx, [rbp + rax + 1] | 0x0040c167 mov rdi, r15 | 0x0040c16a mov ecx, dword [rsp + 0x50] | 0x0040c16e mov r8d, r12d | 0x0040c171 call 0x40e600 | BloombergLP::bdlt::DateUtil::nthDayOfWeekInMonth(int,int,BloombergLP::bdlt::DayOfWeek::Enum,int) (r15, rsi, rbp + rax + 1, *((rsp + 0x50)), r12d); 0x0040c176 mov rdi, r14 | 0x0040c179 mov rsi, r15 | 0x0040c17c call 0x40a680 | bsl::vector>::push_back(BloombergLP::bdlt::Date&&) (r14, r15); 0x0040c181 add ebp, r13d | ebp += r13d; 0x0040c184 cmp ebp, ebx | 0x0040c186 jle 0x40c140 | | } while (ebp <= ebx); | label_1: 0x0040c188 add rsp, 0x18 | 0x0040c18c pop rbx | 0x0040c18d pop r12 | 0x0040c18f pop r13 | 0x0040c191 pop r14 | 0x0040c193 pop r15 | 0x0040c195 pop rbp | 0x0040c196 ret | return rax; | }