// File: /workspace/github_c_makefile_star2_O1/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 0x4ee5
movq %rdi, %rbx
leaq 0x1959(%rip), %r14      # 0x60d4
cmpl $0x0, 0xc(%rbx)
jne 0x4ee5
movzbl %al, %eax
leal -0x20(%rax), %ecx
cmpl $0xb3, %ecx
ja 0x4b66
movslq (%r14,%rcx,4), %rcx
addq %r14, %rcx
jmpq *%rcx
addl $-0x21, %eax
cmpl $0x3, %eax
ja 0x4ecb
leaq 0x1bf1(%rip), %rcx      # 0x63a4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x42e7
jmp 0x4ecb
addl $-0x78, %eax
cmpl $0x3, %eax
ja 0x4ecb
leaq 0x1bf8(%rip), %rcx      # 0x63d4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x3b61
jmp 0x4ecb
addl $0xffffff70, %eax       # imm = 0xFFFFFF70
cmpl $0x3, %eax
ja 0x4ecb
leaq 0x1cfd(%rip), %rcx      # 0x6504
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x156c
jmp 0x4ecb
addl $-0x5c, %eax
cmpl $0x3, %eax
ja 0x4ecb
leaq 0x1c14(%rip), %rcx      # 0x6444
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x2b2a
jmp 0x4ecb
addl $0xffffff40, %eax       # imm = 0xFFFFFF40
cmpl $0x3, %eax
ja 0x4ecb
leaq 0x1c79(%rip), %rcx      # 0x64d4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x1879
jmp 0x4ecb
addl $-0x54, %eax
cmpl $0x3, %eax
ja 0x4ecb
leaq 0x1be0(%rip), %rcx      # 0x6464
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x2694
jmp 0x4ecb
addl $-0x60, %eax
cmpl $0x3, %eax
ja 0x4ecb
leaq 0x1b87(%rip), %rcx      # 0x6434
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x2d81
jmp 0x4ecb
addl $-0x70, %eax
cmpl $0x3, %eax
ja 0x4ecb
leaq 0x1b1e(%rip), %rcx      # 0x63f4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x36c9
jmp 0x4ecb
addl $-0x4c, %eax
cmpl $0x3, %eax
ja 0x4ecb
leaq 0x1b85(%rip), %rcx      # 0x6484
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x21b6
jmp 0x4ecb
addl $-0x48, %eax
cmpl $0x3, %eax
ja 0x4ecb
leaq 0x1b6c(%rip), %rcx      # 0x6494
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x1f2f
jmp 0x4ecb
addl $-0x44, %eax
cmpl $0x3, %eax
ja 0x4ecb
leaq 0x1b53(%rip), %rcx      # 0x64a4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x1cac
jmp 0x4ecb
addl $-0x58, %eax
cmpl $0x3, %eax
ja 0x4ecb
leaq 0x1ada(%rip), %rcx      # 0x6454
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x28d7
jmp 0x4ecb
addl $-0x6c, %eax
cmpl $0x3, %eax
ja 0x4ecb
leaq 0x1a61(%rip), %rcx      # 0x6404
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x346f
jmp 0x4ecb
addl $-0x50, %eax
cmpl $0x3, %eax
ja 0x4ecb
leaq 0x1aa8(%rip), %rcx      # 0x6474
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x2445
jmp 0x4ecb
addl $-0x40, %eax
cmpl $0x3, %eax
ja 0x4ecb
leaq 0x1abf(%rip), %rcx      # 0x64b4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x1a29
jmp 0x4ecb
addl $-0x68, %eax
cmpl $0x3, %eax
ja 0x4ecb
leaq 0x19f6(%rip), %rcx      # 0x6414
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x3219
jmp 0x4ecb
addl $-0x64, %eax
cmpl $0x3, %eax
ja 0x4ecb
leaq 0x19dd(%rip), %rcx      # 0x6424
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x2fd3
jmp 0x4ecb
addl $-0x7c, %eax
cmpl $0x3, %eax
ja 0x4ecb
leaq 0x1954(%rip), %rcx      # 0x63c4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x3db7
jmp 0x4ecb
addl $-0x74, %eax
cmpl $0x3, %eax
ja 0x4ecb
leaq 0x194b(%rip), %rcx      # 0x63e4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x391b
jmp 0x4ecb
addl $0xffffff30, %eax       # imm = 0xFFFFFF30
cmpl $0x3, %eax
ja 0x4ecb
leaq 0x1a00(%rip), %rcx      # 0x64c4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x1951
jmp 0x4ecb
addl $0xffffff50, %eax       # imm = 0xFFFFFF50
cmpl $0x3, %eax
ja 0x4ecb
leaq 0x19f5(%rip), %rcx      # 0x64e4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x17a1
jmp 0x4ecb
addl $-0x80, %eax
cmpl $0x3, %eax
ja 0x4ecb
leaq 0x189c(%rip), %rcx      # 0x63b4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x4011
jmp 0x4ecb
addl $0xffffff60, %eax       # imm = 0xFFFFFF60
cmpl $0x3, %eax
ja 0x4ecb
leaq 0x19b1(%rip), %rcx      # 0x64f4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
callq 0x16cb
jmp 0x4ecb
movq %rbx, %rdi
callq 0x4263
jmp 0x4ecb
movq %rbx, %rdi
callq 0x1130
jmp 0x4ecb
movq %rbx, %rdi
callq 0x3c92
jmp 0x4ecb
movq %rbx, %rdi
callq 0x3d1e
jmp 0x4ecb
movq %rbx, %rdi
callq 0x3bf9
jmp 0x4ecb
movq %rbx, %rdi
callq 0x161b
jmp 0x4ecb
movq %rbx, %rdi
callq 0x2c53
jmp 0x4ecb
movq %rbx, %rdi
callq 0x1673
jmp 0x4ecb
movq %rbx, %rdi
callq 0x15c3
jmp 0x4ecb
movq %rbx, %rdi
callq 0x2cea
jmp 0x4ecb
movq %rbx, %rdi
callq 0x2bbc
jmp 0x4ecb
movq %rbx, %rdi
callq 0x18f2
jmp 0x4ecb
movq %rbx, %rdi
callq 0x27b1
jmp 0x4ecb
movq %rbx, %rdi
callq 0x2ea3
jmp 0x4ecb
movq %rbx, %rdi
callq 0x37f8
jmp 0x4ecb
movq %rbx, %rdi
callq 0x1914
jmp 0x4ecb
movq %rbx, %rdi
callq 0x2844
jmp 0x4ecb
movq %rbx, %rdi
callq 0x2f3b
jmp 0x4ecb
movq %rbx, %rdi
callq 0x18b5
jmp 0x4ecb
movq %rbx, %rdi
callq 0x271e
jmp 0x4ecb
movq %rbx, %rdi
callq 0x2e18
jmp 0x4ecb
movq %rbx, %rdi
callq 0x3883
jmp 0x4ecb
movq %rbx, %rdi
callq 0x22fd
jmp 0x4ecb
movq %rbx, %rdi
callq 0x2072
jmp 0x4ecb
movq %rbx, %rdi
callq 0x3760
jmp 0x4ecb
movq %rbx, %rdi
callq 0x23a1
jmp 0x4ecb
movq %rbx, %rdi
callq 0x2114
jmp 0x4ecb
movq %rbx, %rdi
callq 0x2259
jmp 0x4ecb
movq %rbx, %rdi
callq 0x1fd0
jmp 0x4ecb
movq %rbx, %rdi
callq 0x4376
jmp 0x4ecb
movq %rbx, %rdi
callq 0x1ded
jmp 0x4ecb
movq %rbx, %rdi
callq 0x29fa
jmp 0x4ecb
movq %rbx, %rdi
callq 0x43be
jmp 0x4ecb
movq %rbx, %rdi
callq 0x1e8e
jmp 0x4ecb
movq %rbx, %rdi
callq 0x3599
jmp 0x4ecb
movq %rbx, %rdi
callq 0x2a92
jmp 0x4ecb
movq %rbx, %rdi
callq 0x432e
jmp 0x4ecb
movq %rbx, %rdi
callq 0x1d4c
jmp 0x4ecb
movq %rbx, %rdi
callq 0x2566
jmp 0x4ecb
movq %rbx, %rdi
callq 0x2962
jmp 0x4ecb
movq %rbx, %rdi
callq 0x1b6a
jmp 0x4ecb
movq %rbx, %rdi
callq 0x333d
jmp 0x4ecb
movq %rbx, %rdi
callq 0x3631
jmp 0x4ecb
movq %rbx, %rdi
callq 0x25fd
jmp 0x4ecb
movq %rbx, %rdi
callq 0x30f1
jmp 0x4ecb
movq %rbx, %rdi
callq 0x3506
jmp 0x4ecb
movq %rbx, %rdi
callq 0x1c0b
jmp 0x4ecb
movq %rbx, %rdi
callq 0x3ee6
jmp 0x4ecb
movq %rbx, %rdi
callq 0x33d6
jmp 0x4ecb
movq %rbx, %rdi
callq 0x24cf
jmp 0x4ecb
movq %rbx, %rdi
callq 0x3a42
jmp 0x4ecb
movq %rbx, %rdi
callq 0x1ac9
jmp 0x4ecb
movq %rbx, %rdi
callq 0x32b1
jmp 0x4ecb
movq %rbx, %rdi
callq 0x3185
jmp 0x4ecb
movq %rbx, %rdi
callq 0x3f79
jmp 0x4ecb
movq %rbx, %rdi
callq 0x3066
jmp 0x4ecb
movq %rbx, %rdi
callq 0x3acd
jmp 0x4ecb
movq %rbx, %rdi
callq 0x3e4e
jmp 0x4ecb
movq %rbx, %rdi
callq 0x39ae
jmp 0x4ecb
movq %rbx, %rdi
callq 0x19ca
jmp 0x4ecb
movq %rbx, %rdi
callq 0x17ff
jmp 0x4ecb
movq %rbx, %rdi
callq 0x1a07
jmp 0x4ecb
movq %rbx, %rdi
callq 0x198d
jmp 0x4ecb
movq %rbx, %rdi
callq 0x183c
jmp 0x4ecb
movq %rbx, %rdi
callq 0x4140
jmp 0x4ecb
movq %rbx, %rdi
callq 0x17dd
jmp 0x4ecb
movq %rbx, %rdi
callq 0x41d8
jmp 0x4ecb
movq %rbx, %rdi
callq 0x40a8
jmp 0x4ecb
movq %rbx, %rdi
callq 0x1729
jmp 0x4ecb
movq %rbx, %rdi
callq 0x1765
jmp 0x4ecb
movq %rbx, %rdi
callq 0x16ed
movq (%rbx), %rax
movslq 0x8(%rbx), %rcx
leaq 0x1(%rcx), %rdx
movl %edx, 0x8(%rbx)
movb 0x1(%rax,%rcx), %al
testb %al, %al
jne 0x477b
popq %rbx
popq %r14
popq %rbp
retq