// File: /workspace/github_cpp_makefile_star2_O3/pc260533[P]ITC313-TP1/date.cpp
// Function: Date::nombreDeJoursAvecCetteDate(Date)
int Date::nombreDeJoursAvecCetteDate(Date date) {
    int res = 0;
    if (this->estAvantDate(date)) {
        if (this->annee < date.annee) {
            for (int i = this->annee; i < date.annee; i++) {
                res += 365;
                if (this->anneeEstBissextile(i)) {
                    res++;
                }
            }
            //std::cout << "annee" << std::to_string(res) << std::endl;
            return res += this->nombreDeJoursAvecCetteDate(Date(date.jour, date.mois, this->annee));
        }
        if (this->mois < date.mois) {
            for (int i = this->mois; i < date.mois; i++) {
                res += this->getListeJourDesMois().at(i - 1);
                if ((this->anneeEstBissextile(date.annee)) && (i == 1)) {
                    res++;
                }
            }
            //std::cout << "mois inf" << std::to_string(res) << std::endl;
            return res += this->nombreDeJoursAvecCetteDate(Date(date.jour, this->mois, this->annee));
        }
        else if (this->mois > date.mois) {
            for (int i = this->mois; i < date.mois; i++) {
                res -= this->getListeJourDesMois().at(i - 1);
                if ((this->anneeEstBissextile(date.annee)) && (i == 1)) {
                    res--;
                }
            }
            //std::cout << "mois sup" << std::to_string(res) << std::endl;
            return res += this->nombreDeJoursAvecCetteDate(Date(date.jour, this->mois, this->annee));
        }
        if (this->jour < date.jour) {
            res += date.jour - this->jour;
            //std::cout << "jour inf" << std::to_string(res) << std::endl;
            return res += this->nombreDeJoursAvecCetteDate(Date(this->jour, this->mois, this->annee));
        }
        else if (this->jour > date.jour) {
            res -= this->jour - date.jour;
            //std::cout << "jour supp" << std::to_string(res) << std::endl;
            return res += this->nombreDeJoursAvecCetteDate(Date(this->jour, this->mois, this->annee));
        }
    }
    return res;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edx, %ecx
movq %rsi, %r14
xorl %eax, %eax
movl (%rdi), %r10d
movl 0x4(%rdi), %esi
movslq %esi, %r15
movl %r10d, %ebx
movdqa 0x4934(%rip), %xmm8     # 0xa360
movdqa 0x493c(%rip), %xmm7     # 0xa370
movdqa 0x4944(%rip), %xmm0     # 0xa380
movdqa 0x494c(%rip), %xmm1     # 0xa390
movdqa 0x4954(%rip), %xmm6     # 0xa3a0
movdqa 0x495b(%rip), %xmm9     # 0xa3b0
movdqa 0x4973(%rip), %xmm3     # 0xa3d0
movdqa 0x497b(%rip), %xmm4     # 0xa3e0
xorl %r12d, %r12d
pxor %xmm10, %xmm10
movq %r14, %r8
shrq $0x20, %r8
cmpl %r8d, %esi
sete %dl
cmpl %r14d, %r10d
setl %r9b
cmpl %r8d, %esi
jl 0x5a8f
andb %r9b, %dl
je 0x5c5c
movl 0x8(%rdi), %edx
xorl %ebp, %ebp
movl %ecx, %r9d
subl %edx, %r9d
jle 0x5c2c
leal 0x3(%r9), %ecx
andl $-0x4, %ecx
decl %r9d
movd %edx, %xmm2
pshufd $0x0, %xmm2, %xmm11     # xmm11 = xmm2[0,0,0,0]
paddd %xmm8, %xmm11
movd %r9d, %xmm2
pshufd $0x0, %xmm2, %xmm12     # xmm12 = xmm2[0,0,0,0]
pxor %xmm15, %xmm15
xorl %r9d, %r9d
pxor %xmm7, %xmm12
movdqa %xmm15, %xmm14
movd %r9d, %xmm2
pshufd $0x0, %xmm2, %xmm13     # xmm13 = xmm2[0,0,0,0]
por %xmm8, %xmm13
pxor %xmm7, %xmm13
pcmpgtd %xmm12, %xmm13
movdqa %xmm11, %xmm2
pmuludq %xmm1, %xmm2
pshufd $0xed, %xmm2, %xmm15    # xmm15 = xmm2[1,3,2,3]
movdqa %xmm7, %xmm5
pshufd $0xf5, %xmm11, %xmm7    # xmm7 = xmm11[1,1,3,3]
movdqa %xmm7, %xmm2
pmuludq %xmm1, %xmm2
pshufd $0xed, %xmm2, %xmm2     # xmm2 = xmm2[1,3,2,3]
punpckldq %xmm2, %xmm15   # xmm15 = xmm15[0],xmm2[0],xmm15[1],xmm2[1]
pxor %xmm2, %xmm2
pcmpgtd %xmm11, %xmm2
pand %xmm1, %xmm2
psubd %xmm2, %xmm15
movdqa %xmm15, %xmm2
psrld $0x1f, %xmm2
psrad $0x5, %xmm15
paddd %xmm2, %xmm15
pshufd $0xf5, %xmm15, %xmm2    # xmm2 = xmm15[1,1,3,3]
pmuludq %xmm6, %xmm15
pshufd $0xe8, %xmm15, %xmm15   # xmm15 = xmm15[0,2,2,3]
pmuludq %xmm6, %xmm2
pshufd $0xe8, %xmm2, %xmm2     # xmm2 = xmm2[0,2,2,3]
punpckldq %xmm2, %xmm15   # xmm15 = xmm15[0],xmm2[0],xmm15[1],xmm2[1]
movdqa %xmm11, %xmm2
psubd %xmm15, %xmm2
movdqa %xmm11, %xmm15
pand %xmm0, %xmm15
pcmpgtd %xmm10, %xmm15
pcmpeqd %xmm10, %xmm2
por %xmm15, %xmm2
movdqa %xmm13, %xmm15
pandn %xmm2, %xmm15
movdqa %xmm11, %xmm2
pmuludq %xmm9, %xmm2
pshufd $0xe8, %xmm2, %xmm2     # xmm2 = xmm2[0,2,2,3]
pmuludq %xmm9, %xmm7
pshufd $0xe8, %xmm7, %xmm7     # xmm7 = xmm7[0,2,2,3]
punpckldq %xmm7, %xmm2    # xmm2 = xmm2[0],xmm7[0],xmm2[1],xmm7[1]
paddd 0x480d(%rip), %xmm2     # 0xa3c0
movdqa %xmm2, %xmm7
psrld $0x4, %xmm7
pslld $0x1c, %xmm2
por %xmm7, %xmm2
movdqa %xmm5, %xmm7
pxor %xmm5, %xmm2
pcmpgtd %xmm3, %xmm2
paddd %xmm4, %xmm2
pand %xmm15, %xmm2
pandn %xmm4, %xmm15
por %xmm2, %xmm15
paddd %xmm14, %xmm15
addl $0x4, %r9d
paddd 0x47fa(%rip), %xmm11    # 0xa3f0
cmpl %r9d, %ecx
jne 0x5ad1
pand %xmm13, %xmm14
pandn %xmm15, %xmm13
por %xmm14, %xmm13
pshufd $0xee, %xmm13, %xmm2    # xmm2 = xmm13[2,3,2,3]
paddd %xmm13, %xmm2
pshufd $0x55, %xmm2, %xmm7     # xmm7 = xmm2[1,1,1,1]
paddd %xmm2, %xmm7
movd %xmm7, %ebp
movdqa %xmm5, %xmm7
movl %edx, %ecx
cmpl %r8d, %esi
jl 0x5c63
cmpl %r8d, %esi
jg 0x5d64
cmpl %r14d, %ebx
jge 0x5d78
addl %r14d, %ebp
movq %rsi, %r14
shlq $0x20, %r14
orq %rbx, %r14
subl %ebx, %ebp
addl %ebp, %r12d
movl %edx, %ecx
jmp 0x5a6d
xorl %ebp, %ebp
jmp 0x5d97
movq %rdi, 0x10(%rsp)
movl %r12d, 0xc(%rsp)
testb $0x3, %cl
sete %al
imull $0xc28f5c29, %ecx, %ecx # imm = 0xC28F5C29
addl $0x51eb850, %ecx        # imm = 0x51EB850
movl %ecx, %edx
rorl $0x2, %edx
cmpl $0x28f5c29, %edx        # imm = 0x28F5C29
setae %dl
andb %al, %dl
rorl $0x4, %ecx
cmpl $0xa3d70b, %ecx         # imm = 0xA3D70B
setb %al
movq %r14, %r13
sarq $0x20, %r13
orb %dl, %al
movb %al, 0xa(%rsp)
decq %r15
negq %r13
xorl %ebx, %ebx
movups 0x47f1(%rip), %xmm0     # 0xa4a8
movaps %xmm0, 0x50(%rsp)
movups 0x47d5(%rip), %xmm0     # 0xa498
movaps %xmm0, 0x40(%rsp)
movdqu 0x47b8(%rip), %xmm0     # 0xa488
movdqa %xmm0, 0x30(%rsp)
movl $0xc, %edx
leaq 0x18(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0xb(%rsp), %rcx
callq 0x630c
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rdx
subq %rdi, %rdx
sarq $0x2, %rdx
cmpq %r15, %rdx
jbe 0x5dad
movl %ebx, %r12d
addl (%rdi,%r15,4), %r12d
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x2150
testq %r15, %r15
sete %al
andb 0xa(%rsp), %al
movzbl %al, %ebx
addl %r12d, %ebx
leaq (%r15,%r13), %rax
incq %rax
incq %r15
cmpq $-0x1, %rax
jne 0x5cb0
movq 0x10(%rsp), %rdi
movl 0x4(%rdi), %eax
movl 0x8(%rdi), %edx
shlq $0x20, %rax
movl %r14d, %esi
orq %rax, %rsi
callq 0x5a02
addl %ebx, %eax
movl 0xc(%rsp), %r12d
jmp 0x5d97
shlq $0x20, %rsi
movl %r14d, %eax
orq %rsi, %rax
movq %rax, %rsi
callq 0x5a02
jmp 0x5d97
xorl %eax, %eax
cmpl %r14d, %ebx
jle 0x5d97
shlq $0x20, %rsi
orq %rbx, %rsi
callq 0x5a02
addl %r14d, %ebp
subl %ebx, %ebp
addl %r12d, %ebp
addl %eax, %ebp
jmp 0x5d9c
addl %eax, %ebp
addl %r12d, %ebp
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4483(%rip), %rdi      # 0xa237
movq %r15, %rsi
xorl %eax, %eax
callq 0x21c0
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x5dd8
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0x2150
movq %rbx, %rdi
callq 0x2220