// File: MatthewZMD[P]TetrisDual/interface.cc
// Function: Interface::cmdInterface(std::istream&)
bool Interface::cmdInterface(std::istream& in) {
    if (g->isAutoDrop()) {
        execFunc(in, 1, "drop");
        std::cout << *(g->display) << std::endl;
        return true;
    }

    std::string cmd;
    if(in >> cmd){
        // Used for multiplier
        int step;

        // Extract numbers from cmd
        cmdExtract(step, cmd);

        // Interpret the command
        cmd = cmdInterpreter(cmd, cmdList);

        if (cmd == "") {
            std::cout << "What are you talking about?" << std::endl;
        }
        else {
            execFunc(in, step, cmd);
            std::cout << *(g->display) << std::endl;
        }

        return true;
    }
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
addq $0x60, %rdi
callq 0x7350
movq %rax, %rdi
callq 0x1b9f0
testb $0x1, %al
jne 0x9e78
jmp 0x9f50
movq -0x18(%rbp), %rax
movq %rax, -0xd8(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x6640
movq -0xd0(%rbp), %rdx
leaq 0x2333b(%rip), %rsi     # 0x2d1dc
leaq -0x38(%rbp), %rdi
callq 0x7180
jmp 0x9eac
movq -0xd8(%rbp), %rsi
movq -0xc8(%rbp), %rdi
movl $0x1, %edx
leaq -0x38(%rbp), %rcx
callq 0x9830
jmp 0x9eca
leaq -0x38(%rbp), %rdi
callq 0x6230
leaq -0x39(%rbp), %rdi
callq 0x63c0
movq -0xc8(%rbp), %rdi
addq $0x60, %rdi
callq 0x7350
movq %rax, %rdi
addq $0x20, %rdi
callq 0x7370
movq %rax, %rsi
movq 0x3a0a6(%rip), %rdi     # 0x43fa8
callq 0x25e90
movq %rax, %rdi
movq 0x3a06f(%rip), %rsi     # 0x43f80
callq 0x63a0
movb $0x1, -0x1(%rbp)
jmp 0xa160
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x9f42
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x6230
leaq -0x39(%rbp), %rdi
callq 0x63c0
jmp 0xa16e
leaq -0x70(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x6500
movq -0xe8(%rbp), %rsi
movq -0x18(%rbp), %rdi
callq 0x6490
movq %rax, -0xe0(%rbp)
jmp 0x9f79
movq -0xe0(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x6480
movb %al, -0xe9(%rbp)
jmp 0x9f97
movb -0xe9(%rbp), %al
testb $0x1, %al
jne 0x9fa6
jmp 0xa13c
movq -0xc8(%rbp), %rdi
leaq -0x74(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x9740
jmp 0x9fbc
movq -0xc8(%rbp), %rcx
leaq -0x98(%rbp), %rdi
leaq -0x70(%rbp), %rdx
xorl %r8d, %r8d
movq %rcx, %rsi
callq 0x9430
jmp 0x9fdb
leaq -0x70(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
leaq -0x98(%rbp), %rsi
movq %rsi, -0x100(%rbp)
callq 0x6460
movq -0x100(%rbp), %rdi
callq 0x6230
movq -0xf8(%rbp), %rdi
leaq 0x2399a(%rip), %rsi     # 0x2d9ad
callq 0x7230
movb %al, -0xea(%rbp)
jmp 0xa020
movb -0xea(%rbp), %al
testb $0x1, %al
jne 0xa02c
jmp 0xa073
movq 0x39f75(%rip), %rdi     # 0x43fa8
leaq 0x231eb(%rip), %rsi     # 0x2d225
callq 0x6350
movq %rax, -0x108(%rbp)
jmp 0xa048
movq -0x108(%rbp), %rdi
movq 0x39f2a(%rip), %rsi     # 0x43f80
callq 0x63a0
jmp 0xa05d
jmp 0xa12c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xa155
movq -0x18(%rbp), %rax
movq %rax, -0x118(%rbp)
movl -0x74(%rbp), %eax
movl %eax, -0x10c(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x6180
jmp 0xa099
movl -0x10c(%rbp), %edx
movq -0x118(%rbp), %rsi
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rcx
callq 0x9830
jmp 0xa0bb
leaq -0xb8(%rbp), %rdi
callq 0x6230
movq -0xc8(%rbp), %rdi
addq $0x60, %rdi
callq 0x7350
movq %rax, %rdi
addq $0x20, %rdi
callq 0x7370
movq %rax, %rsi
movq 0x39ebb(%rip), %rdi     # 0x43fa8
callq 0x25e90
movq %rax, -0x120(%rbp)
jmp 0xa0fb
movq -0x120(%rbp), %rdi
movq 0x39e77(%rip), %rsi     # 0x43f80
callq 0x63a0
jmp 0xa110
jmp 0xa12c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x6230
jmp 0xa155
movb $0x1, -0x1(%rbp)
movl $0x1, -0xbc(%rbp)
jmp 0xa14a
movb $0x0, -0x1(%rbp)
movl $0x1, -0xbc(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6230
jmp 0xa160
leaq -0x70(%rbp), %rdi
callq 0x6230
jmp 0xa16e
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x6630
nopw (%rax,%rax)