// File: /workspace/github_cpp_makefile_star2_O3/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 $0x418, %rsp            # imm = 0x418
leaq -0xa8(%rbp), %rdi
callq 0x238c
xorl %eax, %eax
movl %eax, -0x3c(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x118(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0xf8(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movq 0x3c57(%rip), %rbx      # 0x6fd0
leaq 0x1d9c(%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 0x3c25(%rip), %rdi      # 0x6fd0
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq 0x3c21(%rip), %rdi      # 0x6fe0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %edx
movq 0x3c06(%rip), %rbx      # 0x6fe0
leaq -0x128(%rbp), %rsi
movq %rbx, %rdi
callq 0x21f0
leaq -0x438(%rbp), %rdi
leaq -0x128(%rbp), %rsi
movl $0x18, %edx
callq 0x21b0
leaq -0x438(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
callq 0x20b0
movq 0x3bb8(%rip), %r14      # 0x6fd0
leaq 0x1d0e(%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 0x3b86(%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 0x3b68(%rip), %rbx      # 0x6fe0
leaq -0x108(%rbp), %rsi
movq %rbx, %rdi
callq 0x21f0
leaq -0x2b0(%rbp), %rdi
leaq -0x108(%rbp), %rsi
movl $0x18, %edx
callq 0x21b0
leaq -0x2b0(%rbp), %rdi
leaq -0x64(%rbp), %rsi
callq 0x20b0
movl -0x3c(%rbp), %esi
leaq -0xa8(%rbp), %rdi
callq 0x23d6
movl -0x3c(%rbp), %esi
leaq -0xa8(%rbp), %rdi
callq 0x26f4
movl -0x64(%rbp), %esi
leaq -0xa8(%rbp), %rdi
callq 0x293a
leaq -0xa8(%rbp), %rdi
callq 0x2e88
movq %rax, %r13
leaq -0xa8(%rbp), %rdi
callq 0x3024
movq %rax, -0x38(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x2dee
leaq -0xd8(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq $0x0, -0xe0(%rbp)
movb $0x0, -0xd8(%rbp)
movl $0x1e, %edx
movq %r14, %rdi
leaq 0x1c0a(%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 0x1b4c(%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 0x1bb3(%rip), %rsi      # 0x515f
callq 0x2160
movl 0x40(%r13), %esi
movq %r14, %rdi
callq 0x21d0
movq %rax, %r12
movl $0xe, %edx
movq %rax, %rdi
leaq 0x1b9b(%rip), %rsi      # 0x516a
callq 0x2160
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %edx
movq %rbx, %rdi
leaq -0xe8(%rbp), %rsi
callq 0x21f0
movq -0xe8(%rbp), %r15
callq 0x2040
movq %rax, %r12
movl (%rax), %ebx
movl $0x0, (%rax)
movq %r15, %rdi
leaq -0xc8(%rbp), %rsi
movl $0xa, %edx
callq 0x2170
cmpq %r15, -0xc8(%rbp)
je 0x4482
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x4476
movl (%r12), %ecx
cmpl $0x22, %ecx
je 0x4476
testl %ecx, %ecx
jne 0x3689
movl %ebx, (%r12)
leaq -0xa8(%rbp), %rdi
movl %eax, %esi
callq 0x2bd0
leaq -0xa8(%rbp), %rdi
callq 0x2af4
leaq -0xa8(%rbp), %rdi
callq 0x2e96
movl $0x10, %edx
movq %r14, %rdi
leaq 0x1abb(%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 0x1a91(%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 -0x38(%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 0x1993(%rip), %rsi      # 0x50e5
callq 0x2160
movq -0x38(%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 (%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 0x198d(%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 0x28(%r13), %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 0x18be(%rip), %rsi      # 0x50e5
callq 0x2160
movq 0x28(%r13), %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 0x28(%r13), %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 0x184e(%rip), %rsi      # 0x50e5
callq 0x2160
movq 0x28(%r13), %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 0x1879(%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 0x1846(%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 0x1814(%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 0x28(%r13), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
movq 0x30(%rax), %rdx
cmpq 0x30(%rcx), %rdx
movq 0x3610(%rip), %rbx      # 0x6fe0
jne 0x3a28
testq %rdx, %rdx
je 0x39e8
movq 0x28(%rcx), %rsi
movq 0x28(%rax), %rdi
callq 0x2150
testl %eax, %eax
jne 0x3a28
movl $0x9, %edx
movq %r14, %rdi
leaq 0x17b7(%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
movb $0x1, 0x48(%r13)
leaq -0xb8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq $0x0, -0xc0(%rbp)
movb $0x0, -0xb8(%rbp)
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %edx
movq %rbx, %rdi
leaq -0xc8(%rbp), %rsi
callq 0x21f0
movq -0xc8(%rbp), %r15
movl (%r12), %ebx
movl $0x0, (%r12)
movq %r15, %rdi
leaq -0x60(%rbp), %rsi
movl $0xa, %edx
callq 0x2170
cmpq %r15, -0x60(%rbp)
je 0x448e
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x449a
movl (%r12), %ecx
cmpl $0x22, %ecx
je 0x449a
testl %ecx, %ecx
jne 0x3acb
movl %ebx, (%r12)
decl %eax
cmpl $0x3, %eax
ja 0x3b56
leaq 0x162f(%rip), %rcx      # 0x510c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
movq 0x34f5(%rip), %rbx      # 0x6fe0
jmpq *%rax
movl $0x0, -0x2c(%rbp)
leaq -0xa8(%rbp), %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x2814
jmp 0x3cbc
leaq -0xa8(%rbp), %rdi
movq %r13, %rsi
callq 0x2d86
jmp 0x3b4a
cmpb $0x1, 0x48(%r13)
jne 0x3b4a
movb $0x1, %al
movl %eax, -0x2c(%rbp)
leaq -0xa8(%rbp), %rdi
movq %r13, %rsi
callq 0x2b52
jmp 0x3cbc
leaq -0xa8(%rbp), %rdi
movq %r13, %rsi
callq 0x2930
movl $0x0, -0x2c(%rbp)
jmp 0x3cbc
movl $0x0, -0x2c(%rbp)
movq 0x347c(%rip), %rbx      # 0x6fe0
jmp 0x3cbc
movl $0x7, %edx
movq %r14, %rdi
leaq 0x1615(%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 0x15e2(%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 -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
movq $0x0, -0x58(%rbp)
movb $0x0, -0x50(%rbp)
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %edx
movq %rbx, %rdi
leaq -0x60(%rbp), %rsi
callq 0x21f0
movq -0x60(%rbp), %r15
movl (%r12), %ebx
movl $0x0, (%r12)
movq %r15, %rdi
leaq -0x70(%rbp), %rsi
movl $0xa, %edx
callq 0x2170
cmpq %r15, -0x70(%rbp)
je 0x4452
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x4446
movl (%r12), %ecx
cmpl $0x22, %ecx
je 0x4446
testl %ecx, %ecx
jne 0x3c70
movl %ebx, (%r12)
cmpl $0x2, %eax
je 0x3c94
cmpl $0x1, %eax
movq 0x3361(%rip), %rbx      # 0x6fe0
jne 0x3caa
leaq -0xa8(%rbp), %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x2814
jmp 0x3caa
leaq -0xa8(%rbp), %rdi
movq %r13, %rsi
callq 0x2930
movq 0x3336(%rip), %rbx      # 0x6fe0
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x3cbc
callq 0x2110
cmpb $0x0, 0x6c(%r13)
je 0x3b69
cmpb $0x1, 0x48(%r13)
jne 0x3e3c
cmpb $0x0, 0x6d(%r13)
jne 0x3e3c
movl $0x7, %edx
movq %r14, %rdi
leaq 0x14a1(%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 0x146e(%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 -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
movq $0x0, -0x58(%rbp)
movb $0x0, -0x50(%rbp)
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %edx
movq %rbx, %rdi
leaq -0x60(%rbp), %rsi
callq 0x21f0
movq -0x60(%rbp), %r15
movl (%r12), %ebx
movl $0x0, (%r12)
movq %r15, %rdi
leaq -0x70(%rbp), %rsi
movl $0xa, %edx
callq 0x2170
cmpq %r15, -0x70(%rbp)
je 0x446a
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x445e
movl (%r12), %ecx
cmpl $0x22, %ecx
je 0x445e
testl %ecx, %ecx
jne 0x3de4
movl %ebx, (%r12)
cmpl $0x2, %eax
je 0x3e0b
cmpl $0x1, %eax
movq 0x31ed(%rip), %rbx      # 0x6fe0
jne 0x3e21
leaq -0xa8(%rbp), %rdi
movq %r13, %rsi
movl $0x1, %edx
callq 0x2814
jmp 0x3e21
leaq -0xa8(%rbp), %rdi
movq %r13, %rsi
callq 0x2b48
movq 0x31bf(%rip), %rbx      # 0x6fe0
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x3cd2
callq 0x2110
jmp 0x3cd2
leaq -0xa8(%rbp), %rdi
callq 0x2da4
leaq -0xa8(%rbp), %rdi
callq 0x2e96
movl $0x10, %edx
movq %r14, %rdi
leaq 0x1355(%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 -0x38(%rbp), %rcx
movq 0x28(%rcx), %rax
cmpq %rax, 0x30(%rcx)
je 0x3f34
xorl %r12d, %r12d
movq (%rax,%r12,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 0x121b(%rip), %rsi      # 0x50e5
callq 0x2160
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax,%r12,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 %r12
movq -0x38(%rbp), %rcx
movq 0x28(%rcx), %rax
movq 0x30(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r12, %rcx
ja 0x3ea4
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 0x125f(%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 0x28(%r13), %rax
cmpq %rax, 0x30(%r13)
je 0x402f
xorl %r12d, %r12d
movq (%rax,%r12,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 0x1118(%rip), %rsi      # 0x50e5
callq 0x2160
movq 0x28(%r13), %rax
movq (%rax,%r12,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 %r12
movq 0x28(%r13), %rax
movq 0x30(%r13), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r12, %rcx
ja 0x3fa7
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 $0xd, %edx
movq %r14, %rdi
leaq 0x116e(%rip), %rsi      # 0x51d3
callq 0x2160
leaq -0xa8(%rbp), %rdi
callq 0x2d7c
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
movl 0x24(%r13), %eax
cmpl $0x16, %eax
jl 0x40bd
movl $0x0, 0x24(%r13)
xorl %eax, %eax
movq -0x38(%rbp), %rcx
movl 0x24(%rcx), %ecx
cmpl $0x16, %ecx
jl 0x40da
movq -0x38(%rbp), %rax
movl $0x0, 0x24(%rax)
movl 0x24(%r13), %eax
xorl %ecx, %ecx
cmpl %ecx, %eax
jge 0x412c
movl $0x9, %edx
movq %r14, %rdi
leaq 0x10f4(%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
movl 0x24(%r13), %eax
movl 0x44(%r13), %ecx
subl %ecx, 0x40(%r13)
movq -0x38(%rbp), %rcx
movl 0x24(%rcx), %ecx
cmpl %ecx, %eax
jle 0x4196
movl $0x9, %edx
movq %r14, %rdi
leaq 0x10ac(%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(%r13), %rdx
subq 0x28(%r13), %rdx
movl 0x40(%r13), %eax
movl 0x44(%r13), %ecx
cmpq $0x10, %rdx
jne 0x4190
movl %ecx, %edx
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
addl %ecx, %eax
addl %edx, %eax
jmp 0x4192
addl %ecx, %eax
movl %eax, 0x40(%r13)
movl 0x24(%r13), %eax
movq -0x38(%rbp), %rcx
cmpl 0x24(%rcx), %eax
jne 0x41de
movl $0xa, %edx
movq %r14, %rdi
leaq 0x1043(%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, -0x2c(%rbp)
je 0x4304
movl 0x4c(%r13), %eax
cmpl $0x16, %eax
jl 0x41fb
movl $0x0, 0x4c(%r13)
xorl %eax, %eax
movq -0x38(%rbp), %rcx
movl 0x24(%rcx), %ecx
cmpl %ecx, %eax
jge 0x4250
movl $0x16, %edx
movq %r14, %rdi
leaq 0xfeb(%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
movl 0x68(%r13), %eax
subl %eax, 0x40(%r13)
movq -0x38(%rbp), %rax
movl 0x24(%rax), %ecx
cmpl %ecx, 0x24(%r13)
jle 0x42bc
movl $0x17, %edx
movq %r14, %rdi
leaq 0xfb2(%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 0x58(%r13), %rdx
subq 0x50(%r13), %rdx
movl 0x40(%r13), %eax
movl 0x68(%r13), %ecx
cmpq $0x10, %rdx
jne 0x42b6
movl %ecx, %edx
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
addl %ecx, %eax
addl %edx, %eax
jmp 0x42b8
addl %ecx, %eax
movl %eax, 0x40(%r13)
movl 0x24(%r13), %eax
movq -0x38(%rbp), %rcx
cmpl 0x24(%rcx), %eax
jne 0x4304
movl $0x17, %edx
movq %r14, %rdi
leaq 0xf57(%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 0xf34(%rip), %rsi       # 0x5247
callq 0x2160
leaq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
movq $0x0, -0x58(%rbp)
movb $0x0, -0x50(%rbp)
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2130
leaq -0x60(%rbp), %r15
movsbl %al, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x21f0
movq %r15, %rdi
leaq 0xf10(%rip), %rsi       # 0x526c
callq 0x2060
movl %eax, %r12d
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x4376
callq 0x2110
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x438e
callq 0x2110
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0x43a6
callq 0x2110
testl %r12d, %r12d
jne 0x34fb
movq 0x2c02(%rip), %rbx      # 0x6fb8
leaq -0x2b0(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x20d0
movl $0x80, %r14d
addq %r14, %r15
movq %r15, %rdi
callq 0x2070
leaq -0x438(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x20d0
addq %r14, %r15
movq %r15, %rdi
callq 0x2070
movq -0x108(%rbp), %rdi
leaq -0xf8(%rbp), %rax
cmpq %rax, %rdi
je 0x440e
callq 0x2110
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
cmpq %rax, %rdi
je 0x4426
callq 0x2110
leaq -0xa8(%rbp), %rdi
callq 0x23a8
xorl %eax, %eax
addq $0x418, %rsp            # imm = 0x418
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc9d(%rip), %rdi       # 0x50ea
callq 0x2180
leaq 0xc91(%rip), %rdi       # 0x50ea
callq 0x20a0
leaq 0xc85(%rip), %rdi       # 0x50ea
callq 0x2180
leaq 0xc79(%rip), %rdi       # 0x50ea
callq 0x20a0
leaq 0xc6d(%rip), %rdi       # 0x50ea
callq 0x2180
leaq 0xc61(%rip), %rdi       # 0x50ea
callq 0x20a0
leaq 0xc55(%rip), %rdi       # 0x50ea
callq 0x20a0
leaq 0xc49(%rip), %rdi       # 0x50ea
callq 0x2180
jmp 0x44c0
jmp 0x44c0
jmp 0x44b8
jmp 0x44b0
jmp 0x44c0
movq %rax, %r14
jmp 0x459d
movq %rax, %r14
jmp 0x457e
movq %rax, %r14
jmp 0x455f
jmp 0x4521
jmp 0x4508
jmp 0x452c
movq %rax, %r14
cmpl $0x0, (%r12)
jne 0x452f
movl %ebx, (%r12)
jmp 0x452f
movq %rax, %r14
cmpl $0x0, (%r12)
jne 0x4547
movl %ebx, (%r12)
jmp 0x4547
jmp 0x4508
jmp 0x4508
jmp 0x44f8
jmp 0x4508
jmp 0x4521
movq %rax, %r14
cmpl $0x0, (%r12)
jne 0x450b
movl %ebx, (%r12)
jmp 0x450b
movq %rax, %r14
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x452f
callq 0x2110
jmp 0x452f
jmp 0x452c
movq %rax, %r14
jmp 0x4547
jmp 0x452c
jmp 0x452c
jmp 0x452c
movq %rax, %r14
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x4547
callq 0x2110
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0x455f
callq 0x2110
movq 0x2a52(%rip), %rsi      # 0x6fb8
leaq -0x2b0(%rbp), %rdi
callq 0x20d0
leaq -0x230(%rbp), %rdi
callq 0x2070
movq 0x2a33(%rip), %rsi      # 0x6fb8
leaq -0x438(%rbp), %rdi
callq 0x20d0
leaq -0x3b8(%rbp), %rdi
callq 0x2070
leaq -0xf8(%rbp), %rax
movq -0x108(%rbp), %rdi
cmpq %rax, %rdi
je 0x45b5
callq 0x2110
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
cmpq %rax, %rdi
je 0x45cd
callq 0x2110
leaq -0xa8(%rbp), %rdi
callq 0x23a8
movq %r14, %rdi
callq 0x21e0