// File: /workspace/github_cpp_makefile_star2_O3/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 0x8c88(%rip), %r14      # 0x13fd0
leaq 0x3a4f(%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 0x3a29(%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 0x3b34(%rip), %r12      # 0xef0c
leaq -0x58(%rbp), %r13
movl $0x20, %edx
movq %r14, %rdi
leaq 0x3a01(%rip), %rsi      # 0xedec
callq 0x31c0
movl $0x1, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x31c0
movl $0x14, %edx
movq %r14, %rdi
leaq 0x39fe(%rip), %rsi      # 0xee0d
callq 0x31c0
movl $0x1, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x31c0
movl $0x63, %edx
movq %r14, %rdi
leaq 0x39ef(%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 0x3a18(%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 0x8b3f(%rip), %rdi      # 0x13fe0
movq %r13, %rsi
callq 0x31e0
movq %r13, %rdi
leaq 0x320a(%rip), %rsi      # 0xe6bd
callq 0x30a0
testl %eax, %eax
je 0xb5c9
movq %r13, %rdi
leaq 0x3298(%rip), %rsi      # 0xe762
callq 0x30a0
testl %eax, %eax
je 0xb5d7
movq %r13, %rdi
leaq 0x31de(%rip), %rsi      # 0xe6bf
callq 0x30a0
movq 0x70(%rbx), %r15
testl %eax, %eax
je 0xb5e5
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 0xdc1c
movq %rax, %r15
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0xb54b
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x3190
testq %r15, %r15
je 0xb5ff
movq 0x70(%rbx), %rdi
callq 0xddfa
cmpl $0x2, %eax
jg 0xb63f
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 0xda48
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0xb3dc
movq -0x108(%rbp), %rsi
incq %rsi
callq 0x3190
jmp 0xb3dc
movq 0x70(%rbx), %rdi
callq 0xd39c
jmp 0xb3dc
movq 0x70(%rbx), %rdi
callq 0xd8bc
jmp 0xb3dc
movq %r15, %rdi
callq 0xddfa
movl $0x2a, %edx
leaq 0x38a5(%rip), %rsi      # 0xee9e
testl %eax, %eax
je 0xb60b
jmp 0xb63f
movl $0x16, %edx
leaq 0x358e(%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 0xb3dc
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 0xa852
movq 0x896b(%rip), %rdi      # 0x13fd0
leaq 0x385d(%rip), %rsi      # 0xeec9
movl $0x44, %edx
callq 0x31c0
movq 0x8953(%rip), %rdi      # 0x13fd0
leaq 0x388a(%rip), %rsi      # 0xef0e
movl $0x1f, %edx
callq 0x31c0
movq 0x893b(%rip), %rdi      # 0x13fd0
leaq 0x3892(%rip), %rsi      # 0xef2e
movl $0x21, %edx
callq 0x31c0
movq 0x8923(%rip), %rdi      # 0x13fd0
leaq 0x389c(%rip), %rsi      # 0xef50
movl $0x1f, %edx
callq 0x31c0
movq 0x890b(%rip), %r14      # 0x13fd0
leaq 0x38a4(%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 0x88d9(%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 0xa4e4
movl $0x0, -0x2c(%rbp)
leaq -0x58(%rbp), %r12
movq 0x88ac(%rip), %rdi      # 0x13fe0
movq %r12, %rsi
callq 0x31e0
movq %r12, %rdi
leaq 0x33a7(%rip), %rsi      # 0xeaed
callq 0x30a0
testl %eax, %eax
je 0xb91c
movq %r12, %rdi
leaq 0x3828(%rip), %rsi      # 0xef85
callq 0x30a0
testl %eax, %eax
je 0xb91c
movq %r12, %rdi
leaq 0x3813(%rip), %rsi      # 0xef87
callq 0x30a0
testl %eax, %eax
je 0xb925
movq %r12, %rdi
leaq 0x37fe(%rip), %rsi      # 0xef89
callq 0x30a0
testl %eax, %eax
je 0xb925
movq %r12, %rdi
leaq 0x37e9(%rip), %rsi      # 0xef8b
callq 0x30a0
testl %eax, %eax
je 0xb936
movq %r12, %rdi
leaq 0x37d4(%rip), %rsi      # 0xef8d
callq 0x30a0
testl %eax, %eax
je 0xb936
movq %r12, %rdi
leaq 0x37bf(%rip), %rsi      # 0xef8f
callq 0x30a0
testl %eax, %eax
je 0xb947
movq %r12, %rdi
leaq 0x322e(%rip), %rsi      # 0xea15
callq 0x30a0
testl %eax, %eax
je 0xb947
movq %r12, %rdi
leaq 0x3793(%rip), %rsi      # 0xef91
callq 0x30a0
testl %eax, %eax
je 0xb958
movq %r12, %rdi
leaq 0x2d9a(%rip), %rsi      # 0xe5af
callq 0x30a0
testl %eax, %eax
je 0xb958
movq %r12, %rdi
leaq 0x3767(%rip), %rsi      # 0xef93
callq 0x30a0
testl %eax, %eax
je 0xbb88
movq %r12, %rdi
leaq 0x3791(%rip), %rsi      # 0xefd4
callq 0x30a0
testl %eax, %eax
je 0xbc25
movq %r12, %rdi
leaq 0x3398(%rip), %rsi      # 0xebf2
callq 0x30a0
testl %eax, %eax
je 0xbcc2
movq %r12, %rdi
leaq 0x34c1(%rip), %rsi      # 0xed32
callq 0x30a0
testl %eax, %eax
jne 0xb967
movl $0x2c, %edx
movq %r14, %rdi
leaq 0x3776(%rip), %rsi      # 0xf003
callq 0x31c0
movl $0x2f, %edx
movq %r14, %rdi
leaq 0x378f(%rip), %rsi      # 0xf030
callq 0x31c0
movq %r14, %rdi
callq 0x30c0
movq 0x872b(%rip), %rdi      # 0x13fe0
movq %r12, %rsi
callq 0x31e0
movq %r12, %rdi
leaq 0x33dd(%rip), %rsi      # 0xeca4
callq 0x30a0
testl %eax, %eax
je 0xbe7e
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 0x6398
movq -0x170(%rbp), %rdi
leaq -0x160(%rbp), %rcx
jmp 0xbe62
movl $0x0, -0x30(%rbp)
jmp 0xb974
movl $0x1, -0x2c(%rbp)
movq %rbx, %rdi
callq 0x9e98
jmp 0xb967
movl $0x1, -0x2c(%rbp)
movq %rbx, %rdi
callq 0xa068
jmp 0xb967
movl $0x1, -0x2c(%rbp)
movq %rbx, %rdi
callq 0x9f5e
jmp 0xb967
movl $0x1, -0x2c(%rbp)
movq %rbx, %rdi
callq 0xa128
movb $0x1, %al
movl %eax, -0x30(%rbp)
movq %rbx, %rdi
callq 0xa852
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 0xba01
movl 0x88(%rbx), %eax
movl %eax, %ecx
xorl $0x1, %ecx
movl -0x2c(%rbp), %edx
xorl $0x1, %edx
orl %ecx, %edx
jne 0xba07
movq %r12, %rdi
leaq 0x3377(%rip), %rsi      # 0xed32
callq 0x30a0
testl %eax, %eax
je 0xba01
movq %r12, %rdi
leaq 0x35c5(%rip), %rsi      # 0xef93
callq 0x30a0
testl %eax, %eax
je 0xba01
movq %r12, %rdi
leaq 0x3211(%rip), %rsi      # 0xebf2
callq 0x30a0
testl %eax, %eax
je 0xba01
movq %r12, %rdi
leaq 0x35e0(%rip), %rsi      # 0xefd4
callq 0x30a0
testl %eax, %eax
jne 0xc008
movl 0x88(%rbx), %eax
cmpl $0x2, %eax
jne 0xbb79
movl $0x33, %edx
movq %r14, %rdi
leaq 0x364f(%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 0x3648(%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 0x8553(%rip), %rdi      # 0x13fe0
movq %r12, %rsi
callq 0x31e0
movq %r12, %rdi
leaq 0x3615(%rip), %rsi      # 0xf0b4
callq 0x30a0
testl %eax, %eax
je 0xbb0b
movq %r12, %rdi
leaq 0x35ff(%rip), %rsi      # 0xf0b1
callq 0x30a0
testl %eax, %eax
je 0xbb71
movl $0x15, %edx
movq %r14, %rdi
leaq 0x360f(%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 0x84df(%rip), %rdi      # 0x13fe0
movq %r12, %rsi
callq 0x31e0
jmp 0xba95
movq 0x68(%rbx), %rdi
callq 0x8532
movl $0x24, %edx
movq %r14, %rdi
leaq 0x3595(%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 0x848a(%rip), %rdi      # 0x13fe0
movq %r12, %rsi
callq 0x31e0
movq %r12, %rdi
leaq 0x354c(%rip), %rsi      # 0xf0b4
callq 0x30a0
testl %eax, %eax
jne 0xbb0b
movq %rbx, %rdi
callq 0xa852
cmpb $0x0, -0x30(%rbp)
jne 0xb72d
jmp 0xbfbc
movl $0x24, %edx
movq %r14, %rdi
leaq 0x3402(%rip), %rsi      # 0xef99
callq 0x31c0
movl $0x15, %edx
movq %r14, %rdi
leaq 0x3413(%rip), %rsi      # 0xefbe
callq 0x31c0
movq %r14, %rdi
callq 0x30c0
movq 0x8421(%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 0xdc1c
movq %rax, %rcx
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0xbf32
movq -0xe8(%rbp), %rsi
jmp 0xbf9b
movl $0x2a, %edx
movq %r14, %rdi
leaq 0x33a4(%rip), %rsi      # 0xefd8
callq 0x31c0
movl $0x15, %edx
movq %r14, %rdi
leaq 0x3376(%rip), %rsi      # 0xefbe
callq 0x31c0
movq %r14, %rdi
callq 0x30c0
movq 0x8384(%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 0xdc1c
movq %rax, %rcx
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0xbea8
movq -0xa8(%rbp), %rsi
jmp 0xbf11
movl $0x2c, %edx
movq %r14, %rdi
leaq 0x2f27(%rip), %rsi      # 0xebf8
callq 0x31c0
movl $0x17, %edx
movq %r14, %rdi
leaq 0x2f40(%rip), %rsi      # 0xec25
callq 0x31c0
movq %r14, %rdi
callq 0x30c0
movq 0x82e7(%rip), %rdi      # 0x13fe0
movq %r12, %rsi
callq 0x31e0
movq %r12, %rdi
leaq 0x2f32(%rip), %rsi      # 0xec3d
callq 0x30a0
testl %eax, %eax
je 0xbdcd
movq %r12, %rdi
leaq 0x2f15(%rip), %rsi      # 0xec37
callq 0x30a0
testl %eax, %eax
jne 0xb967
movl $0x2d, %edx
movq %r14, %rdi
leaq 0x2f6e(%rip), %rsi      # 0xecac
callq 0x31c0
movl $0x2f, %edx
movq %r14, %rdi
leaq 0x2f88(%rip), %rsi      # 0xecda
callq 0x31c0
movq %r14, %rdi
callq 0x30c0
movq 0x827a(%rip), %rdi      # 0x13fe0
movq %r12, %rsi
callq 0x31e0
movq %r12, %rdi
leaq 0x2f2c(%rip), %rsi      # 0xeca4
callq 0x30a0
testl %eax, %eax
je 0xbe9a
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 0x61de
movq -0x190(%rbp), %rdi
leaq -0x180(%rbp), %rcx
jmp 0xbe62
movl $0x2e, %edx
movq %r14, %rdi
leaq 0x2e68(%rip), %rsi      # 0xec44
callq 0x31c0
movl $0x30, %edx
movq %r14, %rdi
leaq 0x2e83(%rip), %rsi      # 0xec73
callq 0x31c0
movq %r14, %rdi
callq 0x30c0
movq 0x81dc(%rip), %rdi      # 0x13fe0
movq %r12, %rsi
callq 0x31e0
movq %r12, %rdi
leaq 0x2e8e(%rip), %rsi      # 0xeca4
callq 0x30a0
testl %eax, %eax
je 0xbe8c
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 0x60a8
movq -0x1b0(%rbp), %rdi
leaq -0x1a0(%rbp), %rcx
movq %rcx, %rax
cmpq %rcx, %rdi
je 0xb967
movq (%rax), %rsi
incq %rsi
callq 0x3190
jmp 0xb967
movq -0x38(%rbp), %rdi
callq 0x5eb6
jmp 0xb967
movq -0x38(%rbp), %rdi
callq 0x5c1a
jmp 0xb967
movq -0x38(%rbp), %rdi
callq 0x5d90
jmp 0xb967
testq %rcx, %rcx
jne 0xbf21
movq 0x812c(%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 0xdc1c
movq %rax, %rcx
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xbea8
movq -0x88(%rbp), %rsi
incq %rsi
movq %rcx, %r13
callq 0x3190
movq %r13, %rcx
jmp 0xbea8
movq %rcx, -0x38(%rbp)
movq %rcx, %rdi
callq 0x556c
jmp 0xb967
testq %rcx, %rcx
jne 0xbfab
movq 0x80a2(%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 0xdc1c
movq %rax, %rcx
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xbf32
movq -0xc8(%rbp), %rsi
incq %rsi
movq %rcx, %r13
callq 0x3190
movq %r13, %rcx
jmp 0xbf32
movq %rcx, -0x38(%rbp)
movq %rcx, %rdi
callq 0x5936
jmp 0xb967
movq -0x150(%rbp), %rdi
cmpq %r15, %rdi
je 0xbfdd
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x3190
movq %rbx, %rdi
cmpq %r15, %rbx
jne 0xbfc8
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0xbff6
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 0x7fc1(%rip), %rdi      # 0x13fd0
leaq 0x304a(%rip), %rsi      # 0xf060
movl $0xd, %edx
callq 0x31c0
movq 0x7fa9(%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 0xdde2
leaq -0x150(%rbp), %rdi
movq %r14, %rsi
callq 0x9c4e
movq -0x78(%rbp), %rdi
cmpq %r14, %rdi
je 0xc096
movq (%rdi), %r12
movl $0x18, %esi
callq 0x3190
movq %r12, %rdi
cmpq %r14, %r12
jne 0xc081
movq -0x150(%rbp), %r12
xorl %esi, %esi
leaq -0x150(%rbp), %rax
cmpq %rax, %r12
jne 0xc0bb
movq %rbx, %rdi
callq 0xa5a8
movq %rbx, %rdi
callq 0xa8e4
xorl %r13d, %r13d
movq 0x10(%r12), %rdi
callq 0x48cc
movl %eax, -0x30(%rbp)
movq 0x10(%r12), %rsi
leaq -0x78(%rbp), %rdi
callq 0x489e
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq 0x7ee8(%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 0xc130
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x3190
addl -0x30(%rbp), %r13d
movq (%r12), %r12
leaq -0x150(%rbp), %rax
cmpq %rax, %r12
jne 0xc0be
movslq %r13d, %rax
imulq $0x55555556, %rax, %rsi # imm = 0x55555556
movq %rsi, %rax
shrq $0x3f, %rax
shrq $0x20, %rsi
addl %eax, %esi
jmp 0xc0ab
jmp 0xc2e8
jmp 0xc2e8
movq %rax, %rbx
movq -0x190(%rbp), %rdi
leaq -0x180(%rbp), %rax
cmpq %rax, %rdi
je 0xc2eb
movq -0x180(%rbp), %rsi
jmp 0xc28a
movq %rax, %rbx
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0xc2eb
movq -0x68(%rbp), %rsi
jmp 0xc28a
movq %rax, %rbx
movq -0x1b0(%rbp), %rdi
leaq -0x1a0(%rbp), %rax
cmpq %rax, %rdi
je 0xc2eb
movq -0x1a0(%rbp), %rsi
jmp 0xc28a
movq %rax, %rbx
movq -0x170(%rbp), %rdi
leaq -0x160(%rbp), %rax
cmpq %rax, %rdi
je 0xc2eb
movq -0x160(%rbp), %rsi
jmp 0xc28a
jmp 0xc2e8
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0xc2eb
movq -0xa8(%rbp), %rsi
jmp 0xc28a
movq %rax, %rbx
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0xc2eb
movq -0xe8(%rbp), %rsi
jmp 0xc28a
movq %rax, %rbx
movq -0x98(%rbp), %rdi
leaq -0x88(%rbp), %rax
cmpq %rax, %rdi
je 0xc2eb
movq -0x88(%rbp), %rsi
jmp 0xc28a
jmp 0xc2e8
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xc2eb
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x3190
jmp 0xc2eb
jmp 0xc2e8
jmp 0xc2e8
jmp 0xc2e8
jmp 0xc30e
movq %rax, %rbx
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0xc311
movq -0x108(%rbp), %rsi
jmp 0xc2d8
movq %rax, %rbx
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0xc311
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x3190
jmp 0xc311
jmp 0xc2e8
jmp 0xc2e8
jmp 0xc2e8
movq %rax, %rbx
movq -0x150(%rbp), %rdi
cmpq %r15, %rdi
je 0xc311
movq (%rdi), %r14
movl $0x18, %esi
callq 0x3190
movq %r14, %rdi
cmpq %r15, %r14
jne 0xc2f7
jmp 0xc311
movq %rax, %rbx
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0xc32a
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3190
movq %rbx, %rdi
callq 0x3220