// File: /workspace/github_cpp_makefile_star2_O3/MichaelXanth[P]RPG_Game/Market/Market.cpp
// Function: Market::Sale(Hero&, int const&)
void Market::Sale(Hero& hero, const int& sellState)
{
    int  column, row;
    char confirmation;
    bool errFlag = false;
    string testSelections[2];

    cout << endl;
    cout << "-------------------------------" << endl << endl;
    cout << "(Type 0 to cancel)" << endl;

    if (sellState == 0) {
        cout << "Choose a Spell by selecting its position in the table(e.g.: \033[1;34m<\033[1;33mcolumn\033[1;34m> <\033[1;33mrow\033[1;34m>\033[0m): ";

        cout << "\n\n\n\n\n\n\n\n";
        cout << "\033[8A\033[77C";
    
    } else if (sellState == 1) {
        cout << "Choose an Item by selecting its position in the table(e.g.: \033[1;34m<\033[1;33mcolumn\033[1;34m> <\033[1;33mrow\033[1;34m>\033[0m): ";

        cout << "\n\n\n\n\n\n\n\n";
        cout << "\033[8A\033[77C";
    
    } else {
        cout << "Choose an Item or a Spell by selecting its position in the table(e.g.: \033[1;34m<\033[1;33mcolumn\033[1;34m> <\033[1;33mrow\033[1;34m>\033[0m): ";

        cout << "\n\n\n\n\n\n\n\n";
        cout << "\033[8A\033[88C";
    }

    cout << "\033[s";

    do {
        if (errFlag)
            usleep(1800000);

        cout << "\033[u";
        cout << "\033[J";
        cout << "\033[s";

        errFlag = true;

        cin >> testSelections[0];

        if (testSelections[0] == "0") {
            column = 0;
            break;
        }

        cin >> testSelections[1];
    } while(!hero.isValidForSale(testSelections,column,row,sellState));

    if (column == 0) {
        cout << endl << "\033[1;32mInfo:\033[0m The sale operation was canceled." << endl << endl;
        return;
    }

    switch(column)
    {
        case 1:
            if (sellState == 1) {
                cout << endl << "Are you sure you want to sell \"\033[1m\033[38;5;166m" << hero.GetWeaponFromSlot(row - 1)->GetName() << "\033[0m\" Weapon? [y/n]: ";

                do {
                    cin >> confirmation;
                } while(confirmation != 'y' && confirmation != 'Y' && confirmation != 'n' && confirmation != 'N');

                if (confirmation == 'n' || confirmation == 'N')
                    break;

                hero.RemoveWeapon(row - 1);
            
            } else {
                cout << endl << "Are you sure you want to sell \"\033[1m\033[38;5;32m" << hero.GetSpellFromSlot(row - 1, 2)->GetName() << "\033[0m\" Ice Spell? [y/n]: ";

                do {
                    cin >> confirmation;
                } while(confirmation != 'y' && confirmation != 'Y' && confirmation != 'n' && confirmation != 'N');

                if (confirmation == 'n' || confirmation == 'N')
                    break;

                hero.RemoveIceSpell(row - 1);
            }

            break;

        case 2:
            if (sellState == 1) {
                cout << endl << "Are you sure you want to sell \"\033[1m\033[38;5;28m" << hero.GetArmorFromSlot(row - 1)->GetName() << "\033[0m\" Armor? [y/n]: ";

                do {
                    cin >> confirmation;
                } while(confirmation != 'y' && confirmation != 'Y' && confirmation != 'n' && confirmation != 'N');

                if (confirmation == 'n' || confirmation == 'N')
                    break;

                hero.RemoveArmor(row - 1);
            
            } else {
                cout << endl << "Are you sure you want to sell \"\033[1m\033[1;31m" << hero.GetSpellFromSlot(row - 1, 3)->GetName() << "\033[0m\" Fire Spell? [y/n]: ";

                do {
                    cin >> confirmation;
                } while(confirmation != 'y' && confirmation != 'Y' && confirmation != 'n' && confirmation != 'N');

                if (confirmation == 'n' || confirmation == 'N')
                    break;

                hero.RemoveFireSpell(row - 1);
            }

            break;

        case 3:
            if (sellState == 1) {
                cout << endl << "Are you sure you want to sell \"\033[1m\033[38;5;90m" << hero.GetPotionFromSlot(row - 1)->GetName() << "\033[0m\" Potion? [y/n]: ";

                do {
                    cin >> confirmation;
                } while(confirmation != 'y' && confirmation != 'Y' && confirmation != 'n' && confirmation != 'N');

                if (confirmation == 'n' || confirmation == 'N')
                    break;

                hero.RemovePotion(row - 1);
            
            } else {
                cout << endl << "Are you sure you want to sell \"\033[1m\033[38;5;15m" << hero.GetSpellFromSlot(row - 1, 1)->GetName() << "\033[0m\" Lighting Spell? [y/n]: ";

                do {
                    cin >> confirmation;
                } while(confirmation != 'y' && confirmation != 'Y' && confirmation != 'n' && confirmation != 'N');

                if (confirmation == 'n' || confirmation == 'N')
                    break;

                hero.RemoveLightingSpell(row - 1);
            }

            break;

        case 4:
            cout << endl << "Are you sure you want to sell \"\033[1m\033[38;5;166m" << hero.GetWeaponFromSlot(row - 1)->GetName() << "\033[0m\" Weapon? [y/n]: ";

            do {
                cin >> confirmation;
            } while(confirmation != 'y' && confirmation != 'Y' && confirmation != 'n' && confirmation != 'N');

            if (confirmation == 'n' || confirmation == 'N')
                break;

            hero.RemoveWeapon(row - 1);

            break;

        case 5:
            cout << endl << "Are you sure you want to sell \"\033[1m\033[38;5;28m" << hero.GetArmorFromSlot(row - 1)->GetName() << "\033[0m\" Armor? [y/n]: ";

            do {
                cin >> confirmation;
            } while(confirmation != 'y' && confirmation != 'Y' && confirmation != 'n' && confirmation != 'N');

            if (confirmation == 'n' || confirmation == 'N')
                break;

            hero.RemoveArmor(row - 1);

            break;

        case 6:
            cout << endl << "Are you sure you want to sell \"\033[1m\033[38;5;90m" << hero.GetPotionFromSlot(row - 1)->GetName() << "\033[0m\" Potion? [y/n]: ";

            do {
                cin >> confirmation;
            } while(confirmation != 'y' && confirmation != 'Y' && confirmation != 'n' && confirmation != 'N');

            if (confirmation == 'n' || confirmation == 'N')
                break;

            hero.RemovePotion(row - 1);

            break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, -0x60(%rbp)
movq %rsi, -0x38(%rbp)
movl $0x10, %eax
leaq (%rax,%rbp), %rcx
addq $-0xb0, %rcx
movq %rcx, -0x10(%rcx)
movq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
addq $0x20, %rax
cmpq $0x50, %rax
jne 0x211b3
movq 0xddea(%rip), %rdi      # 0x2efc8
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq 0xddcf(%rip), %rdi      # 0x2efc8
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq 0xddbb(%rip), %rbx      # 0x2efc8
leaq 0x603e(%rip), %rsi      # 0x27252
movl $0x1f, %edx
movq %rbx, %rdi
callq 0x31e0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq 0xdd89(%rip), %rdi      # 0x2efc8
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq 0xdd4b(%rip), %rbx      # 0x2efc8
leaq 0x6119(%rip), %rsi      # 0x2739d
movl $0x12, %edx
movq %rbx, %rdi
callq 0x31e0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq 0xdd19(%rip), %rdi      # 0x2efc8
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq -0x60(%rbp), %rax
movl (%rax), %eax
cmpl $0x1, %eax
je 0x212d4
testl %eax, %eax
jne 0x2130d
leaq 0x60de(%rip), %rsi      # 0x273b0
jmp 0x212db
leaq 0x615d(%rip), %rsi      # 0x27438
movq 0xdce6(%rip), %rdi      # 0x2efc8
movl $0x74, %edx
callq 0x31e0
movq 0xdcd5(%rip), %rdi      # 0x2efc8
leaq 0x612b(%rip), %rsi      # 0x27425
movl $0x8, %edx
callq 0x31e0
leaq 0x6123(%rip), %rsi      # 0x2742e
jmp 0x21344
movq 0xdcb4(%rip), %rdi      # 0x2efc8
leaq 0x6192(%rip), %rsi      # 0x274ad
movl $0x7f, %edx
callq 0x31e0
movq 0xdc9c(%rip), %rdi      # 0x2efc8
leaq 0x60f2(%rip), %rsi      # 0x27425
movl $0x8, %edx
callq 0x31e0
leaq 0x61e9(%rip), %rsi      # 0x2752d
movq 0xdc7d(%rip), %rdi      # 0x2efc8
movl $0x9, %edx
callq 0x31e0
movq 0xdc6c(%rip), %rdi      # 0x2efc8
leaq 0x351b(%rip), %rsi      # 0x2487e
movl $0x3, %edx
callq 0x31e0
movq 0xdc54(%rip), %r15      # 0x2efc8
movq 0xdc5d(%rip), %r12      # 0x2efd8
leaq -0xb0(%rbp), %r13
leaq 0x61ae(%rip), %rbx      # 0x27537
leaq -0x30(%rbp), %r14
movl $0x3, %edx
movq %r15, %rdi
leaq 0x350c(%rip), %rsi      # 0x248a8
callq 0x31e0
movl $0x3, %edx
movq %r15, %rdi
leaq 0x53f3(%rip), %rsi      # 0x267a3
callq 0x31e0
movl $0x3, %edx
movq %r15, %rdi
leaq 0x34ba(%rip), %rsi      # 0x2487e
callq 0x31e0
movq %r12, %rdi
movq %r13, %rsi
callq 0x3230
movq %r13, %rdi
movq %rbx, %rsi
callq 0x3070
testl %eax, %eax
je 0x21420
movq %r12, %rdi
leaq -0x90(%rbp), %rsi
callq 0x3230
movq -0x38(%rbp), %rdi
movq %r13, %rsi
leaq -0x64(%rbp), %rdx
movq %r14, %rcx
movq -0x60(%rbp), %r8
callq 0x111e8
testb %al, %al
jne 0x214f3
movl $0x1b7740, %edi         # imm = 0x1B7740
callq 0x3260
jmp 0x2138d
movl $0x0, -0x64(%rbp)
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq 0xdb83(%rip), %rdi      # 0x2efc8
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq %rax, %rbx
leaq 0x6404(%rip), %rsi      # 0x27860
movl $0x31, %edx
movq %rax, %rdi
callq 0x31e0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3100
leaq -0x80(%rbp), %rbx
xorl %r14d, %r14d
movq -0x90(%rbp,%r14), %rdi
leaq (%rbx,%r14), %rax
cmpq %rdi, %rax
je 0x214d7
callq 0x3170
addq $-0x20, %r14
cmpq $-0x40, %r14
jne 0x214c1
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl -0x64(%rbp), %eax
cmpq $0x6, %rax
ja 0x214ba
leaq 0x5be1(%rip), %rcx      # 0x270e4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%r15), %rax
addq -0x18(%rax), %r15
movq -0x60(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x21c69
movq %r15, %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq 0xda91(%rip), %rdi      # 0x2efc8
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq %rax, %rbx
leaq 0x6344(%rip), %rsi      # 0x27892
movl $0x2e, %edx
movq %rax, %rdi
callq 0x31e0
movl -0x30(%rbp), %esi
decl %esi
movq -0x38(%rbp), %rdi
callq 0x11682
movq (%rax), %rcx
leaq -0x58(%rbp), %rdi
movq %rax, %rsi
callq *(%rcx)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %rbx, %rdi
callq 0x31e0
leaq 0x60dc(%rip), %rsi      # 0x27668
movl $0x15, %edx
movq %rax, %rdi
callq 0x31e0
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x215ab
callq 0x3170
movq 0xda26(%rip), %rbx      # 0x2efd8
leaq -0x29(%rbp), %r14
movabsq $0x80100000801, %r15    # imm = 0x80100000801
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3250
movzbl -0x29(%rbp), %eax
leal -0x4e(%rax), %ecx
cmpl $0x2b, %ecx
ja 0x215c0
btq %rcx, %r15
jae 0x215c0
andb $0x5f, %al
cmpb $0x4e, %al
je 0x214ba
movl -0x30(%rbp), %eax
decl %eax
leaq -0x58(%rbp), %rsi
movl %eax, (%rsi)
movq -0x38(%rbp), %rdi
callq 0x10f30
jmp 0x214ba
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq 0xd9aa(%rip), %rdi      # 0x2efc8
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq %rax, %rbx
leaq 0x625d(%rip), %rsi      # 0x27892
movl $0x2e, %edx
movq %rax, %rdi
callq 0x31e0
movl -0x30(%rbp), %esi
decl %esi
movq -0x38(%rbp), %rdi
callq 0x11682
movq (%rax), %rcx
leaq -0x58(%rbp), %rdi
movq %rax, %rsi
callq *(%rcx)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %rbx, %rdi
callq 0x31e0
leaq 0x5ff5(%rip), %rsi      # 0x27668
movl $0x15, %edx
movq %rax, %rdi
callq 0x31e0
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x21692
callq 0x3170
movq 0xd93f(%rip), %rbx      # 0x2efd8
leaq -0x29(%rbp), %r14
movabsq $0x80100000801, %r15    # imm = 0x80100000801
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3250
movzbl -0x29(%rbp), %eax
leal -0x4e(%rax), %ecx
cmpl $0x2b, %ecx
ja 0x216a7
btq %rcx, %r15
jae 0x216a7
andb $0x5f, %al
cmpb $0x4e, %al
je 0x214ba
movl -0x30(%rbp), %eax
decl %eax
leaq -0x58(%rbp), %rsi
movl %eax, (%rsi)
movq -0x38(%rbp), %rdi
callq 0x10f30
jmp 0x214ba
movq (%r15), %rax
addq -0x18(%rax), %r15
movq -0x60(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x21a9d
movq %r15, %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq 0xd8b6(%rip), %rdi      # 0x2efc8
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq %rax, %rbx
leaq 0x61c6(%rip), %rsi      # 0x278ef
movl $0x2d, %edx
movq %rax, %rdi
callq 0x31e0
movl -0x30(%rbp), %esi
decl %esi
movq -0x38(%rbp), %rdi
callq 0x1164e
movq (%rax), %rcx
leaq -0x58(%rbp), %rdi
movq %rax, %rsi
callq *(%rcx)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %rbx, %rdi
callq 0x31e0
leaq 0x5f44(%rip), %rsi      # 0x276ab
movl $0x14, %edx
movq %rax, %rdi
callq 0x31e0
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x21786
callq 0x3170
movq 0xd84b(%rip), %rbx      # 0x2efd8
leaq -0x29(%rbp), %r14
movabsq $0x80100000801, %r15    # imm = 0x80100000801
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3250
movzbl -0x29(%rbp), %eax
leal -0x4e(%rax), %ecx
cmpl $0x2b, %ecx
ja 0x2179b
btq %rcx, %r15
jae 0x2179b
andb $0x5f, %al
cmpb $0x4e, %al
je 0x214ba
movl -0x30(%rbp), %eax
decl %eax
leaq -0x58(%rbp), %rsi
movl %eax, (%rsi)
movq -0x38(%rbp), %rdi
callq 0x10fc0
jmp 0x214ba
movq (%r15), %rax
addq -0x18(%rax), %r15
movq -0x60(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x21b83
movq %r15, %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq 0xd7c2(%rip), %rdi      # 0x2efc8
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq %rax, %rbx
leaq 0x612b(%rip), %rsi      # 0x27948
movl $0x2d, %edx
movq %rax, %rdi
callq 0x31e0
movl -0x30(%rbp), %esi
decl %esi
movq -0x38(%rbp), %rdi
callq 0x1158c
movq (%rax), %rcx
leaq -0x58(%rbp), %rdi
movq %rax, %rsi
callq *(%rcx)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %rbx, %rdi
callq 0x31e0
leaq 0x5e92(%rip), %rsi      # 0x276ed
movl $0x15, %edx
movq %rax, %rdi
callq 0x31e0
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2187a
callq 0x3170
movq 0xd757(%rip), %rbx      # 0x2efd8
leaq -0x29(%rbp), %r14
movabsq $0x80100000801, %r15    # imm = 0x80100000801
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3250
movzbl -0x29(%rbp), %eax
leal -0x4e(%rax), %ecx
cmpl $0x2b, %ecx
ja 0x2188f
btq %rcx, %r15
jae 0x2188f
andb $0x5f, %al
cmpb $0x4e, %al
je 0x214ba
movl -0x30(%rbp), %eax
decl %eax
leaq -0x58(%rbp), %rsi
movl %eax, (%rsi)
movq -0x38(%rbp), %rdi
callq 0x11050
jmp 0x214ba
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq 0xd6db(%rip), %rdi      # 0x2efc8
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq %rax, %rbx
leaq 0x5feb(%rip), %rsi      # 0x278ef
movl $0x2d, %edx
movq %rax, %rdi
callq 0x31e0
movl -0x30(%rbp), %esi
decl %esi
movq -0x38(%rbp), %rdi
callq 0x1164e
movq (%rax), %rcx
leaq -0x58(%rbp), %rdi
movq %rax, %rsi
callq *(%rcx)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %rbx, %rdi
callq 0x31e0
leaq 0x5d69(%rip), %rsi      # 0x276ab
movl $0x14, %edx
movq %rax, %rdi
callq 0x31e0
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x21961
callq 0x3170
movq 0xd670(%rip), %rbx      # 0x2efd8
leaq -0x29(%rbp), %r14
movabsq $0x80100000801, %r15    # imm = 0x80100000801
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3250
movzbl -0x29(%rbp), %eax
leal -0x4e(%rax), %ecx
cmpl $0x2b, %ecx
ja 0x21976
btq %rcx, %r15
jae 0x21976
andb $0x5f, %al
cmpb $0x4e, %al
je 0x214ba
movl -0x30(%rbp), %eax
decl %eax
leaq -0x58(%rbp), %rsi
movl %eax, (%rsi)
movq -0x38(%rbp), %rdi
callq 0x10fc0
jmp 0x214ba
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq 0xd5f4(%rip), %rdi      # 0x2efc8
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq %rax, %rbx
leaq 0x5f5d(%rip), %rsi      # 0x27948
movl $0x2d, %edx
movq %rax, %rdi
callq 0x31e0
movl -0x30(%rbp), %esi
decl %esi
movq -0x38(%rbp), %rdi
callq 0x1158c
movq (%rax), %rcx
leaq -0x58(%rbp), %rdi
movq %rax, %rsi
callq *(%rcx)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %rbx, %rdi
callq 0x31e0
leaq 0x5cc4(%rip), %rsi      # 0x276ed
movl $0x15, %edx
movq %rax, %rdi
callq 0x31e0
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x21a48
callq 0x3170
movq 0xd589(%rip), %rbx      # 0x2efd8
leaq -0x29(%rbp), %r14
movabsq $0x80100000801, %r15    # imm = 0x80100000801
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3250
movzbl -0x29(%rbp), %eax
leal -0x4e(%rax), %ecx
cmpl $0x2b, %ecx
ja 0x21a5d
btq %rcx, %r15
jae 0x21a5d
andb $0x5f, %al
cmpb $0x4e, %al
je 0x214ba
movl -0x30(%rbp), %eax
decl %eax
leaq -0x58(%rbp), %rsi
movl %eax, (%rsi)
movq -0x38(%rbp), %rdi
callq 0x11050
jmp 0x214ba
movq %r15, %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq 0xd514(%rip), %rdi      # 0x2efc8
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq %rax, %rbx
leaq 0x5e52(%rip), %rsi      # 0x2791d
movl $0x2a, %edx
movq %rax, %rdi
callq 0x31e0
movl -0x30(%rbp), %esi
decl %esi
movq -0x38(%rbp), %rdi
movl $0x3, %edx
callq 0x111c6
movq (%rax), %rcx
leaq -0x58(%rbp), %rdi
movq %rax, %rsi
callq *0x8(%rcx)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %rbx, %rdi
callq 0x31e0
leaq 0x5ac6(%rip), %rsi      # 0x275d5
movl $0x19, %edx
movq %rax, %rdi
callq 0x31e0
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x21b2e
callq 0x3170
movq 0xd4a3(%rip), %rbx      # 0x2efd8
leaq -0x29(%rbp), %r14
movabsq $0x80100000801, %r15    # imm = 0x80100000801
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3250
movzbl -0x29(%rbp), %eax
leal -0x4e(%rax), %ecx
cmpl $0x2b, %ecx
ja 0x21b43
btq %rcx, %r15
jae 0x21b43
andb $0x5f, %al
cmpb $0x4e, %al
je 0x214ba
movl -0x30(%rbp), %eax
decl %eax
leaq -0x58(%rbp), %rsi
movl %eax, (%rsi)
movq -0x38(%rbp), %rdi
callq 0x10e34
jmp 0x214ba
movq %r15, %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq 0xd42e(%rip), %rdi      # 0x2efc8
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq %rax, %rbx
leaq 0x5dc5(%rip), %rsi      # 0x27976
movl $0x2d, %edx
movq %rax, %rdi
callq 0x31e0
movl -0x30(%rbp), %esi
decl %esi
movq -0x38(%rbp), %rdi
movl $0x1, %edx
callq 0x111c6
movq (%rax), %rcx
leaq -0x58(%rbp), %rdi
movq %rax, %rsi
callq *0x8(%rcx)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %rbx, %rdi
callq 0x31e0
leaq 0x5a27(%rip), %rsi      # 0x2761c
movl $0x1d, %edx
movq %rax, %rdi
callq 0x31e0
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x21c14
callq 0x3170
movq 0xd3bd(%rip), %rbx      # 0x2efd8
leaq -0x29(%rbp), %r14
movabsq $0x80100000801, %r15    # imm = 0x80100000801
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3250
movzbl -0x29(%rbp), %eax
leal -0x4e(%rax), %ecx
cmpl $0x2b, %ecx
ja 0x21c29
btq %rcx, %r15
jae 0x21c29
andb $0x5f, %al
cmpb $0x4e, %al
je 0x214ba
movl -0x30(%rbp), %eax
decl %eax
leaq -0x58(%rbp), %rsi
movl %eax, (%rsi)
movq -0x38(%rbp), %rdi
callq 0x10eb2
jmp 0x214ba
movq %r15, %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq 0xd348(%rip), %rdi      # 0x2efc8
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq %rax, %rbx
leaq 0x5c2a(%rip), %rsi      # 0x278c1
movl $0x2d, %edx
movq %rax, %rdi
callq 0x31e0
movl -0x30(%rbp), %esi
decl %esi
movq -0x38(%rbp), %rdi
movl $0x2, %edx
callq 0x111c6
movq (%rax), %rcx
leaq -0x58(%rbp), %rdi
movq %rax, %rsi
callq *0x8(%rcx)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %rbx, %rdi
callq 0x31e0
leaq 0x58b7(%rip), %rsi      # 0x27592
movl $0x18, %edx
movq %rax, %rdi
callq 0x31e0
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x21cfa
callq 0x3170
movq 0xd2d7(%rip), %rbx      # 0x2efd8
leaq -0x29(%rbp), %r14
movabsq $0x80100000801, %r15    # imm = 0x80100000801
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3250
movzbl -0x29(%rbp), %eax
leal -0x4e(%rax), %ecx
cmpl $0x2b, %ecx
ja 0x21d0f
btq %rcx, %r15
jae 0x21d0f
andb $0x5f, %al
cmpb $0x4e, %al
je 0x214ba
movl -0x30(%rbp), %eax
decl %eax
leaq -0x58(%rbp), %rsi
movl %eax, (%rsi)
movq -0x38(%rbp), %rdi
callq 0x10db6
jmp 0x214ba
jmp 0x21dae
jmp 0x21dae
jmp 0x21dae
jmp 0x21dae
jmp 0x21dae
jmp 0x21dae
jmp 0x21dae
jmp 0x21dae
jmp 0x21dae
jmp 0x21d7d
jmp 0x21d7d
jmp 0x21d7d
jmp 0x21d7d
jmp 0x21d7d
jmp 0x21d7d
jmp 0x21dae
jmp 0x21dae
jmp 0x21dae
jmp 0x21dae
jmp 0x21dae
jmp 0x21dae
jmp 0x21d7d
jmp 0x21d7d
movq %rax, %rbx
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x21db1
callq 0x3170
jmp 0x21db1
jmp 0x21dae
jmp 0x21dae
jmp 0x21dae
jmp 0x21dae
jmp 0x21dae
jmp 0x21dae
jmp 0x21dae
jmp 0x21dae
jmp 0x21dae
jmp 0x21dae
jmp 0x21dae
jmp 0x21dae
jmp 0x21dae
movq %rax, %rbx
leaq -0x80(%rbp), %r14
xorl %r15d, %r15d
movq -0x90(%rbp,%r15), %rdi
leaq (%r14,%r15), %rax
cmpq %rdi, %rax
je 0x21dce
callq 0x3170
addq $-0x20, %r15
cmpq $-0x40, %r15
jne 0x21db8
movq %rbx, %rdi
callq 0x32f0