// File: /workspace/github_c_makefile_star2_O0/hoobaa[P]ficl/vm.c
// Function: ficlVmExecuteString
int ficlVmExecuteString(ficlVm *vm, ficlString s)
{
    ficlSystem *system = vm->callback.system;
    ficlDictionary   *dictionary   = system->dictionary;

    int        except;
    jmp_buf    vmState;
    jmp_buf   *oldState;
    ficlTIB        saveficlTIB;

    FICL_VM_ASSERT(vm, vm);
    FICL_VM_ASSERT(vm, system->interpreterLoop[0]);

    ficlVmPushTib(vm, FICL_STRING_GET_POINTER(s), FICL_STRING_GET_LENGTH(s), &saveficlTIB);

    /*
    ** Save and restore VM's jmp_buf to enable nested calls to ficlExec 
    */
    oldState = vm->exceptionHandler;
    vm->exceptionHandler = &vmState; /* This has to come before the setjmp! */
    except = setjmp(vmState);

    switch (except)
    {
    case 0:
        if (vm->restart)
        {
            vm->runningWord->code(vm);
            vm->restart = 0;
        }
        else
        {   /* set VM up to interpret text */
            ficlVmPushIP(vm, &(system->interpreterLoop[0]));
        }

        ficlVmInnerLoop(vm, 0);
        break;

    case FICL_VM_STATUS_RESTART:
        vm->restart = 1;
        except = FICL_VM_STATUS_OUT_OF_TEXT;
        break;

    case FICL_VM_STATUS_OUT_OF_TEXT:
        ficlVmPopIP(vm);
        if ((vm->state != FICL_VM_STATE_COMPILE) && (vm->sourceId.i == 0))
            ficlVmTextOut(vm, FICL_PROMPT);
        break;

    case FICL_VM_STATUS_USER_EXIT:
    case FICL_VM_STATUS_INNER_EXIT:
    case FICL_VM_STATUS_BREAK:
        break;

    case FICL_VM_STATUS_QUIT:
        if (vm->state == FICL_VM_STATE_COMPILE)
        {
            ficlDictionaryAbortDefinition(dictionary);
#if FICL_WANT_LOCALS
            ficlDictionaryEmpty(system->locals, system->locals->forthWordlist->size);
#endif
        }
        ficlVmQuit(vm);
        break;

    case FICL_VM_STATUS_ERROR_EXIT:
    case FICL_VM_STATUS_ABORT:
    case FICL_VM_STATUS_ABORTQ:
    default:    /* user defined exit code?? */
        if (vm->state == FICL_VM_STATE_COMPILE)
        {
            ficlDictionaryAbortDefinition(dictionary);
#if FICL_WANT_LOCALS
            ficlDictionaryEmpty(system->locals, system->locals->forthWordlist->size);
#endif
        }
        ficlDictionaryResetSearchOrder(dictionary);
        ficlVmReset(vm);
        break;
   }

    vm->exceptionHandler    = oldState;
    ficlVmPopTib(vm, &saveficlTIB);
    return (except);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rsi, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
movq %rdi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x8(%rbp), %rsi
leaq -0x120(%rbp), %rcx
callq 0x9460
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x108(%rbp)
movq -0x18(%rbp), %rax
leaq -0x100(%rbp), %rdi
movq %rdi, 0x30(%rax)
callq 0x3160
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x124(%rbp)
subl $0xfffffefb, %eax       # imm = 0xFFFFFEFB
je 0x98c7
jmp 0x97a3
movl -0x124(%rbp), %eax
subl $0xfffffefc, %eax       # imm = 0xFFFFFEFC
je 0x98e8
jmp 0x97b6
movl -0x124(%rbp), %eax
subl $0xfffffefd, %eax       # imm = 0xFFFFFEFD
je 0x98c7
jmp 0x97c9
movl -0x124(%rbp), %eax
subl $0xfffffefe, %eax       # imm = 0xFFFFFEFE
je 0x9883
jmp 0x97dc
movl -0x124(%rbp), %eax
subl $0xfffffeff, %eax       # imm = 0xFFFFFEFF
je 0x9896
jmp 0x97ef
movl -0x124(%rbp), %eax
subl $0xffffff00, %eax       # imm = 0xFFFFFF00
je 0x98c7
jmp 0x9802
movl -0x124(%rbp), %eax
subl $-0x38, %eax
je 0x98c9
jmp 0x9813
movl -0x124(%rbp), %eax
addl $0x2, %eax
subl $0x2, %eax
jb 0x98e8
jmp 0x9827
movl -0x124(%rbp), %eax
testl %eax, %eax
jne 0x98ea
jmp 0x9837
movq -0x18(%rbp), %rax
cmpw $0x0, 0x38(%rax)
je 0x9860
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x18(%rax), %rax
movq -0x18(%rbp), %rdi
callq *%rax
movq -0x18(%rbp), %rax
movw $0x0, 0x38(%rax)
jmp 0x9871
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x48, %rsi
callq 0x9420
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x6670
jmp 0x9910
movq -0x18(%rbp), %rax
movw $0x1, 0x38(%rax)
movl $0xfffffeff, -0x2c(%rbp) # imm = 0xFFFFFEFF
jmp 0x9910
movq -0x18(%rbp), %rdi
callq 0x93f0
movq -0x18(%rbp), %rax
cmpq $0x1, 0x50(%rax)
je 0x98c5
movq -0x18(%rbp), %rax
cmpq $0x0, 0x78(%rax)
jne 0x98c5
movq -0x18(%rbp), %rdi
leaq 0xb781(%rip), %rsi      # 0x15041
callq 0x95e0
jmp 0x9910
jmp 0x9910
movq -0x18(%rbp), %rax
cmpq $0x1, 0x50(%rax)
jne 0x98dd
movq -0x28(%rbp), %rdi
callq 0x10f30
movq -0x18(%rbp), %rdi
callq 0x9520
jmp 0x9910
jmp 0x98ea
movq -0x18(%rbp), %rax
cmpq $0x1, 0x50(%rax)
jne 0x98fe
movq -0x28(%rbp), %rdi
callq 0x10f30
movq -0x28(%rbp), %rdi
callq 0x11b00
movq -0x18(%rbp), %rdi
callq 0x65a0
movq -0x108(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x18(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x94e0
movl -0x2c(%rbp), %eax
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nopl (%rax,%rax)