// File: daniel5151[P]mips241/src/disasm.cc
// Function: opcode2str[abi:cxx11](unsigned int)
std::string opcode2str(uint32_t opcode) {
  switch (opcode) {
    case OP_ADD:   return "add  ";
    case OP_SUB:   return "sub  ";
    case OP_SLT:   return "slt  ";
    case OP_SLTU:  return "sltu ";
    case OP_MFHI:  return "mfhi ";
    case OP_MFLO:  return "mflo ";
    case OP_MULT:  return "mult ";
    case OP_MULTU: return "multu";
    case OP_DIV:   return "div  ";
    case OP_DIVU:  return "divu ";
    case OP_LIS:   return "lis  ";
    case OP_JR:    return "jr   ";
    case OP_JALR:  return "jalr ";
    case OP_BEQ:   return "beq  ";
    case OP_BNE:   return "bne  ";
    case OP_LW:    return "lw   ";
    case OP_SW:    return "sw   ";
  }
  return "INVALID";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x48(%rbp)
movq %rdi, %rax
movq %rax, -0x40(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x34(%rbp)
subl $0x8c000000, %eax       # imm = 0x8C000000
je 0xbdfa
jmp 0xb880
movl -0x34(%rbp), %eax
subl $0xac000000, %eax       # imm = 0xAC000000
je 0xbe4b
jmp 0xb890
movl -0x34(%rbp), %eax
subl $0x8, %eax
je 0xbcb6
jmp 0xb89e
movl -0x34(%rbp), %eax
subl $0x9, %eax
je 0xbd07
jmp 0xb8ac
movl -0x34(%rbp), %eax
subl $0x10, %eax
je 0xba91
jmp 0xb8ba
movl -0x34(%rbp), %eax
subl $0x12, %eax
je 0xbadc
jmp 0xb8c8
movl -0x34(%rbp), %eax
subl $0x14, %eax
je 0xbc65
jmp 0xb8d6
movl -0x34(%rbp), %eax
subl $0x18, %eax
je 0xbb27
jmp 0xb8e4
movl -0x34(%rbp), %eax
subl $0x19, %eax
je 0xbb72
jmp 0xb8f2
movl -0x34(%rbp), %eax
subl $0x1a, %eax
je 0xbbc3
jmp 0xb900
movl -0x34(%rbp), %eax
subl $0x1b, %eax
je 0xbc14
jmp 0xb90e
movl -0x34(%rbp), %eax
subl $0x20, %eax
je 0xb965
jmp 0xb918
movl -0x34(%rbp), %eax
subl $0x22, %eax
je 0xb9b0
jmp 0xb926
movl -0x34(%rbp), %eax
subl $0x2a, %eax
je 0xb9fb
jmp 0xb934
movl -0x34(%rbp), %eax
subl $0x2b, %eax
je 0xba46
jmp 0xb942
movl -0x34(%rbp), %eax
subl $0x10000000, %eax       # imm = 0x10000000
je 0xbd58
jmp 0xb952
movl -0x34(%rbp), %eax
subl $0x14000000, %eax       # imm = 0x14000000
je 0xbda9
jmp 0xbe96
leaq -0xd(%rbp), %rdi
movq %rdi, -0x50(%rbp)
callq 0x34d0
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rdx
leaq 0x4a95(%rip), %rsi      # 0x10416
callq 0x3a90
jmp 0xb988
leaq -0xd(%rbp), %rdi
callq 0x32d0
jmp 0xbee1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0xd(%rbp), %rdi
callq 0x32d0
jmp 0xbeee
leaq -0x1d(%rbp), %rdi
movq %rdi, -0x58(%rbp)
callq 0x34d0
movq -0x48(%rbp), %rdi
movq -0x58(%rbp), %rdx
leaq 0x4a50(%rip), %rsi      # 0x1041c
callq 0x3a90
jmp 0xb9d3
leaq -0x1d(%rbp), %rdi
callq 0x32d0
jmp 0xbee1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x1d(%rbp), %rdi
callq 0x32d0
jmp 0xbeee
leaq -0x1e(%rbp), %rdi
movq %rdi, -0x60(%rbp)
callq 0x34d0
movq -0x48(%rbp), %rdi
movq -0x60(%rbp), %rdx
leaq 0x4a0b(%rip), %rsi      # 0x10422
callq 0x3a90
jmp 0xba1e
leaq -0x1e(%rbp), %rdi
callq 0x32d0
jmp 0xbee1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x1e(%rbp), %rdi
callq 0x32d0
jmp 0xbeee
leaq -0x1f(%rbp), %rdi
movq %rdi, -0x68(%rbp)
callq 0x34d0
movq -0x48(%rbp), %rdi
movq -0x68(%rbp), %rdx
leaq 0x49c6(%rip), %rsi      # 0x10428
callq 0x3a90
jmp 0xba69
leaq -0x1f(%rbp), %rdi
callq 0x32d0
jmp 0xbee1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x1f(%rbp), %rdi
callq 0x32d0
jmp 0xbeee
leaq -0x20(%rbp), %rdi
movq %rdi, -0x70(%rbp)
callq 0x34d0
movq -0x48(%rbp), %rdi
movq -0x70(%rbp), %rdx
leaq 0x4981(%rip), %rsi      # 0x1042e
callq 0x3a90
jmp 0xbab4
leaq -0x20(%rbp), %rdi
callq 0x32d0
jmp 0xbee1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x32d0
jmp 0xbeee
leaq -0x21(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0x34d0
movq -0x48(%rbp), %rdi
movq -0x78(%rbp), %rdx
leaq 0x493c(%rip), %rsi      # 0x10434
callq 0x3a90
jmp 0xbaff
leaq -0x21(%rbp), %rdi
callq 0x32d0
jmp 0xbee1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x21(%rbp), %rdi
callq 0x32d0
jmp 0xbeee
leaq -0x22(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0x34d0
movq -0x48(%rbp), %rdi
movq -0x80(%rbp), %rdx
leaq 0x48f7(%rip), %rsi      # 0x1043a
callq 0x3a90
jmp 0xbb4a
leaq -0x22(%rbp), %rdi
callq 0x32d0
jmp 0xbee1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x22(%rbp), %rdi
callq 0x32d0
jmp 0xbeee
leaq -0x23(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0x34d0
movq -0x48(%rbp), %rdi
movq -0x88(%rbp), %rdx
leaq 0x48ac(%rip), %rsi      # 0x10440
callq 0x3a90
jmp 0xbb9b
leaq -0x23(%rbp), %rdi
callq 0x32d0
jmp 0xbee1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x23(%rbp), %rdi
callq 0x32d0
jmp 0xbeee
leaq -0x24(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x34d0
movq -0x48(%rbp), %rdi
movq -0x90(%rbp), %rdx
leaq 0x4861(%rip), %rsi      # 0x10446
callq 0x3a90
jmp 0xbbec
leaq -0x24(%rbp), %rdi
callq 0x32d0
jmp 0xbee1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x24(%rbp), %rdi
callq 0x32d0
jmp 0xbeee
leaq -0x25(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x34d0
movq -0x48(%rbp), %rdi
movq -0x98(%rbp), %rdx
leaq 0x4816(%rip), %rsi      # 0x1044c
callq 0x3a90
jmp 0xbc3d
leaq -0x25(%rbp), %rdi
callq 0x32d0
jmp 0xbee1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x25(%rbp), %rdi
callq 0x32d0
jmp 0xbeee
leaq -0x26(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x34d0
movq -0x48(%rbp), %rdi
movq -0xa0(%rbp), %rdx
leaq 0x47cb(%rip), %rsi      # 0x10452
callq 0x3a90
jmp 0xbc8e
leaq -0x26(%rbp), %rdi
callq 0x32d0
jmp 0xbee1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x26(%rbp), %rdi
callq 0x32d0
jmp 0xbeee
leaq -0x27(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0x34d0
movq -0x48(%rbp), %rdi
movq -0xa8(%rbp), %rdx
leaq 0x4780(%rip), %rsi      # 0x10458
callq 0x3a90
jmp 0xbcdf
leaq -0x27(%rbp), %rdi
callq 0x32d0
jmp 0xbee1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x27(%rbp), %rdi
callq 0x32d0
jmp 0xbeee
leaq -0x28(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x34d0
movq -0x48(%rbp), %rdi
movq -0xb0(%rbp), %rdx
leaq 0x4735(%rip), %rsi      # 0x1045e
callq 0x3a90
jmp 0xbd30
leaq -0x28(%rbp), %rdi
callq 0x32d0
jmp 0xbee1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x32d0
jmp 0xbeee
leaq -0x29(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x34d0
movq -0x48(%rbp), %rdi
movq -0xb8(%rbp), %rdx
leaq 0x46ea(%rip), %rsi      # 0x10464
callq 0x3a90
jmp 0xbd81
leaq -0x29(%rbp), %rdi
callq 0x32d0
jmp 0xbee1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x29(%rbp), %rdi
callq 0x32d0
jmp 0xbeee
leaq -0x2a(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x34d0
movq -0x48(%rbp), %rdi
movq -0xc0(%rbp), %rdx
leaq 0x469f(%rip), %rsi      # 0x1046a
callq 0x3a90
jmp 0xbdd2
leaq -0x2a(%rbp), %rdi
callq 0x32d0
jmp 0xbee1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x2a(%rbp), %rdi
callq 0x32d0
jmp 0xbeee
leaq -0x2b(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x34d0
movq -0x48(%rbp), %rdi
movq -0xc8(%rbp), %rdx
leaq 0x4654(%rip), %rsi      # 0x10470
callq 0x3a90
jmp 0xbe23
leaq -0x2b(%rbp), %rdi
callq 0x32d0
jmp 0xbee1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x2b(%rbp), %rdi
callq 0x32d0
jmp 0xbeee
leaq -0x2c(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x34d0
movq -0x48(%rbp), %rdi
movq -0xd0(%rbp), %rdx
leaq 0x4609(%rip), %rsi      # 0x10476
callq 0x3a90
jmp 0xbe74
leaq -0x2c(%rbp), %rdi
callq 0x32d0
jmp 0xbee1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x2c(%rbp), %rdi
callq 0x32d0
jmp 0xbeee
leaq -0x2d(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0x34d0
movq -0x48(%rbp), %rdi
movq -0xd8(%rbp), %rdx
leaq 0x45c4(%rip), %rsi      # 0x1047c
callq 0x3a90
jmp 0xbebf
leaq -0x2d(%rbp), %rdi
callq 0x32d0
jmp 0xbee1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x2d(%rbp), %rdi
callq 0x32d0
jmp 0xbeee
movq -0x40(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x34c0
nopw (%rax,%rax)