; assembly | /* r2dec pseudo code output */ | /* bblb_schedulegenerationutil.t/none @ 0x40bbc0 */ | #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) */ 0x0040bbc0 push rbp | 0x0040bbc1 push r15 | 0x0040bbc3 push r14 | 0x0040bbc5 push r13 | 0x0040bbc7 push r12 | 0x0040bbc9 push rbx | 0x0040bbca sub rsp, 0x28 | 0x0040bbce mov r12d, r9d | r12d = r9d; 0x0040bbd1 mov r15d, r8d | r15d = r8d; 0x0040bbd4 mov r13d, ecx | r13d = ecx; 0x0040bbd7 mov rbx, rdx | rbx = rdx; 0x0040bbda mov r14, rdi | r14 = rdi; 0x0040bbdd mov rax, qword [rdi] | rax = *(rdi); 0x0040bbe0 cmp qword [rdi + 8], rax | | if (*((rdi + 8)) != rax) { 0x0040bbe4 je 0x40bbea | 0x0040bbe6 mov qword [r14 + 8], rax | *((r14 + 8)) = rax; | } 0x0040bbea mov ecx, dword [rsi] | 0x0040bbec lea rdi, [rsp + 8] | 0x0040bbf1 mov rsi, rsp | 0x0040bbf4 lea rdx, [rsp + 0x24] | 0x0040bbf9 call 0x414310 | BloombergLP::bdlt::PosixDateImpUtil::serialToYmd(int*,int*,int*,int) (rsp + 8, rsp, rsp + 0x24, *(rsi)); 0x0040bbfe mov eax, dword [rsp + 8] | eax = *((rsp + 8)); 0x0040bc02 lea eax, [rax + rax*2] | eax = rax * 3; 0x0040bc05 mov ecx, dword [rsp] | ecx = *(rsp); 0x0040bc08 lea ebp, [rcx + rax*4 - 1] | ebp = rcx + rax*4 - 1; 0x0040bc0c mov ecx, dword [rbx] | 0x0040bc0e lea rdi, [rsp + 8] | 0x0040bc13 mov rsi, rsp | 0x0040bc16 lea rdx, [rsp + 0x20] | 0x0040bc1b call 0x414310 | BloombergLP::bdlt::PosixDateImpUtil::serialToYmd(int*,int*,int*,int) (rsp + 8, rsp, rsp + 0x20, *(rbx)); 0x0040bc20 mov eax, dword [rsp + 8] | eax = *((rsp + 8)); 0x0040bc24 lea eax, [rax + rax*2] | eax = rax * 3; 0x0040bc27 mov ecx, dword [rsp] | ecx = *(rsp); 0x0040bc2a lea edi, [rcx + rax*4 - 1] | edi = rcx + rax*4 - 1; 0x0040bc2e lea eax, [r13 + r13*2] | eax = r13 * 3; 0x0040bc33 lea esi, [r15 + rax*4 - 1] | esi = r15 + rax*4 - 1; 0x0040bc38 mov dword [rsp + 0x1c], ebp | *((rsp + 0x1c)) = ebp; 0x0040bc3c mov ecx, ebp | ecx = ebp; 0x0040bc3e sub ecx, esi | ecx -= esi; | if (ecx > 0) { 0x0040bc40 jle 0x40bc58 | 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 test edx, edx | | if (edx != 0) { 0x0040bc4a je 0x40bc58 | 0x0040bc4c mov eax, ecx | eax = ecx; 0x0040bc4e cdq | edx:eax = (int64_t) eax; 0x0040bc4f idiv r12d | eax = edx:eax / r12d; | edx = edx:eax % r12d; 0x0040bc52 mov ebp, eax | 0x0040bc54 inc ebp | ebp++; 0x0040bc56 jmp 0x40bc60 | | } | } else { 0x0040bc58 mov eax, ecx | eax = ecx; 0x0040bc5a cdq | edx:eax = (int64_t) eax; 0x0040bc5b idiv r12d | eax = edx:eax / r12d; | edx = edx:eax % r12d; 0x0040bc5e mov ebp, eax | | } 0x0040bc60 mov ecx, edi | ecx = edi; 0x0040bc62 sub ecx, esi | ecx -= esi; 0x0040bc64 js 0x40bc70 | | while (edx == 0) { 0x0040bc66 mov eax, ecx | eax = ecx; 0x0040bc68 cdq | edx:eax = (int64_t) eax; 0x0040bc69 idiv r12d | eax = edx:eax / r12d; | edx = edx:eax % r12d; 0x0040bc6c mov ebx, eax | ebx = eax; 0x0040bc6e jmp 0x40bc84 | goto label_0; 0x0040bc70 mov eax, ecx | eax = ecx; 0x0040bc72 cdq | edx:eax = (int64_t) eax; 0x0040bc73 idiv r12d | eax = edx:eax / r12d; | edx = edx:eax % r12d; 0x0040bc76 test edx, edx | 0x0040bc78 je 0x40bc66 | | } 0x0040bc7a mov eax, ecx | eax = ecx; 0x0040bc7c cdq | edx:eax = (int64_t) eax; 0x0040bc7d idiv r12d | eax = edx:eax / r12d; | edx = edx:eax % r12d; 0x0040bc80 mov ebx, eax | ebx = eax; 0x0040bc82 dec ebx | ebx--; | label_0: 0x0040bc84 imul ebp, r12d | ebp *= r12d; 0x0040bc88 add ebp, esi | ebp += esi; 0x0040bc8a cmp ebp, 0x1d4bf | | if (ebp > 0x1d4bf) { 0x0040bc90 jg 0x40bf30 | goto label_1; | } 0x0040bc96 imul ebx, r12d | ebx *= r12d; 0x0040bc9a add ebx, esi | ebx += esi; 0x0040bc9c cmp ebx, 0xc | | if (ebx < 0xc) { 0x0040bc9f jl 0x40bf30 | goto label_1; | } 0x0040bca5 cmp dword [rsp + 0x68], 0 | | if (*((rsp + 0x68)) <= 0) { 0x0040bcaa jle 0x40bf30 | goto label_1; | } 0x0040bcb0 movsxd rax, ebp | rax = (int64_t) ebp; 0x0040bcb3 imul r13, rax, 0x2aaaaaab | r13 = rax * 0x2aaaaaab; 0x0040bcba mov rax, r13 | rax = r13; 0x0040bcbd shr rax, 0x3f | rax >>= 0x3f; 0x0040bcc1 sar r13, 0x21 | r13 >>= 0x21; 0x0040bcc5 add r13d, eax | r13d += eax; 0x0040bcc8 lea eax, [r13*4] | eax = r13*4; 0x0040bcd0 lea eax, [rax + rax*2] | eax = rax * 3; 0x0040bcd3 mov ecx, ebp | ecx = ebp; 0x0040bcd5 sub ecx, eax | ecx -= eax; 0x0040bcd7 cmp ecx, 0xb | | if (ecx > 0xb) { 0x0040bcda ja 0x40bf30 | goto label_1; | } 0x0040bce0 neg eax | eax = -eax; 0x0040bce2 lea esi, [rbp + rax + 1] | esi = rbp + rax + 1; 0x0040bce6 mov ecx, dword [rip + 0x3d848] | ecx = BloombergLP::bdlt::PosixDateImpUtil::s_firstCachedYear; 0x0040bcec mov eax, r13d | eax = r13d; 0x0040bcef mov edx, dword [rip + 0x3d843] | edx = BloombergLP::bdlt::PosixDateImpUtil::s_lastCachedYear; 0x0040bcf5 sub eax, ecx | eax -= ecx; 0x0040bcf7 mov dword [rsp + 0x18], edi | *((rsp + 0x18)) = edi; | if (eax >= 0) { 0x0040bcfb jl 0x40bd21 | 0x0040bcfd cmp edx, r13d | | if (edx < r13d) { 0x0040bd00 jl 0x40bd21 | goto label_2; | } 0x0040bd02 cdqe | rax = (int64_t) eax; 0x0040bd04 mov ecx, esi | ecx = esi; 0x0040bd06 lea rdx, [rax + rax*2] | rdx = rax * 3; 0x0040bd0a lea rax, [rax + rdx*4] | rax = rax + rdx*4; 0x0040bd0e movsx eax, byte [rcx + rax + 0x45fdf0] | eax = *((rcx + rax + obj.BloombergLP::bdlt::PosixDateImpUtil::s_cachedDaysInMonth)); 0x0040bd16 cmp eax, dword [rsp + 0x68] | | if (eax >= *((rsp + 0x68))) { 0x0040bd1a jge 0x40bd3b | goto label_3; | } 0x0040bd1c jmp 0x40bf30 | goto label_1; | } | label_2: 0x0040bd21 mov edi, r13d | 0x0040bd24 mov r15d, esi | r15d = esi; 0x0040bd27 mov edx, dword [rsp + 0x68] | 0x0040bd2b call 0x413cd0 | al = BloombergLP::bdlt::PosixDateImpUtil::isValidYearMonthDayNoCache(int,int,int) (r13d, rsi, *((rsp + 0x68)), rcx); 0x0040bd30 mov esi, r15d | esi = r15d; 0x0040bd33 test al, al | | if (al == 0) { 0x0040bd35 je 0x40bf30 | goto label_1; | } | label_3: 0x0040bd3b mov eax, ebx | eax = ebx; 0x0040bd3d mov r15d, 0xaaaaaaab | r15d = 0xaaaaaaab; 0x0040bd43 imul r15, rax | r15 *= rax; 0x0040bd47 shr r15, 0x23 | r15 >>= 0x23; 0x0040bd4b lea eax, [r15*4] | eax = r15*4; 0x0040bd53 lea eax, [rax + rax*2] | eax = rax * 3; 0x0040bd56 neg eax | eax = -eax; 0x0040bd58 lea ecx, [rbx + rax + 1] | ecx = rbx + rax + 1; 0x0040bd5c mov eax, r15d | eax = r15d; 0x0040bd5f sub eax, dword [rip + 0x3d7cf] | eax -= *(obj.BloombergLP::bdlt::PosixDateImpUtil::s_firstCachedYear); 0x0040bd65 mov dword [rsp + 0x14], ecx | *((rsp + 0x14)) = ecx; | if (eax >= 0) { 0x0040bd69 jl 0x40bd93 | 0x0040bd6b cmp dword [rip + 0x3d7c6], r15d | | if (*(obj.BloombergLP::bdlt::PosixDateImpUtil::s_lastCachedYear) < r15d) { 0x0040bd72 jl 0x40bd93 | goto label_4; | } 0x0040bd74 cdqe | rax = (int64_t) eax; 0x0040bd76 mov ecx, ecx | 0x0040bd78 lea rdx, [rax + rax*2] | rdx = rax * 3; 0x0040bd7c lea rax, [rax + rdx*4] | rax = rax + rdx*4; 0x0040bd80 movsx eax, byte [rcx + rax + 0x45fdf0] | eax = *((rcx + rax + obj.BloombergLP::bdlt::PosixDateImpUtil::s_cachedDaysInMonth)); 0x0040bd88 cmp eax, dword [rsp + 0x68] | | if (eax >= *((rsp + 0x68))) { 0x0040bd8c jge 0x40bdb1 | goto label_5; | } 0x0040bd8e jmp 0x40bf30 | goto label_1; | } | label_4: 0x0040bd93 mov edi, r15d | 0x0040bd96 mov dword [rsp + 0x10], esi | *((rsp + 0x10)) = esi; 0x0040bd9a mov esi, ecx | 0x0040bd9c mov edx, dword [rsp + 0x68] | 0x0040bda0 call 0x413cd0 | al = BloombergLP::bdlt::PosixDateImpUtil::isValidYearMonthDayNoCache(int,int,int) (r15d, ecx, *((rsp + 0x68)), rcx); 0x0040bda5 mov esi, dword [rsp + 0x10] | esi = *((rsp + 0x10)); 0x0040bda9 test al, al | | if (al == 0) { 0x0040bdab je 0x40bf30 | goto label_1; | } | label_5: 0x0040bdb1 mov edi, r13d | 0x0040bdb4 mov edx, dword [rsp + 0x68] | 0x0040bdb8 call 0x413e50 | eax = BloombergLP::bdlt::PosixDateImpUtil::ymdToSerial(int,int,int) (r13d, rsi, *((rsp + 0x68)), rcx); 0x0040bdbd mov dword [rsp], eax | *(rsp) = eax; 0x0040bdc0 lea rdi, [rsp + 8] | 0x0040bdc5 mov rdx, rsp | 0x0040bdc8 mov esi, dword [rsp + 0x60] | 0x0040bdcc call 0x40e5d0 | BloombergLP::bdlt::DateUtil::nextDayOfWeekInclusive(BloombergLP::bdlt::DayOfWeek::Enum,BloombergLP::bdlt::Dateconst&) (rsp + 8, *((rsp + 0x60)), rsp); 0x0040bdd1 mov edi, dword [rsp + 8] | 0x0040bdd5 call 0x414250 | eax = BloombergLP::bdlt::PosixDateImpUtil::serialToDay(int) (*((rsp + 8)), rsi); 0x0040bdda mov r13d, eax | r13d = eax; 0x0040bddd mov edi, r15d | 0x0040bde0 mov esi, dword [rsp + 0x14] | 0x0040bde4 mov edx, dword [rsp + 0x68] | 0x0040bde8 call 0x413e50 | eax = BloombergLP::bdlt::PosixDateImpUtil::ymdToSerial(int,int,int) (r15d, *((rsp + 0x14)), *((rsp + 0x68)), rcx); 0x0040bded mov dword [rsp], eax | *(rsp) = eax; 0x0040bdf0 lea rdi, [rsp + 8] | 0x0040bdf5 mov rdx, rsp | 0x0040bdf8 mov esi, dword [rsp + 0x60] | 0x0040bdfc call 0x40e5d0 | BloombergLP::bdlt::DateUtil::nextDayOfWeekInclusive(BloombergLP::bdlt::DayOfWeek::Enum,BloombergLP::bdlt::Dateconst&) (rsp + 8, *((rsp + 0x60)), rsp); 0x0040be01 mov edi, dword [rsp + 8] | 0x0040be05 call 0x414250 | eax = BloombergLP::bdlt::PosixDateImpUtil::serialToDay(int) (*((rsp + 8)), rsi); 0x0040be0a xor ecx, ecx | ecx = 0; 0x0040be0c cmp r13d, dword [rsp + 0x24] | 0x0040be11 mov r15d, 0 | r15d = 0; | if (r13d < *((rsp + 0x24))) { 0x0040be17 cmovl r15d, r12d | r15d = r12d; | } 0x0040be1b cmp ebp, dword [rsp + 0x1c] | | if (ebp != *((rsp + 0x1c))) { 0x0040be1f cmovne r15d, ecx | r15d = ecx; | } 0x0040be23 add r15d, ebp | r15d += ebp; 0x0040be26 cmp eax, dword [rsp + 0x20] | 0x0040be2a mov eax, 0 | eax = 0; | if (eax > *((rsp + 0x20))) { 0x0040be2f cmovg eax, r12d | eax = r12d; | } 0x0040be33 cmp ebx, dword [rsp + 0x18] | | if (ebx != *((rsp + 0x18))) { 0x0040be37 cmovne eax, ecx | eax = ecx; | } 0x0040be3a cmp r15d, 0x1d4bf | | if (r15d > 0x1d4bf) { 0x0040be41 jg 0x40bf30 | goto label_1; | } 0x0040be47 sub ebx, eax | ebx -= eax; 0x0040be49 cmp ebx, 0xc | | if (ebx < 0xc) { 0x0040be4c jl 0x40bf30 | goto label_1; | } 0x0040be52 mov eax, ebx | eax = ebx; 0x0040be54 sub eax, r15d | eax -= r15d; 0x0040be57 cdq | edx:eax = (int64_t) eax; 0x0040be58 idiv r12d | eax = edx:eax / r12d; | edx = edx:eax % r12d; 0x0040be5b inc eax | eax++; 0x0040be5d movsxd rsi, eax | rsi = (int64_t) eax; 0x0040be60 mov rdi, r14 | 0x0040be63 call 0x40c1a0 | bsl::vector>::reserve(unsigned long) (r14, rsi); 0x0040be68 cmp ebx, r15d | | if (ebx < r15d) { 0x0040be6b jl 0x40bf30 | goto label_1; | } | do { 0x0040be71 movsxd rcx, r15d | rcx = (int64_t) r15d; 0x0040be74 imul rbp, rcx, 0x2aaaaaab | rbp = rcx * 0x2aaaaaab; 0x0040be7b mov rax, rbp | rax = rbp; 0x0040be7e shr rax, 0x3f | rax >>= 0x3f; 0x0040be82 sar rbp, 0x21 | rbp >>= 0x21; 0x0040be86 add ebp, eax | ebp += eax; 0x0040be88 lea eax, [rbp*4] | eax = rbp*4; 0x0040be8f lea eax, [rax + rax*2] | eax = rax * 3; 0x0040be92 sub ecx, eax | ecx -= eax; 0x0040be94 cmp ecx, 0xb | | if (ecx > 0xb) { 0x0040be97 ja 0x40bf23 | goto label_6; | } 0x0040be9d neg eax | eax = -eax; 0x0040be9f lea r13d, [r15 + rax + 1] | r13d = r15 + rax + 1; 0x0040bea4 mov eax, ebp | eax = ebp; 0x0040bea6 sub eax, dword [rip + 0x3d688] | eax -= *(obj.BloombergLP::bdlt::PosixDateImpUtil::s_firstCachedYear); | if (eax >= 0) { 0x0040beac jl 0x40bed3 | 0x0040beae cmp dword [rip + 0x3d684], ebp | | if (*(obj.BloombergLP::bdlt::PosixDateImpUtil::s_lastCachedYear) < ebp) { 0x0040beb4 jl 0x40bed3 | goto label_7; | } 0x0040beb6 cdqe | rax = (int64_t) eax; 0x0040beb8 mov ecx, r13d | ecx = r13d; 0x0040bebb lea rdx, [rax + rax*2] | rdx = rax * 3; 0x0040bebf lea rax, [rax + rdx*4] | rax = rax + rdx*4; 0x0040bec3 movsx eax, byte [rcx + rax + 0x45fdf0] | eax = *((rcx + rax + obj.BloombergLP::bdlt::PosixDateImpUtil::s_cachedDaysInMonth)); 0x0040becb cmp eax, dword [rsp + 0x68] | | if (eax >= *((rsp + 0x68))) { 0x0040becf jge 0x40bee5 | goto label_8; | } 0x0040bed1 jmp 0x40bf23 | goto label_6; | } | label_7: 0x0040bed3 mov edi, ebp | 0x0040bed5 mov esi, r13d | 0x0040bed8 mov edx, dword [rsp + 0x68] | 0x0040bedc call 0x413cd0 | al = BloombergLP::bdlt::PosixDateImpUtil::isValidYearMonthDayNoCache(int,int,int) (ebp, r13d, *((rsp + 0x68)), rcx); 0x0040bee1 test al, al | | if (al == 0) { 0x0040bee3 je 0x40bf23 | goto label_6; | } | label_8: 0x0040bee5 mov edi, ebp | 0x0040bee7 mov esi, r13d | 0x0040beea mov edx, dword [rsp + 0x68] | 0x0040beee call 0x413e50 | eax = BloombergLP::bdlt::PosixDateImpUtil::ymdToSerial(int,int,int) (ebp, r13d, *((rsp + 0x68)), rcx); 0x0040bef3 mov dword [rsp], eax | *(rsp) = eax; 0x0040bef6 lea rbp, [rsp + 8] | rbp = rsp + 8; 0x0040befb mov rdi, rbp | 0x0040befe mov esi, dword [rsp + 0x60] | 0x0040bf02 mov rdx, rsp | 0x0040bf05 call 0x40e5d0 | BloombergLP::bdlt::DateUtil::nextDayOfWeekInclusive(BloombergLP::bdlt::DayOfWeek::Enum,BloombergLP::bdlt::Dateconst&) (rbp, *((rsp + 0x60)), rsp); 0x0040bf0a mov rdi, r14 | 0x0040bf0d mov rsi, rbp | 0x0040bf10 call 0x40a680 | bsl::vector>::push_back(BloombergLP::bdlt::Date&&) (r14, rbp); 0x0040bf15 add r15d, r12d | r15d += r12d; 0x0040bf18 cmp r15d, ebx | 0x0040bf1b jle 0x40be71 | | } while (r15d <= ebx); 0x0040bf21 jmp 0x40bf30 | goto label_1; | label_6: 0x0040bf23 mov rax, qword [r14] | rax = *(r14); 0x0040bf26 cmp qword [r14 + 8], rax | | if (*((r14 + 8)) != rax) { 0x0040bf2a je 0x40bf30 | 0x0040bf2c mov qword [r14 + 8], rax | *((r14 + 8)) = rax; | } | label_1: 0x0040bf30 add rsp, 0x28 | 0x0040bf34 pop rbx | 0x0040bf35 pop r12 | 0x0040bf37 pop r13 | 0x0040bf39 pop r14 | 0x0040bf3b pop r15 | 0x0040bf3d pop rbp | 0x0040bf3e ret | return rax; | }