// File: /workspace/github_c_makefile_star2_O2/plvhx[P]dummy-vm/src/vm.c
// Function: vm_run
void vm_run(vm_t *vm) {
  while (vm->buf[++vm->ip] && !vm->is_error) {
    switch (vm->buf[vm->ip]) {
    // move imm8 to general-purpose register.
    case VM_INSN_MOVB_IMM8_TO_R0:
    case VM_INSN_MOVB_IMM8_TO_R1:
    case VM_INSN_MOVB_IMM8_TO_R2:
    case VM_INSN_MOVB_IMM8_TO_R3:
      vm_movb_imm8_to_regs(vm);
      break;
    // move general-purpose register value as
    // byte value to 'r0' general-purpose register.
    case VM_INSN_MOVB_R0_TO_R0:
    case VM_INSN_MOVB_R1_TO_R0:
    case VM_INSN_MOVB_R2_TO_R0:
    case VM_INSN_MOVB_R3_TO_R0:
      vm_movb_regs_to_r0(vm);
      break;
    // move general-purpose register value as
    // byte value to 'r1' general-purpose register.
    case VM_INSN_MOVB_R0_TO_R1:
    case VM_INSN_MOVB_R1_TO_R1:
    case VM_INSN_MOVB_R2_TO_R1:
    case VM_INSN_MOVB_R3_TO_R1:
      vm_movb_regs_to_r1(vm);
      break;
    // move general-purpose register value as
    // byte value to 'r2' general-purpose register.
    case VM_INSN_MOVB_R0_TO_R2:
    case VM_INSN_MOVB_R1_TO_R2:
    case VM_INSN_MOVB_R2_TO_R2:
    case VM_INSN_MOVB_R3_TO_R2:
      vm_movb_regs_to_r2(vm);
      break;
    // move general-purpose register value as
    // byte value to 'r3' general-purpose register.
    case VM_INSN_MOVB_R0_TO_R3:
    case VM_INSN_MOVB_R1_TO_R3:
    case VM_INSN_MOVB_R2_TO_R3:
    case VM_INSN_MOVB_R3_TO_R3:
      vm_movb_regs_to_r3(vm);
      break;
    // add imm8, imm8 and store its result to
    // general-purpose register
    case VM_INSN_ADDB_IMM8_IMM8_TO_R0:
    case VM_INSN_ADDB_IMM8_IMM8_TO_R1:
    case VM_INSN_ADDB_IMM8_IMM8_TO_R2:
    case VM_INSN_ADDB_IMM8_IMM8_TO_R3:
      vm_addb_imm8_imm8_to_regs(vm);
      break;
    // subtract imm8, imm8 and store its result to
    // general-purpose register
    case VM_INSN_SUBB_IMM8_IMM8_TO_R0:
    case VM_INSN_SUBB_IMM8_IMM8_TO_R1:
    case VM_INSN_SUBB_IMM8_IMM8_TO_R2:
    case VM_INSN_SUBB_IMM8_IMM8_TO_R3:
      vm_subb_imm8_imm8_to_regs(vm);
      break;
    // multiply imm8, imm8 and store its result to
    // general-purpose register.
    case VM_INSN_MULB_IMM8_IMM8_TO_R0:
    case VM_INSN_MULB_IMM8_IMM8_TO_R1:
    case VM_INSN_MULB_IMM8_IMM8_TO_R2:
    case VM_INSN_MULB_IMM8_IMM8_TO_R3:
      vm_mulb_imm8_imm8_to_regs(vm);
      break;
    // divide imm8, imm8 and store its result to
    // general-purpose register.
    case VM_INSN_DIVB_IMM8_IMM8_TO_R0:
    case VM_INSN_DIVB_IMM8_IMM8_TO_R1:
    case VM_INSN_DIVB_IMM8_IMM8_TO_R2:
    case VM_INSN_DIVB_IMM8_IMM8_TO_R3:
      vm_divb_imm8_imm8_to_regs(vm);
      break;
    // add imm8, r0 and store its result to
    // general-purpose register.
    case VM_INSN_ADDB_IMM8_R0_TO_R0:
    case VM_INSN_ADDB_IMM8_R0_TO_R1:
    case VM_INSN_ADDB_IMM8_R0_TO_R2:
    case VM_INSN_ADDB_IMM8_R0_TO_R3:
      vm_addb_imm8_r0_to_regs(vm);
      break;
    // subtract imm8, r0 and store its result to
    // general-purpose register.
    case VM_INSN_SUBB_IMM8_R0_TO_R0:
    case VM_INSN_SUBB_IMM8_R0_TO_R1:
    case VM_INSN_SUBB_IMM8_R0_TO_R2:
    case VM_INSN_SUBB_IMM8_R0_TO_R3:
      vm_subb_imm8_r0_to_regs(vm);
      break;
    // multiply imm8, r0 and store its result to
    // general-purpose register.
    case VM_INSN_MULB_IMM8_R0_TO_R0:
    case VM_INSN_MULB_IMM8_R0_TO_R1:
    case VM_INSN_MULB_IMM8_R0_TO_R2:
    case VM_INSN_MULB_IMM8_R0_TO_R3:
      vm_mulb_imm8_r0_to_regs(vm);
      break;
    // divide imm8, r0 and store its result to
    // general-purpose register.
    case VM_INSN_DIVB_IMM8_R0_TO_R0:
    case VM_INSN_DIVB_IMM8_R0_TO_R1:
    case VM_INSN_DIVB_IMM8_R0_TO_R2:
    case VM_INSN_DIVB_IMM8_R0_TO_R3:
      vm_divb_imm8_r0_to_regs(vm);
      break;
    // add imm8, r1 and store its result to
    // general-purpose register.
    case VM_INSN_ADDB_IMM8_R1_TO_R0:
    case VM_INSN_ADDB_IMM8_R1_TO_R1:
    case VM_INSN_ADDB_IMM8_R1_TO_R2:
    case VM_INSN_ADDB_IMM8_R1_TO_R3:
      vm_addb_imm8_r1_to_regs(vm);
      break;
    // subtract imm8, r1 and store its result to
    // general-purpose register.
    case VM_INSN_SUBB_IMM8_R1_TO_R0:
    case VM_INSN_SUBB_IMM8_R1_TO_R1:
    case VM_INSN_SUBB_IMM8_R1_TO_R2:
    case VM_INSN_SUBB_IMM8_R1_TO_R3:
      vm_subb_imm8_r1_to_regs(vm);
      break;
    // multiply imm8, r1 and store its result to
    // general-purpose register.
    case VM_INSN_MULB_IMM8_R1_TO_R0:
    case VM_INSN_MULB_IMM8_R1_TO_R1:
    case VM_INSN_MULB_IMM8_R1_TO_R2:
    case VM_INSN_MULB_IMM8_R1_TO_R3:
      vm_mulb_imm8_r1_to_regs(vm);
      break;
    // divide imm8, r1 and store its result to
    // general-purpose register.
    case VM_INSN_DIVB_IMM8_R1_TO_R0:
    case VM_INSN_DIVB_IMM8_R1_TO_R1:
    case VM_INSN_DIVB_IMM8_R1_TO_R2:
    case VM_INSN_DIVB_IMM8_R1_TO_R3:
      vm_divb_imm8_r1_to_regs(vm);
      break;
    // add imm8, r2 and store its result to
    // general-purpose register.
    case VM_INSN_ADDB_IMM8_R2_TO_R0:
    case VM_INSN_ADDB_IMM8_R2_TO_R1:
    case VM_INSN_ADDB_IMM8_R2_TO_R2:
    case VM_INSN_ADDB_IMM8_R2_TO_R3:
      vm_addb_imm8_r2_to_regs(vm);
      break;
    // subtract imm8, r2 and store its result to
    // general-purpose register.
    case VM_INSN_SUBB_IMM8_R2_TO_R0:
    case VM_INSN_SUBB_IMM8_R2_TO_R1:
    case VM_INSN_SUBB_IMM8_R2_TO_R2:
    case VM_INSN_SUBB_IMM8_R2_TO_R3:
      vm_subb_imm8_r2_to_regs(vm);
      break;
    // multiply imm8, r2 and store its result to
    // general-purpose register.
    case VM_INSN_MULB_IMM8_R2_TO_R0:
    case VM_INSN_MULB_IMM8_R2_TO_R1:
    case VM_INSN_MULB_IMM8_R2_TO_R2:
    case VM_INSN_MULB_IMM8_R2_TO_R3:
      vm_mulb_imm8_r2_to_regs(vm);
      break;
    // divide imm8, r2 and store its result to
    // general-purpose register.
    case VM_INSN_DIVB_IMM8_R2_TO_R0:
    case VM_INSN_DIVB_IMM8_R2_TO_R1:
    case VM_INSN_DIVB_IMM8_R2_TO_R2:
    case VM_INSN_DIVB_IMM8_R2_TO_R3:
      vm_divb_imm8_r2_to_regs(vm);
      break;
    // add imm8, r3 and store its result to
    // general-purpose register.
    case VM_INSN_ADDB_IMM8_R3_TO_R0:
    case VM_INSN_ADDB_IMM8_R3_TO_R1:
    case VM_INSN_ADDB_IMM8_R3_TO_R2:
    case VM_INSN_ADDB_IMM8_R3_TO_R3:
      vm_addb_imm8_r3_to_regs(vm);
      break;
    // print immediate 8-bit integer value.
    case VM_INSN_PRINT_IMM8:
      vm_insn_print_imm8(vm);
      break;
    // print integer value from associated
    // general-purpose register.
    case VM_INSN_PRINT_R0:
    case VM_INSN_PRINT_R1:
    case VM_INSN_PRINT_R2:
    case VM_INSN_PRINT_R3:
      vm_print_regs(vm);
      break;
    // invalid opcode handler.
    default:
      vm_insn_unknown_bytecode_handler(vm);
      break;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0xb7f(%rip), %r14       # 0x50d4
movq (%rbx), %rax
movslq 0x8(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movl %edx, 0x8(%rbx)
movzbl 0x1(%rax,%rcx), %eax
testl %eax, %eax
je 0x4c11
cmpl $0x0, 0xc(%rbx)
jne 0x4c11
leal -0x20(%rax), %ecx
cmpl $0xb3, %ecx
ja 0x4c04
movslq (%r14,%rcx,4), %rcx
addq %r14, %rcx
jmpq *%rcx
addl $-0x21, %eax
leaq 0xe08(%rip), %rcx       # 0x53a4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x40ed
jmp 0x4555
addl $-0x78, %eax
leaq 0xe1b(%rip), %rcx       # 0x53d4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x38fd
jmp 0x4555
addl $0xffffff70, %eax       # imm = 0xFFFFFF70
leaq 0xf2c(%rip), %rcx       # 0x5504
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x121c
jmp 0x4555
addl $-0x5c, %eax
leaq 0xe4c(%rip), %rcx       # 0x5444
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x2806
jmp 0x4555
addl $0xffffff40, %eax       # imm = 0xFFFFFF40
leaq 0xeba(%rip), %rcx       # 0x54d4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x1529
jmp 0x4555
addl $-0x54, %eax
leaq 0xe2a(%rip), %rcx       # 0x5464
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x2380
jmp 0x4555
addl $-0x60, %eax
leaq 0xdda(%rip), %rcx       # 0x5434
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x2ad1
jmp 0x4555
addl $-0x70, %eax
leaq 0xd7a(%rip), %rcx       # 0x53f4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x3475
jmp 0x4555
addl $-0x4c, %eax
leaq 0xdea(%rip), %rcx       # 0x5484
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x1e2a
jmp 0x4555
addl $-0x48, %eax
leaq 0xdda(%rip), %rcx       # 0x5494
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x1bb7
jmp 0x4555
addl $-0x44, %eax
leaq 0xdca(%rip), %rcx       # 0x54a4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x1948
jmp 0x4555
addl $-0x58, %eax
leaq 0xd5a(%rip), %rcx       # 0x5454
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x25bb
jmp 0x4555
addl $-0x6c, %eax
leaq 0xcea(%rip), %rcx       # 0x5404
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x31a7
jmp 0x4555
addl $-0x50, %eax
leaq 0xd3a(%rip), %rcx       # 0x5474
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x2139
jmp 0x4555
addl $-0x40, %eax
leaq 0xd5a(%rip), %rcx       # 0x54b4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x16d9
jmp 0x4555
addl $-0x68, %eax
leaq 0xc9a(%rip), %rcx       # 0x5414
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x2f59
jmp 0x4555
addl $-0x64, %eax
leaq 0xc8a(%rip), %rcx       # 0x5424
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x2d1b
jmp 0x4555
addl $-0x7c, %eax
leaq 0xc0a(%rip), %rcx       # 0x53c4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x3b4b
jmp 0x4555
addl $-0x74, %eax
leaq 0xc0a(%rip), %rcx       # 0x53e4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x36bf
jmp 0x4555
addl $0xffffff30, %eax       # imm = 0xFFFFFF30
leaq 0xcc8(%rip), %rcx       # 0x54c4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x1601
jmp 0x4555
addl $0xffffff50, %eax       # imm = 0xFFFFFF50
leaq 0xcc6(%rip), %rcx       # 0x54e4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x1451
jmp 0x4555
addl $-0x80, %eax
leaq 0xb76(%rip), %rcx       # 0x53b4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x3e19
jmp 0x4555
addl $0xffffff60, %eax       # imm = 0xFFFFFF60
leaq 0xc94(%rip), %rcx       # 0x54f4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x137b
jmp 0x4555
movq %rbx, %rdi
callq 0x406b
jmp 0x4555
movq %rbx, %rdi
callq 0x3a2a
jmp 0x4555
movq %rbx, %rdi
callq 0x3ab4
jmp 0x4555
movq %rbx, %rdi
callq 0x3993
jmp 0x4555
movq %rbx, %rdi
callq 0x12cb
jmp 0x4555
movq %rbx, %rdi
callq 0x2969
jmp 0x4555
movq %rbx, %rdi
callq 0x1323
jmp 0x4555
movq %rbx, %rdi
callq 0x1273
jmp 0x4555
movq %rbx, %rdi
callq 0x2a1d
jmp 0x4555
movq %rbx, %rdi
callq 0x28b5
jmp 0x4555
movq %rbx, %rdi
callq 0x15a2
jmp 0x4555
movq %rbx, %rdi
callq 0x2499
jmp 0x4555
movq %rbx, %rdi
callq 0x2bef
jmp 0x4555
movq %rbx, %rdi
callq 0x35a0
jmp 0x4555
movq %rbx, %rdi
callq 0x15c4
jmp 0x4555
movq %rbx, %rdi
callq 0x252a
jmp 0x4555
movq %rbx, %rdi
callq 0x2c85
jmp 0x4555
movq %rbx, %rdi
callq 0x1565
jmp 0x4555
movq %rbx, %rdi
callq 0x2408
jmp 0x4555
movq %rbx, %rdi
callq 0x2b66
jmp 0x4555
movq %rbx, %rdi
callq 0x3629
jmp 0x4555
movq %rbx, %rdi
callq 0x1fb1
jmp 0x4555
movq %rbx, %rdi
callq 0x1cf0
jmp 0x4555
movq %rbx, %rdi
callq 0x350a
jmp 0x4555
movq %rbx, %rdi
callq 0x2075
jmp 0x4555
movq %rbx, %rdi
callq 0x1d8d
jmp 0x4555
movq %rbx, %rdi
callq 0x1eed
jmp 0x4555
movq %rbx, %rdi
callq 0x1c53
jmp 0x4555
movq %rbx, %rdi
callq 0x4178
jmp 0x4555
movq %rbx, %rdi
callq 0x1a7f
jmp 0x4555
movq %rbx, %rdi
callq 0x26da
jmp 0x4555
movq %rbx, %rdi
callq 0x41be
jmp 0x4555
movq %rbx, %rdi
callq 0x1b1b
jmp 0x4555
movq %rbx, %rdi
callq 0x330b
jmp 0x4555
movq %rbx, %rdi
callq 0x2770
jmp 0x4555
movq %rbx, %rdi
callq 0x4132
jmp 0x4555
movq %rbx, %rdi
callq 0x19e3
jmp 0x4555
movq %rbx, %rdi
callq 0x2256
jmp 0x4555
movq %rbx, %rdi
callq 0x2644
jmp 0x4555
movq %rbx, %rdi
callq 0x1810
jmp 0x4555
movq %rbx, %rdi
callq 0x3079
jmp 0x4555
movq %rbx, %rdi
callq 0x33c0
jmp 0x4555
movq %rbx, %rdi
callq 0x22eb
jmp 0x4555
movq %rbx, %rdi
callq 0x2e35
jmp 0x4555
movq %rbx, %rdi
callq 0x325b
jmp 0x4555
movq %rbx, %rdi
callq 0x18ac
jmp 0x4555
movq %rbx, %rdi
callq 0x3cb4
jmp 0x4555
movq %rbx, %rdi
callq 0x3110
jmp 0x4555
movq %rbx, %rdi
callq 0x21c1
jmp 0x4555
movq %rbx, %rdi
callq 0x37e2
jmp 0x4555
movq %rbx, %rdi
callq 0x1774
jmp 0x4555
movq %rbx, %rdi
callq 0x2fef
jmp 0x4555
movq %rbx, %rdi
callq 0x2ec7
jmp 0x4555
movq %rbx, %rdi
callq 0x3d64
jmp 0x4555
movq %rbx, %rdi
callq 0x2dac
jmp 0x4555
movq %rbx, %rdi
callq 0x386b
jmp 0x4555
movq %rbx, %rdi
callq 0x3bff
jmp 0x4555
movq %rbx, %rdi
callq 0x3750
jmp 0x4555
movq %rbx, %rdi
callq 0x167a
jmp 0x4555
movq %rbx, %rdi
callq 0x14af
jmp 0x4555
movq %rbx, %rdi
callq 0x16b7
jmp 0x4555
movq %rbx, %rdi
callq 0x163d
jmp 0x4555
movq %rbx, %rdi
callq 0x14ec
jmp 0x4555
movq %rbx, %rdi
callq 0x3f48
jmp 0x4555
movq %rbx, %rdi
callq 0x148d
jmp 0x4555
movq %rbx, %rdi
callq 0x3fe0
jmp 0x4555
movq %rbx, %rdi
callq 0x3eb0
jmp 0x4555
movq %rbx, %rdi
callq 0x13d9
jmp 0x4555
movq %rbx, %rdi
callq 0x1415
jmp 0x4555
movq %rbx, %rdi
callq 0x139d
jmp 0x4555
movq %rbx, %rdi
callq 0x4204
jmp 0x4555
popq %rbx
popq %r14
popq %rbp
retq