// File: pc260533[P]ITC313-TP1/date.cpp
// Function: Date::normalise(Date)
Date Date::normalise(Date date) {
    std::vector<int> listeJourMois({31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31});
    if (((date.getAnnee() % 4 == 0) && (date.getAnnee() % 100 != 0)) || (date.getAnnee() % 400 == 0)) {
        listeJourMois.at(1) = 29;
    }
    if (date.getJour() > listeJourMois.at(date.getMois() - 1)) {
        date.setMois(date.getMois()+1);
        date.setJour(1);
    }
    if (date.getMois() > 12) {
        date.setAnnee(date.getAnnee()+1);
        date.setMois(1);
    }
    return date;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rsi, -0x30(%rbp)
movl %edx, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x18(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x20(%rbp)
movq %rdi, -0x38(%rbp)
movups 0x60e5(%rip), %xmm0     # 0xf420
movaps %xmm0, -0x70(%rbp)
movups 0x60ca(%rip), %xmm0     # 0xf410
movaps %xmm0, -0x80(%rbp)
movups 0x60af(%rip), %xmm0     # 0xf400
movaps %xmm0, -0x90(%rbp)
leaq -0x90(%rbp), %rax
movq %rax, -0x60(%rbp)
movq $0xc, -0x58(%rbp)
leaq -0x91(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0xa200
movq -0xc0(%rbp), %rcx
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
leaq -0x50(%rbp), %rdi
callq 0xa220
jmp 0x9398
leaq -0x91(%rbp), %rdi
callq 0xa2a0
leaq -0x20(%rbp), %rdi
callq 0x95a0
movl %eax, -0xc4(%rbp)
jmp 0x93b5
movl -0xc4(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x93ec
leaq -0x20(%rbp), %rdi
callq 0x95a0
movl %eax, -0xc8(%rbp)
jmp 0x93d9
movl -0xc8(%rbp), %eax
movl $0x64, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x9410
leaq -0x20(%rbp), %rdi
callq 0x95a0
movl %eax, -0xcc(%rbp)
jmp 0x93fd
movl -0xcc(%rbp), %eax
movl $0x190, %ecx            # imm = 0x190
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x9479
leaq -0x50(%rbp), %rdi
movl $0x1, %esi
callq 0xa2c0
movq %rax, -0xd8(%rbp)
jmp 0x9427
movq -0xd8(%rbp), %rax
movl $0x1d, (%rax)
jmp 0x9479
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x91(%rbp), %rdi
callq 0xa2a0
jmp 0x9592
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xa300
jmp 0x9592
leaq -0x20(%rbp), %rdi
callq 0x95c0
movl %eax, -0xdc(%rbp)
jmp 0x948a
leaq -0x20(%rbp), %rdi
callq 0x95d0
movl %eax, -0xe0(%rbp)
jmp 0x949b
movl -0xe0(%rbp), %eax
decl %eax
movslq %eax, %rsi
leaq -0x50(%rbp), %rdi
callq 0xa2c0
movq %rax, -0xe8(%rbp)
jmp 0x94b8
movl -0xdc(%rbp), %eax
movq -0xe8(%rbp), %rcx
cmpl (%rcx), %eax
jle 0x94ff
leaq -0x20(%rbp), %rdi
callq 0x95d0
movl %eax, -0xec(%rbp)
jmp 0x94da
movl -0xec(%rbp), %esi
incl %esi
leaq -0x20(%rbp), %rdi
callq 0x95f0
jmp 0x94ed
leaq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x9610
jmp 0x94fd
jmp 0x94ff
leaq -0x20(%rbp), %rdi
callq 0x95d0
movl %eax, -0xf0(%rbp)
jmp 0x9510
movl -0xf0(%rbp), %eax
cmpl $0xc, %eax
jle 0x9551
leaq -0x20(%rbp), %rdi
callq 0x95a0
movl %eax, -0xf4(%rbp)
jmp 0x952c
movl -0xf4(%rbp), %esi
incl %esi
leaq -0x20(%rbp), %rdi
callq 0x9630
jmp 0x953f
leaq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x95f0
jmp 0x954f
jmp 0x9551
movl -0x18(%rbp), %eax
movl %eax, -0x8(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xa300
movl -0x8(%rbp), %eax
movl %eax, -0xb0(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
movl -0xb0(%rbp), %edx
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0xa0(%rbp), %rdi
callq 0x3350
nop