// File: /workspace/github_cpp_makefile_star2_O1/pollow[P]MIPSClide/simulator.cpp
// Function: Simulator::debug()
void Simulator::debug() {
    char c;
    int start, length;
    while (pc < statements.size()) {
        cout << statements[pc] << endl;
        c = getchar();
        cout << (int)c << endl;
        if ( c == 'n' ) {
            tick();
        } else if ( c == 's' ) {
            size_t tmp = pc + 1;
            while (pc != tmp) tick();
        } else if ( c == 'r' ) {
            for(auto i : reg_name) {
                cout << i.first << " : " << regs[i.second] << endl;
            }
        } else if ( c == 'm' ) {
            cin >> start >> length;
            for(int i = start; i < start+length; i++) {
                cout << i << ' ' << memory[i];
            }
        } else if ( c == 'e' ) {
            run();
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x98(%rdi), %rax
movq 0x20(%rdi), %rcx
movq 0x28(%rdi), %rdx
subq %rcx, %rdx
sarq $0x5, %rdx
cmpq %rdx, %rax
jae 0xaf60
movq %rdi, %rbx
movq 0x2328c(%rip), %r14     # 0x2df98
leaq -0x58(%rbp), %r15
shlq $0x5, %rax
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
movq %r14, %rdi
callq 0x5390
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x52f0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5220
callq 0x5400
movsbl %al, %esi
movl %eax, %r13d
shll $0x18, %r13d
movq %r14, %rdi
callq 0x5530
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x52f0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5220
cmpl $0x6dffffff, %r13d      # imm = 0x6DFFFFFF
jle 0xadcd
cmpl $0x73000000, %r13d      # imm = 0x73000000
je 0xae5b
cmpl $0x72000000, %r13d      # imm = 0x72000000
je 0xae7b
cmpl $0x6e000000, %r13d      # imm = 0x6E000000
jne 0xaf41
movq %rbx, %rdi
callq 0xa6f2
jmp 0xaf41
cmpl $0x65000000, %r13d      # imm = 0x65000000
je 0xaf39
cmpl $0x6d000000, %r13d      # imm = 0x6D000000
jne 0xaf41
movq 0x231e2(%rip), %rdi     # 0x2dfd0
leaq -0x30(%rbp), %rsi
callq 0x51d0
movq %rax, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x51d0
cmpl $0x0, -0x2c(%rbp)
jle 0xaf41
movslq -0x30(%rbp), %r13
movq %r14, %rdi
movl %r13d, %esi
callq 0x5530
movb $0x20, -0x58(%rbp)
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x5390
movq 0xb8(%rbx), %rcx
movl (%rcx,%r13,4), %esi
movq %rax, %rdi
callq 0x5530
incq %r13
movslq -0x30(%rbp), %rax
movslq -0x2c(%rbp), %rcx
addq %rax, %rcx
cmpq %rcx, %r13
jl 0xae11
jmp 0xaf41
movq 0x98(%rbx), %r12
incq %r12
movq %rbx, %rdi
callq 0xa6f2
cmpq %r12, 0x98(%rbx)
jne 0xae65
jmp 0xaf41
movq 0x238e6(%rip), %r13     # 0x2e768
leaq 0x238cf(%rip), %rax     # 0x2e758
cmpq %rax, %r13
je 0xaf41
leaq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq 0x20(%r13), %rsi
movq 0x28(%r13), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x9c8e
movl 0x40(%r13), %eax
movl %eax, -0x38(%rbp)
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %r14, %rdi
callq 0x5390
movq %rax, %r12
movl $0x3, %edx
movq %rax, %rdi
leaq 0x1823d(%rip), %rsi     # 0x23113
callq 0x5390
movl -0x38(%rbp), %eax
movl 0xc0(%rbx,%rax,4), %esi
movq %r12, %rdi
callq 0x5530
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x52f0
movsbl %al, %esi
movq %r12, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5220
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0xaf29
callq 0x52d0
movq %r13, %rdi
callq 0x5230
movq %rax, %r13
jmp 0xae82
movq %rbx, %rdi
callq 0xa558
movq 0x98(%rbx), %rax
movq 0x20(%rbx), %rcx
movq 0x28(%rbx), %rdx
subq %rcx, %rdx
sarq $0x5, %rdx
cmpq %rdx, %rax
jb 0xad10
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0xaf84
callq 0x52d0
movq %rbx, %rdi
callq 0x5570