// File: MatthewZMD[P]TetrisDual/interface.cc
// Function: Interface::cmdInterpreter(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, unsigned int)
std::string Interface::cmdInterpreter(const std::string& cmd, const std::vector<std::string>& cmdList, unsigned i){
    if(cmd.size() == 0 && cmdList.size() > 1){
        // Matched more than 1 command
        return "";
    }
    std::vector<std::string> newList;
    // Loop through the command
    for(unsigned l = 0; l < cmdList.size(); ++l){
        if(cmdList.at(l).size() > i && cmd.at(0) == cmdList.at(l).at(i)){
            newList.emplace_back(cmdList.at(l));
        }
    }
    if(newList.size() == 0){
        // Cannot find any match string
        return "";
    } else if (newList.size() == 1){
        return newList.at(0);
    } else {
        return cmdInterpreter(cmd.substr(1), newList, i + 1);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x98(%rbp)
movq %rdi, %rax
movq %rax, -0x90(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x18(%rbp), %rdi
callq 0x6270
cmpq $0x0, %rax
jne 0x94dd
movq -0x20(%rbp), %rdi
callq 0xa2b0
cmpq $0x1, %rax
jbe 0x94dd
leaq -0x25(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x6640
movq -0x98(%rbp), %rdi
movq -0xa0(%rbp), %rdx
leaq 0x244ff(%rip), %rsi     # 0x2d9ad
callq 0x7180
jmp 0x94b5
leaq -0x25(%rbp), %rdi
callq 0x63c0
jmp 0x9724
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x25(%rbp), %rdi
callq 0x63c0
jmp 0x9734
leaq -0x50(%rbp), %rdi
callq 0xa2d0
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
movq %rax, -0xa8(%rbp)
movq -0x20(%rbp), %rdi
callq 0xa2b0
movq %rax, %rcx
movq -0xa8(%rbp), %rax
cmpq %rcx, %rax
jae 0x95f9
movq -0x20(%rbp), %rdi
movl -0x54(%rbp), %eax
movl %eax, %esi
callq 0xa2f0
movq %rax, -0xb0(%rbp)
jmp 0x952a
movq -0xb0(%rbp), %rdi
callq 0x6270
movl -0x24(%rbp), %ecx
cmpq %rcx, %rax
jbe 0x95e9
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x6440
movq %rax, -0xb8(%rbp)
jmp 0x9558
movq -0xb8(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0xc4(%rbp)
movq -0x20(%rbp), %rdi
movl -0x54(%rbp), %eax
movl %eax, %esi
callq 0xa2f0
movq %rax, -0xc0(%rbp)
jmp 0x957f
movq -0xc0(%rbp), %rdi
movl -0x24(%rbp), %eax
movl %eax, %esi
callq 0x6440
movq %rax, -0xd0(%rbp)
jmp 0x9599
movl -0xc4(%rbp), %eax
movq -0xd0(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x95e9
movq -0x20(%rbp), %rdi
movl -0x54(%rbp), %eax
movl %eax, %esi
callq 0xa2f0
movq %rax, -0xd8(%rbp)
jmp 0x95c4
movq -0xd8(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0xa330
jmp 0x95d6
jmp 0x95e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x9719
jmp 0x95eb
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x94ed
leaq -0x50(%rbp), %rdi
callq 0xa2b0
cmpq $0x0, %rax
jne 0x9663
leaq -0x55(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0x6640
movq -0x98(%rbp), %rdi
movq -0xe0(%rbp), %rdx
leaq 0x24380(%rip), %rsi     # 0x2d9ad
callq 0x7180
jmp 0x9634
leaq -0x55(%rbp), %rdi
callq 0x63c0
movl $0x1, -0x5c(%rbp)
jmp 0x970e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x55(%rbp), %rdi
callq 0x63c0
jmp 0x9719
leaq -0x50(%rbp), %rdi
callq 0xa2b0
cmpq $0x1, %rax
jne 0x96a6
xorl %eax, %eax
movl %eax, %esi
leaq -0x50(%rbp), %rdi
callq 0xa3b0
movq %rax, -0xe8(%rbp)
jmp 0x9688
movq -0xe8(%rbp), %rsi
movq -0x98(%rbp), %rdi
callq 0x6180
jmp 0x969d
movl $0x1, -0x5c(%rbp)
jmp 0x970e
movq -0x18(%rbp), %rsi
leaq -0x80(%rbp), %rdi
movl $0x1, %edx
movq $-0x1, %rcx
callq 0x6390
jmp 0x96c1
movq -0x88(%rbp), %rsi
movq -0x98(%rbp), %rdi
movl -0x24(%rbp), %r8d
incl %r8d
leaq -0x80(%rbp), %rdx
leaq -0x50(%rbp), %rcx
callq 0x9430
jmp 0x96e5
leaq -0x80(%rbp), %rdi
callq 0x6230
movl $0x1, -0x5c(%rbp)
jmp 0x970e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x6230
jmp 0x9719
leaq -0x50(%rbp), %rdi
callq 0x8490
jmp 0x9724
leaq -0x50(%rbp), %rdi
callq 0x8490
jmp 0x9734
movq -0x90(%rbp), %rax
addq $0xf0, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x6630
nopl (%rax)