// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rdi, %rbx
movq 0x8d0a(%rip), %r14      # 0x13fd0
leaq 0x3ad1(%rip), %rsi      # 0xed9e
movl $0x14, %edx
movq %r14, %rdi
callq 0x31c0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3160
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3100
leaq 0x3aab(%rip), %rsi      # 0xedb3
movl $0x38, %edx
movq %r14, %rdi
callq 0x31c0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3160
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3100
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x3bb6(%rip), %r12      # 0xef0c
leaq -0x58(%rbp), %r13
movl $0x20, %edx
movq %r14, %rdi
leaq 0x3a83(%rip), %rsi      # 0xedec
callq 0x31c0
movl $0x1, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x31c0
movl $0x14, %edx
movq %r14, %rdi
leaq 0x3a80(%rip), %rsi      # 0xee0d
callq 0x31c0
movl $0x1, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x31c0
movl $0x63, %edx
movq %r14, %rdi
leaq 0x3a71(%rip), %rsi      # 0xee22
callq 0x31c0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3160
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3100
movl $0x17, %edx
movq %r14, %rdi
leaq 0x3a9a(%rip), %rsi      # 0xee86
callq 0x31c0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3160
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq 0x8bc1(%rip), %rdi      # 0x13fe0
movq %r13, %rsi
callq 0x31e0
movq %r13, %rdi
leaq 0x328c(%rip), %rsi      # 0xe6bd
callq 0x30a0
testl %eax, %eax
je 0xb547
movq %r13, %rdi
leaq 0x331a(%rip), %rsi      # 0xe762
callq 0x30a0
testl %eax, %eax
je 0xb555
movq %r13, %rdi
leaq 0x3260(%rip), %rsi      # 0xe6bf
callq 0x30a0
testl %eax, %eax
je 0xb563
movq 0x70(%rbx), %r15
leaq -0x128(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
addq %rsi, %rdx
leaq -0x138(%rbp), %rdi
callq 0x47b8
movq %r15, %rdi
leaq -0x138(%rbp), %rsi
callq 0xdbac
movq %rax, %r15
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0xb4c9
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x3190
testq %r15, %r15
je 0xb57e
movq 0x70(%rbx), %rdi
callq 0xdd82
cmpl $0x2, %eax
jg 0xb5be
movq 0x70(%rbx), %r15
leaq -0x108(%rbp), %rax
movq %rax, -0x118(%rbp)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
addq %rsi, %rdx
leaq -0x118(%rbp), %rdi
callq 0x47b8
movq %r15, %rdi
leaq -0x118(%rbp), %rsi
callq 0xd9d8
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0xb35a
movq -0x108(%rbp), %rsi
incq %rsi
callq 0x3190
jmp 0xb35a
movq 0x70(%rbx), %rdi
callq 0xd318
jmp 0xb35a
movq 0x70(%rbx), %rdi
callq 0xd84c
jmp 0xb35a
movq 0x70(%rbx), %rdi
callq 0xdd82
movl $0x2a, %edx
leaq 0x3926(%rip), %rsi      # 0xee9e
testl %eax, %eax
je 0xb58a
jmp 0xb5be
movl $0x16, %edx
leaq 0x360f(%rip), %rsi      # 0xeb99
movq %r14, %rdi
callq 0x31c0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3160
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3100
jmp 0xb35a
movq 0x60(%rbx), %rax
movslq 0x78(%rbx), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x7c(%rbx), %rcx
movl $0x3, (%rax,%rcx,4)
movq %rbx, %rdi
callq 0xa7d0
movq 0x89ec(%rip), %rdi      # 0x13fd0
leaq 0x38de(%rip), %rsi      # 0xeec9
movl $0x44, %edx
callq 0x31c0
movq 0x89d4(%rip), %rdi      # 0x13fd0
leaq 0x390b(%rip), %rsi      # 0xef0e
movl $0x1f, %edx
callq 0x31c0
movq 0x89bc(%rip), %rdi      # 0x13fd0
leaq 0x3913(%rip), %rsi      # 0xef2e
movl $0x21, %edx
callq 0x31c0
movq 0x89a4(%rip), %rdi      # 0x13fd0
leaq 0x391d(%rip), %rsi      # 0xef50
movl $0x1f, %edx
callq 0x31c0
movq 0x898c(%rip), %r14      # 0x13fd0
leaq 0x3925(%rip), %rsi      # 0xef70
movl $0x14, %edx
movq %r14, %rdi
callq 0x31c0
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x3160
movsbl %al, %esi
movq 0x895a(%rip), %r14      # 0x13fd0
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3100
leaq -0x150(%rbp), %r15
movq %r15, 0x8(%r15)
movq %r15, (%r15)
movq $0x0, 0x10(%r15)
callq 0xa42e
movl $0x0, -0x2c(%rbp)
leaq -0x58(%rbp), %r12
movq 0x892d(%rip), %rdi      # 0x13fe0
movq %r12, %rsi
callq 0x31e0
movq %r12, %rdi
leaq 0x3428(%rip), %rsi      # 0xeaed
callq 0x30a0
testl %eax, %eax
je 0xb89b
movq %r12, %rdi
leaq 0x38a9(%rip), %rsi      # 0xef85
callq 0x30a0
testl %eax, %eax
je 0xb89b
movq %r12, %rdi
leaq 0x3894(%rip), %rsi      # 0xef87
callq 0x30a0
testl %eax, %eax
je 0xb8a4
movq %r12, %rdi
leaq 0x387f(%rip), %rsi      # 0xef89
callq 0x30a0
testl %eax, %eax
je 0xb8a4
movq %r12, %rdi
leaq 0x386a(%rip), %rsi      # 0xef8b
callq 0x30a0
testl %eax, %eax
je 0xb8b5
movq %r12, %rdi
leaq 0x3855(%rip), %rsi      # 0xef8d
callq 0x30a0
testl %eax, %eax
je 0xb8b5
movq %r12, %rdi
leaq 0x3840(%rip), %rsi      # 0xef8f
callq 0x30a0
testl %eax, %eax
je 0xb8c6
movq %r12, %rdi
leaq 0x32af(%rip), %rsi      # 0xea15
callq 0x30a0
testl %eax, %eax
je 0xb8c6
movq %r12, %rdi
leaq 0x3814(%rip), %rsi      # 0xef91
callq 0x30a0
testl %eax, %eax
je 0xb8d7
movq %r12, %rdi
leaq 0x2e1b(%rip), %rsi      # 0xe5af
callq 0x30a0
testl %eax, %eax
je 0xb8d7
movq %r12, %rdi
leaq 0x37e8(%rip), %rsi      # 0xef93
callq 0x30a0
testl %eax, %eax
je 0xbb03
movq %r12, %rdi
leaq 0x3812(%rip), %rsi      # 0xefd4
callq 0x30a0
testl %eax, %eax
je 0xbba0
movq %r12, %rdi
leaq 0x3419(%rip), %rsi      # 0xebf2
callq 0x30a0
testl %eax, %eax
je 0xbc3d
movq %r12, %rdi
leaq 0x3542(%rip), %rsi      # 0xed32
callq 0x30a0
testl %eax, %eax
jne 0xb8e6
movl $0x2c, %edx
movq %r14, %rdi
leaq 0x37f7(%rip), %rsi      # 0xf003
callq 0x31c0
movl $0x2f, %edx
movq %r14, %rdi
leaq 0x3810(%rip), %rsi      # 0xf030
callq 0x31c0
movq %r14, %rdi
callq 0x30c0
movq 0x87ac(%rip), %rdi      # 0x13fe0
movq %r12, %rsi
callq 0x31e0
movq %r12, %rdi
leaq 0x345e(%rip), %rsi      # 0xeca4
callq 0x30a0
testl %eax, %eax
je 0xbdf9
leaq -0x160(%rbp), %rax
movq %rax, -0x170(%rbp)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
addq %rsi, %rdx
leaq -0x170(%rbp), %rdi
callq 0x47b8
movq -0x38(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x638a
movq -0x170(%rbp), %rdi
leaq -0x160(%rbp), %rcx
jmp 0xbddd
movl $0x0, -0x30(%rbp)
jmp 0xb8f3
movl $0x1, -0x2c(%rbp)
movq %rbx, %rdi
callq 0x9de2
jmp 0xb8e6
movl $0x1, -0x2c(%rbp)
movq %rbx, %rdi
callq 0x9fb2
jmp 0xb8e6
movl $0x1, -0x2c(%rbp)
movq %rbx, %rdi
callq 0x9ea8
jmp 0xb8e6
movl $0x1, -0x2c(%rbp)
movq %rbx, %rdi
callq 0xa072
movb $0x1, %al
movl %eax, -0x30(%rbp)
movq %rbx, %rdi
callq 0xa7d0
callq 0x3080
movslq %eax, %r13
imulq $0x51eb851f, %r13, %rax # imm = 0x51EB851F
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x25, %rax
addl %ecx, %eax
imull $0x64, %eax, %eax
subl %eax, %r13d
cmpl $0x13, %r13d
jg 0xb97e
movl 0x88(%rbx), %eax
xorl $0x1, %eax
movl -0x2c(%rbp), %ecx
xorl $0x1, %ecx
orl %eax, %ecx
jne 0xb97e
movq %r12, %rdi
leaq 0x33fa(%rip), %rsi      # 0xed32
callq 0x30a0
testl %eax, %eax
je 0xb97e
movq %r12, %rdi
leaq 0x3648(%rip), %rsi      # 0xef93
callq 0x30a0
testl %eax, %eax
je 0xb97e
movq %r12, %rdi
leaq 0x3294(%rip), %rsi      # 0xebf2
callq 0x30a0
testl %eax, %eax
je 0xb97e
movq %r12, %rdi
leaq 0x3663(%rip), %rsi      # 0xefd4
callq 0x30a0
testl %eax, %eax
jne 0xbf83
cmpl $0x2, 0x88(%rbx)
jne 0xbaf4
movl $0x33, %edx
movq %r14, %rdi
leaq 0x36d4(%rip), %rsi      # 0xf06e
callq 0x31c0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3160
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3100
movl $0x11, %edx
movq %r14, %rdi
leaq 0x36cd(%rip), %rsi      # 0xf0a2
callq 0x31c0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3160
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq 0x85d8(%rip), %rdi      # 0x13fe0
movq %r12, %rsi
callq 0x31e0
movq %r12, %rdi
leaq 0x369a(%rip), %rsi      # 0xf0b4
callq 0x30a0
testl %eax, %eax
je 0xba86
movq %r12, %rdi
leaq 0x3684(%rip), %rsi      # 0xf0b1
callq 0x30a0
testl %eax, %eax
je 0xbaec
movl $0x15, %edx
movq %r14, %rdi
leaq 0x3694(%rip), %rsi      # 0xf0dd
callq 0x31c0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3160
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq 0x8564(%rip), %rdi      # 0x13fe0
movq %r12, %rsi
callq 0x31e0
jmp 0xba10
movq 0x68(%rbx), %rdi
callq 0x852a
movl $0x24, %edx
movq %r14, %rdi
leaq 0x361a(%rip), %rsi      # 0xf0b8
callq 0x31c0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3160
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq 0x850f(%rip), %rdi      # 0x13fe0
movq %r12, %rsi
callq 0x31e0
movq %r12, %rdi
leaq 0x35d1(%rip), %rsi      # 0xf0b4
callq 0x30a0
testl %eax, %eax
jne 0xba86
movq %rbx, %rdi
callq 0xa7d0
cmpb $0x0, -0x30(%rbp)
jne 0xb6ac
jmp 0xbf37
movl $0x24, %edx
movq %r14, %rdi
leaq 0x3487(%rip), %rsi      # 0xef99
callq 0x31c0
movl $0x15, %edx
movq %r14, %rdi
leaq 0x3498(%rip), %rsi      # 0xefbe
callq 0x31c0
movq %r14, %rdi
callq 0x30c0
movq 0x84a6(%rip), %rdi      # 0x13fe0
movq %r12, %rsi
callq 0x31e0
movq 0x70(%rbx), %r13
leaq -0xe8(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
addq %rsi, %rdx
leaq -0xf8(%rbp), %rdi
callq 0x47b8
movq %r13, %rdi
leaq -0xf8(%rbp), %rsi
callq 0xdbac
movq %rax, %rcx
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0xbead
movq -0xe8(%rbp), %rsi
jmp 0xbf16
movl $0x2a, %edx
movq %r14, %rdi
leaq 0x3429(%rip), %rsi      # 0xefd8
callq 0x31c0
movl $0x15, %edx
movq %r14, %rdi
leaq 0x33fb(%rip), %rsi      # 0xefbe
callq 0x31c0
movq %r14, %rdi
callq 0x30c0
movq 0x8409(%rip), %rdi      # 0x13fe0
movq %r12, %rsi
callq 0x31e0
movq 0x70(%rbx), %r13
leaq -0xa8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
addq %rsi, %rdx
leaq -0xb8(%rbp), %rdi
callq 0x47b8
movq %r13, %rdi
leaq -0xb8(%rbp), %rsi
callq 0xdbac
movq %rax, %rcx
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0xbe23
movq -0xa8(%rbp), %rsi
jmp 0xbe8c
movl $0x2c, %edx
movq %r14, %rdi
leaq 0x2fac(%rip), %rsi      # 0xebf8
callq 0x31c0
movl $0x17, %edx
movq %r14, %rdi
leaq 0x2fc5(%rip), %rsi      # 0xec25
callq 0x31c0
movq %r14, %rdi
callq 0x30c0
movq 0x836c(%rip), %rdi      # 0x13fe0
movq %r12, %rsi
callq 0x31e0
movq %r12, %rdi
leaq 0x2fb7(%rip), %rsi      # 0xec3d
callq 0x30a0
testl %eax, %eax
je 0xbd48
movq %r12, %rdi
leaq 0x2f9a(%rip), %rsi      # 0xec37
callq 0x30a0
testl %eax, %eax
jne 0xb8e6
movl $0x2d, %edx
movq %r14, %rdi
leaq 0x2ff3(%rip), %rsi      # 0xecac
callq 0x31c0
movl $0x2f, %edx
movq %r14, %rdi
leaq 0x300d(%rip), %rsi      # 0xecda
callq 0x31c0
movq %r14, %rdi
callq 0x30c0
movq 0x82ff(%rip), %rdi      # 0x13fe0
movq %r12, %rsi
callq 0x31e0
movq %r12, %rdi
leaq 0x2fb1(%rip), %rsi      # 0xeca4
callq 0x30a0
testl %eax, %eax
je 0xbe15
leaq -0x180(%rbp), %rax
movq %rax, -0x190(%rbp)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
addq %rsi, %rdx
leaq -0x190(%rbp), %rdi
callq 0x47b8
movq -0x38(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x61d8
movq -0x190(%rbp), %rdi
leaq -0x180(%rbp), %rcx
jmp 0xbddd
movl $0x2e, %edx
movq %r14, %rdi
leaq 0x2eed(%rip), %rsi      # 0xec44
callq 0x31c0
movl $0x30, %edx
movq %r14, %rdi
leaq 0x2f08(%rip), %rsi      # 0xec73
callq 0x31c0
movq %r14, %rdi
callq 0x30c0
movq 0x8261(%rip), %rdi      # 0x13fe0
movq %r12, %rsi
callq 0x31e0
movq %r12, %rdi
leaq 0x2f13(%rip), %rsi      # 0xeca4
callq 0x30a0
testl %eax, %eax
je 0xbe07
leaq -0x1a0(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1b0(%rbp), %rdi
callq 0x47b8
movq -0x38(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x60a4
movq -0x1b0(%rbp), %rdi
leaq -0x1a0(%rbp), %rcx
movq %rcx, %rax
cmpq %rcx, %rdi
je 0xb8e6
movq (%rax), %rsi
incq %rsi
callq 0x3190
jmp 0xb8e6
movq -0x38(%rbp), %rdi
callq 0x5eb2
jmp 0xb8e6
movq -0x38(%rbp), %rdi
callq 0x5c16
jmp 0xb8e6
movq -0x38(%rbp), %rdi
callq 0x5d8c
jmp 0xb8e6
testq %rcx, %rcx
jne 0xbe9c
movq 0x81b1(%rip), %rdi      # 0x13fe0
movq %r12, %rsi
callq 0x31e0
leaq -0x98(%rbp), %rdi
movq 0x70(%rbx), %r13
leaq -0x88(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
addq %rsi, %rdx
callq 0x47b8
leaq -0x98(%rbp), %rsi
movq %r13, %rdi
callq 0xdbac
movq %rax, %rcx
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xbe23
movq -0x88(%rbp), %rsi
incq %rsi
movq %rcx, %r13
callq 0x3190
movq %r13, %rcx
jmp 0xbe23
movq %rcx, -0x38(%rbp)
movq %rcx, %rdi
callq 0x5568
jmp 0xb8e6
testq %rcx, %rcx
jne 0xbf26
movq 0x8127(%rip), %rdi      # 0x13fe0
movq %r12, %rsi
callq 0x31e0
leaq -0xd8(%rbp), %rdi
movq 0x70(%rbx), %r13
leaq -0xc8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
addq %rsi, %rdx
callq 0x47b8
leaq -0xd8(%rbp), %rsi
movq %r13, %rdi
callq 0xdbac
movq %rax, %rcx
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xbead
movq -0xc8(%rbp), %rsi
incq %rsi
movq %rcx, %r13
callq 0x3190
movq %r13, %rcx
jmp 0xbead
movq %rcx, -0x38(%rbp)
movq %rcx, %rdi
callq 0x5932
jmp 0xb8e6
movq -0x150(%rbp), %rdi
cmpq %r15, %rdi
je 0xbf58
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x3190
movq %rbx, %rdi
cmpq %r15, %rbx
jne 0xbf43
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0xbf71
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3190
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8046(%rip), %rdi      # 0x13fd0
leaq 0x30cf(%rip), %rsi      # 0xf060
movl $0xd, %edx
callq 0x31c0
movq 0x802e(%rip), %rdi      # 0x13fd0
movl %r13d, %esi
callq 0x3210
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3160
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq 0x70(%rbx), %rsi
leaq -0x78(%rbp), %r14
movq %r14, %rdi
callq 0xdd6a
leaq -0x150(%rbp), %rdi
movq %r14, %rsi
callq 0x9b9a
movq -0x78(%rbp), %rdi
cmpq %r14, %rdi
je 0xc011
movq (%rdi), %r12
movl $0x18, %esi
callq 0x3190
movq %r12, %rdi
cmpq %r14, %r12
jne 0xbffc
movq -0x150(%rbp), %r12
xorl %esi, %esi
leaq -0x150(%rbp), %rax
cmpq %rax, %r12
jne 0xc036
movq %rbx, %rdi
callq 0xa4f2
movq %rbx, %rdi
callq 0xa862
xorl %r13d, %r13d
movq 0x10(%r12), %rdi
callq 0x48c8
movl %eax, -0x30(%rbp)
movq 0x10(%r12), %rsi
leaq -0x78(%rbp), %rdi
callq 0x489a
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq 0x7f6d(%rip), %rdi      # 0x13fd0
callq 0x31c0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3160
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xc0ab
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x3190
addl -0x30(%rbp), %r13d
movq (%r12), %r12
leaq -0x150(%rbp), %rax
cmpq %rax, %r12
jne 0xc039
movslq %r13d, %rax
imulq $0x55555556, %rax, %rsi # imm = 0x55555556
movq %rsi, %rax
shrq $0x3f, %rax
shrq $0x20, %rsi
addl %eax, %esi
jmp 0xc026
jmp 0xc263
jmp 0xc263
movq %rax, %rbx
movq -0x190(%rbp), %rdi
leaq -0x180(%rbp), %rax
cmpq %rax, %rdi
je 0xc266
movq -0x180(%rbp), %rsi
jmp 0xc205
movq %rax, %rbx
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xc266
movq -0x68(%rbp), %rsi
jmp 0xc205
movq %rax, %rbx
movq -0x1b0(%rbp), %rdi
leaq -0x1a0(%rbp), %rax
cmpq %rax, %rdi
je 0xc266
movq -0x1a0(%rbp), %rsi
jmp 0xc205
movq %rax, %rbx
movq -0x170(%rbp), %rdi
leaq -0x160(%rbp), %rax
cmpq %rax, %rdi
je 0xc266
movq -0x160(%rbp), %rsi
jmp 0xc205
jmp 0xc263
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0xc266
movq -0xa8(%rbp), %rsi
jmp 0xc205
movq %rax, %rbx
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0xc266
movq -0xe8(%rbp), %rsi
jmp 0xc205
movq %rax, %rbx
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xc266
movq -0x88(%rbp), %rsi
jmp 0xc205
jmp 0xc263
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xc266
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x3190
jmp 0xc266
jmp 0xc263
jmp 0xc263
jmp 0xc263
jmp 0xc289
movq %rax, %rbx
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0xc28c
movq -0x108(%rbp), %rsi
jmp 0xc253
movq %rax, %rbx
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0xc28c
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x3190
jmp 0xc28c
jmp 0xc263
jmp 0xc263
jmp 0xc263
movq %rax, %rbx
movq -0x150(%rbp), %rdi
cmpq %r15, %rdi
je 0xc28c
movq (%rdi), %r14
movl $0x18, %esi
callq 0x3190
movq %r14, %rdi
cmpq %r15, %r14
jne 0xc272
jmp 0xc28c
movq %rax, %rbx
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0xc2a5
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3190
movq %rbx, %rdi
callq 0x3220
nop