// File: /workspace/github_cpp_makefile_star2_O3/whitefusion[P]Jaipur_cardgame-/Game.cpp
// Function: Game::tradeInputVerify(Player&, Market&)
vector<vector<int> > Game::tradeInputVerify(Player &p, Market &m){
    vector<vector<int> > temp;
    vector<int> tempM;
    vector<int> tempH;

    char tmp[256];
    char *token;

    // read in user's input
    cout << "Choose the cards on MARKET want to take in: ";
    //cin.getline(tmp, 256);
    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");
    }

    tempM.push_back(atoi(token));
    token = strtok(NULL, " \t\n\r\f");
    while (token){
        tempM.push_back(atoi(token));
        token = strtok(NULL, " \t\n\r\f");
    }

    cout << "Choose the cards on HANDS want to trade: ";
    cin.getline(tmp, 256);

    token = strtok(tmp, " \t\n\r\f");


    // if nothing input, will trade camels
    if (token){
        tempH.push_back(atoi(token));
        token = strtok(NULL, " \t\n\r\f");
        while (token){
            tempH.push_back(atoi(token));
            token = strtok(NULL, " \t\n\r\f");
        }        
    }

    while(!tradeVerify(tempM, tempH, p, m)){
        tempM.clear();
        tempH.clear();
        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");
        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");
        }


        tempM.push_back(atoi(token));
        token = strtok(NULL, " \t\n\r\f");
        while (token){
            tempM.push_back(atoi(token));
            token = strtok(NULL, " \t\n\r\f");
        }

        cout << "Choose the cards on HANDS want to trade: ";
        cin.getline(tmp, 256);

        token = strtok(tmp, " \t\n\r\f");

        // if nothing input, will trade camels
        if (token){
            tempH.push_back(atoi(token));
            token = strtok(NULL, " \t\n\r\f");
            while (token){
                tempH.push_back(atoi(token));
                token = strtok(NULL, " \t\n\r\f");
            }
        }
    }

    temp.push_back(tempM);
    temp.push_back(tempH);

    return temp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movq %rcx, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
