// File: /workspace/github_cpp_makefile_star2_O3/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 0xaf6c
movq %rdi, %rbx
movq 0x23280(%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 0xadd9
cmpl $0x73000000, %r13d      # imm = 0x73000000
je 0xae67
cmpl $0x72000000, %r13d      # imm = 0x72000000
je 0xae87
cmpl $0x6e000000, %r13d      # imm = 0x6E000000
jne 0xaf4d
movq %rbx, %rdi
callq 0xa6fe
jmp 0xaf4d
cmpl $0x65000000, %r13d      # imm = 0x65000000
je 0xaf45
cmpl $0x6d000000, %r13d      # imm = 0x6D000000
jne 0xaf4d
movq 0x231d6(%rip), %rdi     # 0x2dfd0
leaq -0x30(%rbp), %rsi
callq 0x51d0
movq %rax, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x51d0
cmpl $0x0, -0x2c(%rbp)
jle 0xaf4d
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 0xae1d
jmp 0xaf4d
movq 0x98(%rbx), %r12
incq %r12
movq %rbx, %rdi
callq 0xa6fe
cmpq %r12, 0x98(%rbx)
jne 0xae71
jmp 0xaf4d
movq 0x238da(%rip), %r13     # 0x2e768
leaq 0x238c3(%rip), %rax     # 0x2e758
cmpq %rax, %r13
je 0xaf4d
leaq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movq 0x20(%r13), %rsi
movq 0x28(%r13), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x9c9c
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 0x18231(%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 0xaf35
callq 0x52d0
movq %r13, %rdi
callq 0x5230
movq %rax, %r13
jmp 0xae8e
movq %rbx, %rdi
callq 0xa564
movq 0x98(%rbx), %rax
movq 0x20(%rbx), %rcx
movq 0x28(%rbx), %rdx
subq %rcx, %rdx
sarq $0x5, %rdx
cmpq %rdx, %rax
jb 0xad1c
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 0xaf90
callq 0x52d0
movq %rbx, %rdi
callq 0x5570