// File: /workspace/github_cpp_makefile_star2_O2/MichaelXanth[P]RPG_Game/Market/Market.cpp
// Function: Market::Purchase(Hero&, int const&)
void Market::Purchase(Hero& hero, const int& buyState)
{
    int  column, row;
    char confirmation;
    bool errFlag = false;
    string testSelections[2];

    cout << endl;
    cout << "-------------------------------" << endl << endl;
    cout << "(Type 0 to cancel)" << endl;

    if (buyState == 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 (buyState == 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(!isValidForPurchase(testSelections,column,row,buyState));

    if (column == 0) {
        cout << endl << "\033[1;32mInfo:\033[0m The purchase was canceled." << endl << endl;
        return;
    }

    switch(column)
    {
        case 1:
            cout << endl << "Are you sure you want to buy \"\033[1m\033[38;5;32m" << iceSpellsArray[iceSpellsIndexes[row - 1]]->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.ChangeMoney(-iceSpellsArray[iceSpellsIndexes[row - 1]]->GetPrice());
            hero.AddNewSpell(iceSpellsArray[iceSpellsIndexes[row - 1]]);
            iceSpellsArray.erase(iceSpellsArray.begin() + iceSpellsIndexes[row - 1]);
            RecalcMostItems();

            break;

        case 2:
            cout << endl << "Are you sure you want to buy \"\033[1m\033[1;31m" << fireSpellsArray[fireSpellsIndexes[row - 1]]->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.ChangeMoney(-fireSpellsArray[fireSpellsIndexes[row - 1]]->GetPrice());
            hero.AddNewSpell(fireSpellsArray[fireSpellsIndexes[row - 1]]);
            fireSpellsArray.erase(fireSpellsArray.begin() + fireSpellsIndexes[row - 1]);
            RecalcMostItems();

            break;

        case 3:
            cout << endl << "Are you sure you want to buy \"\033[1m\033[38;5;15m" << lightingSpellsArray[lightingSpellsIndexes[row - 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.ChangeMoney(-lightingSpellsArray[lightingSpellsIndexes[row - 1]]->GetPrice());
            hero.AddNewSpell(lightingSpellsArray[lightingSpellsIndexes[row - 1]]);
            lightingSpellsArray.erase(lightingSpellsArray.begin() + lightingSpellsIndexes[row - 1]);
            RecalcMostItems();

            break;

        case 4:
            cout << endl << "Are you sure you want to buy \"\033[1m\033[38;5;166m" << weaponsArray[weaponsIndexes[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.ChangeMoney(-weaponsArray[weaponsIndexes[row - 1]]->GetPrice());
            hero.AddNewItem(weaponsArray[weaponsIndexes[row - 1]]);
            weaponsArray.erase(weaponsArray.begin() + weaponsIndexes[row - 1]);
            RecalcMostItems();

            break;

        case 5:
            cout << endl << "Are you sure you want to buy \"\033[1m\033[38;5;28m" << armorsArray[armorsIndexes[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.ChangeMoney(-(armorsArray[armorsIndexes[row - 1]]->GetPrice()));
            hero.AddNewItem(armorsArray[armorsIndexes[row - 1]]);
            armorsArray.erase(armorsArray.begin() + armorsIndexes[row - 1]);
            RecalcMostItems();

            break;

        case 6:
            cout << endl << "Are you sure you want to buy \"\033[1m\033[38;5;90m" << potionsArray[potionsIndexes[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.ChangeMoney(-potionsArray[potionsIndexes[row - 1]]->GetPrice());
            hero.AddNewItem(potionsArray[potionsIndexes[row - 1]]);
            potionsArray.erase(potionsArray.begin() + potionsIndexes[row - 1]);
            RecalcMostItems();

            break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, -0x70(%rbp)
movq %rsi, -0x40(%rbp)
movq %rdi, -0x38(%rbp)
pushq $0x10
popq %rax
leaq (%rax,%rbp), %rcx
addq $-0xb0, %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
addq $0x20, %rax
cmpq $0x50, %rax
jne 0x17269
movq 0xfd37(%rip), %rdi      # 0x26fc8
callq 0x30d0
movq 0xfd2b(%rip), %rdi      # 0x26fc8
leaq 0x6fae(%rip), %rsi      # 0x1e252
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq %rax, %rdi
callq 0x30d0
movq 0xfd08(%rip), %rdi      # 0x26fc8
leaq 0x70d6(%rip), %rsi      # 0x1e39d
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq -0x70(%rbp), %rax
movl (%rax), %eax
cmpl $0x1, %eax
je 0x172ec
testl %eax, %eax
jne 0x1731b
leaq 0x70c6(%rip), %rsi      # 0x1e3b0
jmp 0x172f3
leaq 0x7145(%rip), %rsi      # 0x1e438
movq 0xfcce(%rip), %rdi      # 0x26fc8
callq 0x31d0
movq 0xfcc2(%rip), %rdi      # 0x26fc8
leaq 0x7118(%rip), %rsi      # 0x1e425
callq 0x31d0
leaq 0x7115(%rip), %rsi      # 0x1e42e
jmp 0x17348
movq 0xfca6(%rip), %rdi      # 0x26fc8
leaq 0x7184(%rip), %rsi      # 0x1e4ad
callq 0x31d0
movq 0xfc93(%rip), %rdi      # 0x26fc8
leaq 0x70e9(%rip), %rsi      # 0x1e425
callq 0x31d0
leaq 0x71e5(%rip), %rsi      # 0x1e52d
movq 0xfc79(%rip), %rdi      # 0x26fc8
callq 0x31d0
movq 0xfc6d(%rip), %rdi      # 0x26fc8
leaq 0x451c(%rip), %rsi      # 0x1b87e
callq 0x31d0
movq 0xfc5a(%rip), %r13      # 0x26fc8
movq 0xfc63(%rip), %r12      # 0x26fd8
leaq -0xb0(%rbp), %r14
leaq 0x71b4(%rip), %rbx      # 0x1e537
leaq -0x30(%rbp), %r15
movq %r13, %rdi
leaq 0x4517(%rip), %rsi      # 0x1b8a8
callq 0x31d0
movq %r13, %rdi
leaq 0x6403(%rip), %rsi      # 0x1d7a3
callq 0x31d0
movq %r13, %rdi
leaq 0x44cf(%rip), %rsi      # 0x1b87e
callq 0x31d0
movq %r12, %rdi
movq %r14, %rsi
callq 0x3250
movq %r14, %rdi
movq %rbx, %rsi
callq 0x19330
testb %al, %al
jne 0x17404
movq %r12, %rdi
leaq -0x90(%rbp), %rsi
callq 0x3250
movq -0x38(%rbp), %rdi
movq %r14, %rsi
leaq -0x64(%rbp), %rdx
movq %r15, %rcx
movq -0x70(%rbp), %r8
callq 0x12b82
testb %al, %al
jne 0x17438
movl $0x1b7740, %edi         # imm = 0x1B7740
callq 0x32a0
jmp 0x17387
andl $0x0, -0x64(%rbp)
movq 0xfbb9(%rip), %rdi      # 0x26fc8
callq 0x30d0
leaq 0x711e(%rip), %rsi      # 0x1e539
movq %rax, %rdi
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq %rax, %rdi
callq 0x30d0
jmp 0x17ba5
movl -0x64(%rbp), %eax
cmpq $0x6, %rax
ja 0x17ba5
leaq 0x6c7c(%rip), %rcx      # 0x1e0c8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xfb6c(%rip), %rdi      # 0x26fc8
callq 0x30d0
leaq 0x70fd(%rip), %rsi      # 0x1e565
movq %rax, %rdi
callq 0x31d0
movq %rax, %rbx
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdx
movq 0xd8(%rdx), %rcx
movq 0x168(%rdx), %rdx
movslq -0x4(%rdx,%rax,4), %rax
movq (%rcx,%rax,8), %rsi
movq (%rsi), %rax
leaq -0x60(%rbp), %rdi
callq *0x8(%rax)
leaq -0x60(%rbp), %rsi
movq %rbx, %rdi
callq 0x3190
leaq 0x70e3(%rip), %rsi      # 0x1e592
movq %rax, %rdi
callq 0x31d0
movq -0x38(%rbp), %rax
leaq 0xd8(%rax), %rbx
leaq -0x60(%rbp), %rdi
callq 0x30c0
movq 0xfb06(%rip), %r14      # 0x26fd8
leaq -0x29(%rbp), %r15
movabsq $0x80100000801, %r12    # imm = 0x80100000801
movq %r14, %rdi
movq %r15, %rsi
callq 0x3280
movzbl -0x29(%rbp), %eax
leal -0x4e(%rax), %ecx
cmpl $0x2b, %ecx
ja 0x174e0
btq %rcx, %r12
jae 0x174e0
andb $0x5f, %al
cmpb $0x4e, %al
je 0x17ba5
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdx
movq 0xd8(%rdx), %rcx
movq 0x168(%rdx), %rdx
movslq -0x4(%rdx,%rax,4), %rax
movq (%rcx,%rax,8), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
negl %eax
movq -0x40(%rbp), %rdi
movl %eax, %esi
callq 0xd5d0
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdx
movq 0xd8(%rdx), %rcx
movq 0x168(%rdx), %rdx
movslq -0x4(%rdx,%rax,4), %rax
movq (%rcx,%rax,8), %rsi
movq -0x40(%rbp), %rdi
callq 0xd180
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %r14
movq 0x168(%r14), %rcx
movslq -0x4(%rcx,%rax,4), %rsi
shlq $0x3, %rsi
addq 0xd8(%r14), %rsi
movq %rbx, %rdi
callq 0x11464
jmp 0x17b9d
movq 0xfa34(%rip), %rdi      # 0x26fc8
callq 0x30d0
leaq 0x709a(%rip), %rsi      # 0x1e63a
movq %rax, %rdi
callq 0x31d0
movq %rax, %rbx
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdx
movq 0xf0(%rdx), %rcx
movq 0x180(%rdx), %rdx
movslq -0x4(%rdx,%rax,4), %rax
movq (%rcx,%rax,8), %rsi
movq (%rsi), %rax
leaq -0x60(%rbp), %rdi
callq *(%rax)
leaq -0x60(%rbp), %rsi
movq %rbx, %rdi
callq 0x3190
leaq 0x7082(%rip), %rsi      # 0x1e668
movq %rax, %rdi
callq 0x31d0
movq -0x38(%rbp), %rax
leaq 0xf0(%rax), %rbx
leaq -0x60(%rbp), %rdi
callq 0x30c0
movq 0xf9cf(%rip), %r14      # 0x26fd8
leaq -0x29(%rbp), %r15
movabsq $0x80100000801, %r12    # imm = 0x80100000801
movq %r14, %rdi
movq %r15, %rsi
callq 0x3280
movzbl -0x29(%rbp), %eax
leal -0x4e(%rax), %ecx
cmpl $0x2b, %ecx
ja 0x17617
btq %rcx, %r12
jae 0x17617
andb $0x5f, %al
cmpb $0x4e, %al
je 0x17ba5
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdx
movq 0xf0(%rdx), %rcx
movq 0x180(%rdx), %rdx
movslq -0x4(%rdx,%rax,4), %rax
movq (%rcx,%rax,8), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
negl %eax
movq -0x40(%rbp), %rdi
movl %eax, %esi
callq 0xd5d0
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdx
movq 0xf0(%rdx), %rcx
movq 0x180(%rdx), %rdx
movslq -0x4(%rdx,%rax,4), %rax
movq (%rcx,%rax,8), %rsi
movq -0x40(%rbp), %rdi
callq 0xd252
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %r14
movq 0x180(%r14), %rcx
movslq -0x4(%rcx,%rax,4), %rsi
shlq $0x3, %rsi
addq 0xf0(%r14), %rsi
movq %rbx, %rdi
callq 0x11512
jmp 0x17b9d
movq 0xf8fd(%rip), %rdi      # 0x26fc8
callq 0x30d0
leaq 0x6ed4(%rip), %rsi      # 0x1e5ab
movq %rax, %rdi
callq 0x31d0
movq %rax, %rbx
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdx
movq 0xc0(%rdx), %rcx
movq 0x150(%rdx), %rdx
movslq -0x4(%rdx,%rax,4), %rax
movq (%rcx,%rax,8), %rsi
movq (%rsi), %rax
leaq -0x60(%rbp), %rdi
callq *0x8(%rax)
leaq -0x60(%rbp), %rsi
movq %rbx, %rdi
callq 0x3190
leaq 0x6eb7(%rip), %rsi      # 0x1e5d5
movq %rax, %rdi
callq 0x31d0
movq -0x38(%rbp), %rax
leaq 0xc0(%rax), %rbx
leaq -0x60(%rbp), %rdi
callq 0x30c0
movq 0xf897(%rip), %r14      # 0x26fd8
leaq -0x29(%rbp), %r15
movabsq $0x80100000801, %r12    # imm = 0x80100000801
movq %r14, %rdi
movq %r15, %rsi
callq 0x3280
movzbl -0x29(%rbp), %eax
leal -0x4e(%rax), %ecx
cmpl $0x2b, %ecx
ja 0x1774f
btq %rcx, %r12
jae 0x1774f
andb $0x5f, %al
cmpb $0x4e, %al
je 0x17ba5
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdx
movq 0xc0(%rdx), %rcx
movq 0x150(%rdx), %rdx
movslq -0x4(%rdx,%rax,4), %rax
movq (%rcx,%rax,8), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
negl %eax
movq -0x40(%rbp), %rdi
movl %eax, %esi
callq 0xd5d0
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdx
movq 0xc0(%rdx), %rcx
movq 0x150(%rdx), %rdx
movslq -0x4(%rdx,%rax,4), %rax
movq (%rcx,%rax,8), %rsi
movq -0x40(%rbp), %rdi
callq 0xd1c6
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %r14
movq 0x150(%r14), %rcx
movslq -0x4(%rcx,%rax,4), %rsi
shlq $0x3, %rsi
addq 0xc0(%r14), %rsi
movq %rbx, %rdi
callq 0x1149e
jmp 0x17b9d
movq 0xf7c5(%rip), %rdi      # 0x26fc8
callq 0x30d0
leaq 0x6de0(%rip), %rsi      # 0x1e5ef
movq %rax, %rdi
callq 0x31d0
movq %rax, %rbx
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdx
movq 0xa8(%rdx), %rcx
movq 0x138(%rdx), %rdx
movslq -0x4(%rdx,%rax,4), %rax
movq (%rcx,%rax,8), %rsi
movq (%rsi), %rax
leaq -0x60(%rbp), %rdi
callq *0x8(%rax)
leaq -0x60(%rbp), %rsi
movq %rbx, %rdi
callq 0x3190
leaq 0x6dc6(%rip), %rsi      # 0x1e61c
movq %rax, %rdi
callq 0x31d0
movq -0x38(%rbp), %rax
leaq 0xa8(%rax), %rbx
leaq -0x60(%rbp), %rdi
callq 0x30c0
movq 0xf75f(%rip), %r14      # 0x26fd8
leaq -0x29(%rbp), %r15
movabsq $0x80100000801, %r12    # imm = 0x80100000801
movq %r14, %rdi
movq %r15, %rsi
callq 0x3280
movzbl -0x29(%rbp), %eax
leal -0x4e(%rax), %ecx
cmpl $0x2b, %ecx
ja 0x17887
btq %rcx, %r12
jae 0x17887
andb $0x5f, %al
cmpb $0x4e, %al
je 0x17ba5
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdx
movq 0xa8(%rdx), %rcx
movq 0x138(%rdx), %rdx
movslq -0x4(%rdx,%rax,4), %rax
movq (%rcx,%rax,8), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
negl %eax
movq -0x40(%rbp), %rdi
movl %eax, %esi
callq 0xd5d0
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdx
movq 0xa8(%rdx), %rcx
movq 0x138(%rdx), %rdx
movslq -0x4(%rdx,%rax,4), %rax
movq (%rcx,%rax,8), %rsi
movq -0x40(%rbp), %rdi
callq 0xd20c
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %r14
movq 0x138(%r14), %rcx
movslq -0x4(%rcx,%rax,4), %rsi
shlq $0x3, %rsi
addq 0xa8(%r14), %rsi
movq %rbx, %rdi
callq 0x114d8
jmp 0x17b9d
movq 0xf68d(%rip), %rdi      # 0x26fc8
callq 0x30d0
leaq 0x6d37(%rip), %rsi      # 0x1e67e
movq %rax, %rdi
callq 0x31d0
movq %rax, %rbx
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdx
movq 0x120(%rdx), %rcx
movq 0x1b0(%rdx), %rdx
movslq -0x4(%rdx,%rax,4), %rax
movq (%rcx,%rax,8), %rsi
movq (%rsi), %rax
leaq -0x60(%rbp), %rdi
callq *(%rax)
leaq -0x60(%rbp), %rsi
movq %rbx, %rdi
callq 0x3190
leaq 0x6d1e(%rip), %rsi      # 0x1e6ab
movq %rax, %rdi
callq 0x31d0
movq -0x38(%rbp), %rax
leaq 0x120(%rax), %rbx
leaq -0x60(%rbp), %rdi
callq 0x30c0
movq 0xf628(%rip), %r14      # 0x26fd8
leaq -0x29(%rbp), %r15
movabsq $0x80100000801, %r12    # imm = 0x80100000801
movq %r14, %rdi
movq %r15, %rsi
callq 0x3280
movzbl -0x29(%rbp), %eax
leal -0x4e(%rax), %ecx
cmpl $0x2b, %ecx
ja 0x179be
btq %rcx, %r12
jae 0x179be
andb $0x5f, %al
cmpb $0x4e, %al
je 0x17ba5
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdx
movq 0x120(%rdx), %rcx
movq 0x1b0(%rdx), %rdx
movslq -0x4(%rdx,%rax,4), %rax
movq (%rcx,%rax,8), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
negl %eax
movq -0x40(%rbp), %rdi
movl %eax, %esi
callq 0xd5d0
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdx
movq 0x120(%rdx), %rcx
movq 0x1b0(%rdx), %rdx
movslq -0x4(%rdx,%rax,4), %rax
movq (%rcx,%rax,8), %rsi
movq -0x40(%rbp), %rdi
callq 0xd2a0
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %r14
movq 0x1b0(%r14), %rcx
movslq -0x4(%rcx,%rax,4), %rsi
shlq $0x3, %rsi
addq 0x120(%r14), %rsi
movq %rbx, %rdi
callq 0x1154c
jmp 0x17b9d
movq 0xf556(%rip), %rdi      # 0x26fc8
callq 0x30d0
leaq 0x6c42(%rip), %rsi      # 0x1e6c0
movq %rax, %rdi
callq 0x31d0
movq %rax, %rbx
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdx
movq 0x108(%rdx), %rcx
movq 0x198(%rdx), %rdx
movslq -0x4(%rdx,%rax,4), %rax
movq (%rcx,%rax,8), %rsi
movq (%rsi), %rax
leaq -0x60(%rbp), %rdi
callq *(%rax)
leaq -0x60(%rbp), %rsi
movq %rbx, %rdi
callq 0x3190
leaq 0x6c29(%rip), %rsi      # 0x1e6ed
movq %rax, %rdi
callq 0x31d0
movq -0x38(%rbp), %rax
leaq 0x108(%rax), %rbx
leaq -0x60(%rbp), %rdi
callq 0x30c0
movq 0xf4f1(%rip), %r14      # 0x26fd8
leaq -0x29(%rbp), %r15
movabsq $0x80100000801, %r12    # imm = 0x80100000801
movq %r14, %rdi
movq %r15, %rsi
callq 0x3280
movzbl -0x29(%rbp), %eax
leal -0x4e(%rax), %ecx
cmpl $0x2b, %ecx
ja 0x17af5
btq %rcx, %r12
jae 0x17af5
andb $0x5f, %al
cmpb $0x4e, %al
je 0x17ba5
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdx
movq 0x108(%rdx), %rcx
movq 0x198(%rdx), %rdx
movslq -0x4(%rdx,%rax,4), %rax
movq (%rcx,%rax,8), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
negl %eax
movq -0x40(%rbp), %rdi
movl %eax, %esi
callq 0xd5d0
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdx
movq 0x108(%rdx), %rcx
movq 0x198(%rdx), %rdx
movslq -0x4(%rdx,%rax,4), %rax
movq (%rcx,%rax,8), %rsi
movq -0x40(%rbp), %rdi
callq 0xd2ee
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %r14
movq 0x198(%r14), %rcx
movslq -0x4(%rcx,%rax,4), %rsi
shlq $0x3, %rsi
addq 0x108(%r14), %rsi
movq %rbx, %rdi
callq 0x11586
movq %r14, %rdi
callq 0x12aa4
pushq $0x20
popq %rbx
leaq (%rbx,%rbp), %rdi
addq $-0xb0, %rdi
callq 0x30c0
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0x17ba8
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x17c12
jmp 0x17c12
jmp 0x17c12
jmp 0x17c12
jmp 0x17c12
jmp 0x17c12
jmp 0x17c12
jmp 0x17c12
jmp 0x17c12
jmp 0x17c12
jmp 0x17c12
jmp 0x17c12
jmp 0x17bf6
jmp 0x17bf6
jmp 0x17bf6
jmp 0x17bf6
jmp 0x17bf6
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x30c0
jmp 0x17c15
jmp 0x17c12
jmp 0x17c12
jmp 0x17c12
jmp 0x17c12
jmp 0x17c12
jmp 0x17c12
jmp 0x17c12
movq %rax, %rbx
pushq $0x20
popq %r14
leaq (%r14,%rbp), %rdi
addq $-0xb0, %rdi
callq 0x30c0
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x17c19
movq %rbx, %rdi
callq 0x3330
nop