// File: /workspace/github_c_makefile_star2_O0/MuvikLabs[P]runt/basic.c
// Function: rproc_loop
static int rproc_loop(runt_vm *vm, runt_ptr p)
{
    runt_stacklet *s;
    runt_int rc;
    runt_uint level;
    runt_uint ppos;
    runt_uint pos;
    runt_int pstate;
    runt_uint i;
    runt_uint reps;

    rc = runt_ppop(vm, &s);
    RUNT_ERROR_CHECK(rc);
    reps = s->f;

    rc = runt_ppop(vm, &s);
    RUNT_ERROR_CHECK(rc);

    pstate = runt_get_state(vm, RUNT_MODE_END);
    runt_set_state(vm, RUNT_MODE_END, RUNT_OFF);
    ppos = vm->pos;
    pos = s->f;

    vm->level++;
    level = vm->level;
    for(i = 0; i < reps; i++) {
        vm->pos = pos + 1;
        runt_set_state(vm, RUNT_MODE_END, RUNT_OFF);
        while(runt_get_state(vm, RUNT_MODE_END) == RUNT_OFF &&
                vm->level == level) {
            rc = runt_cell_call(vm, &vm->cell_pool.cells[vm->pos - 1]);
            RUNT_ERROR_CHECK(rc);
            vm->pos++;
        }
    }
    vm->level--;
    vm->pos = ppos;
    runt_set_state(vm, RUNT_MODE_END, pstate);

    return RUNT_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x2aa0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x6fce
movl $0x0, -0x4(%rbp)
jmp 0x7164
movq -0x18(%rbp), %rax
cvttss2si 0x20(%rax), %rax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x2aa0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x6ffd
movl $0x0, -0x4(%rbp)
jmp 0x7164
movq -0x10(%rbp), %rdi
movl $0x40, %esi
movl %esi, -0x38(%rbp)
callq 0x1f00
movl -0x38(%rbp), %esi
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
movl $0x4, %edx
callq 0x1550
movq -0x10(%rbp), %rax
movl 0x11bc(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rax
cvttss2si 0x20(%rax), %rax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl 0x11b8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x11b8(%rax)
movq -0x10(%rbp), %rax
movl 0x11b8(%rax), %eax
movl %eax, -0x20(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x34(%rbp), %eax
jae 0x712c
movl -0x28(%rbp), %ecx
addl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x11bc(%rax)
movq -0x10(%rbp), %rdi
movl $0x40, %esi
movl $0x4, %edx
callq 0x1550
movq -0x10(%rbp), %rdi
movl $0x40, %esi
callq 0x1f00
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x4, %ecx
movb %al, -0x39(%rbp)
jne 0x70bf
movq -0x10(%rbp), %rax
movl 0x11b8(%rax), %eax
cmpl -0x20(%rbp), %eax
sete %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
testb $0x1, %al
jne 0x70c8
jmp 0x711c
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x510(%rax), %rsi
movq -0x10(%rbp), %rax
movl 0x11bc(%rax), %eax
subl $0x1, %eax
movl %eax, %eax
imulq $0x28, %rax, %rax
addq %rax, %rsi
callq 0x20f0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x7104
movl $0x0, -0x4(%rbp)
jmp 0x7164
movq -0x10(%rbp), %rax
movl 0x11bc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x11bc(%rax)
jmp 0x7092
jmp 0x711e
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x7063
movq -0x10(%rbp), %rax
movl 0x11b8(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x11b8(%rax)
movl -0x24(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x11bc(%rax)
movq -0x10(%rbp), %rdi
movl -0x2c(%rbp), %edx
movl $0x40, %esi
callq 0x1550
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)