// File: /workspace/github_c_makefile_star2_O3/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), %rax
movslq 0x8(%rdi), %rcx
leaq 0x1(%rcx), %rdx
movl %edx, 0x8(%rdi)
movb 0x1(%rax,%rcx), %al
testb %al, %al
je 0x4e22
movq %rdi, %rbx
leaq 0x94d(%rip), %r14       # 0x50d4
cmpl $0x0, 0xc(%rbx)
jne 0x4e22
movzbl %al, %eax
leal -0x20(%rax), %ecx
cmpl $0xb3, %ecx
ja 0x4e00
movslq (%r14,%rcx,4), %rcx
addq %r14, %rcx
jmpq *%rcx
addl $-0x21, %eax
leaq 0xbee(%rip), %rcx       # 0x53a4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x430f
jmp 0x4e08
addl $-0x78, %eax
leaq 0xbfe(%rip), %rcx       # 0x53d4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x3b79
jmp 0x4e08
addl $0xffffff70, %eax       # imm = 0xFFFFFF70
leaq 0xd0c(%rip), %rcx       # 0x5504
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x156c
jmp 0x4e08
addl $-0x5c, %eax
leaq 0xc2c(%rip), %rcx       # 0x5444
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x2b22
jmp 0x4e08
addl $0xffffff40, %eax       # imm = 0xFFFFFF40
leaq 0xc9a(%rip), %rcx       # 0x54d4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x1879
jmp 0x4e08
addl $-0x54, %eax
leaq 0xc0a(%rip), %rcx       # 0x5464
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x268c
jmp 0x4e08
addl $-0x60, %eax
leaq 0xbba(%rip), %rcx       # 0x5434
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x2d89
jmp 0x4e08
addl $-0x70, %eax
leaq 0xb5a(%rip), %rcx       # 0x53f4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x36e1
jmp 0x4e08
addl $-0x4c, %eax
leaq 0xbca(%rip), %rcx       # 0x5484
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x2192
jmp 0x4e08
addl $-0x48, %eax
leaq 0xbba(%rip), %rcx       # 0x5494
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x1f17
jmp 0x4e08
addl $-0x44, %eax
leaq 0xbaa(%rip), %rcx       # 0x54a4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x1ca0
jmp 0x4e08
addl $-0x58, %eax
leaq 0xb3a(%rip), %rcx       # 0x5454
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x28cf
jmp 0x4e08
addl $-0x6c, %eax
leaq 0xaca(%rip), %rcx       # 0x5404
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x3477
jmp 0x4e08
addl $-0x50, %eax
leaq 0xb1a(%rip), %rcx       # 0x5474
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x243d
jmp 0x4e08
addl $-0x40, %eax
leaq 0xb3a(%rip), %rcx       # 0x54b4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x1a29
jmp 0x4e08
addl $-0x68, %eax
leaq 0xa7a(%rip), %rcx       # 0x5414
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x3221
jmp 0x4e08
addl $-0x64, %eax
leaq 0xa6a(%rip), %rcx       # 0x5424
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x2fdb
jmp 0x4e08
addl $-0x7c, %eax
leaq 0x9ea(%rip), %rcx       # 0x53c4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x3dcf
jmp 0x4e08
addl $-0x74, %eax
leaq 0x9ea(%rip), %rcx       # 0x53e4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x3933
jmp 0x4e08
addl $0xffffff30, %eax       # imm = 0xFFFFFF30
leaq 0xaa8(%rip), %rcx       # 0x54c4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x1951
jmp 0x4e08
addl $0xffffff50, %eax       # imm = 0xFFFFFF50
leaq 0xaa6(%rip), %rcx       # 0x54e4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x17a1
jmp 0x4e08
addl $-0x80, %eax
leaq 0x956(%rip), %rcx       # 0x53b4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x4039
jmp 0x4e08
addl $0xffffff60, %eax       # imm = 0xFFFFFF60
leaq 0xa74(%rip), %rcx       # 0x54f4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x16cb
jmp 0x4e08
movq %rbx, %rdi
callq 0x428b
jmp 0x4e08
movq %rbx, %rdi
callq 0x3caa
jmp 0x4e08
movq %rbx, %rdi
callq 0x3d36
jmp 0x4e08
movq %rbx, %rdi
callq 0x3c11
jmp 0x4e08
movq %rbx, %rdi
callq 0x161b
jmp 0x4e08
movq %rbx, %rdi
callq 0x2c53
jmp 0x4e08
movq %rbx, %rdi
callq 0x1673
jmp 0x4e08
movq %rbx, %rdi
callq 0x15c3
jmp 0x4e08
movq %rbx, %rdi
callq 0x2cee
jmp 0x4e08
movq %rbx, %rdi
callq 0x2bb8
jmp 0x4e08
movq %rbx, %rdi
callq 0x18f2
jmp 0x4e08
movq %rbx, %rdi
callq 0x27a9
jmp 0x4e08
movq %rbx, %rdi
callq 0x2eab
jmp 0x4e08
movq %rbx, %rdi
callq 0x3810
jmp 0x4e08
movq %rbx, %rdi
callq 0x1914
jmp 0x4e08
movq %rbx, %rdi
callq 0x283c
jmp 0x4e08
movq %rbx, %rdi
callq 0x2f43
jmp 0x4e08
movq %rbx, %rdi
callq 0x18b5
jmp 0x4e08
movq %rbx, %rdi
callq 0x2716
jmp 0x4e08
movq %rbx, %rdi
callq 0x2e20
jmp 0x4e08
movq %rbx, %rdi
callq 0x389b
jmp 0x4e08
movq %rbx, %rdi
callq 0x22e7
jmp 0x4e08
movq %rbx, %rdi
callq 0x2054
jmp 0x4e08
movq %rbx, %rdi
callq 0x3778
jmp 0x4e08
movq %rbx, %rdi
callq 0x2392
jmp 0x4e08
movq %rbx, %rdi
callq 0x20f3
jmp 0x4e08
movq %rbx, %rdi
callq 0x223c
jmp 0x4e08
movq %rbx, %rdi
callq 0x1fb5
jmp 0x4e08
movq %rbx, %rdi
callq 0x439e
jmp 0x4e08
movq %rbx, %rdi
callq 0x1ddb
jmp 0x4e08
movq %rbx, %rdi
callq 0x29f2
jmp 0x4e08
movq %rbx, %rdi
callq 0x43e6
jmp 0x4e08
movq %rbx, %rdi
callq 0x1e79
jmp 0x4e08
movq %rbx, %rdi
callq 0x35a9
jmp 0x4e08
movq %rbx, %rdi
callq 0x2a8a
jmp 0x4e08
movq %rbx, %rdi
callq 0x4356
jmp 0x4e08
movq %rbx, %rdi
callq 0x1d3d
jmp 0x4e08
movq %rbx, %rdi
callq 0x255e
jmp 0x4e08
movq %rbx, %rdi
callq 0x295a
jmp 0x4e08
movq %rbx, %rdi
callq 0x1b64
jmp 0x4e08
movq %rbx, %rdi
callq 0x3345
jmp 0x4e08
movq %rbx, %rdi
callq 0x3645
jmp 0x4e08
movq %rbx, %rdi
callq 0x25f5
jmp 0x4e08
movq %rbx, %rdi
callq 0x30f9
jmp 0x4e08
movq %rbx, %rdi
callq 0x3512
jmp 0x4e08
movq %rbx, %rdi
callq 0x1c02
jmp 0x4e08
movq %rbx, %rdi
callq 0x3f06
jmp 0x4e08
movq %rbx, %rdi
callq 0x33de
jmp 0x4e08
movq %rbx, %rdi
callq 0x24c7
jmp 0x4e08
movq %rbx, %rdi
callq 0x3a5a
jmp 0x4e08
movq %rbx, %rdi
callq 0x1ac6
jmp 0x4e08
movq %rbx, %rdi
callq 0x32b9
jmp 0x4e08
movq %rbx, %rdi
callq 0x318d
jmp 0x4e08
movq %rbx, %rdi
callq 0x3f9d
jmp 0x4e08
movq %rbx, %rdi
callq 0x306e
jmp 0x4e08
movq %rbx, %rdi
callq 0x3ae5
jmp 0x4e08
movq %rbx, %rdi
callq 0x3e6a
jmp 0x4e08
movq %rbx, %rdi
callq 0x39c6
jmp 0x4e08
movq %rbx, %rdi
callq 0x19ca
jmp 0x4e08
movq %rbx, %rdi
callq 0x17ff
jmp 0x4e08
movq %rbx, %rdi
callq 0x1a07
jmp 0x4e08
movq %rbx, %rdi
callq 0x198d
jmp 0x4e08
movq %rbx, %rdi
callq 0x183c
jmp 0x4e08
movq %rbx, %rdi
callq 0x4168
jmp 0x4e08
movq %rbx, %rdi
callq 0x17dd
jmp 0x4e08
movq %rbx, %rdi
callq 0x4200
jmp 0x4e08
movq %rbx, %rdi
callq 0x40d0
jmp 0x4e08
movq %rbx, %rdi
callq 0x1729
jmp 0x4e08
movq %rbx, %rdi
callq 0x1765
jmp 0x4e08
movq %rbx, %rdi
callq 0x16ed
jmp 0x4e08
movq %rbx, %rdi
callq 0x1130
movq (%rbx), %rax
movslq 0x8(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movl %edx, 0x8(%rbx)
movb 0x1(%rax,%rcx), %al
testb %al, %al
jne 0x4787
popq %rbx
popq %r14
popq %rbp
retq