// File: /workspace/github_cpp_makefile_star2_O2/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
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movq %rdi, %rbx
xorl %ecx, %ecx
movb %cl, (%rax)
movb %cl, -0x29(%rbp)
movq %rsi, -0x50(%rbp)
callq 0x13fc8
leaq -0x30(%rbp), %rsi
movb $0x0, (%rsi)
pushq $-0x1
popq %rcx
movq %rbx, -0x38(%rbp)
movq %rbx, %rdi
xorl %edx, %edx
callq 0x1496c
movq $0x0, -0x48(%rbp)
movq 0xde14(%rip), %r15      # 0x26fc8
leaq 0x26c3(%rip), %r12      # 0x1b87e
leaq -0x30(%rbp), %r14
leaq -0x3c(%rbp), %r13
pushq $0x1
popq %rbx
movq %r15, %rdi
callq 0x30d0
movq %r15, %rdi
leaq 0x507a(%rip), %rsi      # 0x1e252
callq 0x31d0
movq %rax, %rdi
callq 0x30d0
movq %rax, %rdi
callq 0x30d0
movq %r15, %rdi
leaq 0x561c(%rip), %rsi      # 0x1e813
callq 0x31d0
movq %r15, %rdi
leaq 0x5222(%rip), %rsi      # 0x1e428
callq 0x31d0
movq %r15, %rdi
leaq 0x5611(%rip), %rsi      # 0x1e826
callq 0x31d0
movq %r15, %rdi
movq %r12, %rsi
callq 0x31d0
movq %r15, %rdi
leaq 0x2679(%rip), %rsi      # 0x1b8a8
callq 0x31d0
movq %r15, %rdi
leaq 0x4565(%rip), %rsi      # 0x1d7a3
callq 0x31d0
movq %r15, %rdi
movq %r12, %rsi
callq 0x31d0
movq 0xdd83(%rip), %rdi      # 0x26fd8
leaq -0x70(%rbp), %rsi
callq 0x3250
movq -0x70(%rbp), %rdi
movl $0x1, -0x30(%rbp)
movl $0x4, -0x3c(%rbp)
leaq -0x40(%rbp), %rsi
movq %r14, %rdx
movq %r13, %rcx
movl %ebx, %r8d
callq 0xcb5c
testb %al, %al
jne 0x19292
movl $0x1b7740, %edi         # imm = 0x1B7740
callq 0x32a0
jmp 0x19225
movl -0x40(%rbp), %eax
decl %eax
cmpl $0x3, %eax
ja 0x191c6
leaq 0x4e59(%rip), %rcx      # 0x1e100
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x38(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x17c3c
jmp 0x191c6
movq -0x38(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x18bd8
jmp 0x191c6
movq -0x48(%rbp), %rax
xorb $0x1, %al
movq %rax, -0x48(%rbp)
movb %al, -0x29(%rbp)
movq -0x38(%rbp), %rdi
leaq -0x29(%rbp), %rsi
xorl %edx, %edx
pushq $-0x1
popq %rcx
callq 0x1496c
jmp 0x191c6
leaq -0x70(%rbp), %rdi
callq 0x30c0
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1931c
jmp 0x1931c
jmp 0x1931c
jmp 0x1931c
jmp 0x1931c
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x3330