// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x428, %rsp            # imm = 0x428
leaq -0xb8(%rbp), %rdi
callq 0x238c
xorl %eax, %eax
movl %eax, -0x44(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x128(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x108(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movq 0x3c3b(%rip), %rbx      # 0x6fd0
leaq 0x1d80(%rip), %rsi      # 0x511c
movl $0x10, %edx
movq %rbx, %rdi
callq 0x2160
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq 0x3c09(%rip), %rdi      # 0x6fd0
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq 0x3c05(%rip), %rdi      # 0x6fe0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %edx
movq 0x3bea(%rip), %rbx      # 0x6fe0
leaq -0x138(%rbp), %rsi
movq %rbx, %rdi
callq 0x21f0
leaq -0x448(%rbp), %rdi
leaq -0x138(%rbp), %rsi
movl $0x18, %edx
callq 0x21b0
leaq -0x448(%rbp), %rdi
leaq -0x44(%rbp), %rsi
callq 0x20b0
movq 0x3b9c(%rip), %r14      # 0x6fd0
leaq 0x1cf2(%rip), %rsi      # 0x512d
movl $0x12, %edx
movq %r14, %rdi
callq 0x2160
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq 0x3b6a(%rip), %r14      # 0x6fd0
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %edx
movq 0x3b4c(%rip), %r13      # 0x6fe0
leaq -0x118(%rbp), %rsi
movq %r13, %rdi
callq 0x21f0
leaq -0x2c0(%rbp), %rdi
leaq -0x118(%rbp), %rsi
movl $0x18, %edx
callq 0x21b0
leaq -0x2c0(%rbp), %rdi
leaq -0x6c(%rbp), %rsi
callq 0x20b0
movl -0x44(%rbp), %esi
leaq -0xb8(%rbp), %rdi
callq 0x23d6
movl -0x44(%rbp), %esi
leaq -0xb8(%rbp), %rdi
callq 0x270e
movl -0x6c(%rbp), %esi
leaq -0xb8(%rbp), %rdi
callq 0x2952
leaq -0xb8(%rbp), %rdi
callq 0x2ea4
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x3040
movq %rax, -0x40(%rbp)
movq $0x0, -0x78(%rbp)
movq %rbx, -0x30(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x2e04
leaq -0xe8(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq $0x0, -0xf0(%rbp)
movb $0x0, -0xe8(%rbp)
movl $0x1e, %edx
movq %r14, %rdi
leaq 0x1be2(%rip), %rsi      # 0x5140
callq 0x2160
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movl $0x1f, %edx
movq %r14, %rdi
leaq 0x1b24(%rip), %rsi      # 0x50bd
callq 0x2160
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movl $0xa, %edx
movq %r14, %rdi
leaq 0x1b8b(%rip), %rsi      # 0x515f
callq 0x2160
movl 0x40(%rbx), %esi
movq %r14, %rdi
callq 0x21d0
movq %rax, %r15
movl $0xe, %edx
movq %rax, %rdi
leaq 0x1b74(%rip), %rsi      # 0x516a
callq 0x2160
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %edx
movq %r13, %rdi
leaq -0xf8(%rbp), %rsi
callq 0x21f0
movq -0xf8(%rbp), %r15
callq 0x2040
movq %rax, %r12
movl (%rax), %ebx
movl $0x0, (%rax)
movq %r15, %rdi
leaq -0xd8(%rbp), %rsi
movl $0xa, %edx
callq 0x2170
cmpq %r15, -0xd8(%rbp)
je 0x44e5
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x44d9
movl (%r12), %ecx
cmpl $0x22, %ecx
je 0x44d9
testl %ecx, %ecx
jne 0x36b0
movl %ebx, (%r12)
leaq -0xb8(%rbp), %rdi
movl %eax, %esi
callq 0x2be6
movq -0x40(%rbp), %rbx
leaq -0xb8(%rbp), %rdi
callq 0x2b0c
leaq -0xb8(%rbp), %rdi
callq 0x2eb2
movl $0x10, %edx
movq %r14, %rdi
leaq 0x1a90(%rip), %rsi      # 0x5179
callq 0x2160
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movl $0x2, %edx
movq %r14, %rdi
leaq 0x1a66(%rip), %rsi      # 0x518a
callq 0x2160
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq 0x28(%rbx), %rax
movq (%rax), %rax
movq 0x28(%rax), %rsi
movq 0x30(%rax), %rdx
movq %r14, %rdi
callq 0x2160
movq %rax, %r15
movl $0x4, %edx
movq %rax, %rdi
leaq 0x196c(%rip), %rsi      # 0x50e5
callq 0x2160
movq 0x28(%rbx), %rax
movq (%rax), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %r15, %rdi
callq 0x2160
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movl $0xa, %edx
movq %r14, %rdi
leaq 0x196a(%rip), %rsi      # 0x515f
callq 0x2160
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movq 0x28(%rax), %rsi
movq 0x30(%rax), %rdx
movq %r14, %rdi
callq 0x2160
movq %rax, %r15
movl $0x4, %edx
movq %rax, %rdi
leaq 0x1897(%rip), %rsi      # 0x50e5
callq 0x2160
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %r15, %rdi
callq 0x2160
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
movq 0x28(%rax), %rsi
movq 0x30(%rax), %rdx
movq %r14, %rdi
callq 0x2160
movq %rax, %r15
movl $0x4, %edx
movq %rax, %rdi
leaq 0x181f(%rip), %rsi      # 0x50e5
callq 0x2160
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %r15, %rdi
callq 0x2160
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movl $0x7, %edx
movq %r14, %rdi
leaq 0x1846(%rip), %rsi      # 0x518d
callq 0x2160
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movl $0x8, %edx
movq %r14, %rdi
leaq 0x1813(%rip), %rsi      # 0x5195
callq 0x2160
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movl $0xf, %edx
movq %r14, %rdi
leaq 0x17e1(%rip), %rsi      # 0x519e
callq 0x2160
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
movq 0x30(%rax), %rdx
cmpq 0x30(%rcx), %rdx
jne 0x3a5b
testq %rdx, %rdx
je 0x3a18
movq 0x28(%rcx), %rsi
movq 0x28(%rax), %rdi
callq 0x2150
testl %eax, %eax
jne 0x3a5b
movl $0x9, %edx
movq %r14, %rdi
leaq 0x1787(%rip), %rsi      # 0x51ae
callq 0x2160
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq -0x30(%rbp), %rax
movb $0x1, 0x48(%rax)
leaq -0xc8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq $0x0, -0xd0(%rbp)
movb $0x0, -0xc8(%rbp)
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %edx
movq %r13, %rdi
leaq -0xd8(%rbp), %rsi
callq 0x21f0
movq -0xd8(%rbp), %rbx
movl (%r12), %eax
movl %eax, -0x34(%rbp)
movl $0x0, (%r12)
movq %rbx, %rdi
leaq -0x68(%rbp), %rsi
movl $0xa, %edx
callq 0x2170
cmpq %rbx, -0x68(%rbp)
je 0x44f1
movq %rax, %r15
addq $-0x80000000, %rax      # imm = 0x80000000
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
cmpq %rcx, %rax
jb 0x44fd
movl (%r12), %eax
cmpl $0x22, %eax
je 0x44fd
testl %eax, %eax
movq -0x40(%rbp), %rbx
jne 0x3b0b
movl -0x34(%rbp), %eax
movl %eax, (%r12)
leal -0x1(%r15), %eax
cmpl $0x3, %eax
ja 0x3b9b
leaq 0x15ed(%rip), %rcx      # 0x510c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0xb8(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %edx, %edx
callq 0x2834
cmpl $0x4, %r15d
je 0x3b7e
cmpl $0x3, %r15d
je 0x3b68
cmpl $0x2, %r15d
jne 0x3b9b
leaq -0xb8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x2948
cmpl $0x4, %r15d
je 0x3b7e
cmpl $0x3, %r15d
jne 0x3b9b
leaq -0xb8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x2d9c
cmpl $0x4, %r15d
jne 0x3b9b
movq -0x30(%rbp), %rsi
cmpb $0x1, 0x48(%rsi)
jne 0x3b9b
movb $0x1, %al
movl %eax, -0x34(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x2b6a
jmp 0x3ba2
movl $0x0, -0x34(%rbp)
movq -0x30(%rbp), %rax
cmpb $0x0, 0x6c(%rax)
jne 0x3d19
movl $0x7, %edx
movq %r14, %rdi
leaq 0x15ce(%rip), %rsi      # 0x518d
callq 0x2160
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movl $0x8, %edx
movq %r14, %rdi
leaq 0x159b(%rip), %rsi      # 0x5195
callq 0x2160
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
leaq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
movq $0x0, -0x60(%rbp)
movb $0x0, -0x58(%rbp)
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %edx
movq %r13, %rdi
leaq -0x68(%rbp), %rsi
callq 0x21f0
movq -0x68(%rbp), %rbx
movl (%r12), %r13d
movl $0x0, (%r12)
movq %rbx, %rdi
leaq -0x80(%rbp), %rsi
movl $0xa, %edx
callq 0x2170
cmpq %rbx, -0x80(%rbp)
je 0x44a9
movq %rax, %r15
addq $-0x80000000, %rax      # imm = 0x80000000
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
cmpq %rcx, %rax
jb 0x44b5
movl (%r12), %eax
cmpl $0x22, %eax
je 0x44b5
testl %eax, %eax
jne 0x3cba
movl %r13d, (%r12)
cmpl $0x2, %r15d
movq -0x40(%rbp), %rbx
je 0x3ce2
cmpl $0x1, %r15d
jne 0x3cf2
leaq -0xb8(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %edx, %edx
callq 0x2834
cmpl $0x2, %r15d
jne 0x3cf2
leaq -0xb8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x2948
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x3d04
callq 0x2110
movq -0x30(%rbp), %rax
cmpb $0x0, 0x6c(%rax)
movq 0x32cd(%rip), %r13      # 0x6fe0
je 0x3bb0
movq -0x30(%rbp), %rax
cmpb $0x1, 0x48(%rax)
jne 0x3ea1
movq -0x30(%rbp), %rax
cmpb $0x0, 0x6d(%rax)
jne 0x3ea1
movl $0x7, %edx
movq %r14, %rdi
leaq 0x1449(%rip), %rsi      # 0x518d
callq 0x2160
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movl $0x8, %edx
movq %r14, %rdi
leaq 0x1416(%rip), %rsi      # 0x5195
callq 0x2160
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
leaq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
movq $0x0, -0x60(%rbp)
movb $0x0, -0x58(%rbp)
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %edx
movq %r13, %rdi
leaq -0x68(%rbp), %rsi
callq 0x21f0
movq -0x68(%rbp), %rbx
movl (%r12), %r13d
movl $0x0, (%r12)
movq %rbx, %rdi
leaq -0x80(%rbp), %rsi
movl $0xa, %edx
callq 0x2170
cmpq %rbx, -0x80(%rbp)
je 0x44c1
movq %rax, %r15
addq $-0x80000000, %rax      # imm = 0x80000000
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
cmpq %rcx, %rax
jb 0x44cd
movl (%r12), %eax
cmpl $0x22, %eax
je 0x44cd
testl %eax, %eax
jne 0x3e3f
movl %r13d, (%r12)
cmpl $0x2, %r15d
movq -0x40(%rbp), %rbx
je 0x3e6a
cmpl $0x1, %r15d
jne 0x3e7a
leaq -0xb8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl $0x1, %edx
callq 0x2834
cmpl $0x2, %r15d
jne 0x3e7a
leaq -0xb8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x2b60
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x3e8c
callq 0x2110
movq -0x30(%rbp), %rax
cmpb $0x0, 0x6d(%rax)
movq 0x3145(%rip), %r13      # 0x6fe0
je 0x3d35
leaq -0xb8(%rbp), %rdi
callq 0x2dba
leaq -0xb8(%rbp), %rdi
callq 0x2eb2
movl $0x10, %edx
movq %r14, %rdi
leaq 0x12f0(%rip), %rsi      # 0x51b8
callq 0x2160
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq 0x28(%rbx), %rax
cmpq %rax, 0x30(%rbx)
je 0x3f94
xorl %ebx, %ebx
movq (%rax,%rbx,8), %rax
movq 0x28(%rax), %rsi
movq 0x30(%rax), %rdx
movq %r14, %rdi
callq 0x2160
movq %rax, %r15
movl $0x4, %edx
movq %rax, %rdi
leaq 0x11bb(%rip), %rsi      # 0x50e5
callq 0x2160
movq -0x40(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax,%rbx,8), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %r15, %rdi
callq 0x2160
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
incq %rbx
movq -0x40(%rbp), %rcx
movq 0x28(%rcx), %rax
movq 0x30(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rbx, %rcx
ja 0x3f04
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movl $0x9, %edx
movq %r14, %rdi
leaq 0x11ff(%rip), %rsi      # 0x51c9
callq 0x2160
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq -0x30(%rbp), %r12
movq 0x28(%r12), %rax
cmpq %rax, 0x30(%r12)
je 0x4097
xorl %ebx, %ebx
movq (%rax,%rbx,8), %rax
movq 0x28(%rax), %rsi
movq 0x30(%rax), %rdx
movq %r14, %rdi
callq 0x2160
movq %rax, %r15
movl $0x4, %edx
movq %rax, %rdi
leaq 0x10b3(%rip), %rsi      # 0x50e5
callq 0x2160
movq 0x28(%r12), %rax
movq (%rax,%rbx,8), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %r15, %rdi
callq 0x2160
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
incq %rbx
movq 0x28(%r12), %rax
movq 0x30(%r12), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %rbx, %rcx
ja 0x400c
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movq -0x40(%rbp), %rbx
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movl $0xd, %edx
movq %r14, %rdi
leaq 0x1102(%rip), %rsi      # 0x51d3
callq 0x2160
leaq -0xb8(%rbp), %rdi
callq 0x2d92
movq %r14, %rdi
movl %eax, %esi
callq 0x21d0
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq -0x30(%rbp), %rsi
cmpl $0x16, 0x24(%rsi)
jl 0x4127
movl $0x0, 0x24(%rsi)
cmpl $0x16, 0x24(%rbx)
jl 0x4134
movl $0x0, 0x24(%rbx)
movl 0x24(%rsi), %eax
cmpl 0x24(%rbx), %eax
jge 0x4181
movl $0x9, %edx
movq %r14, %rdi
leaq 0x1096(%rip), %rsi      # 0x51e1
callq 0x2160
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq -0x30(%rbp), %rsi
movl 0x44(%rsi), %eax
subl %eax, 0x40(%rsi)
movl 0x24(%rsi), %eax
cmpl 0x24(%rbx), %eax
jle 0x41f1
movl $0x9, %edx
movq %r14, %rdi
leaq 0x1053(%rip), %rsi      # 0x51eb
callq 0x2160
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq -0x30(%rbp), %rsi
movq 0x30(%rsi), %rcx
subq 0x28(%rsi), %rcx
movl 0x40(%rsi), %eax
cmpq $0x10, %rcx
jne 0x41eb
movl 0x44(%rsi), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
addl %ecx, %eax
addl %edx, %eax
jmp 0x41ee
addl 0x44(%rsi), %eax
movl %eax, 0x40(%rsi)
movl 0x24(%rsi), %eax
cmpl 0x24(%rbx), %eax
jne 0x4234
movl $0xa, %edx
movq %r14, %rdi
leaq 0xfed(%rip), %rsi       # 0x51f5
callq 0x2160
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
cmpb $0x0, -0x34(%rbp)
je 0x434f
movq -0x30(%rbp), %rsi
cmpl $0x16, 0x4c(%rsi)
jl 0x424f
movl $0x0, 0x4c(%rsi)
movl 0x4c(%rsi), %eax
cmpl 0x24(%rbx), %eax
jge 0x429c
movl $0x16, %edx
movq %r14, %rdi
leaq 0xf9a(%rip), %rsi       # 0x5200
callq 0x2160
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq -0x30(%rbp), %rsi
movl 0x68(%rsi), %eax
subl %eax, 0x40(%rsi)
movl 0x24(%rsi), %eax
cmpl 0x24(%rbx), %eax
jle 0x430c
movl $0x17, %edx
movq %r14, %rdi
leaq 0xf64(%rip), %rsi       # 0x5217
callq 0x2160
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq -0x30(%rbp), %rsi
movq 0x58(%rsi), %rcx
subq 0x50(%rsi), %rcx
movl 0x40(%rsi), %eax
cmpq $0x10, %rcx
jne 0x4306
movl 0x68(%rsi), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
addl %ecx, %eax
addl %edx, %eax
jmp 0x4309
addl 0x68(%rsi), %eax
movl %eax, 0x40(%rsi)
movl 0x24(%rsi), %eax
cmpl 0x24(%rbx), %eax
jne 0x434f
movl $0x17, %edx
movq %r14, %rdi
leaq 0xf0c(%rip), %rsi       # 0x522f
callq 0x2160
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movl $0x24, %edx
movq %r14, %rdi
leaq 0xee9(%rip), %rsi       # 0x5247
callq 0x2160
leaq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
movq $0x0, -0x60(%rbp)
movb $0x0, -0x58(%rbp)
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2130
leaq -0x68(%rbp), %rbx
movsbl %al, %edx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x21f0
movq %rbx, %rdi
leaq 0xec4(%rip), %rsi       # 0x526c
callq 0x2060
testl %eax, %eax
movq -0x78(%rbp), %rax
movzbl %al, %eax
movl $0x1, %ecx
cmovel %ecx, %eax
movq %rax, -0x78(%rbp)
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
movq -0x30(%rbp), %rbx
je 0x43d8
callq 0x2110
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0x43f0
callq 0x2110
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0x4408
callq 0x2110
testb $0x1, -0x78(%rbp)
je 0x3523
movq 0x2b9f(%rip), %rbx      # 0x6fb8
leaq -0x2c0(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x20d0
movl $0x80, %r14d
addq %r14, %r15
movq %r15, %rdi
callq 0x2070
leaq -0x448(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x20d0
addq %r14, %r15
movq %r15, %rdi
callq 0x2070
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0x4471
callq 0x2110
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0x4489
callq 0x2110
leaq -0xb8(%rbp), %rdi
callq 0x23a8
xorl %eax, %eax
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc3a(%rip), %rdi       # 0x50ea
callq 0x20a0
leaq 0xc2e(%rip), %rdi       # 0x50ea
callq 0x2180
leaq 0xc22(%rip), %rdi       # 0x50ea
callq 0x20a0
leaq 0xc16(%rip), %rdi       # 0x50ea
callq 0x2180
leaq 0xc0a(%rip), %rdi       # 0x50ea
callq 0x2180
leaq 0xbfe(%rip), %rdi       # 0x50ea
callq 0x20a0
leaq 0xbf2(%rip), %rdi       # 0x50ea
callq 0x20a0
leaq 0xbe6(%rip), %rdi       # 0x50ea
callq 0x2180
jmp 0x4523
jmp 0x4523
jmp 0x451b
jmp 0x4513
jmp 0x4523
movq %rax, %r14
jmp 0x4603
movq %rax, %r14
jmp 0x45e4
movq %rax, %r14
jmp 0x45c5
jmp 0x4587
jmp 0x455e
jmp 0x4592
movq %rax, %r14
cmpl $0x0, (%r12)
jne 0x4595
movl -0x34(%rbp), %eax
movl %eax, (%r12)
jmp 0x4595
movq %rax, %r14
cmpl $0x0, (%r12)
jne 0x45ad
movl %ebx, (%r12)
jmp 0x45ad
jmp 0x455e
jmp 0x455e
jmp 0x455e
jmp 0x4563
jmp 0x4587
movq %rax, %r14
jmp 0x4571
movq %rax, %r14
cmpl $0x0, (%r12)
jne 0x4571
movl %r13d, (%r12)
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x4595
callq 0x2110
jmp 0x4595
jmp 0x4592
movq %rax, %r14
jmp 0x45ad
jmp 0x4592
jmp 0x4592
jmp 0x4592
movq %rax, %r14
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0x45ad
callq 0x2110
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0x45c5
callq 0x2110
movq 0x29ec(%rip), %rsi      # 0x6fb8
leaq -0x2c0(%rbp), %rdi
callq 0x20d0
leaq -0x240(%rbp), %rdi
callq 0x2070
movq 0x29cd(%rip), %rsi      # 0x6fb8
leaq -0x448(%rbp), %rdi
callq 0x20d0
leaq -0x3c8(%rbp), %rdi
callq 0x2070
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0x461b
callq 0x2110
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0x4633
callq 0x2110
leaq -0xb8(%rbp), %rdi
callq 0x23a8
movq %r14, %rdi
callq 0x21e0