// File: /workspace/github_cpp_makefile_star2_O2/whitefusion[P]Jaipur_cardgame-/Human.cpp
// Function: Human::actionVerify(int, Market&)
bool Human::actionVerify(int act, Market &m){
    if (act > 4 || act < 1)
        return false;

    bool allCamel = true;
    int nonCML = 0;
    for (int i = 0; i < 5; ++i){
        if (m.getGoods(i+1).getCard() != "CAMEL"){
            allCamel = false;
            nonCML++;
        }
    }

    int gc, dc, sc, rc;
    gc = dc = sc = rc = 0;

    for (int i = 0; i < getSize(0); ++i){
        string tmp = getHand(0,i).getCard();
        if (tmp == "DIAMD")
            dc++;
        else if (tmp == "GOLD")
            gc++;
        else if (tmp == "SILVR")
            sc++;
        else
            rc++;
    }

    switch (act){
        //take
        case 1:
        {
            if (allCamel || getSize(0) == 7)
                return false;
            else 
                return true;
        }

        // trade
        case 2:
        {
            if (nonCML > 1 && (getSize(0) + getSize(1) > 1))
                return true;
            else
                return false;
        }

        //sell
        case 3:
        {
            if (gc > 1 || dc > 1 || sc > 1 || rc > 0)
                return true;
            else 
                return false;
        }

        //take camel
        case 4:
        {
            if (nonCML < 5) 
                return true;
            else
                return false;
        }
    }

    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, %r15
leal -0x5(%rsi), %eax
xorl %edx, %edx
cmpl $-0x4, %eax
jb 0xa610
movq %rsi, 0x20(%rsp)
movq %rdi, 0x18(%rsp)
movl $0x0, 0x8(%rsp)
movb $0x1, %bl
pushq $0x1
popq %rbp
leaq 0x28(%rsp), %r12
leaq 0x48(%rsp), %r13
cmpl $0x6, %ebp
je 0xa4c0
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x7ff6
movq %r13, %rdi
movq %r12, %rsi
callq 0x7d18
movq %r13, %rdi
leaq 0x2cee(%rip), %rsi      # 0xd183
callq 0xa647
movl %eax, %r14d
movq %r13, %rdi
callq 0x20e0
movq %r12, %rdi
callq 0x7d12
movzbl %r14b, %eax
xorb $0x1, %r14b
andb %r14b, %bl
addl %eax, 0x8(%rsp)
incl %ebp
jmp 0xa46e
movl $0x0, 0x14(%rsp)
leaq 0x28(%rsp), %r12
leaq 0x48(%rsp), %r13
xorl %r14d, %r14d
movl $0x0, 0xc(%rsp)
movl $0x0, 0x10(%rsp)
xorl %r15d, %r15d
movq 0x18(%rsp), %rbp
movq %rbp, %rdi
xorl %esi, %esi
callq 0x8b20
cmpl %eax, %r15d
jge 0xa581
movq %r12, %rdi
movq %rbp, %rsi
xorl %edx, %edx
movl %r15d, %ecx
callq 0x8ba0
movq %r13, %rdi
movq %r12, %rsi
callq 0x7d18
movq %r12, %rdi
callq 0x7d12
movq %r13, %rdi
leaq 0x2c33(%rip), %rsi      # 0xd160
callq 0x83b7
testb %al, %al
je 0xa53b
incl %r14d
jmp 0xa571
movq %r13, %rdi
leaq 0x2c21(%rip), %rsi      # 0xd166
callq 0x83b7
testb %al, %al
je 0xa554
incl 0x14(%rsp)
jmp 0xa571
movq %r13, %rdi
leaq 0x2c0d(%rip), %rsi      # 0xd16b
callq 0x83b7
testb %al, %al
je 0xa56d
incl 0xc(%rsp)
jmp 0xa571
incl 0x10(%rsp)
movq %r13, %rdi
callq 0x20e0
incl %r15d
jmp 0xa4ed
movq 0x20(%rsp), %rcx
decl %ecx
leaq 0x3361(%rip), %rax      # 0xd8f0
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
testb $0x1, %bl
jne 0xa60e
movq 0x18(%rsp), %rdi
xorl %esi, %esi
callq 0x8b20
cmpl $0x7, %eax
setne %dl
jmp 0xa610
cmpl $0x2, 0x14(%rsp)
setge %al
cmpl $0x2, %r14d
setge %cl
orb %al, %cl
cmpl $0x2, 0xc(%rsp)
setge %al
cmpl $0x0, 0x10(%rsp)
setg %dl
orb %al, %dl
orb %cl, %dl
jmp 0xa610
cmpl $0x5, 0x8(%rsp)
setb %dl
jmp 0xa610
cmpl $0x2, 0x8(%rsp)
movq 0x18(%rsp), %r14
jb 0xa60e
movq %r14, %rdi
xorl %esi, %esi
callq 0x8b20
movl %eax, %ebx
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x8b20
addl %ebx, %eax
movb $0x1, %dl
cmpl $0x1, %eax
jg 0xa610
xorl %edx, %edx
movl %edx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa623
movq %rax, %rbx
jmp 0xa635
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x20e0
leaq 0x28(%rsp), %rdi
callq 0x7d12
movq %rbx, %rdi
callq 0x22a0