// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xac03(%rip), %rsi      # 0x111c0
movq %rcx, %rdi
callq 0x5af9
testb %al, %al
je 0x65e4
movq 0x60(%rbx), %rdi
movq %r15, %rsi
movl %ebp, %edx
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xb244
leaq 0xabda(%rip), %rsi      # 0x111c5
movq %r14, %rdi
callq 0x5af9
testb %al, %al
je 0x6612
movq 0x60(%rbx), %rdi
movq %r15, %rsi
movl %ebp, %edx
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xb504
leaq 0xabd5(%rip), %rsi      # 0x111ee
movq %r14, %rdi
callq 0x5af9
testb %al, %al
je 0x663d
movq 0x60(%rbx), %rdi
movl %ebp, %esi
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xb596
leaq 0xab8e(%rip), %rsi      # 0x111d2
movq %r14, %rdi
callq 0x5af9
testb %al, %al
je 0x6659
movq 0x60(%rbx), %rdi
pushq $0x1
popq %rsi
jmp 0x6672
leaq 0xab6b(%rip), %rsi      # 0x111cb
movq %r14, %rdi
callq 0x5af9
testb %al, %al
je 0x6686
movq 0x60(%rbx), %rdi
xorl %esi, %esi
movl %ebp, %edx
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xb5b4
leaq 0xab4f(%rip), %rsi      # 0x111dc
movq %r14, %rdi
callq 0x5af9
testb %al, %al
je 0x66b4
movq 0x60(%rbx), %rdi
movq %r15, %rsi
movl %ebp, %edx
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xb5d6
leaq 0xab26(%rip), %rsi      # 0x111e1
movq %r14, %rdi
callq 0x5af9
testb %al, %al
je 0x66df
movq 0x60(%rbx), %rdi
movl %ebp, %esi
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xb6dc
leaq 0xab03(%rip), %rsi      # 0x111e9
movq %r14, %rdi
callq 0x5af9
testb %al, %al
je 0x670a
movq 0x60(%rbx), %rdi
movl %ebp, %esi
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xb71e
leaq 0xaae2(%rip), %rsi      # 0x111f3
movq %r14, %rdi
callq 0x5af9
testb %al, %al
je 0x677d
leaq 0x70(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x60(%rsp), %rsi
movq %r15, %rdi
callq 0x5340
movq 0x60(%rbx), %rbx
leaq 0x20(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x53b0
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0xb760
leaq 0x20(%rsp), %rdi
callq 0x5150
leaq 0x60(%rsp), %rdi
callq 0x5150
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xaa71(%rip), %rsi      # 0x111f5
movq %r14, %rdi
callq 0x5af9
testb %al, %al
je 0x67a6
movq 0x60(%rbx), %rdi
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xb7e4
leaq 0xaa4f(%rip), %rsi      # 0x111fc
movq %r14, %rdi
callq 0x5af9
testb %al, %al
je 0x6820
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq %rsp, %rsi
movq %r15, %rdi
callq 0x5340
leaq 0x60(%rsp), %rdi
callq 0x52e0
movq (%rsp), %rsi
leaq 0x60(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x51e0
leaq 0x60(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x699c
testb %al, %al
jne 0x67f5
leaq 0x60(%rsp), %rdi
callq 0x5060
leaq 0x60(%rsp), %rdi
callq 0x5090
movq %rsp, %rdi
jmp 0x676a
leaq 0xa9de(%rip), %rsi      # 0x11205
movq %r14, %rdi
callq 0x5af9
testb %al, %al
je 0x68a1
movq 0x1576e(%rip), %r14     # 0x1bfa8
leaq 0xa9cc(%rip), %rsi      # 0x1120d
movq %r14, %rdi
callq 0x5290
movq %rax, %rdi
callq 0x5160
leaq 0x18(%rbx), %rsi
leaq 0x38(%rbx), %rdx
leaq 0x58(%rbx), %rcx
leaq 0x5c(%rbx), %r8
leaq 0x60(%rsp), %r15
movq %r15, %rdi
callq 0x6b8f
leaq 0x60(%rbx), %rdi
movq %r15, %rsi
callq 0x716c
leaq 0x68(%rsp), %rdi
callq 0x5c18
movq 0x60(%rbx), %rax
movq 0x20(%rax), %rsi
movq %r14, %rdi
callq 0xde55
movq %rax, %rdi
callq 0x5160
jmp 0x676f
leaq 0xb078(%rip), %rsi      # 0x11920
movq %r14, %rdi
callq 0x5af9
testb %al, %al
jne 0x692a
leaq 0xb069(%rip), %rsi      # 0x11924
movq %r14, %rdi
callq 0x5af9
testb %al, %al
jne 0x692a
leaq 0xb042(%rip), %rsi      # 0x11910
movq %r14, %rdi
callq 0x5af9
testb %al, %al
jne 0x692a
leaq 0xb032(%rip), %rsi      # 0x11913
movq %r14, %rdi
callq 0x5af9
testb %al, %al
jne 0x692a
leaq 0xb023(%rip), %rsi      # 0x11917
movq %r14, %rdi
callq 0x5af9
testb %al, %al
jne 0x692a
leaq 0xb025(%rip), %rsi      # 0x1192c
movq %r14, %rdi
callq 0x5af9
testb %al, %al
jne 0x692a
leaq 0xb015(%rip), %rsi      # 0x1192f
movq %r14, %rdi
callq 0x5af9
testb %al, %al
je 0x676f
movq 0x60(%rbx), %rbx
leaq 0x40(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x53b0
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb802
leaq 0x40(%rsp), %rdi
jmp 0x676a
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
jmp 0x698f
jmp 0x695f
movq %rax, %rbx
jmp 0x698c
jmp 0x697f
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x5150
jmp 0x6978
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
jmp 0x698f
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x5090
movq %rsp, %rdi
callq 0x5150
movq %rbx, %rdi
callq 0x54b0