// File: /workspace/github_cpp_makefile_star2_O3/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)
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 0x1fb89
movq 0xf414(%rip), %rdi      # 0x2efc8
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq 0xf3f9(%rip), %rdi      # 0x2efc8
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq 0xf3e5(%rip), %rbx      # 0x2efc8
leaq 0x7668(%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 0xf3b3(%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 0xf375(%rip), %rbx      # 0x2efc8
leaq 0x7743(%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 0xf343(%rip), %rdi      # 0x2efc8
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq -0x70(%rbp), %rax
movl (%rax), %eax
cmpl $0x1, %eax
je 0x1fcaa
testl %eax, %eax
jne 0x1fce3
leaq 0x7708(%rip), %rsi      # 0x273b0
jmp 0x1fcb1
leaq 0x7787(%rip), %rsi      # 0x27438
movq 0xf310(%rip), %rdi      # 0x2efc8
movl $0x74, %edx
callq 0x31e0
movq 0xf2ff(%rip), %rdi      # 0x2efc8
leaq 0x7755(%rip), %rsi      # 0x27425
movl $0x8, %edx
callq 0x31e0
leaq 0x774d(%rip), %rsi      # 0x2742e
jmp 0x1fd1a
movq 0xf2de(%rip), %rdi      # 0x2efc8
leaq 0x77bc(%rip), %rsi      # 0x274ad
movl $0x7f, %edx
callq 0x31e0
movq 0xf2c6(%rip), %rdi      # 0x2efc8
leaq 0x771c(%rip), %rsi      # 0x27425
movl $0x8, %edx
callq 0x31e0
leaq 0x7813(%rip), %rsi      # 0x2752d
movq 0xf2a7(%rip), %rdi      # 0x2efc8
movl $0x9, %edx
callq 0x31e0
movq 0xf296(%rip), %rdi      # 0x2efc8
leaq 0x4b45(%rip), %rsi      # 0x2487e
movl $0x3, %edx
callq 0x31e0
movq 0xf27e(%rip), %r12      # 0x2efc8
movq 0xf287(%rip), %r13      # 0x2efd8
leaq -0xb0(%rbp), %r14
leaq 0x77d8(%rip), %rbx      # 0x27537
leaq -0x30(%rbp), %r15
movl $0x3, %edx
movq %r12, %rdi
leaq 0x4b36(%rip), %rsi      # 0x248a8
callq 0x31e0
movl $0x3, %edx
movq %r12, %rdi
leaq 0x6a1d(%rip), %rsi      # 0x267a3
callq 0x31e0
movl $0x3, %edx
movq %r12, %rdi
leaq 0x4ae4(%rip), %rsi      # 0x2487e
callq 0x31e0
movq %r13, %rdi
movq %r14, %rsi
callq 0x3230
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3070
testl %eax, %eax
je 0x1fdf6
movq %r13, %rdi
leaq -0x90(%rbp), %rsi
callq 0x3230
movq -0x38(%rbp), %rdi
movq %r14, %rsi
leaq -0x64(%rbp), %rdx
movq %r15, %rcx
movq -0x70(%rbp), %r8
callq 0x191da
testb %al, %al
jne 0x1fe96
movl $0x1b7740, %edi         # imm = 0x1B7740
callq 0x3260
jmp 0x1fd63
movl $0x0, -0x64(%rbp)
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq 0xf1ac(%rip), %rdi      # 0x2efc8
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq %rax, %rbx
leaq 0x7706(%rip), %rsi      # 0x27539
movl $0x2b, %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
jmp 0x20763
movl -0x64(%rbp), %eax
cmpq $0x6, %rax
ja 0x20763
leaq 0x721e(%rip), %rcx      # 0x270c8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq 0xf0f6(%rip), %rdi      # 0x2efc8
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq %rax, %rbx
leaq 0x767c(%rip), %rsi      # 0x27565
movl $0x2c, %edx
movq %rax, %rdi
callq 0x31e0
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)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq %rbx, %rdi
callq 0x31e0
leaq 0x765c(%rip), %rsi      # 0x27592
movl $0x18, %edx
movq %rax, %rdi
callq 0x31e0
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1ff55
callq 0x3170
movq 0xf07c(%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 0x1ff6a
btq %rcx, %r15
jae 0x1ff6a
andb $0x5f, %al
cmpb $0x4e, %al
je 0x20763
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 0x1110a
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 0x10b28
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdi
movq 0x168(%rdi), %rcx
movslq -0x4(%rcx,%rax,4), %rax
movq 0xd8(%rdi), %rcx
movq 0xe0(%rdi), %rdx
leaq (%rcx,%rax,8), %rsi
addq $0x8, %rsi
leaq 0xe0(%rdi), %rbx
jmp 0x2073f
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq 0xef88(%rip), %rdi      # 0x2efc8
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq %rax, %rbx
leaq 0x75e3(%rip), %rsi      # 0x2763a
movl $0x2d, %edx
movq %rax, %rdi
callq 0x31e0
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)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq %rbx, %rdi
callq 0x31e0
leaq 0x75c5(%rip), %rsi      # 0x27668
movl $0x15, %edx
movq %rax, %rdi
callq 0x31e0
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x200c2
callq 0x3170
movq 0xef0f(%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 0x200d7
btq %rcx, %r15
jae 0x200d7
andb $0x5f, %al
cmpb $0x4e, %al
je 0x20763
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 0x1110a
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 0x10c4e
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdi
movq 0x180(%rdi), %rcx
movslq -0x4(%rcx,%rax,4), %rax
movq 0xf0(%rdi), %rcx
movq 0xf8(%rdi), %rdx
leaq (%rcx,%rax,8), %rsi
addq $0x8, %rsi
leaq 0xf8(%rdi), %rbx
jmp 0x2073f
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq 0xee1b(%rip), %rdi      # 0x2efc8
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq %rax, %rbx
leaq 0x73e7(%rip), %rsi      # 0x275ab
movl $0x29, %edx
movq %rax, %rdi
callq 0x31e0
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)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq %rbx, %rdi
callq 0x31e0
leaq 0x73c4(%rip), %rsi      # 0x275d5
movl $0x19, %edx
movq %rax, %rdi
callq 0x31e0
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x20230
callq 0x3170
movq 0xeda1(%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 0x20245
btq %rcx, %r15
jae 0x20245
andb $0x5f, %al
cmpb $0x4e, %al
je 0x20763
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 0x1110a
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 0x10b8a
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdi
movq 0x150(%rdi), %rcx
movslq -0x4(%rcx,%rax,4), %rax
movq 0xc0(%rdi), %rcx
movq 0xc8(%rdi), %rdx
leaq (%rcx,%rax,8), %rsi
addq $0x8, %rsi
leaq 0xc8(%rdi), %rbx
jmp 0x2073f
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq 0xecad(%rip), %rdi      # 0x2efc8
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq %rax, %rbx
leaq 0x72bd(%rip), %rsi      # 0x275ef
movl $0x2c, %edx
movq %rax, %rdi
callq 0x31e0
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)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq %rbx, %rdi
callq 0x31e0
leaq 0x729d(%rip), %rsi      # 0x2761c
movl $0x1d, %edx
movq %rax, %rdi
callq 0x31e0
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2039e
callq 0x3170
movq 0xec33(%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 0x203b3
btq %rcx, %r15
jae 0x203b3
andb $0x5f, %al
cmpb $0x4e, %al
je 0x20763
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 0x1110a
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 0x10bec
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdi
movq 0x138(%rdi), %rcx
movslq -0x4(%rcx,%rax,4), %rax
movq 0xa8(%rdi), %rcx
movq 0xb0(%rdi), %rdx
leaq (%rcx,%rax,8), %rsi
addq $0x8, %rsi
leaq 0xb0(%rdi), %rbx
jmp 0x2073f
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq 0xeb3f(%rip), %rdi      # 0x2efc8
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq %rax, %rbx
leaq 0x71de(%rip), %rsi      # 0x2767e
movl $0x2c, %edx
movq %rax, %rdi
callq 0x31e0
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)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq %rbx, %rdi
callq 0x31e0
leaq 0x71bf(%rip), %rsi      # 0x276ab
movl $0x14, %edx
movq %rax, %rdi
callq 0x31e0
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2050b
callq 0x3170
movq 0xeac6(%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 0x20520
btq %rcx, %r15
jae 0x20520
andb $0x5f, %al
cmpb $0x4e, %al
je 0x20763
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 0x1110a
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 0x10cc6
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdi
movq 0x1b0(%rdi), %rcx
movslq -0x4(%rcx,%rax,4), %rax
movq 0x120(%rdi), %rcx
movq 0x128(%rdi), %rdx
leaq (%rcx,%rax,8), %rsi
addq $0x8, %rsi
leaq 0x128(%rdi), %rbx
jmp 0x2073f
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq 0xe9d2(%rip), %rdi      # 0x2efc8
callq 0x3040
movq %rax, %rdi
callq 0x3100
movq %rax, %rbx
leaq 0x70b3(%rip), %rsi      # 0x276c0
movl $0x2c, %edx
movq %rax, %rdi
callq 0x31e0
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)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq %rbx, %rdi
callq 0x31e0
leaq 0x7094(%rip), %rsi      # 0x276ed
movl $0x15, %edx
movq %rax, %rdi
callq 0x31e0
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x20678
callq 0x3170
movq 0xe959(%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 0x2068d
btq %rcx, %r15
jae 0x2068d
andb $0x5f, %al
cmpb $0x4e, %al
je 0x20763
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 0x1110a
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 0x10d3e
movslq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdi
movq 0x198(%rdi), %rcx
movslq -0x4(%rcx,%rax,4), %rax
movq 0x108(%rdi), %rcx
movq 0x110(%rdi), %rdx
leaq (%rcx,%rax,8), %rsi
addq $0x8, %rsi
leaq 0x110(%rdi), %rbx
cmpq %rdx, %rsi
je 0x20753
leaq (%rcx,%rax,8), %rdi
subq %rsi, %rdx
callq 0x32b0
movq (%rbx), %rdx
addq $-0x8, %rdx
movq %rdx, (%rbx)
movq -0x38(%rbp), %rdi
callq 0x190f4
leaq -0x80(%rbp), %rbx
xorl %r14d, %r14d
movq -0x90(%rbp,%r14), %rdi
leaq (%rbx,%r14), %rax
cmpq %rdi, %rax
je 0x20780
callq 0x3170
addq $-0x20, %r14
cmpq $-0x40, %r14
jne 0x2076a
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x207d7
jmp 0x207d7
jmp 0x207d7
jmp 0x207d7
jmp 0x207d7
jmp 0x207d7
jmp 0x207b2
jmp 0x207b2
jmp 0x207b2
jmp 0x207b2
jmp 0x207b2
movq %rax, %rbx
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x207da
callq 0x3170
jmp 0x207da
jmp 0x207d7
jmp 0x207d7
jmp 0x207d7
jmp 0x207d7
jmp 0x207d7
jmp 0x207d7
jmp 0x207d7
movq %rax, %rbx
leaq -0x80(%rbp), %r14
xorl %r15d, %r15d
movq -0x90(%rbp,%r15), %rdi
leaq (%r14,%r15), %rax
cmpq %rdi, %rax
je 0x207f7
callq 0x3170
addq $-0x20, %r15
cmpq $-0x40, %r15
jne 0x207e1
movq %rbx, %rdi
callq 0x32f0
nop