// File: /workspace/github_cpp_makefile_star2_O2/kongrigoriou[P]Text-Based-RPG/src/main.cpp
// Function: main
int main(void){

    Squad team;
    Market m(&team);
    Grid grid(&m, &team);

    //Armors
    ifstream Armors;
    Armors.open("./data/Armors.txt");

    string name;
    int price, lvl, def;
    if(Armors.is_open()){
        while (Armors >> name >> price >> lvl >> def){
            m.AddArmor(name, price, lvl, def);
        }
    }else{
        cout << "File Armors could not be opened." << endl;
        return 1;
    }

    //Weapons
    ifstream Weapons;
    Weapons.open("./data/Weapons.txt");

    int dmg, hands;
    if(Weapons.is_open()){
        // cout << "-----------------------------------------------------------------------" << endl;
        while (Weapons >> name >> price >> lvl >> dmg >> hands){
            cout << name << price << endl;
            m.AddWeapon(name, price, lvl, hands, dmg);
        }
    }else{
        cout << "File Weapons could not be opened." << endl;
        return 1;
    }

    //Potions
    ifstream Potions;
    Potions.open("./data/Potions.txt");

    string buff;
    if(Potions.is_open()){
        // cout << "-----------------------------------------------------------------------" << endl;
        while (Potions >> name >> price >> lvl >> buff >> dmg){         //dmg aka buff%
            m.AddPotion(name, buff, lvl, price, dmg);
        }
    }else{
        cout << "File Potions could not be opened." << endl;
        return 1;
    }

    //Fire Spells
    ifstream FireSpells;
    FireSpells.open("./data/FireSpells.txt");

    int rounds, magic;
    if(FireSpells.is_open()){
        // cout << "-----------------------------------------------------------------------" << endl;
        while (FireSpells >> name >> price >> lvl >> magic >> dmg >> rounds){         //dmg aka buff%
            m.AddFireSpell(name, price, lvl, dmg, magic, rounds);
        }
    }else{
        cout << "File FireSpells could not be opened." << endl;
        return 1;
    }

    //Ice Spells
    ifstream IceSpells;
    IceSpells.open("./data/IceSpells.txt");

    if(IceSpells.is_open()){
        // cout << "-----------------------------------------------------------------------" << endl;
        while (IceSpells >> name >> price >> lvl >> magic >> dmg >> rounds){         //dmg aka buff%
            m.AddIceSpell(name, price, lvl, dmg, magic, rounds);
        }
    }else{
        cout << "File IceSpells could not be opened." << endl;
        return 1;
    }

    //Lighting Spells
    ifstream LightingSpells;
    LightingSpells.open("./data/LightingSpells.txt");

    if(LightingSpells.is_open()){
        // cout << "-----------------------------------------------------------------------" << endl;
        while (LightingSpells >> name >> price >> lvl >> magic >> dmg >> rounds){         //dmg aka buff%
            m.AddLightingSpell(name, price, lvl, dmg, magic, rounds);
        }
    }else{
        cout << "File LightingSpells could not be opened." << endl;
        return 1;
    }

    //Dragons
    ifstream Dragons;
    Dragons.open("./data/Dragons.txt");

    int hp, ag;
    if(Dragons.is_open()){
        // cout << "-----------------------------------------------------------------------" << endl;
        while (Dragons >> name >> hp >> dmg >> def >> ag >> lvl){
            grid.insert_Dragon(name, hp, dmg, def, ag, lvl);
            cout <<"Dragon here: " << name << endl;
            cout << "With Damage: " << dmg << endl; 
        }
    }else{
        cout << "File Dragons could not be opened." << endl;
        return 1;
    }

    //Exoskeletons
    ifstream Exoskeletons;
    Exoskeletons.open("./data/Exoskeletons.txt");

    if(Exoskeletons.is_open()){
        // cout << "-----------------------------------------------------------------------" << endl;
        while (Exoskeletons >> name >> hp >> dmg >> def >> ag >> lvl){
            grid.insert_Exoskeleton(name, hp, dmg, def, ag, lvl);
        }
    }else{
        cout << "File Exoskeletons could not be opened." << endl;
        return 1;
    }

    //Spirits
    ifstream Spirits;
    Spirits.open("./data/Spirits.txt");

    if(Spirits.is_open()){
        // cout << "-----------------------------------------------------------------------" << endl;
        while (Spirits >> name >> hp >> dmg >> def >> ag >> lvl){
            grid.insert_Spirit(name, hp, dmg, def, ag, lvl);
        }
    }else{
        cout << "File Spirits could not be opened." << endl;
        return 1;
    }

    //Warriors
    ifstream Warriors;
    Warriors.open("./data/Warriors.txt");

    int dex;
    if(Warriors.is_open()){
        // cout << "-----------------------------------------------------------------------" << endl;
        while (Warriors >> name >> hp >> magic >> dmg >> ag >> dex){
            team.insert_Warrior(name, hp, magic, dmg, ag, dex);
        }
    }else{
        cout << "File Spirits could not be opened." << endl;
        return 1;
    }

    // //Paladins
    // ifstream Paladins;
    // Paladins.open("./data/Paladins.txt");

    // if(Paladins.is_open()){
    //     cout << "-----------------------------------------------------------------------" << endl;
    //     while (Paladins >> name >> hp >> magic >> dmg >> ag >> dex){
    //         team.insert_Paladin(name, hp, magic, dmg, ag, dex);
    //     }
    // }else{
    //     cout << "File Paladins could not be opened." << endl;
    //     return 1;
    // }

    //leipoun ta arxeia gia sorcerers/paladins

    grid.gameplay();

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1798, %rsp           # imm = 0x1798
leaq -0x2d0(%rbp), %rbx
movq %rbx, %rdi
callq 0xa370
leaq -0x110(%rbp), %rdi
movq %rbx, %rsi
callq 0x6858
leaq -0x360(%rbp), %rdi
leaq -0x110(%rbp), %rsi
leaq -0x2d0(%rbp), %rdx
callq 0x80ec
leaq -0x17b0(%rbp), %rdi
callq 0x31d0
leaq 0x8ab9(%rip), %rsi      # 0xc004
leaq -0x17b0(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x3120
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x1738(%rbp), %rdi
callq 0x3050
testb %al, %al
je 0x3601
leaq -0x70(%rbp), %r14
leaq -0x30(%rbp), %r12
leaq -0x44(%rbp), %r13
leaq -0x270(%rbp), %rbx
leaq -0x110(%rbp), %r15
leaq -0x17b0(%rbp), %rdi
movq %r14, %rsi
callq 0x31f0
movq %rax, %rdi
leaq -0x34(%rbp), %rsi
callq 0x3110
movq %rax, %rdi
movq %r12, %rsi
callq 0x3110
movq %rax, %rdi
movq %r13, %rsi
callq 0x3110
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3624
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3200
movl -0x34(%rbp), %edx
movl -0x30(%rbp), %ecx
movl -0x44(%rbp), %r8d
movq %r15, %rdi
movq %rbx, %rsi
callq 0x69d0
movq %rbx, %rdi
callq 0x30e0
jmp 0x3598
movq 0xf9c8(%rip), %rdi      # 0x12fd0
leaq 0x8a07(%rip), %rsi      # 0xc016
callq 0x31a0
movq %rax, %rdi
callq 0x30f0
pushq $0x1
popq %rbx
jmp 0x4024
leaq -0x15a8(%rbp), %rdi
callq 0x31d0
leaq 0x8a00(%rip), %rsi      # 0xc037
leaq -0x15a8(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x3120
leaq -0x1530(%rbp), %rdi
callq 0x3050
testb %al, %al
je 0x3712
leaq -0x70(%rbp), %r14
leaq -0x2c(%rbp), %r13
leaq -0x50(%rbp), %rbx
leaq -0x250(%rbp), %r15
leaq -0x110(%rbp), %r12
leaq -0x15a8(%rbp), %rdi
movq %r14, %rsi
callq 0x31f0
movq %rax, %rdi
leaq -0x34(%rbp), %rsi
callq 0x3110
movq %rax, %rdi
leaq -0x30(%rbp), %rsi
callq 0x3110
movq %rax, %rdi
movq %r13, %rsi
callq 0x3110
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3110
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3735
movq 0xf90a(%rip), %rdi      # 0x12fd0
movq %r14, %rsi
callq 0x3170
movl -0x34(%rbp), %esi
movq %rax, %rdi
callq 0x3230
movq %rax, %rdi
callq 0x30f0
movq %r15, %rdi
movq %r14, %rsi
callq 0x3200
movl -0x34(%rbp), %edx
movl -0x30(%rbp), %ecx
movl -0x50(%rbp), %r8d
movl -0x2c(%rbp), %r9d
movq %r12, %rdi
movq %r15, %rsi
callq 0x692e
movq %r15, %rdi
callq 0x30e0
jmp 0x3674
movq 0xf8b7(%rip), %rdi      # 0x12fd0
leaq 0x892a(%rip), %rsi      # 0xc04a
callq 0x31a0
movq %rax, %rdi
callq 0x30f0
pushq $0x1
popq %rbx
jmp 0x4018
leaq -0x13a0(%rbp), %rdi
callq 0x31d0
leaq 0x8924(%rip), %rsi      # 0xc06c
leaq -0x13a0(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x3120
leaq -0x80(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x1328(%rbp), %rdi
callq 0x3050
testb %al, %al
je 0x382b
leaq -0x70(%rbp), %r14
leaq -0x90(%rbp), %r13
leaq -0x2c(%rbp), %rbx
leaq -0x230(%rbp), %r15
leaq -0x210(%rbp), %r12
leaq -0x13a0(%rbp), %rdi
movq %r14, %rsi
callq 0x31f0
movq %rax, %rdi
leaq -0x34(%rbp), %rsi
callq 0x3110
movq %rax, %rdi
leaq -0x30(%rbp), %rsi
callq 0x3110
movq %rax, %rdi
movq %r13, %rsi
callq 0x31f0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3110
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x384e
movq %r15, %rdi
movq %r14, %rsi
callq 0x3200
movq %r12, %rdi
movq %r13, %rsi
callq 0x3200
movl -0x30(%rbp), %ecx
movl -0x34(%rbp), %r8d
movl -0x2c(%rbp), %r9d
leaq -0x110(%rbp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x6a6e
movq %r12, %rdi
callq 0x30e0
movq %r15, %rdi
callq 0x30e0
jmp 0x3798
movq 0xf79e(%rip), %rdi      # 0x12fd0
leaq 0x8846(%rip), %rsi      # 0xc07f
callq 0x31a0
movq %rax, %rdi
callq 0x30f0
pushq $0x1
popq %rbx
jmp 0x4000
leaq -0x1198(%rbp), %rdi
callq 0x31d0
leaq 0x8840(%rip), %rsi      # 0xc0a1
leaq -0x1198(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x3120
leaq -0x1120(%rbp), %rdi
callq 0x3050
testb %al, %al
je 0x392c
leaq -0x70(%rbp), %r14
leaq -0x40(%rbp), %r13
leaq -0x2c(%rbp), %rbx
leaq -0x48(%rbp), %r15
leaq -0x1f0(%rbp), %r12
leaq -0x1198(%rbp), %rdi
movq %r14, %rsi
callq 0x31f0
movq %rax, %rdi
leaq -0x34(%rbp), %rsi
callq 0x3110
movq %rax, %rdi
leaq -0x30(%rbp), %rsi
callq 0x3110
movq %rax, %rdi
movq %r13, %rsi
callq 0x3110
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3110
movq %rax, %rdi
movq %r15, %rsi
callq 0x3110
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x394f
movq %r12, %rdi
movq %r14, %rsi
callq 0x3200
movl -0x34(%rbp), %edx
movl -0x30(%rbp), %ecx
movl -0x2c(%rbp), %r8d
movl -0x40(%rbp), %r9d
movl -0x48(%rbp), %eax
movl %eax, (%rsp)
leaq -0x110(%rbp), %rdi
movq %r12, %rsi
callq 0x6be8
movq %r12, %rdi
callq 0x30e0
jmp 0x389b
movq 0xf69d(%rip), %rdi      # 0x12fd0
leaq 0x877d(%rip), %rsi      # 0xc0b7
callq 0x31a0
movq %rax, %rdi
callq 0x30f0
pushq $0x1
popq %rbx
jmp 0x3ff4
leaq -0xf90(%rbp), %rdi
callq 0x31d0
leaq 0x877a(%rip), %rsi      # 0xc0dc
leaq -0xf90(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x3120
leaq -0xf18(%rbp), %rdi
callq 0x3050
testb %al, %al
je 0x3a2d
leaq -0x70(%rbp), %r14
leaq -0x40(%rbp), %r13
leaq -0x2c(%rbp), %rbx
leaq -0x48(%rbp), %r15
leaq -0x1d0(%rbp), %r12
leaq -0xf90(%rbp), %rdi
movq %r14, %rsi
callq 0x31f0
movq %rax, %rdi
leaq -0x34(%rbp), %rsi
callq 0x3110
movq %rax, %rdi
leaq -0x30(%rbp), %rsi
callq 0x3110
movq %rax, %rdi
movq %r13, %rsi
callq 0x3110
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3110
movq %rax, %rdi
movq %r15, %rsi
callq 0x3110
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3a50
movq %r12, %rdi
movq %r14, %rsi
callq 0x3200
movl -0x34(%rbp), %edx
movl -0x30(%rbp), %ecx
movl -0x2c(%rbp), %r8d
movl -0x40(%rbp), %r9d
movl -0x48(%rbp), %eax
movl %eax, (%rsp)
leaq -0x110(%rbp), %rdi
movq %r12, %rsi
callq 0x6b3c
movq %r12, %rdi
callq 0x30e0
jmp 0x399c
movq 0xf59c(%rip), %rdi      # 0x12fd0
leaq 0x86b6(%rip), %rsi      # 0xc0f1
callq 0x31a0
movq %rax, %rdi
callq 0x30f0
pushq $0x1
popq %rbx
jmp 0x3fe8
leaq -0xd88(%rbp), %rdi
callq 0x31d0
leaq 0x86b2(%rip), %rsi      # 0xc115
leaq -0xd88(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x3120
leaq -0xd10(%rbp), %rdi
callq 0x3050
testb %al, %al
je 0x3b2e
leaq -0x70(%rbp), %r14
leaq -0x40(%rbp), %r13
leaq -0x2c(%rbp), %rbx
leaq -0x48(%rbp), %r15
leaq -0x1b0(%rbp), %r12
leaq -0xd88(%rbp), %rdi
movq %r14, %rsi
callq 0x31f0
movq %rax, %rdi
leaq -0x34(%rbp), %rsi
callq 0x3110
movq %rax, %rdi
leaq -0x30(%rbp), %rsi
callq 0x3110
movq %rax, %rdi
movq %r13, %rsi
callq 0x3110
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3110
movq %rax, %rdi
movq %r15, %rsi
callq 0x3110
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3b51
movq %r12, %rdi
movq %r14, %rsi
callq 0x3200
movl -0x34(%rbp), %edx
movl -0x30(%rbp), %ecx
movl -0x2c(%rbp), %r8d
movl -0x40(%rbp), %r9d
movl -0x48(%rbp), %eax
movl %eax, (%rsp)
leaq -0x110(%rbp), %rdi
movq %r12, %rsi
callq 0x6c94
movq %r12, %rdi
callq 0x30e0
jmp 0x3a9d
movq 0xf49b(%rip), %rdi      # 0x12fd0
leaq 0x85f3(%rip), %rsi      # 0xc12f
callq 0x31a0
movq %rax, %rdi
callq 0x30f0
pushq $0x1
popq %rbx
jmp 0x3fdc
leaq -0xb80(%rbp), %rdi
callq 0x31d0
leaq 0x85f4(%rip), %rsi      # 0xc158
leaq -0xb80(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x3120
leaq -0xb08(%rbp), %rdi
callq 0x3050
testb %al, %al
je 0x3c7b
leaq -0x70(%rbp), %r14
leaq -0x30(%rbp), %r15
leaq -0x190(%rbp), %r12
movq 0xf433(%rip), %r13      # 0x12fd0
leaq 0x85d5(%rip), %rbx      # 0xc179
leaq -0xb80(%rbp), %rdi
movq %r14, %rsi
callq 0x31f0
movq %rax, %rdi
leaq -0x3c(%rbp), %rsi
callq 0x3110
movq %rax, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x3110
movq %rax, %rdi
leaq -0x44(%rbp), %rsi
callq 0x3110
movq %rax, %rdi
leaq -0x38(%rbp), %rsi
callq 0x3110
movq %rax, %rdi
movq %r15, %rsi
callq 0x3110
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3c9e
movq %r12, %rdi
movq %r14, %rsi
callq 0x3200
movl -0x3c(%rbp), %edx
movl -0x2c(%rbp), %ecx
movl -0x44(%rbp), %r8d
movl -0x38(%rbp), %r9d
movl -0x30(%rbp), %eax
movl %eax, (%rsp)
leaq -0x360(%rbp), %rdi
movq %r12, %rsi
callq 0x8488
movq %r12, %rdi
callq 0x30e0
movq %r13, %rdi
leaq 0x852b(%rip), %rsi      # 0xc16b
callq 0x31a0
movq %rax, %rdi
movq %r14, %rsi
callq 0x3170
movq %rax, %rdi
callq 0x30f0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x31a0
movl -0x2c(%rbp), %esi
movq %rax, %rdi
callq 0x3230
movq %rax, %rdi
callq 0x30f0
jmp 0x3ba4
movq 0xf34e(%rip), %rdi      # 0x12fd0
leaq 0x84fe(%rip), %rsi      # 0xc187
callq 0x31a0
movq %rax, %rdi
callq 0x30f0
pushq $0x1
popq %rbx
jmp 0x3fd0
leaq -0x978(%rbp), %rdi
callq 0x31d0
leaq 0x84f8(%rip), %rsi      # 0xc1a9
leaq -0x978(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x3120
leaq -0x900(%rbp), %rdi
callq 0x3050
testb %al, %al
je 0x3d7c
leaq -0x70(%rbp), %r14
leaq -0x44(%rbp), %r13
leaq -0x38(%rbp), %rbx
leaq -0x30(%rbp), %r15
leaq -0x170(%rbp), %r12
leaq -0x978(%rbp), %rdi
movq %r14, %rsi
callq 0x31f0
movq %rax, %rdi
leaq -0x3c(%rbp), %rsi
callq 0x3110
movq %rax, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x3110
movq %rax, %rdi
movq %r13, %rsi
callq 0x3110
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3110
movq %rax, %rdi
movq %r15, %rsi
callq 0x3110
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3d9f
movq %r12, %rdi
movq %r14, %rsi
callq 0x3200
movl -0x3c(%rbp), %edx
movl -0x2c(%rbp), %ecx
movl -0x44(%rbp), %r8d
movl -0x38(%rbp), %r9d
movl -0x30(%rbp), %eax
movl %eax, (%rsp)
leaq -0x360(%rbp), %rdi
movq %r12, %rsi
callq 0x8530
movq %r12, %rdi
callq 0x30e0
jmp 0x3ceb
movq 0xf24d(%rip), %rdi      # 0x12fd0
leaq 0x8437(%rip), %rsi      # 0xc1c1
callq 0x31a0
movq %rax, %rdi
callq 0x30f0
pushq $0x1
popq %rbx
jmp 0x3fc4
leaq -0x770(%rbp), %rdi
callq 0x31d0
leaq 0x8436(%rip), %rsi      # 0xc1e8
leaq -0x770(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x3120
leaq -0x6f8(%rbp), %rdi
callq 0x3050
testb %al, %al
je 0x3e7d
leaq -0x70(%rbp), %r14
leaq -0x44(%rbp), %r13
leaq -0x38(%rbp), %rbx
leaq -0x30(%rbp), %r15
leaq -0x150(%rbp), %r12
leaq -0x770(%rbp), %rdi
movq %r14, %rsi
callq 0x31f0
movq %rax, %rdi
leaq -0x3c(%rbp), %rsi
callq 0x3110
movq %rax, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x3110
movq %rax, %rdi
movq %r13, %rsi
callq 0x3110
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3110
movq %rax, %rdi
movq %r15, %rsi
callq 0x3110
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3ea0
movq %r12, %rdi
movq %r14, %rsi
callq 0x3200
movl -0x3c(%rbp), %edx
movl -0x2c(%rbp), %ecx
movl -0x44(%rbp), %r8d
movl -0x38(%rbp), %r9d
movl -0x30(%rbp), %eax
movl %eax, (%rsp)
leaq -0x360(%rbp), %rdi
movq %r12, %rsi
callq 0x85d8
movq %r12, %rdi
callq 0x30e0
jmp 0x3dec
movq 0xf14c(%rip), %rdi      # 0x12fd0
leaq 0x8370(%rip), %rsi      # 0xc1fb
callq 0x31a0
movq %rax, %rdi
callq 0x30f0
pushq $0x1
popq %rbx
jmp 0x3fb8
leaq -0x568(%rbp), %rdi
callq 0x31d0
leaq 0x836a(%rip), %rsi      # 0xc21d
leaq -0x568(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x3120
leaq -0x4f0(%rbp), %rdi
callq 0x3050
testb %al, %al
je 0x3f7e
leaq -0x70(%rbp), %r14
leaq -0x2c(%rbp), %r13
leaq -0x38(%rbp), %rbx
leaq -0x4c(%rbp), %r15
leaq -0x130(%rbp), %r12
leaq -0x568(%rbp), %rdi
movq %r14, %rsi
callq 0x31f0
movq %rax, %rdi
leaq -0x3c(%rbp), %rsi
callq 0x3110
movq %rax, %rdi
leaq -0x40(%rbp), %rsi
callq 0x3110
movq %rax, %rdi
movq %r13, %rsi
callq 0x3110
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3110
movq %rax, %rdi
movq %r15, %rsi
callq 0x3110
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3f9e
movq %r12, %rdi
movq %r14, %rsi
callq 0x3200
movl -0x3c(%rbp), %edx
movl -0x40(%rbp), %ecx
movl -0x2c(%rbp), %r8d
movl -0x38(%rbp), %r9d
movl -0x4c(%rbp), %eax
movl %eax, (%rsp)
leaq -0x2d0(%rbp), %rdi
movq %r12, %rsi
callq 0xa416
movq %r12, %rdi
callq 0x30e0
jmp 0x3eed
movq 0xf04b(%rip), %rdi      # 0x12fd0
leaq 0x826f(%rip), %rsi      # 0xc1fb
callq 0x31a0
movq %rax, %rdi
callq 0x30f0
pushq $0x1
popq %rbx
jmp 0x3fac
xorl %ebx, %ebx
leaq -0x360(%rbp), %rdi
callq 0x8f7e
leaq -0x568(%rbp), %rdi
callq 0x3060
leaq -0x770(%rbp), %rdi
callq 0x3060
leaq -0x978(%rbp), %rdi
callq 0x3060
leaq -0xb80(%rbp), %rdi
callq 0x3060
leaq -0xd88(%rbp), %rdi
callq 0x3060
leaq -0xf90(%rbp), %rdi
callq 0x3060
leaq -0x1198(%rbp), %rdi
callq 0x3060
leaq -0x90(%rbp), %rdi
callq 0x30e0
leaq -0x13a0(%rbp), %rdi
callq 0x3060
leaq -0x15a8(%rbp), %rdi
callq 0x3060
leaq -0x70(%rbp), %rdi
callq 0x30e0
leaq -0x17b0(%rbp), %rdi
callq 0x3060
leaq -0x360(%rbp), %rdi
callq 0x99f6
leaq -0x110(%rbp), %rdi
callq 0x68b2
leaq -0x2d0(%rbp), %rdi
callq 0xa3b6
movl %ebx, %eax
addq $0x1798, %rsp           # imm = 0x1798
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x40f6
jmp 0x412d
jmp 0x40f6
jmp 0x415e
jmp 0x412d
jmp 0x41b6
jmp 0x415e
jmp 0x41b6
jmp 0x41b6
jmp 0x41c7
movq %rax, %rbx
leaq -0x130(%rbp), %rdi
callq 0x30e0
jmp 0x40f9
jmp 0x41fa
movq %rax, %rbx
leaq -0x150(%rbp), %rdi
callq 0x30e0
jmp 0x4130
jmp 0x41c7
jmp 0x421c
movq %rax, %rbx
leaq -0x170(%rbp), %rdi
callq 0x30e0
jmp 0x4161
jmp 0x41fa
jmp 0x421c
jmp 0x421c
jmp 0x423e
movq %rax, %rbx
leaq -0x568(%rbp), %rdi
callq 0x3060
jmp 0x4130
movq %rax, %rbx
leaq -0x190(%rbp), %rdi
callq 0x30e0
jmp 0x41b9
jmp 0x423e
movq %rax, %rbx
jmp 0x424d
jmp 0x425b
movq %rax, %rbx
leaq -0x770(%rbp), %rdi
callq 0x3060
jmp 0x4161
movq %rax, %rbx
leaq -0x1b0(%rbp), %rdi
callq 0x30e0
jmp 0x41ca
jmp 0x425b
jmp 0x425b
jmp 0x426c
movq %rax, %rbx
leaq -0x978(%rbp), %rdi
callq 0x3060
jmp 0x41b9
movq %rax, %rbx
leaq -0x1d0(%rbp), %rdi
callq 0x30e0
jmp 0x41fd
jmp 0x426c
movq %rax, %rbx
jmp 0x4278
movq %rax, %rbx
jmp 0x4284
movq %rax, %rbx
jmp 0x4290
movq %rax, %rbx
jmp 0x429c
movq %rax, %rbx
leaq -0x1f0(%rbp), %rdi
callq 0x30e0
jmp 0x421f
movq %rax, %rbx
leaq -0xb80(%rbp), %rdi
callq 0x3060
jmp 0x41ca
movq %rax, %rbx
leaq -0xd88(%rbp), %rdi
callq 0x3060
jmp 0x41fd
movq %rax, %rbx
leaq -0x210(%rbp), %rdi
callq 0x30e0
jmp 0x41ec
movq %rax, %rbx
leaq -0x230(%rbp), %rdi
callq 0x30e0
jmp 0x4241
movq %rax, %rbx
leaq -0xf90(%rbp), %rdi
callq 0x3060
jmp 0x421f
movq %rax, %rbx
leaq -0x250(%rbp), %rdi
callq 0x30e0
jmp 0x425e
movq %rax, %rbx
leaq -0x1198(%rbp), %rdi
callq 0x3060
jmp 0x4241
movq %rax, %rbx
leaq -0x270(%rbp), %rdi
callq 0x30e0
jmp 0x426f
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x30e0
leaq -0x13a0(%rbp), %rdi
callq 0x3060
jmp 0x425e
movq %rax, %rbx
leaq -0x15a8(%rbp), %rdi
callq 0x3060
jmp 0x426f
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x30e0
leaq -0x17b0(%rbp), %rdi
callq 0x3060
leaq -0x360(%rbp), %rdi
callq 0x99f6
leaq -0x110(%rbp), %rdi
callq 0x68b2
leaq -0x2d0(%rbp), %rdi
callq 0xa3b6
movq %rbx, %rdi
callq 0x3240