// File: /workspace/github_cpp_makefile_star2_O2/MichaelXanth[P]RPG_Game/Living/Heroes/Hero.cpp
// Function: Hero::DisplaySpells(Spell*&, unsigned int&, unsigned int&)
bool Hero::DisplaySpells(Spell*& chosenSpell , unsigned int& slotNum , unsigned int& type)
{
    int arrow = 0;
    int column;
    int lines;
    char selection;

    if(!iceSpellsArray.empty())
        column = 0;
    else if(!fireSpellsArray.empty())
        column = 1;
    else if(!lightingSpellsArray.empty())
        column = 2;

    if(iceSpellsArray.size() >= fireSpellsArray.size() && iceSpellsArray.size() >= lightingSpellsArray.size())
        lines = 5 * (iceSpellsArray.size() + 1) - 1;

    if(fireSpellsArray.size() >= iceSpellsArray.size() && fireSpellsArray.size() >= lightingSpellsArray.size())
        lines = 5 * (fireSpellsArray.size() + 1) - 1;

    if(lightingSpellsArray.size() >= iceSpellsArray.size() && lightingSpellsArray.size() >= fireSpellsArray.size())
        lines = 5 * (lightingSpellsArray.size() + 1) - 1;

    do{
        cout << "\033[1;33m+\033[0;34m==============================\033[1;33m+\033[0;34m==============================\033[1;33m+\033[0;34m==============================\033[1;33m+\033[0m" << endl;
        cout << "\033[34m|\033[0m          Ice Spells          \033[34m|\033[0m         Fire Spells          \033[34m|\033[0m       Lighting Spells        \033[34m|\033[0m" << endl;
        cout << "\033[1;33m+\033[0;34m------------------------------\033[1;33m+\033[0;34m------------------------------\033[1;33m+\033[0;34m------------------------------\033[1;33m+\033[0m";

        for(unsigned int i = 0; i < iceSpellsArray.size() || i < fireSpellsArray.size() || i < lightingSpellsArray.size(); i++)
        {
            if(!i)
                cout << endl;
            else
                cout << "\033[34m|                              |                              |                              |\033[0m" << endl;

            if(i < iceSpellsArray.size())
            {
                if(column == 0 && arrow == i)
                    cout << "\033[34m| \033[1;33m~> ";
                else
                    cout << "\033[34m|\033[0m    ";

                cout.width(26);
                cout << left << iceSpellsArray[i]->GetName() << "\033[0;34m|\033[0m" << endl;
                cout << "\033[34m|\033[0m    \u2022 Damage Range: ";
                cout.width(10);
                string str = to_string(iceSpellsArray[i]->GetMinDamage()) + "-" + to_string(iceSpellsArray[i]->GetMaxDamage());
                cout << left << str << "\033[34m|\033[0m" << endl;
                cout << "\033[34m|\033[0m    \u2022 Damage Reduction: ";
                cout.width(6);
                cout << left << iceSpellsArray[i]->GetDamageReduction() << "\033[34m|\033[0m" << endl;
                cout << "\033[34m|\033[0m    \u2022 Affected Rounds: ";
                cout.width(7);
                cout << left << iceSpellsArray[i]->GetRounds() << "\033[34m|\033[0m" << endl;
            }
            else
            {
                cout << "\033[34m|\033[30C|\033[0m" << endl;
                cout << "\033[34m|\033[30C|\033[0m" << endl;
                cout << "\033[34m|\033[30C|\033[0m" << endl;
                cout << "\033[34m|\033[30C|\033[0m" << endl;
            }

            cout << "\033[4A";

            if(i < fireSpellsArray.size())
            {
                if(column == 1 && arrow == i)
                    cout << "\033[32C \033[1;33m~> ";
                else
                    cout << "\033[32C    ";

                cout.width(26);
                cout << left << fireSpellsArray[i]->GetName() << "\033[0;34m|\033[0m" << endl;
                cout << "\033[32C    \u2022 Damage Range: ";
                cout.width(10);
                string str = to_string(fireSpellsArray[i]->GetMinDamage()) + "-" + to_string(fireSpellsArray[i]->GetMaxDamage());
                cout << left << str << "\033[34m|\033[0m" << endl;
                cout << "\033[32C    \u2022 Defence Reduction: ";
                cout.width(5);
                cout << left << fireSpellsArray[i]->GetDefenceReduction() << "\033[34m|\033[0m" << endl;
                cout << "\033[32C    \u2022 Affected Rounds: ";
                cout.width(7);
                cout << left << fireSpellsArray[i]->GetRounds() << "\033[34m|\033[0m" << endl;
            }
            else
            {
                cout << "\033[62C\033[34m|\033[0m" << endl;
                cout << "\033[62C\033[34m|\033[0m" << endl;
                cout << "\033[62C\033[34m|\033[0m" << endl;
                cout << "\033[62C\033[34m|\033[0m" << endl;
            }

            cout << "\033[4A";

            if(i < lightingSpellsArray.size())
            {
                if(column == 2 && arrow == i)
                    cout << "\033[63C \033[1;33m~> ";
                else
                    cout << "\033[63C    ";

                cout.width(26);
                cout << left << lightingSpellsArray[i]->GetName() << "\033[0;34m|\033[0m" << endl;
                cout << "\033[63C    \u2022 Damage Range: ";
                cout.width(10);
                string str = to_string(lightingSpellsArray[i]->GetMinDamage()) + "-" + to_string(lightingSpellsArray[i]->GetMaxDamage());
                cout << left << str << "\033[34m|\033[0m" << endl;
                cout << "\033[63C    \u2022 Avoidance Reduction: ";
                cout.width(3);
                cout << left << lightingSpellsArray[i]->GetAvoidanceReduction() << "\033[34m|\033[0m" << endl;
                cout << "\033[63C    \u2022 Affected Rounds: ";
                cout.width(7);
                cout << left << lightingSpellsArray[i]->GetRounds() << "\033[34m|\033[0m" << endl;
            }
            else
            {
                cout << "\033[93C\033[34m|\033[0m" << endl;
                cout << "\033[93C\033[34m|\033[0m" << endl;
                cout << "\033[93C\033[34m|\033[0m" << endl;
                cout << "\033[93C\033[34m|\033[0m" << endl;
            }
        }
        cout << "\033[1;33m+\033[0;34m==============================\033[1;33m+\033[0;34m==============================\033[1;33m+\033[0;34m==============================\033[1;33m+\033[0m" << endl;
        cout << "Press 'e' to cancel" << endl;

        selection = getch();

        if(selection == 'e')
        {
            cout << "\033[" << lines << "A";
            cout << "\033[J";

            //for(int i = 0; i < lines; i++)
            //    cout << "\033[1A\033[K";

            return false;
        }
        else if(selection == 'w' && arrow) //navigates the menu arrow
            arrow--;
        else if(selection == 'a' && column)
        {
            if(column == 2)
            {
                if(fireSpellsArray.size())
                {
                    column--;

                    if(arrow > fireSpellsArray.size() - 1)
                        arrow = fireSpellsArray.size() - 1;
                }
                else if(iceSpellsArray.size())
                {
                    column -= 2;

                    if(arrow > iceSpellsArray.size() - 1)
                        arrow = iceSpellsArray.size() - 1;
                }
            }
            else if(column == 1)
            {
                if(iceSpellsArray.size())
                {
                    column --;

                    if(arrow > iceSpellsArray.size() - 1)
                        arrow = iceSpellsArray.size() - 1;
                }
            }
        }
        else if(selection == 's')
        {
            if(column == 0 && arrow < iceSpellsArray.size() - 1) //navigates the menu arrow
                arrow++;
            else if(column == 1 && arrow < fireSpellsArray.size() - 1)
                arrow++;
            else if(column == 2 && arrow < lightingSpellsArray.size() - 1)
                arrow++;
        }
        else if(selection == 'd' && column < 2)
        {
            if(column == 0)
            {
                if(fireSpellsArray.size())
                {
                    column++;

                    if(arrow > fireSpellsArray.size() - 1)
                        arrow = fireSpellsArray.size() - 1;
                }
                else if(lightingSpellsArray.size())
                {
                    column += 2;

                    if(arrow > lightingSpellsArray.size() - 1)
                        arrow = lightingSpellsArray.size() - 1;
                }
            }
            else if(column == 1)
            {
                if(lightingSpellsArray.size())
                {
                    column ++;

                    if(arrow > lightingSpellsArray.size() - 1)
                        arrow = lightingSpellsArray.size() - 1;
                }
            }
        }

        if(selection != '\n')
            cout << "\033[" << lines << "A";

    }while(selection != '\n');

    switch(column)
    {
        case 0:
            chosenSpell = iceSpellsArray[arrow];
            type = 2;
            slotNum = arrow + 1;

            break;

        case 1:
            chosenSpell = fireSpellsArray[arrow];
            type = 3;
            slotNum = arrow + 1;

            break;

        case 2:
            chosenSpell = lightingSpellsArray[arrow];
            type = 1;
            slotNum = arrow + 1;

            break;
    }

    cout << "\033[" << lines + 10 << "A";
    cout << "\033[J";

    //for(int i = 0; i < lines + 10; i++)
    //    cout << "\033[1A\033[K";

    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdi, %r12
movq 0x58(%rdi), %rdi
movq 0x70(%r12), %r8
xorl %eax, %eax
subq 0x50(%r12), %rdi
sete %al
incl %eax
xorl %r9d, %r9d
subq 0x68(%r12), %r8
cmovel %eax, %r9d
movl %r9d, 0x4(%rsp)
movq %r8, %rax
sarq $0x3, %rax
movq %rdi, %r10
sarq $0x3, %r10
cmpq %r10, %rax
jb 0xf9ac
movq 0x40(%r12), %r11
subq 0x38(%r12), %r11
cmpq %r11, %r8
jb 0xf9ac
leal (%rax,%rax,4), %r9d
addl $0x4, %r9d
cmpq %rax, %r10
movq %rdx, 0x58(%rsp)
movq %rcx, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
jae 0xf9cc
movq 0x40(%r12), %r8
subq 0x38(%r12), %r8
jmp 0xf9e3
movq 0x40(%r12), %r8
subq 0x38(%r12), %r8
cmpq %r8, %rdi
jb 0xf9e3
leal (%r10,%r10,4), %r9d
addl $0x4, %r9d
leaq 0x68(%r12), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x50(%r12), %rcx
movq %rcx, 0x20(%rsp)
leaq 0x38(%r12), %rcx
movq %rcx, 0x18(%rsp)
sarq $0x3, %r8
cmpq %r10, %r8
leal 0x4(%r8,%r8,4), %ecx
cmovbl %r9d, %ecx
cmpq %rax, %r8
cmovbl %r9d, %ecx
movl %ecx, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
movq 0x1759d(%rip), %r13     # 0x26fc8
leaq 0xde47(%rip), %r15      # 0x1d879
leaq 0xa8(%rsp), %rbp
movq %r12, 0xa0(%rsp)
movq %r13, %rdi
movq %r15, %rsi
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq %r13, %rdi
leaq 0xdeae(%rip), %rsi      # 0x1d90d
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq %r13, %rdi
leaq 0xdf1a(%rip), %rsi      # 0x1d990
callq 0x31d0
xorl %r15d, %r15d
movl %r15d, %r15d
movq 0x70(%r12), %rax
subq 0x68(%r12), %rax
sarq $0x3, %rax
cmpq %r15, %rax
ja 0xfabe
movq 0x58(%r12), %rax
subq 0x50(%r12), %rax
sarq $0x3, %rax
cmpq %r15, %rax
ja 0xfabe
movq 0x40(%r12), %rax
subq 0x38(%r12), %rax
sarq $0x3, %rax
cmpq %r15, %rax
jbe 0x10360
movq %r13, %rdi
testq %r15, %r15
je 0xfad8
movq %r13, %rdi
leaq 0xdf54(%rip), %rsi      # 0x1da24
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq 0x70(%r12), %rax
subq 0x68(%r12), %rax
sarq $0x3, %rax
cmpq %r15, %rax
jbe 0xfd5d
movl 0x8(%rsp), %eax
xorl %r15d, %eax
orl 0x4(%rsp), %eax
leaq 0xdf98(%rip), %rsi      # 0x1da9e
leaq 0xdf7f(%rip), %rax      # 0x1da8c
cmoveq %rax, %rsi
movq %r13, %rdi
callq 0x31d0
movq (%r13), %rax
movq -0x18(%rax), %rcx
movq $0x1a, 0x10(%r13,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%r13,%rax), %ecx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl %edx, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r13,%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq (%rax,%r15,8), %rsi
movq (%rsi), %rax
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq *0x8(%rax)
movq %r13, %rdi
movq %r14, %rsi
callq 0x3190
movq %rax, %rdi
leaq 0xbe98(%rip), %rsi      # 0x1ba09
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
leaq 0x28(%rsp), %rdi
callq 0x30c0
movq %r13, %rdi
leaq 0xdf1b(%rip), %rsi      # 0x1daad
callq 0x31d0
movq (%r13), %rax
movq -0x18(%rax), %rax
movq $0xa, 0x10(%r13,%rax)
movq 0x10(%rsp), %rbx
movq (%rbx), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x20(%rax)
leaq 0x60(%rsp), %r12
movq %r12, %rdi
movl %eax, %esi
callq 0xbcf1
leaq 0x80(%rsp), %rdi
movq %r12, %rsi
leaq 0xe695(%rip), %rdx      # 0x1e270
callq 0xbcd2
movq (%rbx), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x28(%rax)
leaq 0xa8(%rsp), %r14
movq %r14, %rdi
movl %eax, %esi
callq 0xbcf1
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
leaq 0x80(%rsp), %r12
movq %r12, %rsi
movq %r14, %rdx
callq 0xbc6b
movq %r14, %rdi
callq 0x30c0
movq %r12, %rdi
callq 0x30c0
leaq 0x60(%rsp), %rdi
callq 0x30c0
movq (%r13), %rax
movq -0x18(%rax), %rax
movl 0x18(%r13,%rax), %ecx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl %edx, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r13,%rax)
movq %r13, %rdi
movq %rbx, %rsi
callq 0x3190
leaq 0xc931(%rip), %r14      # 0x1c593
movq %rax, %rdi
movq %r14, %rsi
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq %r13, %rdi
leaq 0xde4f(%rip), %rsi      # 0x1dace
callq 0x31d0
movq (%r13), %rax
movq -0x18(%rax), %rcx
movq $0x6, 0x10(%r13,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%r13,%rax), %ecx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl %edx, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r13,%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
movl %eax, %esi
movq %r13, %rdi
callq 0x3120
movq %rax, %rdi
movq %r14, %rsi
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq %r13, %rdi
leaq 0xde0d(%rip), %rsi      # 0x1daf3
callq 0x31d0
movq (%r13), %rax
movq -0x18(%rax), %rcx
movq $0x7, 0x10(%r13,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%r13,%rax), %ecx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl %edx, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r13,%rax)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movl %eax, %esi
movq %r13, %rdi
callq 0x3120
movq %rax, %rdi
movq %r14, %rsi
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq %rbx, %rdi
callq 0x30c0
movq 0xa0(%rsp), %r12
leaq 0xa8(%rsp), %rbp
jmp 0xfdb0
movq %r13, %rdi
leaq 0xddb0(%rip), %rbx      # 0x1db17
movq %rbx, %rsi
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq %r13, %rdi
leaq 0xdd6e(%rip), %rsi      # 0x1db28
callq 0x31d0
movq 0x58(%r12), %rax
subq 0x50(%r12), %rax
sarq $0x3, %rax
cmpq %r15, %rax
jbe 0x10031
movl 0x4(%rsp), %eax
xorl $0x1, %eax
movl 0x8(%rsp), %ecx
xorl %r15d, %ecx
orl %eax, %ecx
leaq 0xdd51(%rip), %rsi      # 0x1db3e
leaq 0xdd39(%rip), %rax      # 0x1db2d
cmoveq %rax, %rsi
movq %r13, %rdi
callq 0x31d0
movq (%r13), %rax
movq -0x18(%rax), %rcx
movq $0x1a, 0x10(%r13,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%r13,%rax), %ecx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl %edx, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r13,%rax)
movq 0x20(%rsp), %rax
movq (%rax), %rax
movq (%rax,%r15,8), %rsi
movq (%rsi), %rax
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq *0x8(%rax)
movq %r13, %rdi
movq %r14, %rsi
callq 0x3190
movq %rax, %rdi
leaq 0xbbb1(%rip), %rsi      # 0x1ba09
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
leaq 0x28(%rsp), %rdi
callq 0x30c0
movq %r13, %rdi
leaq 0xdccf(%rip), %rsi      # 0x1db48
callq 0x31d0
movq (%r13), %rax
movq -0x18(%rax), %rax
movq $0xa, 0x10(%r13,%rax)
movq 0x20(%rsp), %rbx
movq (%rbx), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x20(%rax)
leaq 0x60(%rsp), %r14
movq %r14, %rdi
movl %eax, %esi
callq 0xbcf1
leaq 0x80(%rsp), %rdi
movq %r14, %rsi
leaq 0xe3ae(%rip), %rdx      # 0x1e270
callq 0xbcd2
movq (%rbx), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x28(%rax)
movq %rbp, %rdi
movl %eax, %esi
callq 0xbcf1
leaq 0x28(%rsp), %r14
movq %r14, %rdi
leaq 0x80(%rsp), %rbx
movq %rbx, %rsi
movq %rbp, %rdx
callq 0xbc6b
movq %rbp, %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x30c0
leaq 0x60(%rsp), %rdi
callq 0x30c0
movq (%r13), %rax
movq -0x18(%rax), %rax
movl 0x18(%r13,%rax), %ecx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl %edx, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r13,%rax)
movq %r13, %rdi
movq %r14, %rsi
callq 0x3190
leaq 0xc652(%rip), %rbx      # 0x1c593
movq 0x20(%rsp), %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq %r13, %rdi
leaq 0xdc01(%rip), %rsi      # 0x1db64
callq 0x31d0
movq (%r13), %rax
movq -0x18(%rax), %rcx
movq $0x5, 0x10(%r13,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%r13,%rax), %ecx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl %edx, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r13,%rax)
movq (%r14), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x48(%rax)
movl %eax, %esi
movq %r13, %rdi
callq 0x3120
movq %rax, %rdi
movq %rbx, %rsi
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq %r13, %rdi
leaq 0xdbc0(%rip), %rsi      # 0x1db85
callq 0x31d0
movq (%r13), %rax
movq -0x18(%rax), %rcx
movq $0x7, 0x10(%r13,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%r13,%rax), %ecx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl %edx, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r13,%rax)
movq (%r14), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movl %eax, %esi
movq %r13, %rdi
callq 0x3120
movq %rax, %rdi
movq %rbx, %rsi
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
leaq 0x28(%rsp), %rdi
callq 0x30c0
leaq 0xa8(%rsp), %rbp
jmp 0x10084
movq %r13, %rdi
leaq 0xdb69(%rip), %rbx      # 0x1dba4
movq %rbx, %rsi
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq %r13, %rdi
leaq 0xda9a(%rip), %rsi      # 0x1db28
callq 0x31d0
movq 0x40(%r12), %rax
subq 0x38(%r12), %rax
sarq $0x3, %rax
cmpq %r15, %rax
jbe 0x10305
movl 0x4(%rsp), %eax
xorl $0x2, %eax
movl 0x8(%rsp), %ecx
xorl %r15d, %ecx
orl %eax, %ecx
leaq 0xdb04(%rip), %rsi      # 0x1dbc5
leaq 0xdaec(%rip), %rax      # 0x1dbb4
cmoveq %rax, %rsi
movq %r13, %rdi
callq 0x31d0
movq (%r13), %rax
movq -0x18(%rax), %rcx
movq $0x1a, 0x10(%r13,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%r13,%rax), %ecx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl %edx, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r13,%rax)
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq (%rax,%r15,8), %rsi
movq (%rsi), %rax
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq *0x8(%rax)
movq %r13, %rdi
movq %r14, %rsi
callq 0x3190
movq %rax, %rdi
leaq 0xb8dd(%rip), %rsi      # 0x1ba09
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
leaq 0x28(%rsp), %rdi
callq 0x30c0
movq %r13, %rdi
leaq 0xda82(%rip), %rsi      # 0x1dbcf
callq 0x31d0
movq (%r13), %rax
movq -0x18(%rax), %rax
movq $0xa, 0x10(%r13,%rax)
movq 0x18(%rsp), %rbx
movq (%rbx), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x20(%rax)
leaq 0x60(%rsp), %r14
movq %r14, %rdi
movl %eax, %esi
callq 0xbcf1
leaq 0x80(%rsp), %rdi
movq %r14, %rsi
leaq 0xe0da(%rip), %rdx      # 0x1e270
callq 0xbcd2
movq (%rbx), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x28(%rax)
movq %rbp, %rdi
movl %eax, %esi
callq 0xbcf1
leaq 0x28(%rsp), %r14
movq %r14, %rdi
leaq 0x80(%rsp), %rbx
movq %rbx, %rsi
movq %rbp, %rdx
callq 0xbc6b
movq %rbp, %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x30c0
leaq 0x60(%rsp), %rdi
callq 0x30c0
movq (%r13), %rax
movq -0x18(%rax), %rax
movl 0x18(%r13,%rax), %ecx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl %edx, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r13,%rax)
movq %r13, %rdi
movq %r14, %rsi
callq 0x3190
leaq 0xc37e(%rip), %rbx      # 0x1c593
movq 0x18(%rsp), %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq %r13, %rdi
leaq 0xd9b4(%rip), %rsi      # 0x1dbeb
callq 0x31d0
movq (%r13), %rax
movq -0x18(%rax), %rcx
movq $0x3, 0x10(%r13,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%r13,%rax), %ecx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl %edx, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r13,%rax)
movq (%r14), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x50(%rax)
movl %eax, %esi
movq %r13, %rdi
callq 0x3120
movq %rax, %rdi
movq %rbx, %rsi
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq %r13, %rdi
leaq 0xd975(%rip), %rsi      # 0x1dc0e
callq 0x31d0
movq (%r13), %rax
movq -0x18(%rax), %rcx
movq $0x7, 0x10(%r13,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%r13,%rax), %ecx
movl $0xffffff4f, %edx       # imm = 0xFFFFFF4F
andl %edx, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r13,%rax)
movq (%r14), %rax
movq (%rax,%r15,8), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movl %eax, %esi
movq %r13, %rdi
callq 0x3120
movq %rax, %rdi
movq %rbx, %rsi
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
leaq 0x28(%rsp), %rdi
callq 0x30c0
leaq 0xa8(%rsp), %rbp
jmp 0x10358
movq %r13, %rdi
leaq 0xd91e(%rip), %rbx      # 0x1dc2d
movq %rbx, %rsi
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq %r13, %rdi
movq %rbx, %rsi
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
incl %r15d
jmp 0xfa7e
movq %r13, %rdi
leaq 0xd50f(%rip), %r15      # 0x1d879
movq %r15, %rsi
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq %r13, %rdi
leaq 0xd8b9(%rip), %rsi      # 0x1dc3d
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
callq 0xcd74
movl %eax, %ebx
cmpb $0x65, %al
je 0x1055a
cmpb $0x77, %bl
movl 0x8(%rsp), %eax
jne 0x103b8
testl %eax, %eax
je 0x103b8
decl %eax
movl %eax, 0x8(%rsp)
jmp 0x10503
cltq
cmpb $0x61, %bl
movl 0x4(%rsp), %ecx
jne 0x10401
testl %ecx, %ecx
je 0x10401
cmpl $0x2, %ecx
jne 0x10477
movq 0x58(%r12), %rcx
movq 0x50(%r12), %rdx
subq %rdx, %rcx
je 0x10494
sarq $0x3, %rcx
leaq -0x1(%rcx), %rdx
pushq $0x1
popq %rsi
movl %esi, 0x4(%rsp)
cmpq %rax, %rdx
jae 0x10503
decl %ecx
pushq $0x1
jmp 0x10470
cmpb $0x73, %bl
jne 0x10433
cmpl $0x2, %ecx
je 0x104c0
cmpl $0x1, %ecx
jne 0x104e2
movq 0x58(%r12), %rcx
subq 0x50(%r12), %rcx
sarq $0x3, %rcx
decq %rcx
cmpq %rcx, %rax
adcl $0x0, 0x8(%rsp)
jmp 0x10486
cmpb $0x64, %bl
jne 0x1048a
cmpl $0x1, %ecx
jg 0x1048a
testl %ecx, %ecx
je 0x10532
movq 0x40(%r12), %rcx
movq 0x38(%r12), %rdx
subq %rdx, %rcx
je 0x10486
sarq $0x3, %rcx
leaq -0x1(%rcx), %rdx
pushq $0x2
popq %rsi
movl %esi, 0x4(%rsp)
cmpq %rax, %rdx
jae 0x10503
decl %ecx
pushq $0x2
popq %rax
movl %eax, 0x4(%rsp)
jmp 0x104ba
movq 0x70(%r12), %rcx
movq 0x68(%r12), %rdx
subq %rdx, %rcx
jne 0x104a3
pushq $0x1
jmp 0x104db
cmpb $0xa, %bl
jne 0x10503
jmp 0x105b5
movq 0x70(%r12), %rcx
movq 0x68(%r12), %rdx
subq %rdx, %rcx
je 0x104d9
sarq $0x3, %rcx
leaq -0x1(%rcx), %rdx
movl $0x0, 0x4(%rsp)
cmpq %rax, %rdx
jae 0x10503
decl %ecx
movl %ecx, 0x8(%rsp)
jmp 0x10503
movq 0x40(%r12), %rcx
subq 0x38(%r12), %rcx
sarq $0x3, %rcx
decq %rcx
cmpq %rcx, %rax
adcl $0x0, 0x8(%rsp)
pushq $0x2
popq %rax
movl %eax, 0x4(%rsp)
jmp 0x10503
movq 0x70(%r12), %rcx
subq 0x68(%r12), %rcx
sarq $0x3, %rcx
decq %rcx
cmpq %rcx, %rax
adcl $0x0, 0x8(%rsp)
movl $0x0, 0x4(%rsp)
movq %r13, %rdi
leaq 0xaece(%rip), %rsi      # 0x1b3db
callq 0x31d0
movq %rax, %rdi
movl 0xc(%rsp), %esi
callq 0x3320
movq %rax, %rdi
leaq 0xb6d6(%rip), %rsi      # 0x1bbfe
callq 0x31d0
jmp 0xfa42
movq 0x58(%r12), %rcx
movq 0x50(%r12), %rdx
subq %rdx, %rcx
jne 0x103e3
movq 0x40(%r12), %rcx
movq 0x38(%r12), %rdx
subq %rdx, %rcx
jne 0x10454
jmp 0x104fb
movq 0x16a67(%rip), %rdi     # 0x26fc8
leaq 0xae73(%rip), %rsi      # 0x1b3db
callq 0x31d0
movq %rax, %rdi
movl 0xc(%rsp), %esi
callq 0x3320
cmpb $0x65, %bl
setne %bl
leaq 0xb678(%rip), %rsi      # 0x1bbfe
movq %rax, %rdi
callq 0x31d0
movq 0x16a33(%rip), %rdi     # 0x26fc8
leaq 0xd207(%rip), %rsi      # 0x1d7a3
callq 0x31d0
movl %ebx, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %ecx, %ecx
je 0x105dc
cmpl $0x2, %ecx
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %r8
movl 0x8(%rsp), %r9d
jne 0x105fa
pushq $0x1
popq %rcx
movq 0x18(%rsp), %rdx
jmp 0x10602
pushq $0x2
popq %rcx
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %r8
movq 0x10(%rsp), %rdx
movl 0x8(%rsp), %r9d
jmp 0x10602
pushq $0x3
popq %rcx
movq 0x20(%rsp), %rdx
movq (%rdx), %rdx
movq (%rdx,%rax,8), %rax
movq %rax, (%r8)
movl %ecx, (%rdi)
incl %r9d
movl %r9d, (%rsi)
movq 0x169ad(%rip), %rdi     # 0x26fc8
leaq 0xadb9(%rip), %rsi      # 0x1b3db
callq 0x31d0
movl 0xc(%rsp), %esi
addl $0xa, %esi
movq %rax, %rdi
jmp 0x10574
jmp 0x10643
jmp 0x1063e
jmp 0x1063e
jmp 0x10643
movq %rax, %rbx
jmp 0x10669
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x30c0
jmp 0x1065c
jmp 0x10659
jmp 0x10659
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x30c0
leaq 0x60(%rsp), %rdi
jmp 0x10682
jmp 0x1067a
jmp 0x1067a
jmp 0x1067a
jmp 0x1067a
jmp 0x1067a
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x3330
nop