// File: pc260533[P]ITC313-TP1/main.cpp
// Function: main
int main() {
    /* Partie 1 Question 1
    Date date(28, 2, 2019);
    Date dateBissextile(28, 2, 2020);
    std::cout << "La date est de : " << date.toString() << endl;
    std::cout << "La date bissextile est de : " << dateBissextile.toString() << endl;
    date.jourProchain();
    dateBissextile.jourProchain();
    std::cout << "La date est de : " << date.toString() << endl;
    std::cout << "La date bissextile est de : " << dateBissextile.toString() << endl;
    */

    /* Question 2
    Client client("1", "Chassagne", "Pierre-Nicolas", 0);
    std::cout << "La client est : " << client.toString() << endl;
    client.setNomClient("Polybe");
    client.setPrenomClient("Polybe");
    client.ajouterReservation();
    std::cout << "La client est : " << client.toString() << endl;
    */

    /* Question 3
    Chambre chambre(1,TypeDeChambre::Simple, 10.0);
    std::cout << "La chambre est : " << chambre.toString() << endl;
    */

    /* Question 4
    Chambre chambre1(1,TypeDeChambre::Simple, 10.0);
    std::cout << "La chambre est : " << chambre1.toString() << endl << endl;
    Chambre chambre2(2,TypeDeChambre::Double, 20.0);
    std::cout << "La chambre est : " << chambre2.toString() << endl << endl;
    std::vector<Chambre> listeChambre;
    listeChambre.push_back(chambre1);
    listeChambre.push_back(chambre2);
    Hotel hotel("HOTEL", "Nom", "Ville", listeChambre);
    std::cout << "L'hotel est : " << hotel.toString() << endl;
    */

    /* Question 5
    Date date1(2, 6, 2019);
    Date date2(3, 8, 2021);
    std::cout << date1.nombreDeJoursAvecCetteDate(date2) << endl;

    Chambre chambre1(1,TypeDeChambre::Simple, 10.0);
    std::cout << "La chambre est : " << chambre1.toString() << endl << endl;
    Chambre chambre2(2,TypeDeChambre::Double, 20.0);
    std::cout << "La chambre est : " << chambre2.toString() << endl << endl;

    std::vector<Chambre> listeChambre;
    listeChambre.push_back(chambre1);
    listeChambre.push_back(chambre2);
    Hotel hotel("HOTEL", "Nom", "Ville", listeChambre);
    std::cout << "L'hotel est : " << hotel.toString() << endl;

    Client client("1", "Chassagne", "Pierre-Nicolas", 0);

    Reservation reservation(0, hotel, chambre1, client);
    reservation.setPeriodeDeReservation(date1, date2);;
    std::cout <<  "La reservation est : " << reservation.toString() << endl;
    */

    /* Partie 2 Question 6 */
    std::vector<Chambre> listeChambres;
    for (int i = 0; i < 10; i++) {
        if (i < 3) {
            listeChambres.push_back(Chambre(i, TypeDeChambre::Simple, 100.0));
        }
        else if (i < 8) {
            listeChambres.push_back(Chambre(i, TypeDeChambre::Double, 125.0));
        }
        else {
            listeChambres.push_back(Chambre(i, TypeDeChambre::Suite, 210.0));
        }
    }
    Hotel hotel("HOTEL", "Nom", "Ville", listeChambres);
    std::cout << "L'hotel est : " << hotel.toString() << endl;

    std::vector<Client> listeClients;
    for (int i = 0; i < 10; i++) {
        listeClients.push_back(Client("Client" + std::to_string(i), "Client" + std::to_string(i), "Client" + std::to_string(i), 0));
    }
    for (Client client : listeClients) {
        std::cout << "Le client est : " << client.toString() << std::endl;
    }
    std::cout << std::endl;

    std::vector<Reservation> listeReservations;
    for(int i = 0; i < 1; i++) {
        Reservation reservation;

        /* Question 7 */
        bool quitDatesReservation = false;
        while (!quitDatesReservation) {
            int jourDebut;
            int jourFin;
            int moisDebut;
            int moisFin;
            int anneeDebut;
            int anneeFin;
            std::cout << "Entrer la date de debut et la date de fin de la reservation :" << std::endl;
            std::cout << "Jour de debut : ";
            cin >> jourDebut;
            std::cout << "Mois de debut : ";
            cin >> moisDebut;
            std::cout << "Annee de debut : ";
            cin >> anneeDebut;
            std::cout << "Jour de fin : ";
            cin >> jourFin;
            std::cout << "Mois de fin : ";
            cin >> moisFin;
            std::cout << "Annee de fin : ";
            cin >> anneeFin;
            Date dateDebut(jourDebut, moisDebut, anneeDebut);
            Date dateFin(jourFin, moisFin, anneeFin);
            if ((dateDebut.estValide()) && (dateFin.estValide()) && (reservation.setPeriodeDeReservation(dateDebut, dateFin))) {
                quitDatesReservation = true;
            }
            else {
                std::cout << "Erreur de saisie : Veuillez resaisir les dates." << std::endl;
            }
        }

        /* Question 8 */
        bool quitChambreReservation = false;
        while (!quitChambreReservation) {
            std::cout << "Entrer le type de chambre désirer :" << std::endl;
            int choixTypeDeChambre = 0;
            std::vector<std::string> listeTypesDeChambre = listeChambres.at(0).getListeTypesDeChambre();
            for (int i = 0; i < listeTypesDeChambre.size(); i++) {
                std::cout << "Taper " << std::to_string(i) << " pour " << listeTypesDeChambre.at(i) << std::endl;
            }
            cin >> choixTypeDeChambre;
            TypeDeChambre typeDeChambreChoisi = listeChambres.at(0).getTypeDeChambreAvecString(listeTypesDeChambre.at(choixTypeDeChambre));
            if (hotel.chambreDeCeTypeEstDisponible(typeDeChambreChoisi)) {
                quitChambreReservation = true;
                reservation.setChambreReservation(hotel.reservePremiereChambreDeCeType(typeDeChambreChoisi));
            }
            else {
                std::cout << "Ce type de chambre n'est pas disponible." << std::endl;
            }
        }

        /* Question 9 */
        bool quitClientReservation = false;
        while (!quitClientReservation) {
            std::string nomClientReservation = "";
            std::cout << "Entrer le nom du client :" << std::endl;
            cin >> nomClientReservation;
            std::vector<Client> listeClientsSelectionnes;
            int choixClient = 0;
            Client clientReservation;
            for (Client client : listeClients) {
                if (client.getNomClient() == nomClientReservation) {
                    listeClientsSelectionnes.push_back(client);
                }
            }
            if (listeClientsSelectionnes.size() != 0) {
                for (int i = 0; i < listeClientsSelectionnes.size(); i++) {
                    std::cout << "Taper " << std::to_string(i) << " pour le client" << listeClientsSelectionnes.at(i).toString() << std::endl;
                }
                cin >> choixClient;
                clientReservation = listeClientsSelectionnes.at(choixClient);
                std::cout << "Le client est : " << clientReservation.toString() << std::endl;
                reservation.setClientReservation(clientReservation);
                quitClientReservation = true;
            }
            else {
                std::cout << "Aucun client ne possede ce nom." << std::endl;
            }
        }
        /* Question 10 */
        reservation.setHotelReservation(hotel);
        reservation.calculMontantTotal();
        listeReservations.push_back(reservation);
    }

    /* Question 10 */
    for (Reservation reservation : listeReservations) {
        std::cout << "La reservation est : " << listeReservations.at(0).toString() << std::endl;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb10, %rsp            # imm = 0xB10
movl $0x0, -0x4(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x49e0
movl $0x0, -0x24(%rbp)
cmpl $0xa, -0x24(%rbp)
jge 0x365c
cmpl $0x3, -0x24(%rbp)
jge 0x35ec
movl -0x24(%rbp), %esi
leaq -0x40(%rbp), %rdi
xorl %edx, %edx
movsd 0xba55(%rip), %xmm0     # 0xf018
callq 0xba70
jmp 0x35ca
leaq -0x20(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x4a00
jmp 0x35d9
jmp 0x364c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x49c9
cmpl $0x8, -0x24(%rbp)
jge 0x361e
movl -0x24(%rbp), %esi
leaq -0x68(%rbp), %rdi
movl $0x1, %edx
movsd 0xba0a(%rip), %xmm0     # 0xf010
callq 0xba70
jmp 0x360d
leaq -0x20(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x4a00
jmp 0x361c
jmp 0x364a
movl -0x24(%rbp), %esi
leaq -0x80(%rbp), %rdi
movl $0x2, %edx
movsd 0xb9d6(%rip), %xmm0     # 0xf008
callq 0xba70
jmp 0x3639
leaq -0x20(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x4a00
jmp 0x3648
jmp 0x364a
jmp 0x364c
jmp 0x364e
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x35a2
leaq -0x119(%rbp), %rdi
movq %rdi, -0x9c8(%rbp)
callq 0x3360
movq -0x9c8(%rbp), %rdx
leaq 0xb9a3(%rip), %rsi      # 0xf020
leaq -0x118(%rbp), %rdi
callq 0x4a30
jmp 0x368b
leaq -0x141(%rbp), %rdi
movq %rdi, -0x9d0(%rbp)
callq 0x3360
movq -0x9d0(%rbp), %rdx
leaq 0xb97a(%rip), %rsi      # 0xf026
leaq -0x140(%rbp), %rdi
callq 0x4a30
jmp 0x36ba
leaq -0x169(%rbp), %rdi
movq %rdi, -0x9d8(%rbp)
callq 0x3360
movq -0x9d8(%rbp), %rdx
leaq 0xb94f(%rip), %rsi      # 0xf02a
leaq -0x168(%rbp), %rdi
callq 0x4a30
jmp 0x36e9
leaq -0x188(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x4ae0
jmp 0x36fb
leaq -0xf8(%rbp), %rdi
leaq -0x118(%rbp), %rsi
leaq -0x140(%rbp), %rdx
leaq -0x168(%rbp), %rcx
leaq -0x188(%rbp), %r8
callq 0xcec0
jmp 0x3725
leaq -0x188(%rbp), %rdi
callq 0x4bd0
leaq -0x168(%rbp), %rdi
callq 0x3160
leaq -0x169(%rbp), %rdi
callq 0x3240
leaq -0x140(%rbp), %rdi
callq 0x3160
leaq -0x141(%rbp), %rdi
callq 0x3240
leaq -0x118(%rbp), %rdi
callq 0x3160
leaq -0x119(%rbp), %rdi
callq 0x3240
movq 0x12850(%rip), %rdi     # 0x15fd0
leaq 0xb8a9(%rip), %rsi      # 0xf030
callq 0x31f0
movq %rax, -0x9e0(%rbp)
jmp 0x3795
leaq -0x1a8(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0xd190
jmp 0x37aa
movq -0x9e0(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
callq 0x31e0
movq %rax, -0x9e8(%rbp)
jmp 0x37c6
movq -0x9e8(%rbp), %rdi
movq 0x127e4(%rip), %rsi     # 0x15fb8
callq 0x3220
jmp 0x37db
leaq -0x1a8(%rbp), %rdi
callq 0x3160
leaq -0x1c0(%rbp), %rdi
callq 0x4c30
movl $0x0, -0x1c4(%rbp)
cmpl $0xa, -0x1c4(%rbp)
jge 0x3ad8
movl -0x1c4(%rbp), %esi
leaq -0x270(%rbp), %rdi
callq 0x4cd0
jmp 0x381e
leaq 0xb81a(%rip), %rsi      # 0xf03f
leaq -0x250(%rbp), %rdi
leaq -0x270(%rbp), %rdx
callq 0x4c80
jmp 0x383a
movl -0x1c4(%rbp), %esi
leaq -0x2b0(%rbp), %rdi
callq 0x4cd0
jmp 0x384e
leaq 0xb7ea(%rip), %rsi      # 0xf03f
leaq -0x290(%rbp), %rdi
leaq -0x2b0(%rbp), %rdx
callq 0x4c80
jmp 0x386a
movl -0x1c4(%rbp), %esi
leaq -0x2f0(%rbp), %rdi
callq 0x4cd0
jmp 0x387e
leaq 0xb7ba(%rip), %rsi      # 0xf03f
leaq -0x2d0(%rbp), %rdi
leaq -0x2f0(%rbp), %rdx
callq 0x4c80
jmp 0x389a
leaq -0x230(%rbp), %rdi
leaq -0x250(%rbp), %rsi
leaq -0x290(%rbp), %rdx
leaq -0x2d0(%rbp), %rcx
xorl %r8d, %r8d
callq 0xb530
jmp 0x38c0
leaq -0x1c0(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x4c50
jmp 0x38d5
leaq -0x230(%rbp), %rdi
callq 0x4df0
leaq -0x2d0(%rbp), %rdi
callq 0x3160
leaq -0x2f0(%rbp), %rdi
callq 0x3160
leaq -0x290(%rbp), %rdi
callq 0x3160
leaq -0x2b0(%rbp), %rdi
callq 0x3160
leaq -0x250(%rbp), %rdi
callq 0x3160
leaq -0x270(%rbp), %rdi
callq 0x3160
movl -0x1c4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c4(%rbp)
jmp 0x37fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x39c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x39b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x3999
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x398d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x4bd0
leaq -0x168(%rbp), %rdi
callq 0x3160
leaq -0x169(%rbp), %rdi
callq 0x3240
leaq -0x140(%rbp), %rdi
callq 0x3160
leaq -0x141(%rbp), %rdi
callq 0x3240
leaq -0x118(%rbp), %rdi
callq 0x3160
leaq -0x119(%rbp), %rdi
callq 0x3240
jmp 0x49c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x49bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x3160
jmp 0x49bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x49b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x3ac7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x3abb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x3aaf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x3aa3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x3a97
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x3a8b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x230(%rbp), %rdi
callq 0x4df0
leaq -0x2d0(%rbp), %rdi
callq 0x3160
leaq -0x2f0(%rbp), %rdi
callq 0x3160
leaq -0x290(%rbp), %rdi
callq 0x3160
leaq -0x2b0(%rbp), %rdi
callq 0x3160
leaq -0x250(%rbp), %rdi
callq 0x3160
leaq -0x270(%rbp), %rdi
callq 0x3160
jmp 0x49b1
leaq -0x1c0(%rbp), %rax
movq %rax, -0x2f8(%rbp)
movq -0x2f8(%rbp), %rdi
callq 0x4e30
movq %rax, -0x300(%rbp)
movq -0x2f8(%rbp), %rdi
callq 0x4e60
movq %rax, -0x308(%rbp)
leaq -0x300(%rbp), %rdi
leaq -0x308(%rbp), %rsi
callq 0x4e90
testb $0x1, %al
jne 0x3b28
jmp 0x3c07
leaq -0x300(%rbp), %rdi
callq 0x4ed0
movq %rax, %rsi
leaq -0x370(%rbp), %rdi
callq 0x4ef0
jmp 0x3b45
movq 0x12484(%rip), %rdi     # 0x15fd0
leaq 0xb4f3(%rip), %rsi      # 0xf046
callq 0x31f0
movq %rax, -0x9f0(%rbp)
jmp 0x3b61
leaq -0x390(%rbp), %rdi
leaq -0x370(%rbp), %rsi
callq 0xb600
jmp 0x3b76
movq -0x9f0(%rbp), %rdi
leaq -0x390(%rbp), %rsi
callq 0x31e0
movq %rax, -0x9f8(%rbp)
jmp 0x3b92
movq -0x9f8(%rbp), %rdi
movq 0x12418(%rip), %rsi     # 0x15fb8
callq 0x3220
jmp 0x3ba7
leaq -0x390(%rbp), %rdi
callq 0x3160
leaq -0x370(%rbp), %rdi
callq 0x4df0
leaq -0x300(%rbp), %rdi
callq 0x4fa0
jmp 0x3b0c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x3bf6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x390(%rbp), %rdi
callq 0x3160
leaq -0x370(%rbp), %rdi
callq 0x4df0
jmp 0x49b1
movq 0x123c2(%rip), %rdi     # 0x15fd0
movq 0x123a3(%rip), %rsi     # 0x15fb8
callq 0x3220
jmp 0x3c1c
leaq -0x3a8(%rbp), %rdi
callq 0x4fc0
movl $0x0, -0x3ac(%rbp)
cmpl $0x1, -0x3ac(%rbp)
jge 0x4820
leaq -0x4d0(%rbp), %rdi
callq 0xe510
jmp 0x3c4d
movb $0x0, -0x4d1(%rbp)
movb -0x4d1(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x3c65
jmp 0x3f1e
movq 0x12364(%rip), %rdi     # 0x15fd0
leaq 0xb3e4(%rip), %rsi      # 0xf057
callq 0x31f0
movq %rax, -0xa00(%rbp)
jmp 0x3c81
movq -0xa00(%rbp), %rdi
movq 0x12329(%rip), %rsi     # 0x15fb8
callq 0x3220
jmp 0x3c96
movq 0x12333(%rip), %rdi     # 0x15fd0
leaq 0xb3f1(%rip), %rsi      # 0xf095
callq 0x31f0
jmp 0x3cab
movq 0x1232e(%rip), %rdi     # 0x15fe0
leaq -0x4d8(%rbp), %rsi
callq 0x3150
jmp 0x3cc0
movq 0x12309(%rip), %rdi     # 0x15fd0
leaq 0xb3d8(%rip), %rsi      # 0xf0a6
callq 0x31f0
jmp 0x3cd5
movq 0x12304(%rip), %rdi     # 0x15fe0
leaq -0x4e0(%rbp), %rsi
callq 0x3150
jmp 0x3cea
movq 0x122df(%rip), %rdi     # 0x15fd0
leaq 0xb3bf(%rip), %rsi      # 0xf0b7
callq 0x31f0
jmp 0x3cff
movq 0x122da(%rip), %rdi     # 0x15fe0
leaq -0x4e8(%rbp), %rsi
callq 0x3150
jmp 0x3d14
movq 0x122b5(%rip), %rdi     # 0x15fd0
leaq 0xb3a7(%rip), %rsi      # 0xf0c9
callq 0x31f0
jmp 0x3d29
movq 0x122b0(%rip), %rdi     # 0x15fe0
leaq -0x4dc(%rbp), %rsi
callq 0x3150
jmp 0x3d3e
movq 0x1228b(%rip), %rdi     # 0x15fd0
leaq 0xb38c(%rip), %rsi      # 0xf0d8
callq 0x31f0
jmp 0x3d53
movq 0x12286(%rip), %rdi     # 0x15fe0
leaq -0x4e4(%rbp), %rsi
callq 0x3150
jmp 0x3d68
movq 0x12261(%rip), %rdi     # 0x15fd0
leaq 0xb371(%rip), %rsi      # 0xf0e7
callq 0x31f0
jmp 0x3d7d
movq 0x1225c(%rip), %rdi     # 0x15fe0
leaq -0x4ec(%rbp), %rsi
callq 0x3150
jmp 0x3d92
movl -0x4d8(%rbp), %esi
movl -0x4e0(%rbp), %edx
movl -0x4e8(%rbp), %ecx
leaq -0x4f8(%rbp), %rdi
callq 0x9680
jmp 0x3db2
movl -0x4dc(%rbp), %esi
movl -0x4e4(%rbp), %edx
movl -0x4ec(%rbp), %ecx
leaq -0x504(%rbp), %rdi
callq 0x9680
jmp 0x3dd2
leaq -0x4f8(%rbp), %rdi
callq 0x9a20
movb %al, -0xa01(%rbp)
jmp 0x3de6
movb -0xa01(%rbp), %al
testb $0x1, %al
jne 0x3df5
jmp 0x3ee6
leaq -0x504(%rbp), %rdi
callq 0x9a20
movb %al, -0xa02(%rbp)
jmp 0x3e09
movb -0xa02(%rbp), %al
testb $0x1, %al
jne 0x3e18
jmp 0x3ee6
movl -0x4f0(%rbp), %eax
movl %eax, -0x508(%rbp)
movq -0x4f8(%rbp), %rax
movq %rax, -0x510(%rbp)
movl -0x4fc(%rbp), %eax
movl %eax, -0x518(%rbp)
movq -0x504(%rbp), %rax
movq %rax, -0x520(%rbp)
movl -0x508(%rbp), %eax
movl %eax, -0x528(%rbp)
movq -0x510(%rbp), %rax
movq %rax, -0x530(%rbp)
movq -0x530(%rbp), %rsi
movl -0x528(%rbp), %edx
movl -0x518(%rbp), %eax
movl %eax, -0x538(%rbp)
movq -0x520(%rbp), %rax
movq %rax, -0x540(%rbp)
movq -0x540(%rbp), %rcx
movl -0x538(%rbp), %r8d
leaq -0x4d0(%rbp), %rdi
callq 0xe6c0
movb %al, -0xa03(%rbp)
jmp 0x3eaf
movb -0xa03(%rbp), %al
testb $0x1, %al
jne 0x3ebb
jmp 0x3ee6
movb $0x1, -0x4d1(%rbp)
jmp 0x3f19
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x49a5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x480f
movq 0x120e3(%rip), %rdi     # 0x15fd0
leaq 0xb203(%rip), %rsi      # 0xf0f7
callq 0x31f0
movq %rax, -0xa10(%rbp)
jmp 0x3f02
movq -0xa10(%rbp), %rdi
movq 0x120a8(%rip), %rsi     # 0x15fb8
callq 0x3220
jmp 0x3f17
jmp 0x3f19
jmp 0x3c54
movb $0x0, -0x541(%rbp)
movb -0x541(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x3f36
jmp 0x4244
movq 0x12093(%rip), %rdi     # 0x15fd0
leaq 0xb1e3(%rip), %rsi      # 0xf127
callq 0x31f0
movq %rax, -0xa18(%rbp)
jmp 0x3f52
movq -0xa18(%rbp), %rdi
movq 0x12058(%rip), %rsi     # 0x15fb8
callq 0x3220
jmp 0x3f67
movl $0x0, -0x548(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x20(%rbp), %rdi
callq 0x4fe0
movq %rax, -0xa20(%rbp)
jmp 0x3f87
movq -0xa20(%rbp), %rsi
leaq -0x560(%rbp), %rdi
callq 0xbab0
jmp 0x3f9c
movl $0x0, -0x564(%rbp)
movslq -0x564(%rbp), %rax
movq %rax, -0xa28(%rbp)
leaq -0x560(%rbp), %rdi
callq 0x5020
movq %rax, %rcx
movq -0xa28(%rbp), %rax
cmpq %rcx, %rax
jae 0x40d6
movq 0x11ff6(%rip), %rdi     # 0x15fd0
leaq 0xb16b(%rip), %rsi      # 0xf14c
callq 0x31f0
movq %rax, -0xa30(%rbp)
jmp 0x3fef
movl -0x564(%rbp), %esi
leaq -0x588(%rbp), %rdi
callq 0x4cd0
jmp 0x4003
movq -0xa30(%rbp), %rdi
leaq -0x588(%rbp), %rsi
callq 0x31e0
movq %rax, -0xa38(%rbp)
jmp 0x401f
movq -0xa38(%rbp), %rdi
leaq 0xb126(%rip), %rsi      # 0xf153
callq 0x31f0
movq %rax, -0xa40(%rbp)
jmp 0x403b
movslq -0x564(%rbp), %rsi
leaq -0x560(%rbp), %rdi
callq 0x5040
movq %rax, -0xa48(%rbp)
jmp 0x4057
movq -0xa48(%rbp), %rsi
movq -0xa40(%rbp), %rdi
callq 0x31e0
movq %rax, -0xa50(%rbp)
jmp 0x4073
movq -0xa50(%rbp), %rdi
movq 0x11f37(%rip), %rsi     # 0x15fb8
callq 0x3220
jmp 0x4088
leaq -0x588(%rbp), %rdi
callq 0x3160
movl -0x564(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x564(%rbp)
jmp 0x3fa6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4233
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x588(%rbp), %rdi
callq 0x3160
jmp 0x4233
movq 0x11f03(%rip), %rdi     # 0x15fe0
leaq -0x548(%rbp), %rsi
callq 0x3150
jmp 0x40eb
xorl %eax, %eax
movl %eax, %esi
leaq -0x20(%rbp), %rdi
callq 0x4fe0
movq %rax, -0xa58(%rbp)
jmp 0x4101
movslq -0x548(%rbp), %rsi
leaq -0x560(%rbp), %rdi
callq 0x5040
movq %rax, -0xa60(%rbp)
jmp 0x411d
movq -0xa60(%rbp), %rsi
leaq -0x5b0(%rbp), %rdi
callq 0x30e0
jmp 0x4132
movq -0xa58(%rbp), %rdi
leaq -0x5b0(%rbp), %rsi
callq 0xbc20
movl %eax, -0xa64(%rbp)
jmp 0x414d
leaq -0x5b0(%rbp), %rdi
callq 0x3160
movl -0xa64(%rbp), %eax
movl %eax, -0x58c(%rbp)
movl -0x58c(%rbp), %esi
leaq -0xf8(%rbp), %rdi
callq 0xcfd0
movb %al, -0xa65(%rbp)
jmp 0x417f
movb -0xa65(%rbp), %al
testb $0x1, %al
jne 0x418b
jmp 0x41ef
movb $0x1, -0x541(%rbp)
movl -0x58c(%rbp), %edx
leaq -0x5c8(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0xd080
jmp 0x41ad
movq -0x5b8(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movups -0x5c8(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x4d0(%rbp), %rdi
callq 0xe470
jmp 0x41d3
jmp 0x4222
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x5b0(%rbp), %rdi
callq 0x3160
jmp 0x4233
movq 0x11dda(%rip), %rdi     # 0x15fd0
leaq 0xaf5d(%rip), %rsi      # 0xf15a
callq 0x31f0
movq %rax, -0xa70(%rbp)
jmp 0x420b
movq -0xa70(%rbp), %rdi
movq 0x11d9f(%rip), %rsi     # 0x15fb8
callq 0x3220
jmp 0x4220
jmp 0x4222
leaq -0x560(%rbp), %rdi
callq 0x5080
jmp 0x3f25
leaq -0x560(%rbp), %rdi
callq 0x5080
jmp 0x480f
movb $0x0, -0x5c9(%rbp)
movb -0x5c9(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x425c
jmp 0x477e
leaq -0x5f1(%rbp), %rdi
movq %rdi, -0xa78(%rbp)
callq 0x3360
movq -0xa78(%rbp), %rdx
leaq 0xb226(%rip), %rsi      # 0xf4a3
leaq -0x5f0(%rbp), %rdi
callq 0x4a30
jmp 0x428b
leaq -0x5f1(%rbp), %rdi
callq 0x3240
movq 0x11d32(%rip), %rdi     # 0x15fd0
leaq 0xaede(%rip), %rsi      # 0xf183
callq 0x31f0
movq %rax, -0xa80(%rbp)
jmp 0x42b3
movq -0xa80(%rbp), %rdi
movq 0x11cf7(%rip), %rsi     # 0x15fb8
callq 0x3220
jmp 0x42c8
movq 0x11d11(%rip), %rdi     # 0x15fe0
leaq -0x5f0(%rbp), %rsi
callq 0x3290
jmp 0x42dd
leaq -0x610(%rbp), %rdi
callq 0x4c30
movl $0x0, -0x614(%rbp)
leaq -0x680(%rbp), %rdi
callq 0xb400
jmp 0x4301
leaq -0x1c0(%rbp), %rax
movq %rax, -0x688(%rbp)
movq -0x688(%rbp), %rdi
callq 0x4e30
movq %rax, -0x690(%rbp)
movq -0x688(%rbp), %rdi
callq 0x4e60
movq %rax, -0x698(%rbp)
leaq -0x690(%rbp), %rdi
leaq -0x698(%rbp), %rsi
callq 0x4e90
testb $0x1, %al
jne 0x4351
jmp 0x4458
leaq -0x690(%rbp), %rdi
callq 0x4ed0
movq %rax, %rsi
leaq -0x700(%rbp), %rdi
callq 0x4ef0
jmp 0x436e
leaq -0x720(%rbp), %rdi
leaq -0x700(%rbp), %rsi
callq 0xb300
jmp 0x4383
leaq -0x720(%rbp), %rdi
leaq -0x5f0(%rbp), %rsi
callq 0x50e0
movb %al, -0xa81(%rbp)
leaq -0x720(%rbp), %rdi
callq 0x3160
movb -0xa81(%rbp), %al
testb $0x1, %al
jne 0x43b7
jmp 0x443b
leaq -0x610(%rbp), %rdi
leaq -0x700(%rbp), %rsi
callq 0x5170
jmp 0x43cc
jmp 0x443b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x5f1(%rbp), %rdi
callq 0x3240
jmp 0x480f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x476d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4761
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4755
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x700(%rbp), %rdi
callq 0x4df0
jmp 0x4755
leaq -0x700(%rbp), %rdi
callq 0x4df0
leaq -0x690(%rbp), %rdi
callq 0x4fa0
jmp 0x4335
leaq -0x610(%rbp), %rdi
callq 0x51e0
cmpq $0x0, %rax
je 0x46f9
movl $0x0, -0x724(%rbp)
movslq -0x724(%rbp), %rax
movq %rax, -0xa90(%rbp)
leaq -0x610(%rbp), %rdi
callq 0x51e0
movq %rax, %rcx
movq -0xa90(%rbp), %rax
cmpq %rcx, %rax
jae 0x45d2
movq 0x11b24(%rip), %rdi     # 0x15fd0
leaq 0xac99(%rip), %rsi      # 0xf14c
callq 0x31f0
movq %rax, -0xa98(%rbp)
jmp 0x44c1
movl -0x724(%rbp), %esi
leaq -0x748(%rbp), %rdi
callq 0x4cd0
jmp 0x44d5
movq -0xa98(%rbp), %rdi
leaq -0x748(%rbp), %rsi
callq 0x31e0
movq %rax, -0xaa0(%rbp)
jmp 0x44f1
movq -0xaa0(%rbp), %rdi
leaq 0xac9e(%rip), %rsi      # 0xf19d
callq 0x31f0
movq %rax, -0xaa8(%rbp)
jmp 0x450d
movslq -0x724(%rbp), %rsi
leaq -0x610(%rbp), %rdi
callq 0x5210
movq %rax, -0xab0(%rbp)
jmp 0x4529
movq -0xab0(%rbp), %rsi
leaq -0x768(%rbp), %rdi
callq 0xb600
jmp 0x453e
movq -0xaa8(%rbp), %rdi
leaq -0x768(%rbp), %rsi
callq 0x31e0
movq %rax, -0xab8(%rbp)
jmp 0x455a
movq -0xab8(%rbp), %rdi
movq 0x11a50(%rip), %rsi     # 0x15fb8
callq 0x3220
jmp 0x456f
leaq -0x768(%rbp), %rdi
callq 0x3160
leaq -0x748(%rbp), %rdi
callq 0x3160
movl -0x724(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x724(%rbp)
jmp 0x4478
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x45c1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x768(%rbp), %rdi
callq 0x3160
leaq -0x748(%rbp), %rdi
callq 0x3160
jmp 0x4755
movq 0x11a07(%rip), %rdi     # 0x15fe0
leaq -0x614(%rbp), %rsi
callq 0x3150
jmp 0x45e7
movslq -0x614(%rbp), %rsi
leaq -0x610(%rbp), %rdi
callq 0x5210
movq %rax, -0xac0(%rbp)
jmp 0x4603
movq -0xac0(%rbp), %rsi
leaq -0x680(%rbp), %rdi
callq 0x5250
jmp 0x4618
movq 0x119b1(%rip), %rdi     # 0x15fd0
leaq 0xaa20(%rip), %rsi      # 0xf046
callq 0x31f0
movq %rax, -0xac8(%rbp)
jmp 0x4634
leaq -0x788(%rbp), %rdi
leaq -0x680(%rbp), %rsi
callq 0xb600
jmp 0x4649
movq -0xac8(%rbp), %rdi
leaq -0x788(%rbp), %rsi
callq 0x31e0
movq %rax, -0xad0(%rbp)
jmp 0x4665
movq -0xad0(%rbp), %rdi
movq 0x11945(%rip), %rsi     # 0x15fb8
callq 0x3220
jmp 0x467a
leaq -0x788(%rbp), %rdi
callq 0x3160
leaq -0x7f0(%rbp), %rdi
leaq -0x680(%rbp), %rsi
callq 0x4ef0
jmp 0x469b
leaq -0x4d0(%rbp), %rdi
leaq -0x7f0(%rbp), %rsi
callq 0xe4e0
jmp 0x46b0
leaq -0x7f0(%rbp), %rdi
callq 0x4df0
movb $0x1, -0x5c9(%rbp)
jmp 0x472c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x788(%rbp), %rdi
callq 0x3160
jmp 0x4755
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x7f0(%rbp), %rdi
callq 0x4df0
jmp 0x4755
movq 0x118d0(%rip), %rdi     # 0x15fd0
leaq 0xaaa6(%rip), %rsi      # 0xf1ad
callq 0x31f0
movq %rax, -0xad8(%rbp)
jmp 0x4715
movq -0xad8(%rbp), %rdi
movq 0x11895(%rip), %rsi     # 0x15fb8
callq 0x3220
jmp 0x472a
jmp 0x472c
leaq -0x680(%rbp), %rdi
callq 0x4df0
leaq -0x610(%rbp), %rdi
callq 0x52b0
leaq -0x5f0(%rbp), %rdi
callq 0x3160
jmp 0x424b
leaq -0x680(%rbp), %rdi
callq 0x4df0
leaq -0x610(%rbp), %rdi
callq 0x52b0
leaq -0x5f0(%rbp), %rdi
callq 0x3160
jmp 0x480f
leaq -0x868(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x5310
jmp 0x4793
leaq -0x4d0(%rbp), %rdi
leaq -0x868(%rbp), %rsi
callq 0xe400
jmp 0x47a8
leaq -0x868(%rbp), %rdi
callq 0x53e0
leaq -0x4d0(%rbp), %rdi
callq 0xe2c0
jmp 0x47c2
leaq -0x3a8(%rbp), %rdi
leaq -0x4d0(%rbp), %rsi
callq 0x5430
jmp 0x47d7
leaq -0x4d0(%rbp), %rdi
callq 0x54a0
movl -0x3ac(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3ac(%rbp)
jmp 0x3c32
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x868(%rbp), %rdi
callq 0x53e0
leaq -0x4d0(%rbp), %rdi
callq 0x54a0
jmp 0x49a5
leaq -0x3a8(%rbp), %rax
movq %rax, -0x870(%rbp)
movq -0x870(%rbp), %rdi
callq 0x54e0
movq %rax, -0x878(%rbp)
movq -0x870(%rbp), %rdi
callq 0x5510
movq %rax, -0x880(%rbp)
leaq -0x878(%rbp), %rdi
leaq -0x880(%rbp), %rsi
callq 0x5540
testb $0x1, %al
jne 0x4870
jmp 0x4965
leaq -0x878(%rbp), %rdi
callq 0x5580
movq %rax, %rsi
leaq -0x9a0(%rbp), %rdi
callq 0x55a0
jmp 0x488d
movq 0x1173c(%rip), %rdi     # 0x15fd0
leaq 0xa932(%rip), %rsi      # 0xf1cd
callq 0x31f0
movq %rax, -0xae0(%rbp)
jmp 0x48a9
xorl %eax, %eax
movl %eax, %esi
leaq -0x3a8(%rbp), %rdi
callq 0x5660
movq %rax, -0xae8(%rbp)
jmp 0x48c2
movq -0xae8(%rbp), %rsi
leaq -0x9c0(%rbp), %rdi
callq 0xe770
jmp 0x48d7
movq -0xae0(%rbp), %rdi
leaq -0x9c0(%rbp), %rsi
callq 0x31e0
movq %rax, -0xaf0(%rbp)
jmp 0x48f3
movq -0xaf0(%rbp), %rdi
movq 0x116b7(%rip), %rsi     # 0x15fb8
callq 0x3220
jmp 0x4908
leaq -0x9c0(%rbp), %rdi
callq 0x3160
leaq -0x9a0(%rbp), %rdi
callq 0x54a0
leaq -0x878(%rbp), %rdi
callq 0x56a0
jmp 0x4854
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4957
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x9c0(%rbp), %rdi
callq 0x3160
leaq -0x9a0(%rbp), %rdi
callq 0x54a0
jmp 0x49a5
movl $0x0, -0x4(%rbp)
leaq -0x3a8(%rbp), %rdi
callq 0x56c0
leaq -0x1c0(%rbp), %rdi
callq 0x52b0
leaq -0xf8(%rbp), %rdi
callq 0x53e0
leaq -0x20(%rbp), %rdi
callq 0x4bd0
movl -0x4(%rbp), %eax
addq $0xb10, %rsp            # imm = 0xB10
popq %rbp
retq
leaq -0x3a8(%rbp), %rdi
callq 0x56c0
leaq -0x1c0(%rbp), %rdi
callq 0x52b0
leaq -0xf8(%rbp), %rdi
callq 0x53e0
leaq -0x20(%rbp), %rdi
callq 0x4bd0
movq -0x48(%rbp), %rdi
callq 0x3350
nopl (%rax,%rax)