xorl %eax, %eax
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movq %rdi, 0x50(%rsp)
movups %xmm0, (%rdi)
movq %rax, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movq %rax, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movq 0x85de(%rip), %r14      # 0x15fd0
leaq 0x2f3d(%rip), %rsi      # 0x10936
movl $0x2c, %edx
movq %r14, %rdi
callq 0x21d0
movq 0x85d3(%rip), %rdi      # 0x15fe0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %ecx
movq 0x85b8(%rip), %rbx      # 0x15fe0
leaq 0x70(%rsp), %rsi
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
callq 0x22a0
leaq 0x2621(%rip), %rsi      # 0x10062
leaq 0x70(%rsp), %rdi
callq 0x2230
testq %rax, %rax
jne 0xdaec
leaq 0x260d(%rip), %r15      # 0x10068
leaq 0x2ed4(%rip), %r12      # 0x10936
leaq 0x70(%rsp), %r13
leaq 0x25f4(%rip), %rbp      # 0x10062
movl $0x1a, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x21d0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movl $0x2c, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x21d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %ecx
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
movq %r13, %rsi
callq 0x22a0
movq %r13, %rdi
movq %rbp, %rsi
callq 0x2230
testq %rax, %rax
je 0xda6e
movq %rax, %rdi
callq 0x2220
movl %eax, 0xc(%rsp)
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0xdb11
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x38(%rsp)
jmp 0xdb20
leaq 0x30(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0xeddc
leaq 0x253b(%rip), %rsi      # 0x10062
xorl %edi, %edi
callq 0x2230
testq %rax, %rax
je 0xdb83
leaq 0x30(%rsp), %r14
leaq 0xc(%rsp), %r15
leaq 0x251e(%rip), %r12      # 0x10062
movq %rax, %rdi
callq 0x2220
movl %eax, 0xc(%rsp)
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0xdb69
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x38(%rsp)
jmp 0xdb74
movq %r14, %rdi
movq %r15, %rdx
callq 0xeddc
xorl %edi, %edi
movq %r12, %rsi
callq 0x2230
testq %rax, %rax
jne 0xdb44
movq 0x8446(%rip), %r13      # 0x15fd0
leaq 0x2ecc(%rip), %rsi      # 0x10a5d
movl $0x29, %edx
movq %r13, %rdi
callq 0x21d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %ecx
movq 0x8424(%rip), %rbp      # 0x15fe0
leaq 0x70(%rsp), %rsi
movl $0x100, %edx            # imm = 0x100
movq %rbp, %rdi
callq 0x22a0
leaq 0x248d(%rip), %rsi      # 0x10062
leaq 0x70(%rsp), %rdi
callq 0x2230
testq %rax, %rax
je 0xdc7f
movq %rax, %rdi
callq 0x2220
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0xdc0d
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0xdc1c
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0xeddc
leaq 0x243f(%rip), %rsi      # 0x10062
xorl %edi, %edi
callq 0x2230
testq %rax, %rax
je 0xdc7f
leaq 0x10(%rsp), %rbx
leaq 0xc(%rsp), %r14
leaq 0x2422(%rip), %r15      # 0x10062
movq %rax, %rdi
callq 0x2220
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0xdc65
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0xdc70
movq %rbx, %rdi
movq %r14, %rdx
callq 0xeddc
xorl %edi, %edi
movq %r15, %rsi
callq 0x2230
testq %rax, %rax
jne 0xdc40
leaq 0x2cb0(%rip), %r12      # 0x10936
leaq 0x70(%rsp), %r14
leaq 0x23d0(%rip), %rbx      # 0x10062
leaq 0xc(%rsp), %r15
movq 0x58(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq 0x60(%rsp), %rcx
movq 0x68(%rsp), %r8
callq 0xe40c
testb %al, %al
jne 0xdf07
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
je 0xdcce
movq %rax, 0x38(%rsp)
movq 0x10(%rsp), %rax
cmpq %rax, 0x18(%rsp)
je 0xdcdf
movq %rax, 0x18(%rsp)
movl $0x1a, %edx
movq %r13, %rdi
leaq 0x237a(%rip), %rsi      # 0x10068
callq 0x21d0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movl $0x2c, %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x21d0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %ecx
movl $0x100, %edx            # imm = 0x100
movq %rbp, %rdi
movq %r14, %rsi
callq 0x22a0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2230
testq %rax, %rax
jne 0xdddc
movl $0x1a, %edx
movq %r13, %rdi
leaq 0x22f6(%rip), %rsi      # 0x10068
callq 0x21d0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20f0
movl $0x2c, %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x21d0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %ecx
movl $0x100, %edx            # imm = 0x100
movq %rbp, %rdi
movq %r14, %rsi
callq 0x22a0
jmp 0xdd53
movq %rax, %rdi
callq 0x2220
movl %eax, 0xc(%rsp)
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0xdee6
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x38(%rsp)
xorl %edi, %edi
movq %rbx, %rsi
callq 0x2230
testq %rax, %rax
je 0xde39
movq %rax, %rdi
callq 0x2220
movl %eax, 0xc(%rsp)
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
jne 0xddf8
leaq 0x30(%rsp), %rdi
movq %r15, %rdx
callq 0xeddc
jmp 0xde03
movl $0x29, %edx
movq %r13, %rdi
leaq 0x2c15(%rip), %rsi      # 0x10a5d
callq 0x21d0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %ecx
movl $0x100, %edx            # imm = 0x100
movq %rbp, %rdi
movq %r14, %rsi
callq 0x22a0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2230
testq %rax, %rax
je 0xdc97
movq %rax, %rdi
callq 0x2220
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0xdef8
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
xorl %edi, %edi
movq %rbx, %rsi
callq 0x2230
testq %rax, %rax
je 0xdc97
movq %rax, %rdi
callq 0x2220
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
jne 0xdea1
leaq 0x10(%rsp), %rdi
movq %r15, %rdx
callq 0xeddc
jmp 0xdeac
leaq 0x30(%rsp), %rdi
movq %r15, %rdx
callq 0xeddc
jmp 0xde03
leaq 0x10(%rsp), %rdi
movq %r15, %rdx
callq 0xeddc
jmp 0xdeac
leaq 0x30(%rsp), %rsi
movq 0x50(%rsp), %rdi
callq 0xec90
leaq 0x10(%rsp), %rsi
movq 0x50(%rsp), %rdi
callq 0xec90
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xdf3c
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xdf53
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x50(%rsp), %rax
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xdf80
jmp 0xdf80
jmp 0xdf80
jmp 0xdf80
jmp 0xdf80
jmp 0xdf80
jmp 0xdf80
jmp 0xdf80
jmp 0xdf80
jmp 0xdf80
jmp 0xdf80
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xdf9a
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xdfb1
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x50(%rsp), %rdi
callq 0x5f9c
movq %rbx, %rdi
callq 0x2280
nop