; assembly | /* r2dec pseudo code output */ | /* bblb_schedulegenerationutil.t/assume @ 0x40bba0 */ | #include | ; (fcn) method.BloombergLP::bblb::ScheduleGenerationUtil.generateFromDayOfWeekAfterDayOfMonth_bsl::vector_BloombergLP::bdlt::Date__bsl::allocator_BloombergLP::bdlt::Date_____BloombergLP::bdlt::Date_const__BloombergLP::bdlt::Date_const__int__int__int__Bloomber () | int64_t method_BloombergLP::bblb::ScheduleGenerationUtil_generateFromDayOfWeekAfterDayOfMonth_bsl::vector_BloombergLP::bdlt::Date_bsl::allocator_BloombergLP::bdlt::Date_BloombergLP::bdlt::Date_const_BloombergLP::bdlt::Date_const_int_int_int_Bloomber (int64_t arg_60h, signed 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_10h; | int64_t var_14h; | uint32_t var_18h; | uint32_t var_1ch; | uint32_t var_20h; | uint32_t var_24h; | r9 = arg6; | r8 = arg5; | rcx = arg4; | rdx = arg3; | rsi = arg2; | rdi = arg1; | /* BloombergLP::bblb::ScheduleGenerationUtil::generateFromDayOfWeekAfterDayOfMonth(bsl::vector >*, BloombergLP::bdlt::Date const&, BloombergLP::bdlt::Date const&, int, int, int, BloombergLP::bdlt::DayOfWeek::Enum, int) */ 0x0040bba0 push rbp | 0x0040bba1 push r15 | 0x0040bba3 push r14 | 0x0040bba5 push r13 | 0x0040bba7 push r12 | 0x0040bba9 push rbx | 0x0040bbaa sub rsp, 0x28 | 0x0040bbae mov r12d, r9d | r12d = r9d; 0x0040bbb1 mov ebx, r8d | ebx = r8d; 0x0040bbb4 mov r15d, ecx | r15d = ecx; 0x0040bbb7 mov r13, rdx | r13 = rdx; 0x0040bbba mov r14, rdi | r14 = rdi; 0x0040bbbd dec ebx | ebx--; 0x0040bbbf mov rax, qword [rdi] | rax = *(rdi); 0x0040bbc2 cmp qword [rdi + 8], rax | | if (*((rdi + 8)) != rax) { 0x0040bbc6 je 0x40bbcc | 0x0040bbc8 mov qword [r14 + 8], rax | *((r14 + 8)) = rax; | } 0x0040bbcc mov ecx, dword [rsi] | 0x0040bbce lea rdi, [rsp + 8] | 0x0040bbd3 mov rsi, rsp | 0x0040bbd6 lea rdx, [rsp + 0x24] | 0x0040bbdb call 0x414270 | BloombergLP::bdlt::PosixDateImpUtil::serialToYmd(int*,int*,int*,int) (rsp + 8, rsp, rsp + 0x24, *(rsi)); 0x0040bbe0 mov eax, dword [rsp + 8] | eax = *((rsp + 8)); 0x0040bbe4 lea eax, [rax + rax*2] | eax = rax * 3; 0x0040bbe7 mov ecx, dword [rsp] | ecx = *(rsp); 0x0040bbea lea ebp, [rcx + rax*4 - 1] | ebp = rcx + rax*4 - 1; 0x0040bbee mov ecx, dword [r13] | 0x0040bbf2 lea rdi, [rsp + 8] | 0x0040bbf7 mov rsi, rsp | 0x0040bbfa lea rdx, [rsp + 0x20] | 0x0040bbff call 0x414270 | BloombergLP::bdlt::PosixDateImpUtil::serialToYmd(int*,int*,int*,int) (rsp + 8, rsp, rsp + 0x20, *(r13)); 0x0040bc04 mov eax, dword [rsp + 8] | eax = *((rsp + 8)); 0x0040bc08 lea eax, [rax + rax*2] | eax = rax * 3; 0x0040bc0b mov ecx, dword [rsp] | ecx = *(rsp); 0x0040bc0e lea edi, [rcx + rax*4 - 1] | edi = rcx + rax*4 - 1; 0x0040bc12 lea eax, [r15 + r15*2] | eax = r15 * 3; 0x0040bc16 lea esi, [rbx + rax*4] | esi = rbx + rax*4; 0x0040bc19 mov dword [rsp + 0x1c], ebp | *((rsp + 0x1c)) = ebp; 0x0040bc1d mov ecx, ebp | ecx = ebp; 0x0040bc1f sub ecx, esi | ecx -= esi; | if (ecx > 0) { 0x0040bc21 jle 0x40bc34 | 0x0040bc23 mov eax, ecx | eax = ecx; 0x0040bc25 xor edx, edx | edx = 0; 0x0040bc27 div r12d | eax = edx:eax / r12d; | edx = edx:eax % r12d; 0x0040bc2a test edx, edx | | if (edx != 0) { 0x0040bc2c je 0x40bc34 | 0x0040bc2e mov ebp, eax | 0x0040bc30 inc ebp | ebp++; 0x0040bc32 jmp 0x40bc3c | | } | } else { 0x0040bc34 mov eax, ecx | eax = ecx; 0x0040bc36 cdq | edx:eax = (int64_t) eax; 0x0040bc37 idiv r12d | eax = edx:eax / r12d; | edx = edx:eax % r12d; 0x0040bc3a mov ebp, eax | | } 0x0040bc3c mov ecx, edi | ecx = edi; 0x0040bc3e sub ecx, esi | ecx -= esi; 0x0040bc40 js 0x40bc4c | | while (edx == 0) { 0x0040bc42 mov eax, ecx | eax = ecx; 0x0040bc44 cdq | edx:eax = (int64_t) eax; 0x0040bc45 idiv r12d | eax = edx:eax / r12d; | edx = edx:eax % r12d; 0x0040bc48 mov ebx, eax | ebx = eax; 0x0040bc4a jmp 0x40bc5d | goto label_0; 0x0040bc4c mov eax, ecx | eax = ecx; 0x0040bc4e neg eax | eax = -eax; 0x0040bc50 xor edx, edx | edx = 0; 0x0040bc52 div r12d | eax = edx:eax / r12d; | edx = edx:eax % r12d; 0x0040bc55 test edx, edx | 0x0040bc57 je 0x40bc42 | | } 0x0040bc59 mov ebx, eax | ebx = eax; 0x0040bc5b not ebx | ebx = ~ebx; | label_0: 0x0040bc5d imul ebp, r12d | ebp *= r12d; 0x0040bc61 add ebp, esi | ebp += esi; 0x0040bc63 cmp ebp, 0x1d4bf | | if (ebp > 0x1d4bf) { 0x0040bc69 jg 0x40befe | goto label_1; | } 0x0040bc6f imul ebx, r12d | ebx *= r12d; 0x0040bc73 add ebx, esi | ebx += esi; 0x0040bc75 cmp ebx, 0xc | | if (ebx < 0xc) { 0x0040bc78 jl 0x40befe | goto label_1; | } 0x0040bc7e movsxd rax, ebp | rax = (int64_t) ebp; 0x0040bc81 imul r13, rax, 0x2aaaaaab | r13 = rax * 0x2aaaaaab; 0x0040bc88 mov rax, r13 | rax = r13; 0x0040bc8b shr rax, 0x3f | rax >>= 0x3f; 0x0040bc8f sar r13, 0x21 | r13 >>= 0x21; 0x0040bc93 add r13d, eax | r13d += eax; 0x0040bc96 lea eax, [r13*4] | eax = r13*4; 0x0040bc9e lea eax, [rax + rax*2] | eax = rax * 3; 0x0040bca1 mov ecx, ebp | ecx = ebp; 0x0040bca3 sub ecx, eax | ecx -= eax; 0x0040bca5 cmp ecx, 0xb | | if (ecx > 0xb) { 0x0040bca8 ja 0x40befe | goto label_1; | } 0x0040bcae neg eax | eax = -eax; 0x0040bcb0 lea esi, [rbp + rax + 1] | esi = rbp + rax + 1; 0x0040bcb4 mov ecx, dword [rip + 0x3d1ea] | ecx = BloombergLP::bdlt::PosixDateImpUtil::s_firstCachedYear; 0x0040bcba mov eax, r13d | eax = r13d; 0x0040bcbd mov edx, dword [rip + 0x3d1e5] | edx = BloombergLP::bdlt::PosixDateImpUtil::s_lastCachedYear; 0x0040bcc3 sub eax, ecx | eax -= ecx; 0x0040bcc5 mov dword [rsp + 0x18], edi | *((rsp + 0x18)) = edi; | if (eax >= 0) { 0x0040bcc9 jl 0x40bcef | 0x0040bccb cmp edx, r13d | | if (edx < r13d) { 0x0040bcce jl 0x40bcef | goto label_2; | } 0x0040bcd0 cdqe | rax = (int64_t) eax; 0x0040bcd2 mov ecx, esi | ecx = esi; 0x0040bcd4 lea rdx, [rax + rax*2] | rdx = rax * 3; 0x0040bcd8 lea rax, [rax + rdx*4] | rax = rax + rdx*4; 0x0040bcdc movsx eax, byte [rcx + rax + 0x45f760] | eax = *((rcx + rax + obj.BloombergLP::bdlt::PosixDateImpUtil::s_cachedDaysInMonth)); 0x0040bce4 cmp eax, dword [rsp + 0x68] | | if (eax >= *((rsp + 0x68))) { 0x0040bce8 jge 0x40bd09 | goto label_3; | } 0x0040bcea jmp 0x40befe | goto label_1; | } | label_2: 0x0040bcef mov edi, r13d | 0x0040bcf2 mov r15d, esi | r15d = esi; 0x0040bcf5 mov edx, dword [rsp + 0x68] | 0x0040bcf9 call 0x413c30 | al = BloombergLP::bdlt::PosixDateImpUtil::isValidYearMonthDayNoCache(int,int,int) (r13d, rsi, *((rsp + 0x68)), rcx); 0x0040bcfe mov esi, r15d | esi = r15d; 0x0040bd01 test al, al | | if (al == 0) { 0x0040bd03 je 0x40befe | goto label_1; | } | label_3: 0x0040bd09 mov eax, ebx | eax = ebx; 0x0040bd0b mov r15d, 0xaaaaaaab | r15d = 0xaaaaaaab; 0x0040bd11 imul r15, rax | r15 *= rax; 0x0040bd15 shr r15, 0x23 | r15 >>= 0x23; 0x0040bd19 lea eax, [r15*4] | eax = r15*4; 0x0040bd21 lea eax, [rax + rax*2] | eax = rax * 3; 0x0040bd24 neg eax | eax = -eax; 0x0040bd26 lea ecx, [rbx + rax + 1] | ecx = rbx + rax + 1; 0x0040bd2a mov eax, r15d | eax = r15d; 0x0040bd2d sub eax, dword [rip + 0x3d171] | eax -= *(obj.BloombergLP::bdlt::PosixDateImpUtil::s_firstCachedYear); 0x0040bd33 mov dword [rsp + 0x14], ecx | *((rsp + 0x14)) = ecx; | if (eax >= 0) { 0x0040bd37 jl 0x40bd61 | 0x0040bd39 cmp dword [rip + 0x3d168], r15d | | if (*(obj.BloombergLP::bdlt::PosixDateImpUtil::s_lastCachedYear) < r15d) { 0x0040bd40 jl 0x40bd61 | goto label_4; | } 0x0040bd42 cdqe | rax = (int64_t) eax; 0x0040bd44 mov ecx, ecx | 0x0040bd46 lea rdx, [rax + rax*2] | rdx = rax * 3; 0x0040bd4a lea rax, [rax + rdx*4] | rax = rax + rdx*4; 0x0040bd4e movsx eax, byte [rcx + rax + 0x45f760] | eax = *((rcx + rax + obj.BloombergLP::bdlt::PosixDateImpUtil::s_cachedDaysInMonth)); 0x0040bd56 cmp eax, dword [rsp + 0x68] | | if (eax >= *((rsp + 0x68))) { 0x0040bd5a jge 0x40bd7f | goto label_5; | } 0x0040bd5c jmp 0x40befe | goto label_1; | } | label_4: 0x0040bd61 mov edi, r15d | 0x0040bd64 mov dword [rsp + 0x10], esi | *((rsp + 0x10)) = esi; 0x0040bd68 mov esi, ecx | 0x0040bd6a mov edx, dword [rsp + 0x68] | 0x0040bd6e call 0x413c30 | al = BloombergLP::bdlt::PosixDateImpUtil::isValidYearMonthDayNoCache(int,int,int) (r15d, ecx, *((rsp + 0x68)), rcx); 0x0040bd73 mov esi, dword [rsp + 0x10] | esi = *((rsp + 0x10)); 0x0040bd77 test al, al | | if (al == 0) { 0x0040bd79 je 0x40befe | goto label_1; | } | label_5: 0x0040bd7f mov edi, r13d | 0x0040bd82 mov edx, dword [rsp + 0x68] | 0x0040bd86 call 0x413db0 | eax = BloombergLP::bdlt::PosixDateImpUtil::ymdToSerial(int,int,int) (r13d, rsi, *((rsp + 0x68)), rcx); 0x0040bd8b mov dword [rsp], eax | *(rsp) = eax; 0x0040bd8e lea rdi, [rsp + 8] | 0x0040bd93 mov rdx, rsp | 0x0040bd96 mov esi, dword [rsp + 0x60] | 0x0040bd9a call 0x40e530 | BloombergLP::bdlt::DateUtil::nextDayOfWeekInclusive(BloombergLP::bdlt::DayOfWeek::Enum,BloombergLP::bdlt::Dateconst&) (rsp + 8, *((rsp + 0x60)), rsp); 0x0040bd9f mov edi, dword [rsp + 8] | 0x0040bda3 call 0x4141b0 | eax = BloombergLP::bdlt::PosixDateImpUtil::serialToDay(int) (*((rsp + 8)), rsi); 0x0040bda8 mov r13d, eax | r13d = eax; 0x0040bdab mov edi, r15d | 0x0040bdae mov esi, dword [rsp + 0x14] | 0x0040bdb2 mov edx, dword [rsp + 0x68] | 0x0040bdb6 call 0x413db0 | eax = BloombergLP::bdlt::PosixDateImpUtil::ymdToSerial(int,int,int) (r15d, *((rsp + 0x14)), *((rsp + 0x68)), rcx); 0x0040bdbb mov dword [rsp], eax | *(rsp) = eax; 0x0040bdbe lea rdi, [rsp + 8] | 0x0040bdc3 mov rdx, rsp | 0x0040bdc6 mov esi, dword [rsp + 0x60] | 0x0040bdca call 0x40e530 | BloombergLP::bdlt::DateUtil::nextDayOfWeekInclusive(BloombergLP::bdlt::DayOfWeek::Enum,BloombergLP::bdlt::Dateconst&) (rsp + 8, *((rsp + 0x60)), rsp); 0x0040bdcf mov edi, dword [rsp + 8] | 0x0040bdd3 call 0x4141b0 | eax = BloombergLP::bdlt::PosixDateImpUtil::serialToDay(int) (*((rsp + 8)), rsi); 0x0040bdd8 xor ecx, ecx | ecx = 0; 0x0040bdda cmp r13d, dword [rsp + 0x24] | 0x0040bddf mov r15d, 0 | r15d = 0; | if (r13d < *((rsp + 0x24))) { 0x0040bde5 cmovl r15d, r12d | r15d = r12d; | } 0x0040bde9 cmp ebp, dword [rsp + 0x1c] | | if (ebp != *((rsp + 0x1c))) { 0x0040bded cmovne r15d, ecx | r15d = ecx; | } 0x0040bdf1 add r15d, ebp | r15d += ebp; 0x0040bdf4 cmp eax, dword [rsp + 0x20] | 0x0040bdf8 mov eax, 0 | eax = 0; | if (eax > *((rsp + 0x20))) { 0x0040bdfd cmovg eax, r12d | eax = r12d; | } 0x0040be01 cmp ebx, dword [rsp + 0x18] | | if (ebx != *((rsp + 0x18))) { 0x0040be05 cmovne eax, ecx | eax = ecx; | } 0x0040be08 cmp r15d, 0x1d4bf | | if (r15d > 0x1d4bf) { 0x0040be0f jg 0x40befe | goto label_1; | } 0x0040be15 sub ebx, eax | ebx -= eax; 0x0040be17 cmp ebx, 0xc | | if (ebx < 0xc) { 0x0040be1a jl 0x40befe | goto label_1; | } 0x0040be20 mov eax, ebx | eax = ebx; 0x0040be22 sub eax, r15d | eax -= r15d; 0x0040be25 cdq | edx:eax = (int64_t) eax; 0x0040be26 idiv r12d | eax = edx:eax / r12d; | edx = edx:eax % r12d; 0x0040be29 inc eax | eax++; 0x0040be2b movsxd rsi, eax | rsi = (int64_t) eax; 0x0040be2e mov rdi, r14 | 0x0040be31 call 0x40c170 | bsl::vector>::reserve(unsigned long) (r14, rsi); 0x0040be36 cmp ebx, r15d | | if (ebx < r15d) { 0x0040be39 jl 0x40befe | goto label_1; | } | do { 0x0040be3f movsxd rcx, r15d | rcx = (int64_t) r15d; 0x0040be42 imul rbp, rcx, 0x2aaaaaab | rbp = rcx * 0x2aaaaaab; 0x0040be49 mov rax, rbp | rax = rbp; 0x0040be4c shr rax, 0x3f | rax >>= 0x3f; 0x0040be50 sar rbp, 0x21 | rbp >>= 0x21; 0x0040be54 add ebp, eax | ebp += eax; 0x0040be56 lea eax, [rbp*4] | eax = rbp*4; 0x0040be5d lea eax, [rax + rax*2] | eax = rax * 3; 0x0040be60 sub ecx, eax | ecx -= eax; 0x0040be62 cmp ecx, 0xb | | if (ecx > 0xb) { 0x0040be65 ja 0x40bef1 | goto label_6; | } 0x0040be6b neg eax | eax = -eax; 0x0040be6d lea r13d, [r15 + rax + 1] | r13d = r15 + rax + 1; 0x0040be72 mov eax, ebp | eax = ebp; 0x0040be74 sub eax, dword [rip + 0x3d02a] | eax -= *(obj.BloombergLP::bdlt::PosixDateImpUtil::s_firstCachedYear); | if (eax >= 0) { 0x0040be7a jl 0x40bea1 | 0x0040be7c cmp dword [rip + 0x3d026], ebp | | if (*(obj.BloombergLP::bdlt::PosixDateImpUtil::s_lastCachedYear) < ebp) { 0x0040be82 jl 0x40bea1 | goto label_7; | } 0x0040be84 cdqe | rax = (int64_t) eax; 0x0040be86 mov ecx, r13d | ecx = r13d; 0x0040be89 lea rdx, [rax + rax*2] | rdx = rax * 3; 0x0040be8d lea rax, [rax + rdx*4] | rax = rax + rdx*4; 0x0040be91 movsx eax, byte [rcx + rax + 0x45f760] | eax = *((rcx + rax + obj.BloombergLP::bdlt::PosixDateImpUtil::s_cachedDaysInMonth)); 0x0040be99 cmp eax, dword [rsp + 0x68] | | if (eax >= *((rsp + 0x68))) { 0x0040be9d jge 0x40beb3 | goto label_8; | } 0x0040be9f jmp 0x40bef1 | goto label_6; | } | label_7: 0x0040bea1 mov edi, ebp | 0x0040bea3 mov esi, r13d | 0x0040bea6 mov edx, dword [rsp + 0x68] | 0x0040beaa call 0x413c30 | al = BloombergLP::bdlt::PosixDateImpUtil::isValidYearMonthDayNoCache(int,int,int) (ebp, r13d, *((rsp + 0x68)), rcx); 0x0040beaf test al, al | | if (al == 0) { 0x0040beb1 je 0x40bef1 | goto label_6; | } | label_8: 0x0040beb3 mov edi, ebp | 0x0040beb5 mov esi, r13d | 0x0040beb8 mov edx, dword [rsp + 0x68] | 0x0040bebc call 0x413db0 | eax = BloombergLP::bdlt::PosixDateImpUtil::ymdToSerial(int,int,int) (ebp, r13d, *((rsp + 0x68)), rcx); 0x0040bec1 mov dword [rsp], eax | *(rsp) = eax; 0x0040bec4 lea rbp, [rsp + 8] | rbp = rsp + 8; 0x0040bec9 mov rdi, rbp | 0x0040becc mov esi, dword [rsp + 0x60] | 0x0040bed0 mov rdx, rsp | 0x0040bed3 call 0x40e530 | BloombergLP::bdlt::DateUtil::nextDayOfWeekInclusive(BloombergLP::bdlt::DayOfWeek::Enum,BloombergLP::bdlt::Dateconst&) (rbp, *((rsp + 0x60)), rsp); 0x0040bed8 mov rdi, r14 | 0x0040bedb mov rsi, rbp | 0x0040bede call 0x40a680 | bsl::vector>::push_back(BloombergLP::bdlt::Date&&) (r14, rbp); 0x0040bee3 add r15d, r12d | r15d += r12d; 0x0040bee6 cmp r15d, ebx | 0x0040bee9 jle 0x40be3f | | } while (r15d <= ebx); 0x0040beef jmp 0x40befe | goto label_1; | label_6: 0x0040bef1 mov rax, qword [r14] | rax = *(r14); 0x0040bef4 cmp qword [r14 + 8], rax | | if (*((r14 + 8)) != rax) { 0x0040bef8 je 0x40befe | 0x0040befa mov qword [r14 + 8], rax | *((r14 + 8)) = rax; | } | label_1: 0x0040befe add rsp, 0x28 | 0x0040bf02 pop rbx | 0x0040bf03 pop r12 | 0x0040bf05 pop r13 | 0x0040bf07 pop r14 | 0x0040bf09 pop r15 | 0x0040bf0b pop rbp | 0x0040bf0c ret | return rax; | }