// File: ogghead[P]Moon_Boersma_Coe_CSCI2270_FinalProject/Main.cpp
// Function: main
int main()
{
    Blackjack myGame;
        int i=0;
        int dD=0;
        int deck=0;
        int players=0;
        string inputDeck, inputPlayers;
        cout<<"How many decks: "<<endl;
        getline(cin,inputDeck);
        stringstream de(inputDeck);
        de >> deck;
        cout<<"How many players: "<<endl;
        getline(cin,inputPlayers);
        stringstream pl(inputPlayers);
        pl >> players;
    myGame.buildDeck(deck);
    myGame.shuffleDeck(deck);
    myGame.createPlayers(players);

    bool Quit = false;
     player* me = myGame.returnPlayer();
        player* dealer = myGame.returnDealer();
    while (!Quit)
    {
        myGame.Reset();
        string bet;
        cout<<"Buy-in is 10, max bet is 1000."<<endl;
        cout<<"How much would you like to bet?"<<endl;
        cout<<"You have: "<< me->totalMoney << " dollars left." << endl;
        getline(cin,bet);
        int myBet = stoi(bet);
        myGame.Bet(myBet);
        myGame.Deal();

        myGame.show();
        cout << "The dealer has: " << endl;
        cout << "??" << endl;
        cout << dealer->hand[0]->name << " of " << dealer->hand[0]->sui << endl;
        cout << endl;

        cout << "You have: " << endl;
        cout << me->hand[0]->name << " of " << me->hand[0]->sui << endl;
        cout << me->hand[1]->name << " of " << me->hand[1]->sui << endl;
        cout << endl;
        //cout << dealer->hand[1] << endl;



        cout << "1. Hit " << endl;
        cout << "2. Stand" << endl;
        cout << "3. Double Down " << endl;
        int splitted=0;
        if (me->hand[0]->name == me->hand[1]->name){
            cout << "4. Split " << endl;
            me->isSplit = true;

        }
        string choice;
        getline(cin, choice);
        int myChoice = stoi(choice);
        if (myChoice == 1){
            myGame.HitMe(me, false);

        }
        if (myChoice == 2){
            myGame.Stand(me);
        }
        if (myChoice == 3){
            myGame.doubleDown(me);
        }
        if (myChoice == 4 && me->isSplit==true){
            myGame.Split(me);
            splitted=1;
        }

        while (!me->stand)
        {
            cout << "1. Hit " << endl;
            cout << "2. Stand" << endl;
            string choice;
            getline(cin, choice);
            int myChoice = stoi(choice);

            if (myChoice == 1){
                myGame.HitMe(me, false);
            }
            if (myChoice == 2){
                myGame.Stand(me);
            }
        }
        if (me->isSplit){
            while (!me->stand2)
            {
                cout << "1. Hit " << endl;
                cout << "2. Stand" << endl;
                string choice;
                getline(cin, choice);
                int myChoice = stoi(choice);

                if (myChoice == 1){
                    myGame.HitMe(me, true);
                }
                if (myChoice == 2){
                    myGame.Stand2(me);
                }
            }
        }
        myGame.Round();
//cout<<"F"<<endl;
        myGame.show();
     cout << "The dealer had: " << endl;
        for (int i = 0; i < dealer->hand.size();i++)
        {
            cout << dealer->hand[i]->name << " of " << dealer->hand[i]->sui << endl;
        }
        cout << endl;

        cout << "You had: " << endl;
        for (int i = 0; i < me->hand.size();i++)
        {
            cout << me->hand[i]->name << " of " << me->hand[i]->sui << endl;
        }
        cout << endl;

         cout<<"CardCounter: "<<myGame.displayCardCounter()<<endl;
        if(me->handValue > 21){
            me->handValue=0;
        }
         if(dealer->handValue > 21){
            dealer->handValue=0;
        }
        if(me->handValue < dealer->handValue){
            cout<<"You lose."<<endl;
            me->totalMoney=me->totalMoney-me->bet;
        }
        if(me->handValue > dealer->handValue){
            cout<< " You win." <<endl;
            if(me->hand.size()==2){
                me->totalMoney=me->totalMoney+(me->bet)/2 +me->bet;
            }else{
            me->totalMoney=me->totalMoney+me->bet;
            }
        }
        if(me->handValue==dealer->handValue){
            cout<< " You push." <<endl;
        }

        if(splitted==1){
          if(me->handValue2 > 21){
            me->handValue2=0;
        }


        if(me->handValue2 < dealer->handValue){
            cout<<"You lose.(Second Hand)"<<endl;
            me->totalMoney=me->totalMoney-me->bet2;
        }
        if(me->handValue > dealer->handValue){
             cout<< " You win. (Second Hand)" <<endl;
            if(me->hand2.size()==2){
                me->totalMoney=me->totalMoney+(me->bet2)/2 +me->bet2;
            }else{
            me->totalMoney=me->totalMoney+me->bet2;
            }
        }
        if(me->handValue==dealer->handValue){
                cout << "You push. (Second Hand)"<<endl;
        }


    }


    cout<< "Would you like to stop playing? (Y) ";
    string choice2;
    getline(cin, choice2);
    if (choice2 == "Y")
        Quit = true;
    }


    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x670, %rsp            # imm = 0x670
movl $0x0, -0x4(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x23c0
movl $0x0, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movl $0x0, -0x50(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x21d0
leaq -0x90(%rbp), %rdi
callq 0x21d0
movq 0x4cc5(%rip), %rdi      # 0x9fc8
leaq 0x1dbb(%rip), %rsi      # 0x70c5
callq 0x2180
movq %rax, -0x498(%rbp)
jmp 0x5318
movq -0x498(%rbp), %rdi
movq 0x4c92(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x532d
movq 0x4cac(%rip), %rdi      # 0x9fe0
leaq -0x70(%rbp), %rsi
callq 0x2040
jmp 0x533f
movl $0x10, %edi
movl $0x8, %esi
callq 0x64b0
movl %eax, -0x49c(%rbp)
jmp 0x5356
movl -0x49c(%rbp), %edx
leaq -0x228(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x2200
jmp 0x536e
leaq -0x228(%rbp), %rdi
leaq -0x4c(%rbp), %rsi
callq 0x20e0
jmp 0x5380
movq 0x4c41(%rip), %rdi      # 0x9fc8
leaq 0x1d48(%rip), %rsi      # 0x70d6
callq 0x2180
movq %rax, -0x4a8(%rbp)
jmp 0x539c
movq -0x4a8(%rbp), %rdi
movq 0x4c0e(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x53b1
movq 0x4c28(%rip), %rdi      # 0x9fe0
leaq -0x90(%rbp), %rsi
callq 0x2040
jmp 0x53c6
movl $0x10, %edi
movl $0x8, %esi
callq 0x64b0
movl %eax, -0x4ac(%rbp)
jmp 0x53dd
movl -0x4ac(%rbp), %edx
leaq -0x3b0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x2200
jmp 0x53f8
leaq -0x3b0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x20e0
jmp 0x540a
movl -0x4c(%rbp), %esi
leaq -0x40(%rbp), %rdi
callq 0x2430
jmp 0x5418
movl -0x4c(%rbp), %esi
leaq -0x40(%rbp), %rdi
callq 0x27d0
jmp 0x5426
movl -0x50(%rbp), %esi
leaq -0x40(%rbp), %rdi
callq 0x2b00
jmp 0x5434
movb $0x0, -0x3b1(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x3150
movq %rax, -0x4b8(%rbp)
jmp 0x544d
movq -0x4b8(%rbp), %rax
movq %rax, -0x3c0(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x3300
movq %rax, -0x4c0(%rbp)
jmp 0x546d
movq -0x4c0(%rbp), %rax
movq %rax, -0x3c8(%rbp)
movb -0x3b1(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x548c
jmp 0x641b
leaq -0x40(%rbp), %rdi
callq 0x2fc0
jmp 0x5497
leaq -0x3e8(%rbp), %rdi
callq 0x21d0
movq 0x4b1e(%rip), %rdi      # 0x9fc8
leaq 0x1c38(%rip), %rsi      # 0x70e9
callq 0x2180
movq %rax, -0x4c8(%rbp)
jmp 0x54bf
movq -0x4c8(%rbp), %rdi
movq 0x4aeb(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x54d4
movq 0x4aed(%rip), %rdi      # 0x9fc8
leaq 0x1b97(%rip), %rsi      # 0x7079
callq 0x2180
movq %rax, -0x4d0(%rbp)
jmp 0x54f0
movq -0x4d0(%rbp), %rdi
movq 0x4aba(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x5505
movq 0x4abc(%rip), %rdi      # 0x9fc8
leaq 0x1bf5(%rip), %rsi      # 0x7108
callq 0x2180
movq %rax, -0x4d8(%rbp)
jmp 0x5521
movq -0x4d8(%rbp), %rdi
movq -0x3c0(%rbp), %rax
movl 0x40(%rax), %esi
callq 0x2220
movq %rax, -0x4e0(%rbp)
jmp 0x5540
movq -0x4e0(%rbp), %rdi
leaq 0x1bc5(%rip), %rsi      # 0x7113
callq 0x2180
movq %rax, -0x4e8(%rbp)
jmp 0x555c
movq -0x4e8(%rbp), %rdi
movq 0x4a4e(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x5571
movq 0x4a68(%rip), %rdi      # 0x9fe0
leaq -0x3e8(%rbp), %rsi
callq 0x2040
jmp 0x5586
xorl %eax, %eax
movl %eax, %esi
leaq -0x3e8(%rbp), %rdi
movl $0xa, %edx
callq 0x3870
movl %eax, -0x4ec(%rbp)
jmp 0x55a3
movl -0x4ec(%rbp), %eax
movl %eax, -0x3ec(%rbp)
movl -0x3ec(%rbp), %esi
leaq -0x40(%rbp), %rdi
callq 0x2db0
jmp 0x55c0
leaq -0x40(%rbp), %rdi
callq 0x2c50
jmp 0x55cb
leaq -0x40(%rbp), %rdi
callq 0x3180
jmp 0x55d6
movq 0x49eb(%rip), %rdi      # 0x9fc8
leaq 0x1b3e(%rip), %rsi      # 0x7122
callq 0x2180
movq %rax, -0x4f8(%rbp)
jmp 0x55f2
movq -0x4f8(%rbp), %rdi
movq 0x49b8(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x5607
movq 0x49ba(%rip), %rdi      # 0x9fc8
leaq 0x1b1e(%rip), %rsi      # 0x7133
callq 0x2180
movq %rax, -0x500(%rbp)
jmp 0x5623
movq -0x500(%rbp), %rdi
movq 0x4987(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x5638
movq -0x3c8(%rbp), %rdi
addq $0x28, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3620
movq (%rax), %rsi
addq $0x28, %rsi
movq 0x496e(%rip), %rdi      # 0x9fc8
callq 0x2140
movq %rax, -0x508(%rbp)
jmp 0x5668
movq -0x508(%rbp), %rdi
leaq 0x1a2b(%rip), %rsi      # 0x70a1
callq 0x2180
movq %rax, -0x510(%rbp)
jmp 0x5684
movq -0x3c8(%rbp), %rdi
addq $0x28, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3620
movq -0x510(%rbp), %rdi
movq (%rax), %rsi
addq $0x8, %rsi
callq 0x2140
movq %rax, -0x518(%rbp)
jmp 0x56b4
movq -0x518(%rbp), %rdi
movq 0x48f6(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x56c9
movq 0x48f8(%rip), %rdi      # 0x9fc8
movq 0x48e1(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x56de
movq 0x48e3(%rip), %rdi      # 0x9fc8
leaq 0x1a1c(%rip), %rsi      # 0x7108
callq 0x2180
movq %rax, -0x520(%rbp)
jmp 0x56fa
movq -0x520(%rbp), %rdi
movq 0x48b0(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x570f
movq -0x3c0(%rbp), %rdi
addq $0x28, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3620
movq (%rax), %rsi
addq $0x28, %rsi
movq 0x4897(%rip), %rdi      # 0x9fc8
callq 0x2140
movq %rax, -0x528(%rbp)
jmp 0x573f
movq -0x528(%rbp), %rdi
leaq 0x1954(%rip), %rsi      # 0x70a1
callq 0x2180
movq %rax, -0x530(%rbp)
jmp 0x575b
movq -0x3c0(%rbp), %rdi
addq $0x28, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3620
movq -0x530(%rbp), %rdi
movq (%rax), %rsi
addq $0x8, %rsi
callq 0x2140
movq %rax, -0x538(%rbp)
jmp 0x578b
movq -0x538(%rbp), %rdi
movq 0x481f(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x57a0
movq -0x3c0(%rbp), %rdi
addq $0x28, %rdi
movl $0x1, %esi
callq 0x3620
movq (%rax), %rsi
addq $0x28, %rsi
movq 0x4805(%rip), %rdi      # 0x9fc8
callq 0x2140
movq %rax, -0x540(%rbp)
jmp 0x57d1
movq -0x540(%rbp), %rdi
leaq 0x18c2(%rip), %rsi      # 0x70a1
callq 0x2180
movq %rax, -0x548(%rbp)
jmp 0x57ed
movq -0x3c0(%rbp), %rdi
addq $0x28, %rdi
movl $0x1, %esi
callq 0x3620
movq -0x548(%rbp), %rdi
movq (%rax), %rsi
addq $0x8, %rsi
callq 0x2140
movq %rax, -0x550(%rbp)
jmp 0x581e
movq -0x550(%rbp), %rdi
movq 0x478c(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x5833
movq 0x478e(%rip), %rdi      # 0x9fc8
movq 0x4777(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x5848
movq 0x4779(%rip), %rdi      # 0x9fc8
leaq 0x18e0(%rip), %rsi      # 0x7136
callq 0x2180
movq %rax, -0x558(%rbp)
jmp 0x5864
movq -0x558(%rbp), %rdi
movq 0x4746(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x5879
movq 0x4748(%rip), %rdi      # 0x9fc8
leaq 0x18b7(%rip), %rsi      # 0x713e
callq 0x2180
movq %rax, -0x560(%rbp)
jmp 0x5895
movq -0x560(%rbp), %rdi
movq 0x4715(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x58aa
movq 0x4717(%rip), %rdi      # 0x9fc8
leaq 0x188f(%rip), %rsi      # 0x7147
callq 0x2180
movq %rax, -0x568(%rbp)
jmp 0x58c6
movq -0x568(%rbp), %rdi
movq 0x46e4(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x58db
movl $0x0, -0x3f0(%rbp)
movq -0x3c0(%rbp), %rdi
addq $0x28, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3620
movq (%rax), %rax
addq $0x28, %rax
movq %rax, -0x570(%rbp)
movq -0x3c0(%rbp), %rdi
addq $0x28, %rdi
movl $0x1, %esi
callq 0x3620
movq -0x570(%rbp), %rdi
movq (%rax), %rsi
addq $0x28, %rsi
callq 0x64d0
testb $0x1, %al
jne 0x5938
jmp 0x59d2
movq 0x4689(%rip), %rdi      # 0x9fc8
leaq 0x1811(%rip), %rsi      # 0x7157
callq 0x2180
movq %rax, -0x578(%rbp)
jmp 0x5954
movq -0x578(%rbp), %rdi
movq 0x4656(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x5969
movq -0x3c0(%rbp), %rax
movb $0x1, 0x48(%rax)
jmp 0x59d2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x647c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x6470
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x6464
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x640d
leaq -0x410(%rbp), %rdi
movq %rdi, -0x580(%rbp)
callq 0x21d0
movq -0x580(%rbp), %rsi
movq 0x45ed(%rip), %rdi      # 0x9fe0
callq 0x2040
jmp 0x59fa
xorl %eax, %eax
movl %eax, %esi
leaq -0x410(%rbp), %rdi
movl $0xa, %edx
callq 0x3870
movl %eax, -0x584(%rbp)
jmp 0x5a17
movl -0x584(%rbp), %eax
movl %eax, -0x414(%rbp)
cmpl $0x1, -0x414(%rbp)
jne 0x5a59
movq -0x3c0(%rbp), %rsi
leaq -0x40(%rbp), %rdi
xorl %edx, %edx
callq 0x2930
jmp 0x5a40
jmp 0x5a59
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x6401
cmpl $0x2, -0x414(%rbp)
jne 0x5a76
movq -0x3c0(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x2ae0
jmp 0x5a74
jmp 0x5a76
cmpl $0x3, -0x414(%rbp)
jne 0x5a93
movq -0x3c0(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x2f00
jmp 0x5a91
jmp 0x5a93
cmpl $0x4, -0x414(%rbp)
jne 0x5acc
movq -0x3c0(%rbp), %rax
movb 0x48(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x5acc
movq -0x3c0(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x2d00
jmp 0x5ac2
movl $0x1, -0x3f0(%rbp)
jmp 0x5ace
movq -0x3c0(%rbp), %rax
movb 0x6c(%rax), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x5ae3
jmp 0x5c06
movq 0x44de(%rip), %rdi      # 0x9fc8
leaq 0x1645(%rip), %rsi      # 0x7136
callq 0x2180
movq %rax, -0x590(%rbp)
jmp 0x5aff
movq -0x590(%rbp), %rdi
movq 0x44ab(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x5b14
movq 0x44ad(%rip), %rdi      # 0x9fc8
leaq 0x161c(%rip), %rsi      # 0x713e
callq 0x2180
movq %rax, -0x598(%rbp)
jmp 0x5b30
movq -0x598(%rbp), %rdi
movq 0x447a(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x5b45
leaq -0x438(%rbp), %rdi
movq %rdi, -0x5a0(%rbp)
callq 0x21d0
movq -0x5a0(%rbp), %rsi
movq 0x447a(%rip), %rdi      # 0x9fe0
callq 0x2040
jmp 0x5b6d
xorl %eax, %eax
movl %eax, %esi
leaq -0x438(%rbp), %rdi
movl $0xa, %edx
callq 0x3870
movl %eax, -0x5a4(%rbp)
jmp 0x5b8a
movl -0x5a4(%rbp), %eax
movl %eax, -0x43c(%rbp)
cmpl $0x1, -0x43c(%rbp)
jne 0x5bd8
movq -0x3c0(%rbp), %rsi
leaq -0x40(%rbp), %rdi
xorl %edx, %edx
callq 0x2930
jmp 0x5bb3
jmp 0x5bd8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x438(%rbp), %rdi
callq 0x20f0
jmp 0x6401
cmpl $0x2, -0x43c(%rbp)
jne 0x5bf5
movq -0x3c0(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x2ae0
jmp 0x5bf3
jmp 0x5bf5
leaq -0x438(%rbp), %rdi
callq 0x20f0
jmp 0x5ace
movq -0x3c0(%rbp), %rax
testb $0x1, 0x48(%rax)
je 0x5d56
jmp 0x5c19
movq -0x3c0(%rbp), %rax
movb 0x6d(%rax), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x5c2e
jmp 0x5d54
movq 0x4393(%rip), %rdi      # 0x9fc8
leaq 0x14fa(%rip), %rsi      # 0x7136
callq 0x2180
movq %rax, -0x5b0(%rbp)
jmp 0x5c4a
movq -0x5b0(%rbp), %rdi
movq 0x4360(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x5c5f
movq 0x4362(%rip), %rdi      # 0x9fc8
leaq 0x14d1(%rip), %rsi      # 0x713e
callq 0x2180
movq %rax, -0x5b8(%rbp)
jmp 0x5c7b
movq -0x5b8(%rbp), %rdi
movq 0x432f(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x5c90
leaq -0x460(%rbp), %rdi
movq %rdi, -0x5c0(%rbp)
callq 0x21d0
movq -0x5c0(%rbp), %rsi
movq 0x432f(%rip), %rdi      # 0x9fe0
callq 0x2040
jmp 0x5cb8
xorl %eax, %eax
movl %eax, %esi
leaq -0x460(%rbp), %rdi
movl $0xa, %edx
callq 0x3870
movl %eax, -0x5c4(%rbp)
jmp 0x5cd5
movl -0x5c4(%rbp), %eax
movl %eax, -0x464(%rbp)
cmpl $0x1, -0x464(%rbp)
jne 0x5d26
movq -0x3c0(%rbp), %rsi
leaq -0x40(%rbp), %rdi
movl $0x1, %edx
callq 0x2930
jmp 0x5d01
jmp 0x5d26
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x460(%rbp), %rdi
callq 0x20f0
jmp 0x6401
cmpl $0x2, -0x464(%rbp)
jne 0x5d43
movq -0x3c0(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x2ce0
jmp 0x5d41
jmp 0x5d43
leaq -0x460(%rbp), %rdi
callq 0x20f0
jmp 0x5c19
jmp 0x5d56
leaq -0x40(%rbp), %rdi
callq 0x2f50
jmp 0x5d61
leaq -0x40(%rbp), %rdi
callq 0x3180
jmp 0x5d6c
movq 0x4255(%rip), %rdi      # 0x9fc8
leaq 0x13e7(%rip), %rsi      # 0x7161
callq 0x2180
movq %rax, -0x5d0(%rbp)
jmp 0x5d88
movq -0x5d0(%rbp), %rdi
movq 0x4222(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x5d9d
movl $0x0, -0x468(%rbp)
movslq -0x468(%rbp), %rax
movq %rax, -0x5d8(%rbp)
movq -0x3c8(%rbp), %rdi
addq $0x28, %rdi
callq 0x3600
movq %rax, %rcx
movq -0x5d8(%rbp), %rax
cmpq %rcx, %rax
jae 0x5e85
movq -0x3c8(%rbp), %rdi
addq $0x28, %rdi
movslq -0x468(%rbp), %rsi
callq 0x3620
movq (%rax), %rsi
addq $0x28, %rsi
movq 0x41cb(%rip), %rdi      # 0x9fc8
callq 0x2140
movq %rax, -0x5e0(%rbp)
jmp 0x5e0b
movq -0x5e0(%rbp), %rdi
leaq 0x1288(%rip), %rsi      # 0x70a1
callq 0x2180
movq %rax, -0x5e8(%rbp)
jmp 0x5e27
movq -0x3c8(%rbp), %rdi
addq $0x28, %rdi
movslq -0x468(%rbp), %rsi
callq 0x3620
movq -0x5e8(%rbp), %rdi
movq (%rax), %rsi
addq $0x8, %rsi
callq 0x2140
movq %rax, -0x5f0(%rbp)
jmp 0x5e5a
movq -0x5f0(%rbp), %rdi
movq 0x4150(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x5e6f
jmp 0x5e71
movl -0x468(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x468(%rbp)
jmp 0x5da7
movq 0x413c(%rip), %rdi      # 0x9fc8
movq 0x4125(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x5e9a
movq 0x4127(%rip), %rdi      # 0x9fc8
leaq 0x12ca(%rip), %rsi      # 0x7172
callq 0x2180
movq %rax, -0x5f8(%rbp)
jmp 0x5eb6
movq -0x5f8(%rbp), %rdi
movq 0x40f4(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x5ecb
movl $0x0, -0x46c(%rbp)
movslq -0x46c(%rbp), %rax
movq %rax, -0x600(%rbp)
movq -0x3c0(%rbp), %rdi
addq $0x28, %rdi
callq 0x3600
movq %rax, %rcx
movq -0x600(%rbp), %rax
cmpq %rcx, %rax
jae 0x5fb3
movq -0x3c0(%rbp), %rdi
addq $0x28, %rdi
movslq -0x46c(%rbp), %rsi
callq 0x3620
movq (%rax), %rsi
addq $0x28, %rsi
movq 0x409d(%rip), %rdi      # 0x9fc8
callq 0x2140
movq %rax, -0x608(%rbp)
jmp 0x5f39
movq -0x608(%rbp), %rdi
leaq 0x115a(%rip), %rsi      # 0x70a1
callq 0x2180
movq %rax, -0x610(%rbp)
jmp 0x5f55
movq -0x3c0(%rbp), %rdi
addq $0x28, %rdi
movslq -0x46c(%rbp), %rsi
callq 0x3620
movq -0x610(%rbp), %rdi
movq (%rax), %rsi
addq $0x8, %rsi
callq 0x2140
movq %rax, -0x618(%rbp)
jmp 0x5f88
movq -0x618(%rbp), %rdi
movq 0x4022(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x5f9d
jmp 0x5f9f
movl -0x46c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x46c(%rbp)
jmp 0x5ed5
movq 0x400e(%rip), %rdi      # 0x9fc8
movq 0x3ff7(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x5fc8
movq 0x3ff9(%rip), %rdi      # 0x9fc8
leaq 0x11a6(%rip), %rsi      # 0x717c
callq 0x2180
movq %rax, -0x620(%rbp)
jmp 0x5fe4
leaq -0x40(%rbp), %rdi
callq 0x2ee0
movl %eax, -0x624(%rbp)
jmp 0x5ff5
movl -0x624(%rbp), %esi
movq -0x620(%rbp), %rdi
callq 0x2220
movq %rax, -0x630(%rbp)
jmp 0x6010
movq -0x630(%rbp), %rdi
movq 0x3f9a(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x6025
movq -0x3c0(%rbp), %rax
cmpl $0x15, 0x24(%rax)
jle 0x6040
movq -0x3c0(%rbp), %rax
movl $0x0, 0x24(%rax)
movq -0x3c8(%rbp), %rax
cmpl $0x15, 0x24(%rax)
jle 0x605b
movq -0x3c8(%rbp), %rax
movl $0x0, 0x24(%rax)
movq -0x3c0(%rbp), %rax
movl 0x24(%rax), %eax
movq -0x3c8(%rbp), %rcx
cmpl 0x24(%rcx), %eax
jge 0x60c0
movq 0x3f50(%rip), %rdi      # 0x9fc8
leaq 0x110b(%rip), %rsi      # 0x718a
callq 0x2180
movq %rax, -0x638(%rbp)
jmp 0x608d
movq -0x638(%rbp), %rdi
movq 0x3f1d(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x60a2
movq -0x3c0(%rbp), %rax
movl 0x40(%rax), %ecx
movq -0x3c0(%rbp), %rax
subl 0x44(%rax), %ecx
movq -0x3c0(%rbp), %rax
movl %ecx, 0x40(%rax)
movq -0x3c0(%rbp), %rax
movl 0x24(%rax), %eax
movq -0x3c8(%rbp), %rcx
cmpl 0x24(%rcx), %eax
jle 0x6175
movq 0x3ee7(%rip), %rdi      # 0x9fc8
leaq 0x10ac(%rip), %rsi      # 0x7194
callq 0x2180
movq %rax, -0x640(%rbp)
jmp 0x60f6
movq -0x640(%rbp), %rdi
movq 0x3eb4(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x610b
movq -0x3c0(%rbp), %rdi
addq $0x28, %rdi
callq 0x3600
cmpq $0x2, %rax
jne 0x6155
movq -0x3c0(%rbp), %rax
movl 0x40(%rax), %ecx
movq -0x3c0(%rbp), %rax
movl 0x44(%rax), %eax
movl $0x2, %esi
cltd
idivl %esi
addl %eax, %ecx
movq -0x3c0(%rbp), %rax
addl 0x44(%rax), %ecx
movq -0x3c0(%rbp), %rax
movl %ecx, 0x40(%rax)
jmp 0x6173
movq -0x3c0(%rbp), %rax
movl 0x40(%rax), %ecx
movq -0x3c0(%rbp), %rax
addl 0x44(%rax), %ecx
movq -0x3c0(%rbp), %rax
movl %ecx, 0x40(%rax)
jmp 0x6175
movq -0x3c0(%rbp), %rax
movl 0x24(%rax), %eax
movq -0x3c8(%rbp), %rcx
cmpl 0x24(%rcx), %eax
jne 0x61be
movq 0x3e36(%rip), %rdi      # 0x9fc8
leaq 0x1005(%rip), %rsi      # 0x719e
callq 0x2180
movq %rax, -0x648(%rbp)
jmp 0x61a7
movq -0x648(%rbp), %rdi
movq 0x3e03(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x61bc
jmp 0x61be
cmpl $0x1, -0x3f0(%rbp)
jne 0x634b
movq -0x3c0(%rbp), %rax
cmpl $0x15, 0x4c(%rax)
jle 0x61e6
movq -0x3c0(%rbp), %rax
movl $0x0, 0x4c(%rax)
movq -0x3c0(%rbp), %rax
movl 0x4c(%rax), %eax
movq -0x3c8(%rbp), %rcx
cmpl 0x24(%rcx), %eax
jge 0x624b
movq 0x3dc5(%rip), %rdi      # 0x9fc8
leaq 0xf9f(%rip), %rsi       # 0x71a9
callq 0x2180
movq %rax, -0x650(%rbp)
jmp 0x6218
movq -0x650(%rbp), %rdi
movq 0x3d92(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x622d
movq -0x3c0(%rbp), %rax
movl 0x40(%rax), %ecx
movq -0x3c0(%rbp), %rax
subl 0x68(%rax), %ecx
movq -0x3c0(%rbp), %rax
movl %ecx, 0x40(%rax)
movq -0x3c0(%rbp), %rax
movl 0x24(%rax), %eax
movq -0x3c8(%rbp), %rcx
cmpl 0x24(%rcx), %eax
jle 0x6300
movq 0x3d5c(%rip), %rdi      # 0x9fc8
leaq 0xf4d(%rip), %rsi       # 0x71c0
callq 0x2180
movq %rax, -0x658(%rbp)
jmp 0x6281
movq -0x658(%rbp), %rdi
movq 0x3d29(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x6296
movq -0x3c0(%rbp), %rdi
addq $0x50, %rdi
callq 0x3600
cmpq $0x2, %rax
jne 0x62e0
movq -0x3c0(%rbp), %rax
movl 0x40(%rax), %ecx
movq -0x3c0(%rbp), %rax
movl 0x68(%rax), %eax
movl $0x2, %esi
cltd
idivl %esi
addl %eax, %ecx
movq -0x3c0(%rbp), %rax
addl 0x68(%rax), %ecx
movq -0x3c0(%rbp), %rax
movl %ecx, 0x40(%rax)
jmp 0x62fe
movq -0x3c0(%rbp), %rax
movl 0x40(%rax), %ecx
movq -0x3c0(%rbp), %rax
addl 0x68(%rax), %ecx
movq -0x3c0(%rbp), %rax
movl %ecx, 0x40(%rax)
jmp 0x6300
movq -0x3c0(%rbp), %rax
movl 0x24(%rax), %eax
movq -0x3c8(%rbp), %rcx
cmpl 0x24(%rcx), %eax
jne 0x6349
movq 0x3cab(%rip), %rdi      # 0x9fc8
leaq 0xeb4(%rip), %rsi       # 0x71d8
callq 0x2180
movq %rax, -0x660(%rbp)
jmp 0x6332
movq -0x660(%rbp), %rdi
movq 0x3c78(%rip), %rsi      # 0x9fb8
callq 0x21a0
jmp 0x6347
jmp 0x6349
jmp 0x634b
movq 0x3c76(%rip), %rdi      # 0x9fc8
leaq 0xe97(%rip), %rsi       # 0x71f0
callq 0x2180
jmp 0x6360
leaq -0x490(%rbp), %rdi
movq %rdi, -0x668(%rbp)
callq 0x21d0
movq -0x668(%rbp), %rsi
movq 0x3c5f(%rip), %rdi      # 0x9fe0
callq 0x2040
jmp 0x6388
leaq 0xe86(%rip), %rsi       # 0x7215
leaq -0x490(%rbp), %rdi
callq 0x6560
movb %al, -0x669(%rbp)
jmp 0x63a3
movb -0x669(%rbp), %al
testb $0x1, %al
jne 0x63af
jmp 0x63d8
movb $0x1, -0x3b1(%rbp)
jmp 0x63d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x490(%rbp), %rdi
callq 0x20f0
jmp 0x6401
leaq -0x490(%rbp), %rdi
callq 0x20f0
leaq -0x410(%rbp), %rdi
callq 0x20f0
leaq -0x3e8(%rbp), %rdi
callq 0x20f0
jmp 0x547b
leaq -0x410(%rbp), %rdi
callq 0x20f0
leaq -0x3e8(%rbp), %rdi
callq 0x20f0
jmp 0x6464
movl $0x0, -0x4(%rbp)
leaq -0x3b0(%rbp), %rdi
callq 0x2110
leaq -0x228(%rbp), %rdi
callq 0x2110
leaq -0x90(%rbp), %rdi
callq 0x20f0
leaq -0x70(%rbp), %rdi
callq 0x20f0
leaq -0x40(%rbp), %rdi
callq 0x2400
movl -0x4(%rbp), %eax
addq $0x670, %rsp            # imm = 0x670
popq %rbp
retq
leaq -0x3b0(%rbp), %rdi
callq 0x2110
leaq -0x228(%rbp), %rdi
callq 0x2110
leaq -0x90(%rbp), %rdi
callq 0x20f0
leaq -0x70(%rbp), %rdi
callq 0x20f0
leaq -0x40(%rbp), %rdi
callq 0x2400
movq -0x98(%rbp), %rdi
callq 0x2230
nopw %cs:(%rax,%rax)