// File: MatthewZMD[P]TetrisDual/interface.cc
// Function: Interface::execFunc(std::istream&, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void Interface::execFunc(std::istream& in, int step, std::string cmd) {
    if (cmd == "left") {
        g->left(in, step);
    }
    else if (cmd == "right") {
        g->right(in, step);
    }
    else if (cmd == "down") {
        g->down(step);
    }
    else if (cmd == "clockwise") {
        g->rotate(true, step);
    }
    else if (cmd == "counterclockwise") {
        g->rotate(false, step);
    }
    else if (cmd == "drop") {
        g->drop(in, step);
    }
    else if (cmd == "levelup") {
        g->levelup(step);
    }
    else if (cmd == "leveldown") {
        g->leveldown(step);
    }
    else if (cmd == "norandom") {
        std::string file;
        in >> file;
        g->norandom(file);
    }
    else if (cmd == "random") {
        g->random();
    }
    else if (cmd == "sequence") {
        std::string file;
        in >> file;

        std::ifstream fin;
        fin.open(file.c_str());

        while(cmdInterface(fin));

        fin.close();
    }
    else if (cmd == "restart") {
        std::cout << "Restarting your life..." << std::endl;
        g = std::make_shared<Game>(file1, file2, startLevel, isTextOnly);
        std::cout << *(g->display) << std::endl;
    }
    else if (cmd == "I" || cmd == "J" || cmd == "L" || cmd == "O" || cmd == "S" || cmd == "Z" || cmd == "T") {
        g->replaceBlock(cmd);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x310, %rsp            # imm = 0x310
movq %rcx, -0x2e0(%rbp)
movq %rdi, %rax
movq -0x2e0(%rbp), %rdi
movq %rdi, -0x2d8(%rbp)
movq %rax, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rdi, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x2d0(%rbp)
leaq 0x2394c(%rip), %rsi     # 0x2d1c0
callq 0x7230
testb $0x1, %al
jne 0x987f
jmp 0x98a3
movq -0x2d0(%rbp), %rdi
addq $0x60, %rdi
callq 0x7350
movq %rax, %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x1ad00
jmp 0x9e2e
movq -0x2d8(%rbp), %rdi
leaq 0x23914(%rip), %rsi     # 0x2d1c5
callq 0x7230
testb $0x1, %al
jne 0x98bc
jmp 0x98e0
movq -0x2d0(%rbp), %rdi
addq $0x60, %rdi
callq 0x7350
movq %rax, %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x1b1e0
jmp 0x9e2c
movq -0x2d8(%rbp), %rdi
leaq 0x23900(%rip), %rsi     # 0x2d1ee
callq 0x7230
testb $0x1, %al
jne 0x98f9
jmp 0x9919
movq -0x2d0(%rbp), %rdi
addq $0x60, %rdi
callq 0x7350
movq %rax, %rdi
movl -0x14(%rbp), %esi
callq 0x1b300
jmp 0x9e2a
movq -0x2d8(%rbp), %rdi
leaq 0x238ab(%rip), %rsi     # 0x2d1d2
callq 0x7230
testb $0x1, %al
jne 0x9932
jmp 0x9957
movq -0x2d0(%rbp), %rdi
addq $0x60, %rdi
callq 0x7350
movq %rax, %rdi
movl -0x14(%rbp), %edx
movl $0x1, %esi
callq 0x1b360
jmp 0x9e28
movq -0x2d8(%rbp), %rdi
leaq 0x23866(%rip), %rsi     # 0x2d1cb
callq 0x7230
testb $0x1, %al
jne 0x9970
jmp 0x9992
movq -0x2d0(%rbp), %rdi
addq $0x60, %rdi
callq 0x7350
movq %rax, %rdi
movl -0x14(%rbp), %edx
xorl %esi, %esi
callq 0x1b360
jmp 0x9e26
movq -0x2d8(%rbp), %rdi
leaq 0x2383c(%rip), %rsi     # 0x2d1dc
callq 0x7230
testb $0x1, %al
jne 0x99ab
jmp 0x99cf
movq -0x2d0(%rbp), %rdi
addq $0x60, %rdi
callq 0x7350
movq %rax, %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x1b3e0
jmp 0x9e24
movq -0x2d8(%rbp), %rdi
leaq 0x23804(%rip), %rsi     # 0x2d1e1
callq 0x7230
testb $0x1, %al
jne 0x99e8
jmp 0x9a08
movq -0x2d0(%rbp), %rdi
addq $0x60, %rdi
callq 0x7350
movq %rax, %rdi
movl -0x14(%rbp), %esi
callq 0x1b600
jmp 0x9e22
movq -0x2d8(%rbp), %rdi
leaq 0x237d3(%rip), %rsi     # 0x2d1e9
callq 0x7230
testb $0x1, %al
jne 0x9a21
jmp 0x9a41
movq -0x2d0(%rbp), %rdi
addq $0x60, %rdi
callq 0x7350
movq %rax, %rdi
movl -0x14(%rbp), %esi
callq 0x1b690
jmp 0x9e20
movq -0x2d8(%rbp), %rdi
leaq 0x237a4(%rip), %rsi     # 0x2d1f3
callq 0x7230
testb $0x1, %al
jne 0x9a5d
jmp 0x9aff
leaq -0x40(%rbp), %rdi
movq %rdi, -0x2e8(%rbp)
callq 0x6500
movq -0x2e8(%rbp), %rsi
movq -0x10(%rbp), %rdi
callq 0x6490
jmp 0x9a7f
movq -0x2d0(%rbp), %rdi
addq $0x60, %rdi
callq 0x7350
movq %rax, -0x2f0(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x6180
jmp 0x9aa5
movq -0x2f0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x1b720
jmp 0x9ab7
leaq -0x70(%rbp), %rdi
callq 0x6230
leaq -0x40(%rbp), %rdi
callq 0x6230
jmp 0x9e1e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x9af1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6230
leaq -0x40(%rbp), %rdi
callq 0x6230
jmp 0x9e37
movq -0x2d8(%rbp), %rdi
leaq 0x236e8(%rip), %rsi     # 0x2d1f5
callq 0x7230
testb $0x1, %al
jne 0x9b18
jmp 0x9b35
movq -0x2d0(%rbp), %rdi
addq $0x60, %rdi
callq 0x7350
movq %rax, %rdi
callq 0x1b830
jmp 0x9e1c
movq -0x2d8(%rbp), %rdi
leaq 0x236b9(%rip), %rsi     # 0x2d1fc
callq 0x7230
testb $0x1, %al
jne 0x9b51
jmp 0x9c35
leaq -0x90(%rbp), %rdi
movq %rdi, -0x2f8(%rbp)
callq 0x6500
movq -0x2f8(%rbp), %rsi
movq -0x10(%rbp), %rdi
callq 0x6490
jmp 0x9b76
leaq -0x298(%rbp), %rdi
callq 0x6400
jmp 0x9b84
leaq -0x90(%rbp), %rdi
callq 0x6170
movq %rax, %rsi
leaq -0x298(%rbp), %rdi
movl $0x8, %edx
callq 0x6250
jmp 0x9ba6
jmp 0x9ba8
movq -0x2d0(%rbp), %rdi
leaq -0x298(%rbp), %rsi
callq 0x9e40
movb %al, -0x2f9(%rbp)
jmp 0x9bc3
movb -0x2f9(%rbp), %al
testb $0x1, %al
jne 0x9bcf
jmp 0x9bf9
jmp 0x9ba8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x9c24
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x298(%rbp), %rdi
callq 0x60a0
jmp 0x9c24
leaq -0x298(%rbp), %rdi
callq 0x6070
jmp 0x9c07
leaq -0x298(%rbp), %rdi
callq 0x60a0
leaq -0x90(%rbp), %rdi
callq 0x6230
jmp 0x9e1a
leaq -0x90(%rbp), %rdi
callq 0x6230
jmp 0x9e37
movq -0x2d8(%rbp), %rdi
leaq 0x235c2(%rip), %rsi     # 0x2d205
callq 0x7230
testb $0x1, %al
jne 0x9c51
jmp 0x9d01
movq 0x3a350(%rip), %rdi     # 0x43fa8
leaq 0x235ae(%rip), %rsi     # 0x2d20d
callq 0x6350
movq %rax, %rdi
movq 0x3a312(%rip), %rsi     # 0x43f80
callq 0x63a0
movq -0x2d0(%rbp), %r8
movq %r8, %rsi
addq $0x18, %rsi
movq %r8, %rdx
addq $0x38, %rdx
movq %r8, %rcx
addq $0x58, %rcx
addq $0x5c, %r8
leaq -0x2a8(%rbp), %rdi
callq 0xa220
movq -0x2d0(%rbp), %rdi
addq $0x60, %rdi
leaq -0x2a8(%rbp), %rsi
callq 0xa3f0
leaq -0x2a8(%rbp), %rdi
callq 0x8470
movq -0x2d0(%rbp), %rdi
addq $0x60, %rdi
callq 0x7350
movq %rax, %rdi
addq $0x20, %rdi
callq 0x7370
movq %rax, %rsi
movq 0x3a2c0(%rip), %rdi     # 0x43fa8
callq 0x25e90
movq %rax, %rdi
movq 0x3a289(%rip), %rsi     # 0x43f80
callq 0x63a0
jmp 0x9e18
movq -0x2d8(%rbp), %rdi
leaq 0x23c15(%rip), %rsi     # 0x2d924
callq 0x7230
testb $0x1, %al
jne 0x9da8
movq -0x2d8(%rbp), %rdi
leaq 0x23bfe(%rip), %rsi     # 0x2d928
callq 0x7230
testb $0x1, %al
jne 0x9da8
movq -0x2d8(%rbp), %rdi
leaq 0x23bd3(%rip), %rsi     # 0x2d914
callq 0x7230
testb $0x1, %al
jne 0x9da8
movq -0x2d8(%rbp), %rdi
leaq 0x23bbf(%rip), %rsi     # 0x2d917
callq 0x7230
testb $0x1, %al
jne 0x9da8
movq -0x2d8(%rbp), %rdi
leaq 0x23bac(%rip), %rsi     # 0x2d91b
callq 0x7230
testb $0x1, %al
jne 0x9da8
movq -0x2d8(%rbp), %rdi
leaq 0x23baa(%rip), %rsi     # 0x2d930
callq 0x7230
testb $0x1, %al
jne 0x9da8
movq -0x2d8(%rbp), %rdi
leaq 0x23b96(%rip), %rsi     # 0x2d933
callq 0x7230
testb $0x1, %al
jne 0x9da8
jmp 0x9e16
movq -0x2d0(%rbp), %rdi
addq $0x60, %rdi
callq 0x7350
movq -0x2d8(%rbp), %rsi
movq %rax, -0x310(%rbp)
leaq -0x2c8(%rbp), %rdi
movq %rdi, -0x308(%rbp)
callq 0x6180
movq -0x310(%rbp), %rdi
movq -0x308(%rbp), %rsi
callq 0x1b890
jmp 0x9dee
leaq -0x2c8(%rbp), %rdi
callq 0x6230
jmp 0x9e16
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x2c8(%rbp), %rdi
callq 0x6230
jmp 0x9e37
jmp 0x9e18
jmp 0x9e1a
jmp 0x9e1c
jmp 0x9e1e
jmp 0x9e20
jmp 0x9e22
jmp 0x9e24
jmp 0x9e26
jmp 0x9e28
jmp 0x9e2a
jmp 0x9e2c
jmp 0x9e2e
addq $0x310, %rsp            # imm = 0x310
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x6630