// File: 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
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rdi, -0x1b0(%rbp)
movq %rdi, %rax
movq %rax, -0x1a8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movb $0x0, -0x21(%rbp)
callq 0x1bc70
leaq -0x40(%rbp), %rdi
callq 0x15ff0
leaq -0x58(%rbp), %rdi
callq 0x15ff0
movq 0x107c7(%rip), %rdi     # 0x2afd0
leaq 0x411e(%rip), %rsi      # 0x1e92e
callq 0x2200
jmp 0x1a817
movq 0x107c2(%rip), %rdi     # 0x2afe0
leaq -0x160(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x20a0
jmp 0x1a831
leaq -0x160(%rbp), %rdi
leaq 0x3823(%rip), %rsi      # 0x1e062
callq 0x2310
movq %rax, -0x168(%rbp)
cmpq $0x0, -0x168(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1a861
jmp 0x1a915
movq 0x10768(%rip), %rdi     # 0x2afd0
leaq 0x37f9(%rip), %rsi      # 0x1e068
callq 0x2200
movq %rax, -0x1b8(%rbp)
jmp 0x1a87d
movq -0x1b8(%rbp), %rdi
movq 0x10735(%rip), %rsi     # 0x2afc0
callq 0x2240
jmp 0x1a892
movq 0x10737(%rip), %rdi     # 0x2afd0
leaq 0x408e(%rip), %rsi      # 0x1e92e
callq 0x2200
jmp 0x1a8a7
movq 0x10732(%rip), %rdi     # 0x2afe0
leaq -0x160(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x20a0
jmp 0x1a8c1
leaq -0x160(%rbp), %rdi
leaq 0x3793(%rip), %rsi      # 0x1e062
callq 0x2310
movq %rax, -0x168(%rbp)
jmp 0x1a84b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x170(%rbp)
movl %eax, -0x174(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x9900
leaq -0x40(%rbp), %rdi
callq 0x9900
movq -0x1b0(%rbp), %rdi
callq 0x9980
jmp 0x1ad85
movq -0x168(%rbp), %rdi
callq 0x2300
movl %eax, -0x178(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x1bd20
jmp 0x1a939
xorl %eax, %eax
movl %eax, %edi
leaq 0x371e(%rip), %rsi      # 0x1e062
callq 0x2310
movq %rax, -0x168(%rbp)
cmpq $0x0, -0x168(%rbp)
je 0x1a997
movq -0x168(%rbp), %rdi
callq 0x2300
movl %eax, -0x17c(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x17c(%rbp), %rsi
callq 0x1bd20
jmp 0x1a97e
xorl %eax, %eax
movl %eax, %edi
leaq 0x36d9(%rip), %rsi      # 0x1e062
callq 0x2310
movq %rax, -0x168(%rbp)
jmp 0x1a950
movq 0x10632(%rip), %rdi     # 0x2afd0
leaq 0x40b0(%rip), %rsi      # 0x1ea55
callq 0x2200
jmp 0x1a9ac
movq 0x1062d(%rip), %rdi     # 0x2afe0
leaq -0x160(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x20a0
jmp 0x1a9c6
leaq -0x160(%rbp), %rdi
leaq 0x368e(%rip), %rsi      # 0x1e062
callq 0x2310
movq %rax, -0x168(%rbp)
cmpq $0x0, -0x168(%rbp)
je 0x1aa72
movq -0x168(%rbp), %rdi
callq 0x2300
movl %eax, -0x180(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x1bd20
jmp 0x1aa12
xorl %eax, %eax
movl %eax, %edi
leaq 0x3645(%rip), %rsi      # 0x1e062
callq 0x2310
movq %rax, -0x168(%rbp)
cmpq $0x0, -0x168(%rbp)
je 0x1aa70
movq -0x168(%rbp), %rdi
callq 0x2300
movl %eax, -0x184(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x184(%rbp), %rsi
callq 0x1bd20
jmp 0x1aa57
xorl %eax, %eax
movl %eax, %edi
leaq 0x3600(%rip), %rsi      # 0x1e062
callq 0x2310
movq %rax, -0x168(%rbp)
jmp 0x1aa29
jmp 0x1aa72
jmp 0x1aa74
movq -0x1a0(%rbp), %rdi
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
leaq -0x40(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0x1b2a0
movb %al, -0x1b9(%rbp)
jmp 0x1aa98
movb -0x1b9(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1aaa9
jmp 0x1ad29
leaq -0x40(%rbp), %rdi
callq 0x1bd50
leaq -0x58(%rbp), %rdi
callq 0x1bd50
movq 0x1050e(%rip), %rdi     # 0x2afd0
leaq 0x359f(%rip), %rsi      # 0x1e068
callq 0x2200
movq %rax, -0x1c8(%rbp)
jmp 0x1aad7
movq -0x1c8(%rbp), %rdi
movq 0x104db(%rip), %rsi     # 0x2afc0
callq 0x2240
jmp 0x1aaec
movq 0x104dd(%rip), %rdi     # 0x2afd0
leaq 0x3e34(%rip), %rsi      # 0x1e92e
callq 0x2200
jmp 0x1ab01
movq 0x104d8(%rip), %rdi     # 0x2afe0
leaq -0x160(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x20a0
jmp 0x1ab1b
leaq -0x160(%rbp), %rdi
leaq 0x3539(%rip), %rsi      # 0x1e062
callq 0x2310
movq %rax, -0x168(%rbp)
cmpq $0x0, -0x168(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1ab48
jmp 0x1abc7
movq 0x10481(%rip), %rdi     # 0x2afd0
leaq 0x3512(%rip), %rsi      # 0x1e068
callq 0x2200
movq %rax, -0x1d0(%rbp)
jmp 0x1ab64
movq -0x1d0(%rbp), %rdi
movq 0x1044e(%rip), %rsi     # 0x2afc0
callq 0x2240
jmp 0x1ab79
movq 0x10450(%rip), %rdi     # 0x2afd0
leaq 0x3da7(%rip), %rsi      # 0x1e92e
callq 0x2200
jmp 0x1ab8e
movq 0x1044b(%rip), %rdi     # 0x2afe0
leaq -0x160(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x20a0
jmp 0x1aba8
leaq -0x160(%rbp), %rdi
leaq 0x34ac(%rip), %rsi      # 0x1e062
callq 0x2310
movq %rax, -0x168(%rbp)
jmp 0x1ab35
movq -0x168(%rbp), %rdi
callq 0x2300
movl %eax, -0x188(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x1bd20
jmp 0x1abeb
xorl %eax, %eax
movl %eax, %edi
leaq 0x346c(%rip), %rsi      # 0x1e062
callq 0x2310
movq %rax, -0x168(%rbp)
cmpq $0x0, -0x168(%rbp)
je 0x1ac49
movq -0x168(%rbp), %rdi
callq 0x2300
movl %eax, -0x18c(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x18c(%rbp), %rsi
callq 0x1bd20
jmp 0x1ac30
xorl %eax, %eax
movl %eax, %edi
leaq 0x3427(%rip), %rsi      # 0x1e062
callq 0x2310
movq %rax, -0x168(%rbp)
jmp 0x1ac02
movq 0x10380(%rip), %rdi     # 0x2afd0
leaq 0x3dfe(%rip), %rsi      # 0x1ea55
callq 0x2200
jmp 0x1ac5e
movq 0x1037b(%rip), %rdi     # 0x2afe0
leaq -0x160(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x20a0
jmp 0x1ac78
leaq -0x160(%rbp), %rdi
leaq 0x33dc(%rip), %rsi      # 0x1e062
callq 0x2310
movq %rax, -0x168(%rbp)
cmpq $0x0, -0x168(%rbp)
je 0x1ad24
movq -0x168(%rbp), %rdi
callq 0x2300
movl %eax, -0x190(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x1bd20
jmp 0x1acc4
xorl %eax, %eax
movl %eax, %edi
leaq 0x3393(%rip), %rsi      # 0x1e062
callq 0x2310
movq %rax, -0x168(%rbp)
cmpq $0x0, -0x168(%rbp)
je 0x1ad22
movq -0x168(%rbp), %rdi
callq 0x2300
movl %eax, -0x194(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x194(%rbp), %rsi
callq 0x1bd20
jmp 0x1ad09
xorl %eax, %eax
movl %eax, %edi
leaq 0x334e(%rip), %rsi      # 0x1e062
callq 0x2310
movq %rax, -0x168(%rbp)
jmp 0x1acdb
jmp 0x1ad24
jmp 0x1aa74
movq -0x1b0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1bd70
jmp 0x1ad3b
movq -0x1b0(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x1bd70
jmp 0x1ad4d
movb $0x1, -0x21(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x9900
leaq -0x40(%rbp), %rdi
callq 0x9900
testb $0x1, -0x21(%rbp)
jne 0x1ad75
movq -0x1b0(%rbp), %rdi
callq 0x9980
movq -0x1a8(%rbp), %rax
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
movq -0x170(%rbp), %rdi
callq 0x2360
nopw %cs:(%rax,%rax)