// File: /workspace/github_cpp_makefile_star2_O1/MichaelXanth[P]RPG_Game/Market/Market.cpp
// Function: Market::EnterMarket(std::vector<Hero*, std::allocator<Hero*>>&)
bool Market::EnterMarket(vector<Hero *>& heroes)
{
    int action;
    //int buyState;
    string testAction;
    bool infoState = false;

    NewStuff(heroes);

    DisplayMarket();

    while(true){

        bool errFlag = false;

        cout << endl;
        cout << "-------------------------------" << endl << endl;
        cout << "Choose an action: ";

        cout << "\n\n\n\n\n";
        cout << "\033[5A\033[18C";

        cout << "\033[s";

        do {
            if (errFlag)
                usleep(1800000);

            cout << "\033[u";
            cout << "\033[J";
            cout << "\033[s";

            cin >> testAction;

            errFlag = true;
        } while(!isValid(testAction.c_str(),action,1,4));

        switch(action)
        {
            case 1:
                Buy(heroes);
                break;
            case 2:
                Sell(heroes);
                break;
            case 3:
                infoState = !infoState;
                DisplayMarket(infoState);
                break;
            case 4:
                return false;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq -0x58(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq $0x0, -0x8(%rcx)
xorl %eax, %eax
movb %al, (%rcx)
movb %al, -0x29(%rbp)
movq %rsi, -0x48(%rbp)
callq 0x1aafc
leaq -0x30(%rbp), %rsi
movb $0x0, (%rsi)
movq %rbx, -0x38(%rbp)
movq %rbx, %rdi
xorl %edx, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x1b940
leaq -0x29(%rbp), %rax
movb (%rax), %al
movb %al, -0x2a(%rbp)
movq 0xc9d6(%rip), %r12      # 0x2efc8
leaq 0x2285(%rip), %r13      # 0x2487e
leaq -0x30(%rbp), %r14
leaq -0x3c(%rbp), %r15
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq %r12, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x3100
movl $0x1f, %edx
movq %r12, %rdi
leaq 0x4bea(%rip), %rsi      # 0x27222
callq 0x31e0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3190
movsbl %al, %esi
movq %r12, %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
movl $0x12, %edx
movq %r12, %rdi
leaq 0x5145(%rip), %rsi      # 0x277e3
callq 0x31e0
movl $0x5, %edx
movq %r12, %rdi
leaq 0x4d46(%rip), %rsi      # 0x273f8
callq 0x31e0
movl $0x9, %edx
movq %r12, %rdi
leaq 0x5130(%rip), %rsi      # 0x277f6
callq 0x31e0
movl $0x3, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x31e0
movl $0x3, %edx
movq %r12, %rdi
leaq 0x21be(%rip), %rsi      # 0x248a8
callq 0x31e0
movl $0x3, %edx
movq %r12, %rdi
leaq 0x40a5(%rip), %rsi      # 0x267a3
callq 0x31e0
movl $0x3, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x31e0
movq 0xc8be(%rip), %rdi      # 0x2efd8
leaq -0x68(%rbp), %rsi
callq 0x3230
movq -0x68(%rbp), %rdi
movl $0x1, -0x30(%rbp)
movl $0x4, -0x3c(%rbp)
leaq -0x40(%rbp), %rsi
movq %r14, %rdx
movq %r15, %rcx
movl $0x1, %r8d
callq 0x103de
testb %al, %al
jne 0x2275a
movl $0x1b7740, %edi         # imm = 0x1B7740
callq 0x3260
jmp 0x226db
movl -0x40(%rbp), %eax
decl %eax
cmpl $0x3, %eax
ja 0x22601
leaq 0x4959(%rip), %rcx      # 0x270c8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x38(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x20790
jmp 0x22601
movq -0x38(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x21d7e
jmp 0x22601
movb -0x2a(%rbp), %al
xorb $0x1, %al
movb %al, -0x2a(%rbp)
movb %al, -0x29(%rbp)
movq -0x38(%rbp), %rdi
leaq -0x29(%rbp), %rsi
xorl %edx, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x1b940
jmp 0x22601
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x227d2
callq 0x3170
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x227ed
jmp 0x227ed
jmp 0x227ed
jmp 0x227ed
jmp 0x227ed
movq %rax, %rbx
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x22802
callq 0x3170
movq %rbx, %rdi
callq 0x32f0