// File: /workspace/github_cpp_makefile_star2_O1/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 0x84dc(%rip), %r14      # 0x15fd0
leaq 0x2e2b(%rip), %rsi      # 0x10926
movl $0x2c, %edx
movq %r14, %rdi
callq 0x21d0
movq 0x84d1(%rip), %rdi      # 0x15fe0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %ecx
movq 0x84b6(%rip), %rbx      # 0x15fe0
leaq 0x70(%rsp), %rsi
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
callq 0x22a0
leaq 0x251f(%rip), %rsi      # 0x10062
leaq 0x70(%rsp), %rdi
callq 0x2230
testq %rax, %rax
jne 0xdbee
leaq 0x250b(%rip), %r15      # 0x10068
leaq 0x2dc2(%rip), %r12      # 0x10926
leaq 0x70(%rsp), %r13
leaq 0x24f2(%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 0xdb70
movq %rax, %rdi
callq 0x2220
movl %eax, 0xc(%rsp)
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0xdc13
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x38(%rsp)
jmp 0xdc22
leaq 0x30(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0xef2e
leaq 0x2439(%rip), %rsi      # 0x10062
xorl %edi, %edi
callq 0x2230
testq %rax, %rax
je 0xdc85
leaq 0x30(%rsp), %r14
leaq 0xc(%rsp), %r15
leaq 0x241c(%rip), %r12      # 0x10062
movq %rax, %rdi
callq 0x2220
movl %eax, 0xc(%rsp)
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0xdc6b
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x38(%rsp)
jmp 0xdc76
movq %r14, %rdi
movq %r15, %rdx
callq 0xef2e
xorl %edi, %edi
movq %r12, %rsi
callq 0x2230
testq %rax, %rax
jne 0xdc46
movq 0x8344(%rip), %r13      # 0x15fd0
leaq 0x2dba(%rip), %rsi      # 0x10a4d
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 0x8322(%rip), %rbp      # 0x15fe0
leaq 0x70(%rsp), %rsi
movl $0x100, %edx            # imm = 0x100
movq %rbp, %rdi
callq 0x22a0
leaq 0x238b(%rip), %rsi      # 0x10062
leaq 0x70(%rsp), %rdi
callq 0x2230
testq %rax, %rax
je 0xdd81
movq %rax, %rdi
callq 0x2220
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0xdd0f
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0xdd1e
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0xef2e
leaq 0x233d(%rip), %rsi      # 0x10062
xorl %edi, %edi
callq 0x2230
testq %rax, %rax
je 0xdd81
leaq 0x10(%rsp), %rbx
leaq 0xc(%rsp), %r14
leaq 0x2320(%rip), %r15      # 0x10062
movq %rax, %rdi
callq 0x2220
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0xdd67
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0xdd72
movq %rbx, %rdi
movq %r14, %rdx
callq 0xef2e
xorl %edi, %edi
movq %r15, %rsi
callq 0x2230
testq %rax, %rax
jne 0xdd42
leaq 0x2b9e(%rip), %r12      # 0x10926
leaq 0x70(%rsp), %r14
leaq 0x22ce(%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 0xe50e
testb %al, %al
jne 0xe009
movq 0x30(%rsp), %rax
cmpq %rax, 0x38(%rsp)
je 0xddd0
movq %rax, 0x38(%rsp)
movq 0x10(%rsp), %rax
cmpq %rax, 0x18(%rsp)
je 0xdde1
movq %rax, 0x18(%rsp)
movl $0x1a, %edx
movq %r13, %rdi
leaq 0x2278(%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 0xdede
movl $0x1a, %edx
movq %r13, %rdi
leaq 0x21f4(%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 0xde55
movq %rax, %rdi
callq 0x2220
movl %eax, 0xc(%rsp)
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
je 0xdfe8
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x38(%rsp)
xorl %edi, %edi
movq %rbx, %rsi
callq 0x2230
testq %rax, %rax
je 0xdf3b
movq %rax, %rdi
callq 0x2220
movl %eax, 0xc(%rsp)
movq 0x38(%rsp), %rsi
cmpq 0x40(%rsp), %rsi
jne 0xdefa
leaq 0x30(%rsp), %rdi
movq %r15, %rdx
callq 0xef2e
jmp 0xdf05
movl $0x29, %edx
movq %r13, %rdi
leaq 0x2b03(%rip), %rsi      # 0x10a4d
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 0xdd99
movq %rax, %rdi
callq 0x2220
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0xdffa
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
xorl %edi, %edi
movq %rbx, %rsi
callq 0x2230
testq %rax, %rax
je 0xdd99
movq %rax, %rdi
callq 0x2220
movl %eax, 0xc(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
jne 0xdfa3
leaq 0x10(%rsp), %rdi
movq %r15, %rdx
callq 0xef2e
jmp 0xdfae
leaq 0x30(%rsp), %rdi
movq %r15, %rdx
callq 0xef2e
jmp 0xdf05
leaq 0x10(%rsp), %rdi
movq %r15, %rdx
callq 0xef2e
jmp 0xdfae
leaq 0x30(%rsp), %rsi
movq 0x50(%rsp), %rdi
callq 0xede2
leaq 0x10(%rsp), %rsi
movq 0x50(%rsp), %rdi
callq 0xede2
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xe03e
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xe055
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 0xe082
jmp 0xe082
jmp 0xe082
jmp 0xe082
jmp 0xe082
jmp 0xe082
jmp 0xe082
jmp 0xe082
jmp 0xe082
jmp 0xe082
jmp 0xe082
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0xe09c
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0xe0b3
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x21a0
movq 0x50(%rsp), %rdi
callq 0x5fe6
movq %rbx, %rdi
callq 0x2280
nop