// File: whitefusion[P]Jaipur_cardgame-/Human.cpp
// Function: Human::setAction(Market&)
int Human::setAction(Market &m){
    int act;
    char tmp[256];
    char *token;

    cout << "Options(Take--1,  Trade--2,  Sell--3,  TakeCamel--4): ";
    cin.getline(tmp,256);
    token = strtok(tmp, " \t\n\r\f");

    while (!token){
        cout << "Invalid choice! Try again." << endl;
        cout << "Choose the cards on MARKET want to take in: ";
        cin.getline(tmp, 256);
        token = strtok(tmp, " \t\n\r\f");
    }
    act = atoi(token);

    while (!actionVerify(act,m)){
        cout << "Invalid action! Try again." << endl;
        cout << "Options(Take--1,  Trade--2,  Sell--3,  TakeCamel--4): ";
        cin.getline(tmp, 256);
        token = strtok(tmp, " \t\n\r\f");

        while (!token ){
            cout << "Invalid choice! Try again." << endl;
            cout << "Choose the cards on MARKET want to take in: ";
            cin.getline(tmp, 256);
            token = strtok(tmp, " \t\n\r\f");
        }

        act = atoi(token);
    }

    return act;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x130(%rbp)
movq 0x1243b(%rip), %rdi     # 0x2afd0
leaq 0x5d5b(%rip), %rsi      # 0x1e8f7
callq 0x2200
leaq -0x120(%rbp), %rsi
movq 0x12431(%rip), %rdi     # 0x2afe0
movl $0x100, %edx            # imm = 0x100
callq 0x20a0
leaq -0x120(%rbp), %rdi
leaq 0x549b(%rip), %rsi      # 0x1e062
callq 0x2310
movq %rax, -0x128(%rbp)
cmpq $0x0, -0x128(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x18be6
jmp 0x18c4f
movq 0x123e3(%rip), %rdi     # 0x2afd0
leaq 0x5474(%rip), %rsi      # 0x1e068
callq 0x2200
movq %rax, %rdi
movq 0x123bd(%rip), %rsi     # 0x2afc0
callq 0x2240
movq 0x123c1(%rip), %rdi     # 0x2afd0
leaq 0x5d18(%rip), %rsi      # 0x1e92e
callq 0x2200
leaq -0x120(%rbp), %rsi
movq 0x123b7(%rip), %rdi     # 0x2afe0
movl $0x100, %edx            # imm = 0x100
callq 0x20a0
leaq -0x120(%rbp), %rdi
leaq 0x5421(%rip), %rsi      # 0x1e062
callq 0x2310
movq %rax, -0x128(%rbp)
jmp 0x18bd3
movq -0x128(%rbp), %rdi
callq 0x2300
movl %eax, -0x14(%rbp)
movq -0x130(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x10(%rbp), %rdx
callq 0x18d80
xorb $-0x1, %al
testb $0x1, %al
jne 0x18c7c
jmp 0x18d73
movq 0x1234d(%rip), %rdi     # 0x2afd0
leaq 0x5cd1(%rip), %rsi      # 0x1e95b
callq 0x2200
movq %rax, %rdi
movq 0x12327(%rip), %rsi     # 0x2afc0
callq 0x2240
movq 0x1232b(%rip), %rdi     # 0x2afd0
leaq 0x5c4b(%rip), %rsi      # 0x1e8f7
callq 0x2200
leaq -0x120(%rbp), %rsi
movq 0x12321(%rip), %rdi     # 0x2afe0
movl $0x100, %edx            # imm = 0x100
callq 0x20a0
leaq -0x120(%rbp), %rdi
leaq 0x538b(%rip), %rsi      # 0x1e062
callq 0x2310
movq %rax, -0x128(%rbp)
cmpq $0x0, -0x128(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x18cf6
jmp 0x18d5f
movq 0x122d3(%rip), %rdi     # 0x2afd0
leaq 0x5364(%rip), %rsi      # 0x1e068
callq 0x2200
movq %rax, %rdi
movq 0x122ad(%rip), %rsi     # 0x2afc0
callq 0x2240
movq 0x122b1(%rip), %rdi     # 0x2afd0
leaq 0x5c08(%rip), %rsi      # 0x1e92e
callq 0x2200
leaq -0x120(%rbp), %rsi
movq 0x122a7(%rip), %rdi     # 0x2afe0
movl $0x100, %edx            # imm = 0x100
callq 0x20a0
leaq -0x120(%rbp), %rdi
leaq 0x5311(%rip), %rsi      # 0x1e062
callq 0x2310
movq %rax, -0x128(%rbp)
jmp 0x18ce3
movq -0x128(%rbp), %rdi
callq 0x2300
movl %eax, -0x14(%rbp)
jmp 0x18c5e
movl -0x14(%rbp), %eax
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nop