// File: kongrigoriou[P]Text-Based-RPG/src/Grid.cpp
// Function: Grid::gameplay()
void Grid::gameplay(){
    cout << "Welcome to our game!" << endl;
    cout << "Choose heroes for your team! You can pick up to 3 heroes" << endl;

    int flag = 0;
    int BattleFlag = 0;
    int possibility;
    string input;
    while(flag == 0){
        cout << "1: to check the available heroes" << "\n" 
        << "2: if you are ready!" << "\n"
        << "if you have dicided the hero you want just write their name and he/she will be added to your squad!" << endl;
        
        cout << "3: to display your team" << endl;
        cin >> input;
        if(input == "1")
            team->display_allHeroes();
        else if(input == "3")
            team->display_myHeroes();
        else if (input == "2"){
            if(team->get_count() == 0){
                cout << "Your team is empty! You are not ready yet." << endl;
            }else{
                flag = 1;
            }
        }else if(team->search_Hero(input)){
            if(team->get_count() < 3){
                team->select_hero(input);
            }else{
                flag = 1;
            }
        }else{
            cout << "Wrong input. Try again" << endl;
        }
    }

    Map[x][y] = 3;
    display_Map();

    cout << "When you are in a common/market square you can use these commands: \n"
        << "stats: to check a hero's stats\n"
        << "inv: to ckeck a hero's inventory\n"
        << "equip: to equip a Weapon/Armor\n"
        << "use: to use a potion" << endl; 

    int play = 0;
    int monsterlvl = 0;
    list <Hero*> temp;

    display_generalinfo();
    while(play == 0){
        list <Hero*>::iterator it;
        list <Monster*>::iterator mit;
        Hero* he;
        cin >> input;
        if(input == "q" || input == "Q"){
            play = 1;
        }else {
            if(input == "W" || input == "w"){
                move_up();
                BattleFlag = 1;
            }else if(input == "A" || input == "a"){
                move_left();
                BattleFlag = 1;
            }else if(input == "S" || input == "s"){
                move_down();
                BattleFlag = 1;
            }else if(input == "D" || input == "d"){
                move_right();
                BattleFlag = 1;
            }else if(input == "stats"){
                cout << "Whose stats do you want to display?\n"
                    << "Enter the hero's name" << endl;
                cin >> input;
                he = team->search_Hero(input);
                while(he == NULL){
                    cin >> input;
                    he = team->search_Hero(input);
                }
                he->display_stats();
            }else if(input == "inv"){
                cout << "Whose inventory do you want  to display? \n"
                    << "Enter the hero's name" << endl;
                cin >> input;
                he = team->search_Hero(input);
                while(he == NULL){
                    cin >> input;
                    he = team->search_Hero(input);
                }
                he->display_inventory();
            }else if(input == "equip"){
                cout << "Do you want to equip a Weapon or an Armor? \n"
                    << "Reply with weapon/armor" << endl;
                cin >> input;

                if(input == "weapon"){
                    cout << "Type the name of the weapon you want to equip\n"
                        << "To display the available weapons type 'display' " << endl;
                    cin >> input;
                    if(input == "display"){
                        he->display_Weapons();
                    }else{
                        he->equip_weapon(input);
                    }
                }else if(input == "armor"){
                    cout << "Type the name of the armor you want to equip\n"
                        << "To display the available armors type 'display' " << endl;
                    cin >> input;
                    if(input == "display"){
                        he->display_Armors();
                    }else{
                        he->equip_armor(input);
                    }
                }
            }else if(input == "use"){
                cout << "Type the name of the potion you want to use\n"
                    << "To display the available potions type 'display'" << endl;
                cin >> input;
                if(input == "display"){
                    he->display_Potions();
                }else{
                    he->usePotion(input);
                }
            }
            display_Map();
        }

        possibility = rand()%100;

        if(possibility < 20 && pt == 1 && BattleFlag == 1 && input != "use" && input != "stats" && input != "equip" && input != "inv"){

            cout << "Possibility: "<< possibility << endl;
            temp = team->get_HeroList();
            for(it = temp.begin(); it != temp.end(); ++it){
                monsterlvl += (*it)->get_level();
                cout << (*it)->get_name() << endl;
            }
            monsterlvl = monsterlvl/3;
            get_monsters(monsterlvl);

            this->enter_battle();

        }else if(pt == 2){
            cout << "There's a Market near you, would you like to visit?" << endl;
            cout << "Reply with yes/no" << endl;
            int flag = 0;
            cin >> input;
            while(flag == 0){
                if(input == "yes"){            
                while (flag == 0){
                
                    market->EnterMarket();
                    cout << "Woould you like to leave the Market?" << endl;
                    cin >> input;
                    if(input == "yes")
                        flag = 1;
                }
                }else if (input == "no"){
                    flag = 1;
                }else{
                    cout << "Wrong input try again" << endl;
                    cin >> input;
                }
            }
            display_Map();
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3f0, %rsp            # imm = 0x3F0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1f8(%rbp)
movq 0xec4f(%rip), %rdi      # 0x1efd0
leaq 0x5a18(%rip), %rsi      # 0x15da0
callq 0x31e0
movq %rax, %rdi
movq 0xec29(%rip), %rsi      # 0x1efc0
callq 0x3210
movq 0xec2d(%rip), %rdi      # 0x1efd0
leaq 0x5a0b(%rip), %rsi      # 0x15db5
callq 0x31e0
movq %rax, %rdi
movq 0xec07(%rip), %rsi      # 0x1efc0
callq 0x3210
movl $0x0, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x32c0
cmpl $0x0, -0xc(%rbp)
jne 0x1070c
movq 0xebea(%rip), %rdi      # 0x1efd0
leaq 0x5a01(%rip), %rsi      # 0x15dee
callq 0x31e0
movq %rax, -0x200(%rbp)
jmp 0x103fb
movq -0x200(%rbp), %rdi
leaq 0x5b05(%rip), %rsi      # 0x15f0e
callq 0x31e0
movq %rax, -0x208(%rbp)
jmp 0x10417
movq -0x208(%rbp), %rdi
leaq 0x59ea(%rip), %rsi      # 0x15e0f
callq 0x31e0
movq %rax, -0x210(%rbp)
jmp 0x10433
movq -0x210(%rbp), %rdi
leaq 0x5acd(%rip), %rsi      # 0x15f0e
callq 0x31e0
movq %rax, -0x218(%rbp)
jmp 0x1044f
movq -0x218(%rbp), %rdi
leaq 0x59c7(%rip), %rsi      # 0x15e24
callq 0x31e0
movq %rax, -0x220(%rbp)
jmp 0x1046b
movq -0x220(%rbp), %rdi
movq 0xeb47(%rip), %rsi      # 0x1efc0
callq 0x3210
jmp 0x10480
movq 0xeb49(%rip), %rdi      # 0x1efd0
leaq 0x59fa(%rip), %rsi      # 0x15e88
callq 0x31e0
movq %rax, -0x228(%rbp)
jmp 0x1049c
movq -0x228(%rbp), %rdi
movq 0xeb16(%rip), %rsi      # 0x1efc0
callq 0x3210
jmp 0x104b1
movq 0xeb28(%rip), %rdi      # 0x1efe0
leaq -0x38(%rbp), %rsi
callq 0x32a0
jmp 0x104c3
leaq 0x51f5(%rip), %rsi      # 0x156bf
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x229(%rbp)
jmp 0x104db
movb -0x229(%rbp), %al
testb $0x1, %al
jne 0x104e7
jmp 0x1050f
movq -0x1f8(%rbp), %rax
movq 0x70(%rax), %rdi
callq 0x131d0
jmp 0x104f9
jmp 0x10707
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x11640
leaq 0x524e(%rip), %rsi      # 0x15764
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x22a(%rbp)
jmp 0x10527
movb -0x22a(%rbp), %al
testb $0x1, %al
jne 0x10533
jmp 0x1054a
movq -0x1f8(%rbp), %rax
movq 0x70(%rax), %rdi
callq 0x139c0
jmp 0x10545
jmp 0x10705
leaq 0x5170(%rip), %rsi      # 0x156c1
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x22b(%rbp)
jmp 0x10562
movb -0x22b(%rbp), %al
testb $0x1, %al
jne 0x1056e
jmp 0x105d0
movq -0x1f8(%rbp), %rax
movq 0x70(%rax), %rdi
callq 0x14080
movl %eax, -0x230(%rbp)
jmp 0x10586
movl -0x230(%rbp), %eax
cmpl $0x0, %eax
jne 0x105c4
movq 0xea38(%rip), %rdi      # 0x1efd0
leaq 0x5901(%rip), %rsi      # 0x15ea0
callq 0x31e0
movq %rax, -0x238(%rbp)
jmp 0x105ad
movq -0x238(%rbp), %rdi
movq 0xea05(%rip), %rsi      # 0x1efc0
callq 0x3210
jmp 0x105c2
jmp 0x105cb
movl $0x1, -0xc(%rbp)
jmp 0x10703
movq -0x1f8(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x240(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x30c0
jmp 0x105f1
movq -0x240(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x13db0
movq %rax, -0x248(%rbp)
jmp 0x1060a
leaq -0x68(%rbp), %rdi
callq 0x3120
movq -0x248(%rbp), %rax
cmpq $0x0, %rax
je 0x106ce
movq -0x1f8(%rbp), %rax
movq 0x70(%rax), %rdi
callq 0x14080
movl %eax, -0x24c(%rbp)
jmp 0x1063c
movl -0x24c(%rbp), %eax
cmpl $0x3, %eax
jge 0x106c5
movq -0x1f8(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x258(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x30c0
jmp 0x1066b
movq -0x258(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x13c20
jmp 0x10680
leaq -0x88(%rbp), %rdi
callq 0x3120
jmp 0x106cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x3120
jmp 0x11640
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x3120
jmp 0x11640
movl $0x1, -0xc(%rbp)
jmp 0x10701
movq 0xe8fb(%rip), %rdi      # 0x1efd0
leaq 0x54bf(%rip), %rsi      # 0x15b9b
callq 0x31e0
movq %rax, -0x260(%rbp)
jmp 0x106ea
movq -0x260(%rbp), %rdi
movq 0xe8c8(%rip), %rsi      # 0x1efc0
callq 0x3210
jmp 0x106ff
jmp 0x10701
jmp 0x10703
jmp 0x10705
jmp 0x10707
jmp 0x103d5
movq -0x1f8(%rbp), %rdi
movq 0x60(%rdi), %rax
movslq 0x78(%rdi), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x7c(%rdi), %rcx
movl $0x3, (%rax,%rcx,4)
callq 0xf650
jmp 0x10731
movq 0xe898(%rip), %rdi      # 0x1efd0
leaq 0x578c(%rip), %rsi      # 0x15ecb
callq 0x31e0
movq %rax, -0x268(%rbp)
jmp 0x1074d
movq -0x268(%rbp), %rdi
leaq 0x57b5(%rip), %rsi      # 0x15f10
callq 0x31e0
movq %rax, -0x270(%rbp)
jmp 0x10769
movq -0x270(%rbp), %rdi
leaq 0x57b9(%rip), %rsi      # 0x15f30
callq 0x31e0
movq %rax, -0x278(%rbp)
jmp 0x10785
movq -0x278(%rbp), %rdi
leaq 0x57bf(%rip), %rsi      # 0x15f52
callq 0x31e0
movq %rax, -0x280(%rbp)
jmp 0x107a1
movq -0x280(%rbp), %rdi
leaq 0x57c3(%rip), %rsi      # 0x15f72
callq 0x31e0
movq %rax, -0x288(%rbp)
jmp 0x107bd
movq -0x288(%rbp), %rdi
movq 0xe7f5(%rip), %rsi      # 0x1efc0
callq 0x3210
jmp 0x107d2
movl $0x0, -0x8c(%rbp)
movl $0x0, -0x90(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0xde70
movq -0x1f8(%rbp), %rdi
callq 0xf240
jmp 0x10800
jmp 0x10802
cmpl $0x0, -0x8c(%rbp)
jne 0x11616
leaq -0xb0(%rbp), %rdi
callq 0xde50
leaq -0xb8(%rbp), %rdi
callq 0x117a0
movq 0xe7b2(%rip), %rdi      # 0x1efe0
leaq -0x38(%rbp), %rsi
callq 0x32a0
jmp 0x10839
leaq 0x52af(%rip), %rsi      # 0x15aef
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x289(%rbp)
jmp 0x10851
movb -0x289(%rbp), %al
testb $0x1, %al
jne 0x10881
jmp 0x1085d
leaq 0x5723(%rip), %rsi      # 0x15f87
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x28a(%rbp)
jmp 0x10875
movb -0x28a(%rbp), %al
testb $0x1, %al
jne 0x10881
jmp 0x108a1
movl $0x1, -0x8c(%rbp)
jmp 0x1117d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x11634
leaq 0x56e1(%rip), %rsi      # 0x15f89
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x28b(%rbp)
jmp 0x108b9
movb -0x28b(%rbp), %al
testb $0x1, %al
jne 0x108e9
jmp 0x108c5
leaq 0x56bf(%rip), %rsi      # 0x15f8b
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x28c(%rbp)
jmp 0x108dd
movb -0x28c(%rbp), %al
testb $0x1, %al
jne 0x108e9
jmp 0x10903
movq -0x1f8(%rbp), %rdi
callq 0xeb20
jmp 0x108f7
movl $0x1, -0x10(%rbp)
jmp 0x1116d
leaq 0x5683(%rip), %rsi      # 0x15f8d
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x28d(%rbp)
jmp 0x1091b
movb -0x28d(%rbp), %al
testb $0x1, %al
jne 0x1094b
jmp 0x10927
leaq 0x5661(%rip), %rsi      # 0x15f8f
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x28e(%rbp)
jmp 0x1093f
movb -0x28e(%rbp), %al
testb $0x1, %al
jne 0x1094b
jmp 0x10965
movq -0x1f8(%rbp), %rdi
callq 0xed40
jmp 0x10959
movl $0x1, -0x10(%rbp)
jmp 0x1116b
leaq 0x5625(%rip), %rsi      # 0x15f91
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x28f(%rbp)
jmp 0x1097d
movb -0x28f(%rbp), %al
testb $0x1, %al
jne 0x109ad
jmp 0x10989
leaq 0x5087(%rip), %rsi      # 0x15a17
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x290(%rbp)
jmp 0x109a1
movb -0x290(%rbp), %al
testb $0x1, %al
jne 0x109ad
jmp 0x109c7
movq -0x1f8(%rbp), %rdi
callq 0xec20
jmp 0x109bb
movl $0x1, -0x10(%rbp)
jmp 0x11169
leaq 0x55c5(%rip), %rsi      # 0x15f93
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x291(%rbp)
jmp 0x109df
movb -0x291(%rbp), %al
testb $0x1, %al
jne 0x10a0f
jmp 0x109eb
leaq 0x4b95(%rip), %rsi      # 0x15587
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x292(%rbp)
jmp 0x10a03
movb -0x292(%rbp), %al
testb $0x1, %al
jne 0x10a0f
jmp 0x10a29
movq -0x1f8(%rbp), %rdi
callq 0xee40
jmp 0x10a1d
movl $0x1, -0x10(%rbp)
jmp 0x11167
leaq 0x5565(%rip), %rsi      # 0x15f95
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x293(%rbp)
jmp 0x10a41
movb -0x293(%rbp), %al
testb $0x1, %al
jne 0x10a50
jmp 0x10bd2
movq 0xe579(%rip), %rdi      # 0x1efd0
leaq 0x553d(%rip), %rsi      # 0x15f9b
callq 0x31e0
movq %rax, -0x2a0(%rbp)
jmp 0x10a6c
movq -0x2a0(%rbp), %rdi
leaq 0x5546(%rip), %rsi      # 0x15fc0
callq 0x31e0
movq %rax, -0x2a8(%rbp)
jmp 0x10a88
movq -0x2a8(%rbp), %rdi
movq 0xe52a(%rip), %rsi      # 0x1efc0
callq 0x3210
jmp 0x10a9d
movq 0xe53c(%rip), %rdi      # 0x1efe0
leaq -0x38(%rbp), %rsi
callq 0x32a0
jmp 0x10aaf
movq -0x1f8(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x2b0(%rbp)
leaq -0xe0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x30c0
jmp 0x10ad3
movq -0x2b0(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x13db0
movq %rax, -0x2b8(%rbp)
jmp 0x10aef
movq -0x2b8(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x3120
cmpq $0x0, -0xc0(%rbp)
jne 0x10bbf
movq 0xe4c2(%rip), %rdi      # 0x1efe0
leaq -0x38(%rbp), %rsi
callq 0x32a0
jmp 0x10b29
movq -0x1f8(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x2c0(%rbp)
leaq -0x100(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x30c0
jmp 0x10b4d
movq -0x2c0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x13db0
movq %rax, -0x2c8(%rbp)
jmp 0x10b69
movq -0x2c8(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x3120
jmp 0x10b09
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x3120
jmp 0x11634
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x3120
jmp 0x11634
movq -0xc0(%rbp), %rdi
callq 0x5e60
jmp 0x10bcd
jmp 0x11165
leaq 0x53fd(%rip), %rsi      # 0x15fd6
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x2c9(%rbp)
jmp 0x10bea
movb -0x2c9(%rbp), %al
testb $0x1, %al
jne 0x10bf9
jmp 0x10d7b
movq 0xe3d0(%rip), %rdi      # 0x1efd0
leaq 0x53d3(%rip), %rsi      # 0x15fda
callq 0x31e0
movq %rax, -0x2d8(%rbp)
jmp 0x10c15
movq -0x2d8(%rbp), %rdi
leaq 0x539d(%rip), %rsi      # 0x15fc0
callq 0x31e0
movq %rax, -0x2e0(%rbp)
jmp 0x10c31
movq -0x2e0(%rbp), %rdi
movq 0xe381(%rip), %rsi      # 0x1efc0
callq 0x3210
jmp 0x10c46
movq 0xe393(%rip), %rdi      # 0x1efe0
leaq -0x38(%rbp), %rsi
callq 0x32a0
jmp 0x10c58
movq -0x1f8(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x2e8(%rbp)
leaq -0x120(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x30c0
jmp 0x10c7c
movq -0x2e8(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x13db0
movq %rax, -0x2f0(%rbp)
jmp 0x10c98
movq -0x2f0(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x3120
cmpq $0x0, -0xc0(%rbp)
jne 0x10d68
movq 0xe319(%rip), %rdi      # 0x1efe0
leaq -0x38(%rbp), %rsi
callq 0x32a0
jmp 0x10cd2
movq -0x1f8(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x2f8(%rbp)
leaq -0x140(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x30c0
jmp 0x10cf6
movq -0x2f8(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x13db0
movq %rax, -0x300(%rbp)
jmp 0x10d12
movq -0x300(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x3120
jmp 0x10cb2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x3120
jmp 0x11634
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x3120
jmp 0x11634
movq -0xc0(%rbp), %rdi
callq 0x59e0
jmp 0x10d76
jmp 0x11163
leaq 0x4e72(%rip), %rsi      # 0x15bf4
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x301(%rbp)
jmp 0x10d93
movb -0x301(%rbp), %al
testb $0x1, %al
jne 0x10da2
jmp 0x11043
movq 0xe227(%rip), %rdi      # 0x1efd0
leaq 0x4e4a(%rip), %rsi      # 0x15bfa
callq 0x31e0
movq %rax, -0x310(%rbp)
jmp 0x10dbe
movq -0x310(%rbp), %rdi
leaq 0x4e5b(%rip), %rsi      # 0x15c27
callq 0x31e0
movq %rax, -0x318(%rbp)
jmp 0x10dda
movq -0x318(%rbp), %rdi
movq 0xe1d8(%rip), %rsi      # 0x1efc0
callq 0x3210
jmp 0x10def
movq 0xe1ea(%rip), %rdi      # 0x1efe0
leaq -0x38(%rbp), %rsi
callq 0x32a0
jmp 0x10e01
leaq 0x4e37(%rip), %rsi      # 0x15c3f
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x319(%rbp)
jmp 0x10e19
movb -0x319(%rbp), %al
testb $0x1, %al
jne 0x10e28
jmp 0x10f20
movq 0xe1a1(%rip), %rdi      # 0x1efd0
leaq 0x4e10(%rip), %rsi      # 0x15c46
callq 0x31e0
movq %rax, -0x328(%rbp)
jmp 0x10e44
movq -0x328(%rbp), %rdi
leaq 0x4e23(%rip), %rsi      # 0x15c75
callq 0x31e0
movq %rax, -0x330(%rbp)
jmp 0x10e60
movq -0x330(%rbp), %rdi
movq 0xe152(%rip), %rsi      # 0x1efc0
callq 0x3210
jmp 0x10e75
movq 0xe164(%rip), %rdi      # 0x1efe0
leaq -0x38(%rbp), %rsi
callq 0x32a0
jmp 0x10e87
leaq 0x4e18(%rip), %rsi      # 0x15ca6
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x331(%rbp)
jmp 0x10e9f
movb -0x331(%rbp), %al
testb $0x1, %al
jne 0x10eab
jmp 0x10ebb
movq -0xc0(%rbp), %rdi
callq 0x6060
jmp 0x10eb9
jmp 0x10f1b
movq -0xc0(%rbp), %rax
movq %rax, -0x340(%rbp)
leaq -0x160(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x30c0
jmp 0x10edb
movq -0x340(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x6550
jmp 0x10ef0
leaq -0x160(%rbp), %rdi
callq 0x3120
jmp 0x10f1b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x3120
jmp 0x11634
jmp 0x1103e
leaq 0x4d12(%rip), %rsi      # 0x15c39
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x341(%rbp)
jmp 0x10f38
movb -0x341(%rbp), %al
testb $0x1, %al
jne 0x10f47
jmp 0x1103c
movq 0xe082(%rip), %rdi      # 0x1efd0
leaq 0x4d59(%rip), %rsi      # 0x15cae
callq 0x31e0
movq %rax, -0x350(%rbp)
jmp 0x10f63
movq -0x350(%rbp), %rdi
leaq 0x4d6b(%rip), %rsi      # 0x15cdc
callq 0x31e0
movq %rax, -0x358(%rbp)
jmp 0x10f7f
movq -0x358(%rbp), %rdi
movq 0xe033(%rip), %rsi      # 0x1efc0
callq 0x3210
jmp 0x10f94
movq 0xe045(%rip), %rdi      # 0x1efe0
leaq -0x38(%rbp), %rsi
callq 0x32a0
jmp 0x10fa6
leaq 0x4cf9(%rip), %rsi      # 0x15ca6
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x359(%rbp)
jmp 0x10fbe
movb -0x359(%rbp), %al
testb $0x1, %al
jne 0x10fca
jmp 0x10fda
movq -0xc0(%rbp), %rdi
callq 0x61d0
jmp 0x10fd8
jmp 0x1103a
movq -0xc0(%rbp), %rax
movq %rax, -0x368(%rbp)
leaq -0x180(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x30c0
jmp 0x10ffa
movq -0x368(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x66c0
jmp 0x1100f
leaq -0x180(%rbp), %rdi
callq 0x3120
jmp 0x1103a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x3120
jmp 0x11634
jmp 0x1103c
jmp 0x1103e
jmp 0x11161
leaq 0x4cea(%rip), %rsi      # 0x15d34
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x369(%rbp)
jmp 0x1105b
movb -0x369(%rbp), %al
testb $0x1, %al
jne 0x1106a
jmp 0x1115f
movq 0xdf5f(%rip), %rdi      # 0x1efd0
leaq 0x4f8d(%rip), %rsi      # 0x16005
callq 0x31e0
movq %rax, -0x378(%rbp)
jmp 0x11086
movq -0x378(%rbp), %rdi
leaq 0x4f9e(%rip), %rsi      # 0x16032
callq 0x31e0
movq %rax, -0x380(%rbp)
jmp 0x110a2
movq -0x380(%rbp), %rdi
movq 0xdf10(%rip), %rsi      # 0x1efc0
callq 0x3210
jmp 0x110b7
movq 0xdf22(%rip), %rdi      # 0x1efe0
leaq -0x38(%rbp), %rsi
callq 0x32a0
jmp 0x110c9
leaq 0x4bd6(%rip), %rsi      # 0x15ca6
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x381(%rbp)
jmp 0x110e1
movb -0x381(%rbp), %al
testb $0x1, %al
jne 0x110ed
jmp 0x110fd
movq -0xc0(%rbp), %rdi
callq 0x6300
jmp 0x110fb
jmp 0x1115d
movq -0xc0(%rbp), %rax
movq %rax, -0x390(%rbp)
leaq -0x1a0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x30c0
jmp 0x1111d
movq -0x390(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x6930
jmp 0x11132
leaq -0x1a0(%rbp), %rdi
callq 0x3120
jmp 0x1115d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x3120
jmp 0x11634
jmp 0x1115f
jmp 0x11161
jmp 0x11163
jmp 0x11165
jmp 0x11167
jmp 0x11169
jmp 0x1116b
jmp 0x1116d
movq -0x1f8(%rbp), %rdi
callq 0xf650
jmp 0x1117b
jmp 0x1117d
callq 0x3070
movl $0x64, %ecx
cltd
idivl %ecx
movl %edx, -0x14(%rbp)
cmpl $0x14, -0x14(%rbp)
jge 0x11422
movq -0x1f8(%rbp), %rax
cmpl $0x1, 0x88(%rax)
jne 0x11422
cmpl $0x1, -0x10(%rbp)
jne 0x11422
leaq 0x4b78(%rip), %rsi      # 0x15d34
leaq -0x38(%rbp), %rdi
callq 0xdfb0
movb %al, -0x391(%rbp)
jmp 0x111cd
movb -0x391(%rbp), %al
testb $0x1, %al
jne 0x111dc
jmp 0x11422
leaq 0x4db2(%rip), %rsi      # 0x15f95
leaq -0x38(%rbp), %rdi
callq 0xdfb0
movb %al, -0x392(%rbp)
jmp 0x111f4
movb -0x392(%rbp), %al
testb $0x1, %al
jne 0x11203
jmp 0x11422
leaq 0x49ea(%rip), %rsi      # 0x15bf4
leaq -0x38(%rbp), %rdi
callq 0xdfb0
movb %al, -0x393(%rbp)
jmp 0x1121b
movb -0x393(%rbp), %al
testb $0x1, %al
jne 0x1122a
jmp 0x11422
leaq 0x4da5(%rip), %rsi      # 0x15fd6
leaq -0x38(%rbp), %rdi
callq 0xdfb0
movb %al, -0x394(%rbp)
jmp 0x11242
movb -0x394(%rbp), %al
testb $0x1, %al
jne 0x11251
jmp 0x11422
movq 0xdd78(%rip), %rdi      # 0x1efd0
leaq 0x4e03(%rip), %rsi      # 0x16062
callq 0x31e0
movq %rax, -0x3a0(%rbp)
jmp 0x1126d
movq -0x3a0(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x3320
movq %rax, -0x3a8(%rbp)
jmp 0x11285
movq -0x3a8(%rbp), %rdi
movq 0xdd2d(%rip), %rsi      # 0x1efc0
callq 0x3210
jmp 0x1129a
movq -0x1f8(%rbp), %rax
movq 0x70(%rax), %rsi
leaq -0x1b8(%rbp), %rdi
callq 0x14050
jmp 0x112b3
leaq -0xa8(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0xde90
leaq -0x1b8(%rbp), %rdi
callq 0xdec0
leaq -0xa8(%rbp), %rdi
callq 0xdee0
movq %rax, -0x1c0(%rbp)
movq -0x1c0(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0xdf40
movq %rax, -0x1c8(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0xdf10
testb $0x1, %al
jne 0x11322
jmp 0x113da
leaq -0xb0(%rbp), %rdi
callq 0xdf70
movq (%rax), %rdi
callq 0x4e20
movl %eax, -0x3ac(%rbp)
jmp 0x1133e
movl -0x3ac(%rbp), %ecx
movl -0x90(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x90(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0xdf70
movq (%rax), %rsi
leaq -0x1e8(%rbp), %rdi
callq 0x4df0
jmp 0x1136f
movq 0xdc5a(%rip), %rdi      # 0x1efd0
leaq -0x1e8(%rbp), %rsi
callq 0x31b0
movq %rax, -0x3b8(%rbp)
jmp 0x1138b
movq -0x3b8(%rbp), %rdi
movq 0xdc27(%rip), %rsi      # 0x1efc0
callq 0x3210
jmp 0x113a0
leaq -0x1e8(%rbp), %rdi
callq 0x3120
leaq -0xb0(%rbp), %rdi
callq 0xdf90
jmp 0x112f3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0x3120
jmp 0x11634
movq -0x1f8(%rbp), %rdi
movslq -0x90(%rbp), %rax
imulq $0x55555556, %rax, %rax # imm = 0x55555556
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x20, %rax
addl %ecx, %eax
movl %eax, -0x90(%rbp)
movl -0x90(%rbp), %esi
callq 0xf2c0
jmp 0x1140f
movq -0x1f8(%rbp), %rdi
callq 0xf6e0
jmp 0x1141d
jmp 0x11611
movq -0x1f8(%rbp), %rax
cmpl $0x2, 0x88(%rax)
jne 0x1160f
movq 0xdb93(%rip), %rdi      # 0x1efd0
leaq 0x4c2c(%rip), %rsi      # 0x16070
callq 0x31e0
movq %rax, -0x3c0(%rbp)
jmp 0x11452
movq -0x3c0(%rbp), %rdi
movq 0xdb60(%rip), %rsi      # 0x1efc0
callq 0x3210
jmp 0x11467
movq 0xdb62(%rip), %rdi      # 0x1efd0
leaq 0x4c2f(%rip), %rsi      # 0x160a4
callq 0x31e0
movq %rax, -0x3c8(%rbp)
jmp 0x11483
movq -0x3c8(%rbp), %rdi
movq 0xdb2f(%rip), %rsi      # 0x1efc0
callq 0x3210
jmp 0x11498
movl $0x0, -0x1ec(%rbp)
movq 0xdb37(%rip), %rdi      # 0x1efe0
leaq -0x38(%rbp), %rsi
callq 0x32a0
jmp 0x114b4
jmp 0x114b6
cmpl $0x0, -0x1ec(%rbp)
jne 0x115ff
leaq 0x4bec(%rip), %rsi      # 0x160b6
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x3c9(%rbp)
jmp 0x114db
movb -0x3c9(%rbp), %al
testb $0x1, %al
jne 0x114ea
jmp 0x11583
jmp 0x114ec
cmpl $0x0, -0x1ec(%rbp)
jne 0x11581
movq -0x1f8(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0xc430
jmp 0x1150b
movq 0xdabe(%rip), %rdi      # 0x1efd0
leaq 0x4ba1(%rip), %rsi      # 0x160ba
callq 0x31e0
movq %rax, -0x3d8(%rbp)
jmp 0x11527
movq -0x3d8(%rbp), %rdi
movq 0xda8b(%rip), %rsi      # 0x1efc0
callq 0x3210
jmp 0x1153c
movq 0xda9d(%rip), %rdi      # 0x1efe0
leaq -0x38(%rbp), %rsi
callq 0x32a0
jmp 0x1154e
leaq 0x4b61(%rip), %rsi      # 0x160b6
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x3d9(%rbp)
jmp 0x11566
movb -0x3d9(%rbp), %al
testb $0x1, %al
jne 0x11572
jmp 0x1157c
movl $0x1, -0x1ec(%rbp)
jmp 0x114ec
jmp 0x115fa
leaq 0x4b29(%rip), %rsi      # 0x160b3
leaq -0x38(%rbp), %rdi
callq 0x7f70
movb %al, -0x3da(%rbp)
jmp 0x1159b
movb -0x3da(%rbp), %al
testb $0x1, %al
jne 0x115a7
jmp 0x115b3
movl $0x1, -0x1ec(%rbp)
jmp 0x115f8
movq 0xda16(%rip), %rdi      # 0x1efd0
leaq 0x4b1e(%rip), %rsi      # 0x160df
callq 0x31e0
movq %rax, -0x3e8(%rbp)
jmp 0x115cf
movq -0x3e8(%rbp), %rdi
movq 0xd9e3(%rip), %rsi      # 0x1efc0
callq 0x3210
jmp 0x115e4
movq 0xd9f5(%rip), %rdi      # 0x1efe0
leaq -0x38(%rbp), %rsi
callq 0x32a0
jmp 0x115f6
jmp 0x115f8
jmp 0x115fa
jmp 0x114b6
movq -0x1f8(%rbp), %rdi
callq 0xf650
jmp 0x1160d
jmp 0x1160f
jmp 0x11611
jmp 0x10802
leaq -0xa8(%rbp), %rdi
callq 0xdec0
leaq -0x38(%rbp), %rdi
callq 0x3120
addq $0x3f0, %rsp            # imm = 0x3F0
popq %rbp
retq
leaq -0xa8(%rbp), %rdi
callq 0xdec0
leaq -0x38(%rbp), %rdi
callq 0x3120
movq -0x40(%rbp), %rdi
callq 0x3330
nopw %cs:(%rax,%rax)