; assembly | /* r2dec pseudo code output */ | /* bblb_schedulegenerationutil.t/assume @ 0x40bf40 */ | #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_1h, 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) */ 0x0040bf40 push rbp | 0x0040bf41 push r15 | 0x0040bf43 push r14 | 0x0040bf45 push r13 | 0x0040bf47 push r12 | 0x0040bf49 push rbx | 0x0040bf4a sub rsp, 0x18 | 0x0040bf4e mov r13d, r9d | r13d = r9d; 0x0040bf51 mov ebx, r8d | ebx = r8d; 0x0040bf54 mov r15d, ecx | r15d = ecx; 0x0040bf57 mov r12, rdx | r12 = rdx; 0x0040bf5a mov r14, rdi | r14 = rdi; 0x0040bf5d dec ebx | ebx--; 0x0040bf5f mov rax, qword [rdi] | rax = *(rdi); 0x0040bf62 cmp qword [rdi + 8], rax | | if (*((rdi + 8)) != rax) { 0x0040bf66 je 0x40bf6c | 0x0040bf68 mov qword [r14 + 8], rax | *((r14 + 8)) = rax; | } 0x0040bf6c mov ecx, dword [rsi] | 0x0040bf6e mov rdi, rsp | 0x0040bf71 lea rsi, [rsp + 4] | 0x0040bf76 lea rdx, [rsp + 0x14] | 0x0040bf7b call 0x414270 | BloombergLP::bdlt::PosixDateImpUtil::serialToYmd(int*,int*,int*,int) (rsp, rsp + 4, rsp + 0x14, *(rsi)); 0x0040bf80 mov eax, dword [rsp] | eax = *(rsp); 0x0040bf83 lea eax, [rax + rax*2] | eax = rax * 3; 0x0040bf86 mov ecx, dword [rsp + 4] | ecx = *((rsp + 4)); 0x0040bf8a lea ebp, [rcx + rax*4 - 1] | ebp = rcx + rax*4 - 1; 0x0040bf8e mov ecx, dword [r12] | 0x0040bf92 mov rdi, rsp | 0x0040bf95 lea rsi, [rsp + 4] | 0x0040bf9a lea rdx, [rsp + 0x10] | 0x0040bf9f call 0x414270 | BloombergLP::bdlt::PosixDateImpUtil::serialToYmd(int*,int*,int*,int) (rsp, rsp + 4, rsp + 0x10, *(r12)); 0x0040bfa4 mov eax, dword [rsp] | eax = *(rsp); 0x0040bfa7 lea eax, [rax + rax*2] | eax = rax * 3; 0x0040bfaa mov ecx, dword [rsp + 4] | ecx = *((rsp + 4)); 0x0040bfae lea edi, [rcx + rax*4 - 1] | edi = rcx + rax*4 - 1; 0x0040bfb2 lea eax, [r15 + r15*2] | eax = r15 * 3; 0x0040bfb6 lea esi, [rbx + rax*4] | esi = rbx + rax*4; 0x0040bfb9 mov dword [rsp + 0xc], ebp | *((rsp + 0xc)) = ebp; 0x0040bfbd mov ecx, ebp | ecx = ebp; 0x0040bfbf sub ecx, esi | ecx -= esi; | if (ecx > 0) { 0x0040bfc1 jle 0x40bfd4 | 0x0040bfc3 mov eax, ecx | eax = ecx; 0x0040bfc5 xor edx, edx | edx = 0; 0x0040bfc7 div r13d | eax = edx:eax / r13d; | edx = edx:eax % r13d; 0x0040bfca test edx, edx | | if (edx != 0) { 0x0040bfcc je 0x40bfd4 | 0x0040bfce mov ebp, eax | 0x0040bfd0 inc ebp | ebp++; 0x0040bfd2 jmp 0x40bfdc | | } | } else { 0x0040bfd4 mov eax, ecx | eax = ecx; 0x0040bfd6 cdq | edx:eax = (int64_t) eax; 0x0040bfd7 idiv r13d | eax = edx:eax / r13d; | edx = edx:eax % r13d; 0x0040bfda mov ebp, eax | | } 0x0040bfdc mov ecx, edi | ecx = edi; 0x0040bfde sub ecx, esi | ecx -= esi; 0x0040bfe0 js 0x40bfed | | while (edx == 0) { 0x0040bfe2 mov eax, ecx | eax = ecx; 0x0040bfe4 cdq | edx:eax = (int64_t) eax; 0x0040bfe5 idiv r13d | eax = edx:eax / r13d; | edx = edx:eax % r13d; 0x0040bfe8 mov r12d, eax | r12d = eax; 0x0040bfeb jmp 0x40c000 | goto label_0; 0x0040bfed mov eax, ecx | eax = ecx; 0x0040bfef neg eax | eax = -eax; 0x0040bff1 xor edx, edx | edx = 0; 0x0040bff3 div r13d | eax = edx:eax / r13d; | edx = edx:eax % r13d; 0x0040bff6 test edx, edx | 0x0040bff8 je 0x40bfe2 | | } 0x0040bffa mov r12d, eax | r12d = eax; 0x0040bffd not r12d | r12d = ~r12d; | label_0: 0x0040c000 imul ebp, r13d | ebp *= r13d; 0x0040c004 add ebp, esi | ebp += esi; 0x0040c006 cmp ebp, 0x1d4bf | | if (ebp > 0x1d4bf) { 0x0040c00c jg 0x40c159 | goto label_1; | } 0x0040c012 imul r12d, r13d | r12d *= r13d; 0x0040c016 add r12d, esi | r12d += esi; 0x0040c019 cmp r12d, 0xc | | if (r12d < 0xc) { 0x0040c01d jl 0x40c159 | goto label_1; | } 0x0040c023 mov r8d, dword [rsp + 0x58] | 0x0040c028 mov ebx, dword [rsp + 0x50] | ebx = *((rsp + 0x50)); 0x0040c02c movsxd rax, ebp | rax = (int64_t) ebp; 0x0040c02f imul rsi, rax, 0x2aaaaaab | rsi = rax * 0x2aaaaaab; 0x0040c036 mov rax, rsi | rax = rsi; 0x0040c039 shr rax, 0x3f | rax >>= 0x3f; 0x0040c03d sar rsi, 0x21 | rsi >>= 0x21; 0x0040c041 add esi, eax | esi += eax; 0x0040c043 lea eax, [rsi*4] | eax = rsi*4; 0x0040c04a lea eax, [rax + rax*2] | eax = rax * 3; 0x0040c04d neg eax | eax = -eax; 0x0040c04f lea edx, [rbp + rax + 1] | 0x0040c053 mov dword [rsp + 8], edi | *((rsp + 8)) = edi; 0x0040c057 mov rdi, rsp | 0x0040c05a mov ecx, ebx | 0x0040c05c call 0x40e560 | BloombergLP::bdlt::DateUtil::nthDayOfWeekInMonth(int,int,BloombergLP::bdlt::DayOfWeek::Enum,int) (rsp, rsi, rbp + rax + 1, ebx, *((rsp + 0x58))); 0x0040c061 mov edi, dword [rsp] | 0x0040c064 call 0x4141b0 | eax = BloombergLP::bdlt::PosixDateImpUtil::serialToDay(int) (*(rsp), rsi); 0x0040c069 mov r15d, eax | r15d = eax; 0x0040c06c mov eax, r12d | eax = r12d; 0x0040c06f mov esi, 0xaaaaaaab | 0x0040c074 imul rsi, rax | rsi *= rax; 0x0040c078 shr rsi, 0x23 | rsi >>= 0x23; 0x0040c07c lea eax, [rsi*4] | eax = rsi*4; 0x0040c083 lea eax, [rax + rax*2] | eax = rax * 3; 0x0040c086 neg eax | eax = -eax; 0x0040c088 lea edx, [r12 + rax + 1] | 0x0040c08d mov rdi, rsp | 0x0040c090 mov ecx, ebx | 0x0040c092 mov ebx, dword [rsp + 0x58] | ebx = *((rsp + 0x58)); 0x0040c096 mov r8d, ebx | 0x0040c099 call 0x40e560 | BloombergLP::bdlt::DateUtil::nthDayOfWeekInMonth(int,int,BloombergLP::bdlt::DayOfWeek::Enum,int) (rsp, 0xaaaaaaab, r12 + rax + 1, ebx, *((rsp + 0x58))); 0x0040c09e mov edi, dword [rsp] | 0x0040c0a1 call 0x4141b0 | eax = BloombergLP::bdlt::PosixDateImpUtil::serialToDay(int) (*(rsp), rsi); 0x0040c0a6 xor ecx, ecx | ecx = 0; 0x0040c0a8 cmp r15d, dword [rsp + 0x14] | 0x0040c0ad mov r15d, ebx | r15d = ebx; 0x0040c0b0 mov ebx, 0 | ebx = 0; | if (r15d < *((rsp + 0x14))) { 0x0040c0b5 cmovl ebx, r13d | ebx = r13d; | } 0x0040c0b9 cmp ebp, dword [rsp + 0xc] | | if (ebp != *((rsp + 0xc))) { 0x0040c0bd cmovne ebx, ecx | ebx = ecx; | } 0x0040c0c0 add ebx, ebp | ebx += ebp; 0x0040c0c2 cmp eax, dword [rsp + 0x10] | 0x0040c0c6 mov eax, 0 | eax = 0; | if (eax > *((rsp + 0x10))) { 0x0040c0cb cmovg eax, r13d | eax = r13d; | } 0x0040c0cf cmp r12d, dword [rsp + 8] | | if (r12d != *((rsp + 8))) { 0x0040c0d4 cmovne eax, ecx | eax = ecx; | } 0x0040c0d7 cmp ebx, 0x1d4bf | | if (ebx > 0x1d4bf) { 0x0040c0dd jg 0x40c159 | goto label_1; | } 0x0040c0df sub r12d, eax | r12d -= eax; 0x0040c0e2 cmp r12d, 0xc | | if (r12d < 0xc) { 0x0040c0e6 jl 0x40c159 | goto label_1; | } 0x0040c0e8 mov eax, r12d | eax = r12d; 0x0040c0eb sub eax, ebx | eax -= ebx; 0x0040c0ed cdq | edx:eax = (int64_t) eax; 0x0040c0ee idiv r13d | eax = edx:eax / r13d; | edx = edx:eax % r13d; 0x0040c0f1 inc eax | eax++; 0x0040c0f3 movsxd rsi, eax | rsi = (int64_t) eax; 0x0040c0f6 mov rdi, r14 | 0x0040c0f9 call 0x40c170 | bsl::vector>::reserve(unsigned long) (r14, rsi); 0x0040c0fe cmp r12d, ebx | | if (r12d < ebx) { 0x0040c101 jl 0x40c159 | goto label_1; | } 0x0040c103 mov rbp, rsp | 0x0040c106 nop word cs:[rax + rax] | | do { 0x0040c110 movsxd rbx, ebx | rbx = (int64_t) ebx; 0x0040c113 imul rsi, rbx, 0x2aaaaaab | rsi = rbx * 0x2aaaaaab; 0x0040c11a mov rax, rsi | rax = rsi; 0x0040c11d shr rax, 0x3f | rax >>= 0x3f; 0x0040c121 sar rsi, 0x21 | rsi >>= 0x21; 0x0040c125 add esi, eax | esi += eax; 0x0040c127 lea eax, [rsi*4] | eax = rsi*4; 0x0040c12e lea eax, [rax + rax*2] | eax = rax * 3; 0x0040c131 neg eax | eax = -eax; 0x0040c133 lea edx, [rbx + rax + 1] | 0x0040c137 mov rdi, rbp | 0x0040c13a mov ecx, dword [rsp + 0x50] | 0x0040c13e mov r8d, r15d | 0x0040c141 call 0x40e560 | BloombergLP::bdlt::DateUtil::nthDayOfWeekInMonth(int,int,BloombergLP::bdlt::DayOfWeek::Enum,int) (rbp, rsi, rbx + rax + 1, *((rsp + 0x50)), r15d); 0x0040c146 mov rdi, r14 | 0x0040c149 mov rsi, rbp | 0x0040c14c call 0x40a680 | bsl::vector>::push_back(BloombergLP::bdlt::Date&&) (r14, rbp); 0x0040c151 add ebx, r13d | ebx += r13d; 0x0040c154 cmp ebx, r12d | 0x0040c157 jle 0x40c110 | | } while (ebx <= r12d); | label_1: 0x0040c159 add rsp, 0x18 | 0x0040c15d pop rbx | 0x0040c15e pop r12 | 0x0040c160 pop r13 | 0x0040c162 pop r14 | 0x0040c164 pop r15 | 0x0040c166 pop rbp | 0x0040c167 ret | return rax; | }