// File: /workspace/github_c_makefile_star2_O0/alexj136[P]minijit/src/vmcode_interpreter.c
// Function: VMCodeInterpreterState_run
void VMCodeInterpreterState_run(VMCodeInterpreterState *state) {

    // Copy the pointers in the VMCodeInterpreterState to minimise indirection
    int *code      = state->code;
    int *stack     = state->stack;
    int *registers = state->registers;
    int *labels    = state->labels;
    int min_label  = state->min_label;

    while(true) {
        if(OPC == MOVE) {
            registers[ARG2] = registers[ARG1];
            registers[PROGRAM_COUNTER]++;
        }
        else if(OPC == LOAD) {
            registers[ARG2] = stack[registers[ARG1]];
            registers[PROGRAM_COUNTER]++;
        }
        else if(OPC == STORE) {
            stack[registers[ARG2]] = registers[ARG1];
            registers[PROGRAM_COUNTER]++;
        }
        else if(OPC == ADD) {
            registers[ARG1] = registers[ARG1] + registers[ARG2];
            registers[PROGRAM_COUNTER]++;
        }
        else if(OPC == SUB) {
            registers[ARG1] = registers[ARG1] - registers[ARG2];
            registers[PROGRAM_COUNTER]++;
        }
        else if(OPC == LOADIMM) {
            registers[ARG2] = ARG1;
            registers[PROGRAM_COUNTER]++;
        }
        else if(OPC == JUMP) {
            registers[PROGRAM_COUNTER] =
                    VMCodeInterpreterState_lookup_label_address(ARG1);
        }
        else if(OPC == JUMPCOND) {
            if(registers[ARG2] < 1) {
                registers[PROGRAM_COUNTER] =
                        VMCodeInterpreterState_lookup_label_address(ARG1);
            }
            else {
                registers[PROGRAM_COUNTER]++;
            }
        }
        else if(OPC == JUMPLINK) {
            registers[RETURN_ADDRESS] = registers[PROGRAM_COUNTER] + 1;
            registers[PROGRAM_COUNTER] =
                    VMCodeInterpreterState_lookup_label_address(ARG1);
        }
        else if(OPC == JUMPADDR) {
            registers[PROGRAM_COUNTER] = registers[ARG1];
        }
        else if(OPC == LABEL) {
            registers[PROGRAM_COUNTER]++;
        }
        else if(OPC == HALT) {
            break;
        }
        else {
            ERROR("Unrecognised Opcode");
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1f90, %rsp           # imm = 0x1F90
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0xc(%rcx), %rcx
imulq $0xc, %rcx, %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x1d958
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rdx
movslq 0xc(%rdx), %rdx
imulq $0xc, %rdx, %rdx
movslq 0x4(%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %edx
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rsi
movslq 0xc(%rsi), %rsi
imulq $0xc, %rsi, %rsi
movslq 0x8(%rcx,%rsi,4), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
jmp 0x1ddde
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0xc(%rcx), %rcx
imulq $0xc, %rcx, %rcx
cmpl $0x1, (%rax,%rcx,4)
jne 0x1d9c0
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rdx
movq -0x20(%rbp), %rsi
movslq 0xc(%rsi), %rsi
imulq $0xc, %rsi, %rsi
movslq 0x4(%rdx,%rsi,4), %rdx
movslq (%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %edx
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rsi
movslq 0xc(%rsi), %rsi
imulq $0xc, %rsi, %rsi
movslq 0x8(%rcx,%rsi,4), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
jmp 0x1dddc
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0xc(%rcx), %rcx
imulq $0xc, %rcx, %rcx
cmpl $0x2, (%rax,%rcx,4)
jne 0x1da28
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rdx
movslq 0xc(%rdx), %rdx
imulq $0xc, %rdx, %rdx
movslq 0x4(%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %edx
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdi
movslq 0xc(%rdi), %rdi
imulq $0xc, %rdi, %rdi
movslq 0x8(%rsi,%rdi,4), %rsi
movslq (%rcx,%rsi,4), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
jmp 0x1ddda
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0xc(%rcx), %rcx
imulq $0xc, %rcx, %rcx
cmpl $0x3, (%rax,%rcx,4)
jne 0x1daa4
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rdx
movslq 0xc(%rdx), %rdx
imulq $0xc, %rdx, %rdx
movslq 0x4(%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %edx
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rsi
movslq 0xc(%rsi), %rsi
imulq $0xc, %rsi, %rsi
movslq 0x8(%rcx,%rsi,4), %rcx
addl (%rax,%rcx,4), %edx
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rsi
movslq 0xc(%rsi), %rsi
imulq $0xc, %rsi, %rsi
movslq 0x4(%rcx,%rsi,4), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
jmp 0x1ddd8
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0xc(%rcx), %rcx
imulq $0xc, %rcx, %rcx
cmpl $0x4, (%rax,%rcx,4)
jne 0x1db20
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rdx
movslq 0xc(%rdx), %rdx
imulq $0xc, %rdx, %rdx
movslq 0x4(%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %edx
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rsi
movslq 0xc(%rsi), %rsi
imulq $0xc, %rsi, %rsi
movslq 0x8(%rcx,%rsi,4), %rcx
subl (%rax,%rcx,4), %edx
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rsi
movslq 0xc(%rsi), %rsi
imulq $0xc, %rsi, %rsi
movslq 0x4(%rcx,%rsi,4), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
jmp 0x1ddd6
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0xc(%rcx), %rcx
imulq $0xc, %rcx, %rcx
cmpl $0x5, (%rax,%rcx,4)
jne 0x1db78
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0xc(%rcx), %rcx
imulq $0xc, %rcx, %rcx
movl 0x4(%rax,%rcx,4), %edx
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rsi
movslq 0xc(%rsi), %rsi
imulq $0xc, %rsi, %rsi
movslq 0x8(%rcx,%rsi,4), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
jmp 0x1ddd4
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0xc(%rcx), %rcx
imulq $0xc, %rcx, %rcx
cmpl $0x6, (%rax,%rcx,4)
jne 0x1dbbb
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rdx
movslq 0xc(%rdx), %rdx
imulq $0xc, %rdx, %rdx
movl 0x4(%rcx,%rdx,4), %ecx
subl -0x2c(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xc(%rax)
jmp 0x1ddd2
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0xc(%rcx), %rcx
imulq $0xc, %rcx, %rcx
cmpl $0x7, (%rax,%rcx,4)
jne 0x1dc2c
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rdx
movslq 0xc(%rdx), %rdx
imulq $0xc, %rdx, %rdx
movslq 0x8(%rcx,%rdx,4), %rcx
cmpl $0x1, (%rax,%rcx,4)
jge 0x1dc1a
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rdx
movslq 0xc(%rdx), %rdx
imulq $0xc, %rdx, %rdx
movl 0x4(%rcx,%rdx,4), %ecx
subl -0x2c(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xc(%rax)
jmp 0x1dc27
movq -0x20(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
jmp 0x1ddd0
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0xc(%rcx), %rcx
imulq $0xc, %rcx, %rcx
cmpl $0x8, (%rax,%rcx,4)
jne 0x1dc80
movq -0x20(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rdx
movslq 0xc(%rdx), %rdx
imulq $0xc, %rdx, %rdx
movl 0x4(%rcx,%rdx,4), %ecx
subl -0x2c(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xc(%rax)
jmp 0x1ddce
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0xc(%rcx), %rcx
imulq $0xc, %rcx, %rcx
cmpl $0x9, (%rax,%rcx,4)
jne 0x1dcbe
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rdx
movslq 0xc(%rdx), %rdx
imulq $0xc, %rdx, %rdx
movslq 0x4(%rcx,%rdx,4), %rcx
movl (%rax,%rcx,4), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0xc(%rax)
jmp 0x1ddcc
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0xc(%rcx), %rcx
imulq $0xc, %rcx, %rcx
cmpl $0xa, (%rax,%rcx,4)
jne 0x1dce6
movq -0x20(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
jmp 0x1ddca
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movslq 0xc(%rcx), %rcx
imulq $0xc, %rcx, %rcx
cmpl $0xb, (%rax,%rcx,4)
jne 0x1dd01
jmp 0x1dde3
jmp 0x1dd03
leaq 0x62fa(%rip), %rdi      # 0x24004
leaq 0x7b5c(%rip), %rsi      # 0x2586d
movl $0x70, %edx
leaq 0x7b69(%rip), %rcx      # 0x25886
movb $0x0, %al
callq 0x60f0
leaq 0x6301(%rip), %rdi      # 0x2402c
leaq 0x7b6f(%rip), %rsi      # 0x258a1
movb $0x0, %al
callq 0x60f0
leaq -0x1f70(%rbp), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x60d0
movl %eax, -0x1f74(%rbp)
leaq -0x1f70(%rbp), %rdi
movl -0x1f74(%rbp), %esi
callq 0x60a0
movq %rax, -0x1f80(%rbp)
leaq 0x62db(%rip), %rdi      # 0x2404b
movb $0x0, %al
callq 0x60f0
movl $0x0, -0x1f84(%rbp)
movl -0x1f84(%rbp), %eax
cmpl -0x1f74(%rbp), %eax
jge 0x1ddc0
movq -0x1f80(%rbp), %rax
movslq -0x1f84(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x6284(%rip), %rdi      # 0x2402c
movb $0x0, %al
callq 0x60f0
movl -0x1f84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1f84(%rbp)
jmp 0x1dd81
movl $0x1, %edi
callq 0x61a0
jmp 0x1ddcc
jmp 0x1ddce
jmp 0x1ddd0
jmp 0x1ddd2
jmp 0x1ddd4
jmp 0x1ddd6
jmp 0x1ddd8
jmp 0x1ddda
jmp 0x1dddc
jmp 0x1ddde
jmp 0x1d8f8
addq $0x1f90, %rsp           # imm = 0x1F90
popq %rbp
retq
nopl (%rax)