LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/tools.c
// Function: ficlPrimitiveHashSummary
void ficlPrimitiveHashSummary(ficlVm *vm)
{
    ficlDictionary *dictionary = ficlVmGetDictionary(vm);
    ficlHash *pFHash;
    ficlWord **hash;
    unsigned size;
    ficlWord *word;
    unsigned i;
    int nMax = 0;
    int nWords = 0;
    int nFilled;
    double avg = 0.0;
    double best;
    int nAvg, nRem, nDepth;

    FICL_VM_DICTIONARY_CHECK(vm, dictionary, 0);

    pFHash = dictionary->wordlists[dictionary->wordlistCount - 1];
    hash  = pFHash->table;
    size   = pFHash->size;
    nFilled = size;

    for (i = 0; i < size; i++)
    {
        int n = 0;
        word = hash[i];

        while (word)
        {
            ++n;
            ++nWords;
            word = word->link;
        }

        avg += (double)(n * (n+1)) / 2.0;

        if (n > nMax)
            nMax = n;
        if (n == 0)
            --nFilled;
    }

    /* Calc actual avg search depth for this hash */
    avg = avg / nWords;

    /* Calc best possible performance with this size hash */
    nAvg = nWords / size;
    nRem = nWords % size;
    nDepth = size * (nAvg * (nAvg+1))/2 + (nAvg+1)*nRem;
    best = (double)nDepth/nWords;

    sprintf(vm->pad, 
        "%d bins, %2.0f%% filled, Depth: Max=%d, Avg=%2.1f, Best=%2.1f, Score: %2.0f%%\n", 
        size,
        (double)nFilled * 100.0 / size, nMax,
        avg, 
        best,
        100.0 * best / avg);

    ficlVmTextOut(vm, vm->pad);

    return;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x699a
movslq 0xa8(%rax), %rcx
movq 0x20(%rax,%rcx,8), %rdx
movl 0x10(%rdx), %r8d
testq %r8, %r8
je 0x4542
xorpd %xmm1, %xmm1
xorl %edi, %edi
movsd 0x9dd8(%rip), %xmm0     # 0xe2c8
xorl %ecx, %ecx
xorl %eax, %eax
movl %r8d, %esi
movq 0x18(%rdx,%rdi,8), %r10
xorl %r9d, %r9d
testq %r10, %r10
je 0x4512
incl %r9d
movq (%r10), %r10
testq %r10, %r10
jne 0x4504
addl %r9d, %eax
leal 0x1(%r9), %r10d
imull %r9d, %r10d
xorps %xmm2, %xmm2
cvtsi2sd %r10d, %xmm2
mulsd %xmm0, %xmm2
addsd %xmm2, %xmm1
cmpl %ecx, %r9d
cmovgl %r9d, %ecx
cmpl $0x1, %r9d
sbbl $0x0, %esi
incq %rdi
cmpq %r8, %rdi
jne 0x44f7
jmp 0x454d
xorl %eax, %eax
xorpd %xmm1, %xmm1
movl %r8d, %esi
xorl %ecx, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
xorl %edx, %edx
divl %r8d
divsd %xmm0, %xmm1
leal 0x1(%rax), %edi
imull %r8d, %eax
imull %edi, %eax
shrl %eax
imull %edi, %edx
addl %eax, %edx
xorps %xmm2, %xmm2
cvtsi2sd %edx, %xmm2
divsd %xmm0, %xmm2
leaq 0x118(%rbx), %r14
xorps %xmm0, %xmm0
cvtsi2sd %esi, %xmm0
movsd 0x9d41(%rip), %xmm3     # 0xe2d0
movl %r8d, %eax
cvtsi2sd %rax, %xmm4
mulsd %xmm3, %xmm0
divsd %xmm4, %xmm0
mulsd %xmm2, %xmm3
divsd %xmm1, %xmm3
leaq 0x9d6e(%rip), %rsi      # 0xe31c
movq %r14, %rdi
movl %r8d, %edx
movb $0x4, %al
callq 0x32f0
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x6c86
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/tools.c
// Function: ficlStackDisplay
void ficlStackDisplay(ficlStack *stack, ficlStackWalkFunction callback, void *context)
{
	ficlVm *vm = stack->vm;
	char buffer[128];
	struct stackContext myContext;

    FICL_STACK_CHECK(stack, 0, 0);

	sprintf(buffer, "[%s stack has %d entries, top at 0x%08x]\n", stack->name, ficlStackDepth(stack), stack->top);
	ficlVmTextOut(vm, buffer);

    if (callback == NULL)
    {
        myContext.vm = vm;
	    myContext.count = 0;
		context = &myContext;
		callback = ficlStackDisplayCallback;
    }
	ficlStackWalk(stack, callback, context, FICL_FALSE);

	sprintf(buffer, "[%s stack base at 0x%08x]\n", stack->name, stack->base);
	ficlVmTextOut(vm, buffer);

    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
movq 0x18(%rdi), %rbx
movq 0x20(%rdi), %r13
callq 0x4274
movq 0x10(%r14), %r8
leaq 0x9d6c(%rip), %rsi      # 0xe36b
leaq 0x20(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rdx
movl %eax, %ecx
xorl %eax, %eax
callq 0x32f0
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x6c86
testq %r12, %r12
jne 0x463a
leaq 0x8(%rsp), %r15
movq %rbx, (%r15)
movl $0x0, 0x10(%r15)
leaq 0x4e(%rip), %r12        # 0x4688
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x4447
movq 0x20(%r14), %rdx
addq $0x28, %r14
leaq 0x9d3c(%rip), %rsi      # 0xe395
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x32f0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6c86
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/tools.c
// Function: ficlVmDisplayDataStackSimple
void ficlVmDisplayDataStackSimple(ficlVm *vm)
{
    ficlStack *stack = vm->dataStack;
    char buffer[32];
    struct stackContext context;

    FICL_STACK_CHECK(stack, 0, 0);

    sprintf(buffer, "[%d] ", ficlStackDepth(stack));
    ficlVmTextOut(vm, buffer);

    context.vm = vm;
    context.count = 0;
    ficlStackWalk(stack, ficlStackDisplaySimpleCallback, &context, FICL_TRUE);
    return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
movq 0x60(%rdi), %r14
movq %r14, %rdi
callq 0x4274
leaq 0x9cb2(%rip), %rsi      # 0xe3b0
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x32f0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6c86
leaq 0x8(%rsp), %rdx
movq %rbx, (%rdx)
movl $0x0, 0x10(%rdx)
leaq 0x19(%rip), %rsi        # 0x4749
movq %r14, %rdi
movq $-0x1, %rcx
callq 0x4447
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/tools.c
// Function: ficlStackDisplaySimpleCallback
static ficlInteger ficlStackDisplaySimpleCallback(void *c, ficlCell *cell)
{
    struct stackContext *context = (struct stackContext *)c;
    char buffer[32];
    sprintf(buffer, "%s%d", context->count ? " " : "", cell->i);
    context->count++;
    ficlVmTextOut(context->vm, buffer);
	return FICL_TRUE;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
cmpl $0x0, 0x10(%rdi)
leaq 0x9c0c(%rip), %rax      # 0xe36a
leaq 0xaf0e(%rip), %rdx      # 0xf673
cmoveq %rax, %rdx
movq (%rsi), %rcx
leaq 0x9d01(%rip), %rsi      # 0xe474
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x32f0
incl 0x10(%rbx)
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x6c86
movq $-0x1, %rax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/tools.c
// Function: ficlVmDisplayReturnStack
void ficlVmDisplayReturnStack(ficlVm *vm)
{
    struct stackContext context;
	context.vm = vm;
	context.count = 0;
	context.dictionary = ficlVmGetDictionary(vm);
    ficlStackDisplay(vm->returnStack, ficlReturnStackDisplayCallback, &context);
    return;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq %rsp, %r14
movq %rdi, (%r14)
movl $0x0, 0x10(%r14)
callq 0x699a
movq %rax, 0x8(%r14)
movq 0x68(%rbx), %rdi
leaq 0x10(%rip), %rsi        # 0x47d9
movq %r14, %rdx
callq 0x45cd
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/tools.c
// Function: ficlReturnStackDisplayCallback
static ficlInteger ficlReturnStackDisplayCallback(void *c, ficlCell *cell)
{
    struct stackContext *context = (struct stackContext *)c;
    char buffer[128];

    sprintf(buffer, "[0x%08x %3d] %12d (0x%08x)", cell, context->count++, cell->i, cell->i);

    /*
    ** Attempt to find the word that contains the return
    ** stack address (as if it is part of a colon definition).
    ** If this works, also print the name of the word.
    */
    if (ficlDictionaryIncludes(context->dictionary, cell->p))
    {
        ficlWord *word = ficlDictionaryFindEnclosingWord(context->dictionary, cell->p);
        if (word)
        {
            int offset = (ficlCell *)cell->p - &word->param[0];
            sprintf(buffer + strlen(buffer), ", %s + %d ", word->name, offset);
        }
    }
	strcat(buffer, "\n");
    ficlVmTextOut(context->vm, buffer);
	return FICL_TRUE;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x10(%rdi), %ecx
leal 0x1(%rcx), %eax
movl %eax, 0x10(%rdi)
movq (%rsi), %r8
leaq 0x9c7b(%rip), %rsi      # 0xe479
movq %rsp, %rdi
movq %r14, %rdx
movq %r8, %r9
xorl %eax, %eax
callq 0x32f0
movq 0x8(%rbx), %rdi
movq (%r14), %rsi
callq 0xc7ed
testl %eax, %eax
je 0x4861
movq 0x8(%rbx), %rdi
movq (%r14), %rsi
callq 0xc80e
testq %rax, %rax
je 0x4861
movq %rax, %r15
movq (%r14), %r14
subq %rax, %r14
addq $-0x28, %r14
shrq $0x3, %r14
movq %rsp, %rdi
callq 0x30e0
leaq (%rsp,%rax), %rdi
movq 0x10(%r15), %rdx
leaq 0x9c3d(%rip), %rsi      # 0xe494
movl %r14d, %ecx
xorl %eax, %eax
callq 0x32f0
movq %rsp, %r14
movq %r14, %rdi
callq 0x30e0
movw $0xa, (%rsp,%rax)
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x6c86
movq $-0x1, %rax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/tools.c
// Function: ficlPrimitiveParseStepList
void ficlPrimitiveParseStepList(ficlVm *vm)
{
    int i;
    ficlSystem *system = vm->callback.system;
    FICL_VM_ASSERT(vm, system);

    ficlVmTextOut(vm, "Parse steps:\n");
    ficlVmTextOut(vm, "lookup\n");

    for (i = 0; i < FICL_MAX_PARSE_STEPS; i++)
    {
        if (system->parseList[i] != NULL)
        {
            ficlVmTextOut(vm, system->parseList[i]->name);
            ficlVmTextOut(vm, "\n");
        }
        else break;
    }
    return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %r15
leaq 0x9b0f(%rip), %rsi      # 0xe3b6
callq 0x6c86
leaq 0x9b11(%rip), %rsi      # 0xe3c4
movq %rbx, %rdi
callq 0x6c86
xorl %r12d, %r12d
leaq 0x9aa4(%rip), %r14      # 0xe369
movq 0x60(%r15,%r12,8), %rax
testq %rax, %rax
je 0x48ef
movq 0x10(%rax), %rsi
movq %rbx, %rdi
callq 0x6c86
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6c86
incq %r12
cmpq $0x8, %r12
jne 0x48c5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/tools.c
// Function: ficlPrimitiveForget
static void ficlPrimitiveForget(ficlVm *vm)
{
    void *where;
    ficlDictionary *dictionary = ficlVmGetDictionary(vm);
    ficlHash *hash = dictionary->compilationWordlist;

    ficlPrimitiveTick(vm);
    where = ((ficlWord *)ficlStackPopPointer(vm->dataStack))->name;
    ficlHashForget(hash, where);
    dictionary->here = FICL_POINTER_TO_CELL(where);

    return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x699a
movq %rax, %r14
movq 0x20(%rax), %r15
movq %rbx, %rdi
callq 0x71df
movq 0x60(%rbx), %rdi
callq 0x42f1
movq 0x10(%rax), %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0xb880
movq %rbx, (%r14)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/tools.c
// Function: ficlPrimitiveListEnv
static void ficlPrimitiveListEnv(ficlVm *vm)
{
    ficlDictionary *dictionary = vm->callback.system->environment;
    ficlHash *hash = dictionary->forthWordlist;
    ficlWord *word;
    unsigned i;
    int counter = 0;

    for (i = 0; i < hash->size; i++)
    {
        for (word = hash->table[i]; word != NULL; word = word->link, counter++)
        {
            ficlVmTextOut(vm, word->name);
            ficlVmTextOut(vm, "\n");
        }
    }

    sprintf(vm->pad, "Environment: %d words, %ld cells used of %u total\n", 
        counter, (long) (dictionary->here - dictionary->base), dictionary->size);
    ficlVmTextOut(vm, vm->pad);
    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rax
movq 0x40(%rax), %rax
movq %rax, (%rsp)
movq 0x18(%rax), %r12
cmpl $0x0, 0x10(%r12)
je 0x4cff
xorl %r13d, %r13d
leaq 0x96a3(%rip), %r14      # 0xe369
xorl %ebp, %ebp
movq 0x18(%r12,%r13,8), %r15
testq %r15, %r15
je 0x4cf0
movq 0x10(%r15), %rsi
movq %rbx, %rdi
callq 0x6c86
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6c86
incl %ebp
movq (%r15), %r15
jmp 0x4ccd
incq %r13
movl 0x10(%r12), %eax
cmpq %rax, %r13
jb 0x4cc8
jmp 0x4d01
xorl %ebp, %ebp
leaq 0x118(%rbx), %r14
movq (%rsp), %rax
movq (%rax), %rcx
subq %rax, %rcx
addq $-0xb8, %rcx
sarq $0x3, %rcx
movl 0xac(%rax), %r8d
leaq 0x97a6(%rip), %rsi      # 0xe4d1
movq %r14, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x32f0
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6c86
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/tools.c
// Function: ficlPrimitiveDebugXT
static void ficlPrimitiveDebugXT(ficlVm *vm)
{
    ficlWord *xt    = ficlStackPopPointer(vm->dataStack);
    ficlWordKind   wk    = ficlWordClassify(xt);

    ficlStackPushPointer(vm->dataStack, xt);
    ficlPrimitiveSeeXT(vm);

    switch (wk)
    {
    case FICL_WORDKIND_COLON:
    case FICL_WORDKIND_DOES:
        /*
        ** Run the colon code and set a breakpoint at the next instruction
        */
        ficlVmExecuteWord(vm, xt);
        ficlVmSetBreak(vm, &(vm->callback.system->breakpoint));
        break;

    default:
        ficlVmExecuteWord(vm, xt);
        break;
    }

    return;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x60(%rdi), %rdi
callq 0x42f1
movq %rax, %r14
movq %rax, %rdi
callq 0xbab6
movl %eax, %ebp
movq 0x60(%rbx), %rdi
movq %r14, %rsi
callq 0x436a
movq %rbx, %rdi
callq 0x50a4
cmpl $0x7, %ebp
je 0x4e0a
cmpl $0x2, %ebp
jne 0x4e45
movq %rbx, %rdi
movq %r14, %rsi
callq 0x53b5
movq 0x18(%rbx), %r14
leaq 0x9614(%rip), %rsi      # 0xe434
movq %r14, %rdi
callq 0x3a0f
movq 0x40(%rbx), %rcx
movq %rcx, 0xb8(%r14)
movq (%rcx), %rdx
movq %rdx, 0xc0(%r14)
movq %rax, (%rcx)
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x53b5
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/tools.c
// Function: ficlPrimitiveStepIn
static void ficlPrimitiveStepIn(ficlVm *vm)
{
    /*
    ** Do one step of the inner loop
    */
	ficlVmExecuteWord(vm, *vm->ip++);

    /*
    ** Now set a breakpoint at the next instruction
    */
    ficlVmSetBreak(vm, &(vm->callback.system->breakpoint));
    
    return;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x40(%rdi), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x40(%rdi)
movq (%rax), %rsi
callq 0x53b5
movq 0x18(%rbx), %r14
leaq 0x91db(%rip), %rsi      # 0xe434
movq %r14, %rdi
callq 0x3a0f
movq 0x40(%rbx), %rcx
movq %rcx, 0xb8(%r14)
movq (%rcx), %rdx
movq %rdx, 0xc0(%r14)
movq %rax, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/vm.c
// Function: ficlVmCreate
ficlVm *ficlVmCreate(ficlVm *vm, unsigned nPStack, unsigned nRStack)
{
    if (vm == NULL)
    {
        vm = (ficlVm *)ficlMalloc(sizeof (ficlVm));
        FICL_ASSERT(NULL, vm);
        memset(vm, 0, sizeof (ficlVm));
    }

    if (vm->dataStack)
        ficlStackDestroy(vm->dataStack);
    vm->dataStack = ficlStackCreate(vm, "data", nPStack);

    if (vm->returnStack)
        ficlStackDestroy(vm->returnStack);
    vm->returnStack = ficlStackCreate(vm, "return", nRStack);

#if FICL_WANT_FLOAT
    if (vm->floatStack)
        ficlStackDestroy(vm->floatStack);
    vm->floatStack = ficlStackCreate(vm, "float", nPStack);
#endif

    ficlVmReset(vm);
    return vm;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
testq %rdi, %rdi
jne 0x52bd
movl $0x918, %edi            # imm = 0x918
callq 0xb40f
movq %rax, %rbx
movl $0x918, %edx            # imm = 0x918
movq %rax, %rdi
xorl %esi, %esi
callq 0x3130
movq 0x60(%rbx), %rdi
testq %rdi, %rdi
je 0x52cb
callq 0x426a
leaq 0x96b6(%rip), %rsi      # 0xe988
movq %rbx, %rdi
movl %ebp, %edx
callq 0x4225
movq %rax, 0x60(%rbx)
movq 0x68(%rbx), %rdi
testq %rdi, %rdi
je 0x52ee
callq 0x426a
leaq 0x9698(%rip), %rsi      # 0xe98d
movq %rbx, %rdi
movl %r14d, %edx
callq 0x4225
movq %rax, 0x68(%rbx)
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
je 0x5312
callq 0x426a
leaq 0x98a4(%rip), %rsi      # 0xebbd
movq %rbx, %rdi
movl %ebp, %edx
callq 0x4225
movq %rax, 0x70(%rbx)
movq %rbx, %rdi
callq 0x5337
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/vm.c
// Function: ficlVmReset
void ficlVmReset(ficlVm *vm)
{
    ficlVmQuit(vm);
    ficlStackReset(vm->dataStack);
#if FICL_WANT_FLOAT
    ficlStackReset(vm->floatStack);
#endif
    vm->base        = 10;
    return;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x68(%rdi), %rdi
callq 0x4261
movw $0x0, 0x38(%rbx)
movb $0x0, 0x118(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rbx)
movq $0x0, 0x50(%rbx)
movups %xmm0, 0x78(%rbx)
movups %xmm0, 0x88(%rbx)
movq 0x60(%rbx), %rdi
callq 0x4261
movq 0x70(%rbx), %rdi
callq 0x4261
movq $0xa, 0x58(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/vm.c
// Function: ficlVmDestroy
void ficlVmDestroy(ficlVm *vm)
{
    if (vm)
    {
        ficlFree(vm->dataStack);
        ficlFree(vm->returnStack);
#if FICL_WANT_FLOAT
        ficlFree(vm->floatStack);
#endif
        ficlFree(vm);
    }

    return;
}

// Assembly:
testq %rdi, %rdi
je 0x53b4
pushq %rbx
movq %rdi, %rbx
movq 0x60(%rdi), %rdi
callq 0xb419
movq 0x68(%rbx), %rdi
callq 0xb419
movq 0x70(%rbx), %rdi
callq 0xb419
movq %rbx, %rdi
popq %rbx
jmp 0xb419
retq
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/vm.c
// Function: ficlVmThrowError
void ficlVmThrowError(ficlVm *vm, char *fmt, ...)
{
    va_list list;

    va_start(list, fmt);
    vsprintf(vm->pad, fmt, list);
    va_end(list);
	strcat(vm->pad, "\n");

    ficlVmErrorOut(vm, vm->pad);
    longjmp(*(vm->exceptionHandler), FICL_VM_STATUS_ERROR_EXIT);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %rdi
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x68d6
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rdx
movq %rdi, 0x10(%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
leaq 0x118(%rbx), %r14
movq %r14, %rdi
callq 0x32a0
movq %r14, %rdi
callq 0x30e0
movw $0xa, 0x118(%rbx,%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6c8b
movq 0x30(%rbx), %rdi
movl $0xfffffefc, %esi       # imm = 0xFFFFFEFC
callq 0x3280
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/vm.c
// Function: ficlVmOptimizeJumpToJump
static void ficlVmOptimizeJumpToJump(ficlVm *vm, ficlIp ip)
	{
	ficlIp destination;
	switch ((ficlInstruction)(*ip))
		{
		case ficlInstructionBranchParenWithCheck:
			*ip = (ficlWord *)ficlInstructionBranchParen;
			goto RUNTIME_FIXUP;

		case ficlInstructionBranch0ParenWithCheck:
			*ip = (ficlWord *)ficlInstructionBranch0Paren;
RUNTIME_FIXUP:
			ip++;
			destination = ip + *(int *)ip;
			switch ((ficlInstruction)*destination)
			{
				case ficlInstructionBranchParenWithCheck:
					/* preoptimize where we're jumping to */
					ficlVmOptimizeJumpToJump(vm, destination);
				case ficlInstructionBranchParen:
				{
					destination++;
					destination += *(int *)destination;
					*ip = (ficlWord *)(destination - ip);
					break;
				}
			}
		}
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rax
cmpq $0x30, %rax
je 0x694d
cmpq $0x32, %rax
jne 0x6992
movl $0x33, %eax
jmp 0x6952
movl $0x31, %eax
movq %rax, (%rbx)
movslq 0x8(%rbx), %rax
leaq (%rbx,%rax,8), %r14
addq $0x8, %r14
movq (%r14), %rax
cmpq $0x31, %rax
je 0x6978
cmpq $0x30, %rax
jne 0x6992
movq %r14, %rdi
callq 0x6930
addq $0x8, %rbx
movslq 0x8(%r14), %rax
leaq (%r14,%rax,8), %rax
addq $0x8, %rax
subq %rbx, %rax
sarq $0x3, %rax
movq %rax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/vm.c
// Function: ficlVmGetString
char *ficlVmGetString(ficlVm *vm, ficlCountedString *counted, char delimiter)
{
    ficlString s = ficlVmParseStringEx(vm, delimiter, 0);

    if (FICL_STRING_GET_LENGTH(s) > FICL_COUNTED_STRING_MAX)
    {
        FICL_STRING_SET_LENGTH(s, FICL_COUNTED_STRING_MAX);
    }

    strncpy(counted->text, FICL_STRING_GET_POINTER(s), FICL_STRING_GET_LENGTH(s));
    counted->text[FICL_STRING_GET_LENGTH(s)] = '\0';
    counted->length = (ficlUnsigned8)FICL_STRING_GET_LENGTH(s);

    return counted->text + FICL_STRING_GET_LENGTH(s) + 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edx, %esi
xorl %edx, %edx
callq 0x69e6
movl $0x100, %r14d           # imm = 0x100
cmpq %r14, %rax
cmovbq %rax, %r14
leaq 0x1(%rbx), %rdi
movq %rdx, %rsi
movq %r14, %rdx
callq 0x3060
leaq (%rbx,%r14), %rax
addq $0x2, %rax
movb $0x0, -0x1(%rax)
movb %r14b, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/vm.c
// Function: ficlVmParseStringEx
ficlString ficlVmParseStringEx(ficlVm *vm, char delimiter, char skipLeadingDelimiters)
{
    ficlString s;
    char *trace      = ficlVmGetInBuf(vm);
    char *stop      = ficlVmGetInBufEnd(vm);
    char c;

    if (skipLeadingDelimiters)
    {
        while ((trace != stop) && (*trace == delimiter))
            trace++;
    }

    FICL_STRING_SET_POINTER(s, trace);    /* mark start of text */

    for (c = *trace;
		(trace != stop) && (c != delimiter)
			&& (c != '\r') && (c != '\n');
		c = *++trace)
    {
        ;                   /* find next delimiter or end of line */
    }

                            /* set length of result */
    FICL_STRING_SET_LENGTH(s, trace - FICL_STRING_GET_POINTER(s));

    if ((trace != stop) && (*trace == delimiter))     /* gobble trailing delimiter */
        trace++;

    ficlVmUpdateTib(vm, trace);
    return s;
}

// Assembly:
movl %edx, %eax
movq 0x88(%rdi), %r8
movq 0x90(%rdi), %rcx
movq 0x80(%rdi), %rdx
addq %rcx, %rdx
testb %al, %al
sete %al
cmpq %r8, %rdx
sete %r9b
orb %al, %r9b
jne 0x6a21
cmpb %sil, (%rdx)
jne 0x6a21
incq %rdx
cmpq %r8, %rdx
jne 0x6a11
movq %r8, %rdx
movq %rdx, %rax
movq %rdx, %r9
cmpq %r8, %rdx
je 0x6a64
movq %rdx, %rax
movb (%rax), %r10b
cmpb %sil, %r10b
je 0x6a57
cmpb $0xa, %r10b
je 0x6a57
movzbl %r10b, %r9d
cmpl $0xd, %r9d
je 0x6a57
incq %rax
cmpq %r8, %rax
jne 0x6a2f
movq %r8, %rax
movq %r8, %r9
jmp 0x6a64
xorl %r9d, %r9d
cmpb %sil, %r10b
sete %r9b
addq %rax, %r9
subq %rdx, %rax
subq %rcx, %r9
movq %r9, 0x80(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/vm.c
// Function: ficlVmGetWord
ficlString ficlVmGetWord(ficlVm *vm)
{
    ficlString s = ficlVmGetWord0(vm);

    if (FICL_STRING_GET_LENGTH(s) == 0)
    {
        ficlVmThrow(vm, FICL_VM_STATUS_RESTART);
    }

    return s;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x6a95
testq %rax, %rax
jne 0x6a89
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
jne 0x6a8b
popq %rbx
retq
movl $0xfffffefe, %esi       # imm = 0xFFFFFEFE
callq 0x3280
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/vm.c
// Function: ficlVmGetWord0
ficlString ficlVmGetWord0(ficlVm *vm)
{
    char *trace      = ficlVmGetInBuf(vm);
    char *stop      = ficlVmGetInBufEnd(vm);
    ficlString s;
    ficlUnsigned length = 0;
    char c = 0;

    trace = ficlStringSkipSpace(trace, stop);
    FICL_STRING_SET_POINTER(s, trace);


	/* Please leave this loop this way; it makes Purify happier.  --lch */
    for (;;)
    {
		if (trace == stop)
			break;
		c = *trace;
		if (isspace((unsigned char)c))
			break;
        length++;
		trace++;
    }

    FICL_STRING_SET_LENGTH(s, length);

    if ((trace != stop) && isspace((unsigned char)c))    /* skip one trailing delimiter */
        trace++;

    ficlVmUpdateTib(vm, trace);

    return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x88(%rdi), %r15
movq 0x90(%rdi), %rdi
addq 0x80(%rbx), %rdi
movq %r15, %rsi
callq 0xb781
movq %rax, %r14
cmpq %r15, %rax
sete %bpl
je 0x6b0f
callq 0x3340
movq (%rax), %rcx
movzbl (%r14), %eax
testb $0x20, 0x1(%rcx,%rax,2)
jne 0x6b1a
movq %r15, %rdx
subq %r14, %rdx
movq %r14, %rsi
incq %rsi
xorl %r12d, %r12d
cmpq %r15, %rsi
sete %bpl
je 0x6b22
incq %r12
movzbl (%rsi), %eax
incq %rsi
testb $0x20, 0x1(%rcx,%rax,2)
je 0x6aee
decq %rsi
movq %rsi, %r15
jmp 0x6b25
xorl %r12d, %r12d
movq %r14, %r15
xorl %r13d, %r13d
jmp 0x6b29
xorl %r12d, %r12d
movq %r14, %r15
jmp 0x6b25
movq %rdx, %r12
movzbl %al, %r13d
testb %bpl, %bpl
jne 0x6b43
callq 0x3340
movq (%rax), %rax
movzwl (%rax,%r13,2), %eax
btl $0xd, %eax
adcq $0x0, %r15
subq 0x90(%rbx), %r15
movq %r15, 0x80(%rbx)
movq %r12, %rax
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/vm.c
// Function: ficlVmGetWordToPad
int ficlVmGetWordToPad(ficlVm *vm)
{
    ficlString s;
    char *pad = (char *)vm->pad;
    s = ficlVmGetWord(vm);

    if (FICL_STRING_GET_LENGTH(s) > FICL_PAD_SIZE)
        FICL_STRING_SET_LENGTH(s, FICL_PAD_SIZE);

    strncpy(pad, FICL_STRING_GET_POINTER(s), FICL_STRING_GET_LENGTH(s));
    pad[FICL_STRING_GET_LENGTH(s)] = '\0';
    return (int)(FICL_STRING_GET_LENGTH(s));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x6a72
movq %rax, %r14
movl $0x800, %eax            # imm = 0x800
cmpq %rax, %r14
cmovaeq %rax, %r14
leaq 0x118(%rbx), %rdi
movq %rdx, %rsi
movq %r14, %rdx
callq 0x3060
movb $0x0, 0x118(%rbx,%r14)
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/vm.c
// Function: ficlVmPushTib
void ficlVmPushTib(ficlVm *vm, char *text, ficlInteger nChars, ficlTIB *pSaveTib)
{
    if (pSaveTib)
    {
        *pSaveTib = vm->tib;
    }

    vm->tib.text = text;
    vm->tib.end = text + nChars;
    vm->tib.index = 0;
}

// Assembly:
testq %rcx, %rcx
je 0x6c13
movq 0x90(%rdi), %rax
movq %rax, 0x10(%rcx)
movups 0x80(%rdi), %xmm0
movups %xmm0, (%rcx)
movq %rsi, 0x90(%rdi)
addq %rsi, %rdx
movq %rdx, 0x88(%rdi)
movq $0x0, 0x80(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/vm.c
// Function: ficlVmQuit
void ficlVmQuit(ficlVm *vm)
{
    ficlStackReset(vm->returnStack);
    vm->restart    = 0;
    vm->ip          = NULL;
    vm->runningWord = NULL;
    vm->state       = FICL_VM_STATE_INTERPRET;
    vm->tib.text    = NULL;
    vm->tib.end     = NULL;
    vm->tib.index   = 0;
    vm->pad[0]      = '\0';
    vm->sourceId.i  = 0;
    return;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x68(%rdi), %rdi
callq 0x4261
movw $0x0, 0x38(%rbx)
movb $0x0, 0x118(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rbx)
movq $0x0, 0x50(%rbx)
movups %xmm0, 0x78(%rbx)
movups %xmm0, 0x88(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/vm.c
// Function: ficlVmThrowErrorVararg
void ficlVmThrowErrorVararg(ficlVm *vm, char *fmt, va_list list)
{
    vsprintf(vm->pad, fmt, list);
	/* well, we can try anyway, we're certainly not returning to our caller! */
    va_end(list);
	strcat(vm->pad, "\n");
	
    ficlVmErrorOut(vm, vm->pad);
    longjmp(*(vm->exceptionHandler), FICL_VM_STATUS_ERROR_EXIT);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x118(%rdi), %r14
movq %r14, %rdi
callq 0x32a0
movq %r14, %rdi
callq 0x30e0
movw $0xa, 0x118(%rbx,%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6c8b
movq 0x30(%rbx), %rdi
movl $0xfffffefc, %esi       # imm = 0xFFFFFEFC
callq 0x3280
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/vm.c
// Function: ficlVmEvaluate
int ficlVmEvaluate(ficlVm *vm, char *s)
{
    int returnValue;
    ficlCell id = vm->sourceId;
	ficlString string;
    vm->sourceId.i = -1;
	FICL_STRING_SET_FROM_CSTRING(string, s);
    returnValue = ficlVmExecuteString(vm, string);
    vm->sourceId = id;
    return returnValue;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x78(%rdi), %r15
movq $-0x1, 0x78(%rdi)
movq %rsi, %rdi
callq 0x30e0
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x6d08
movq %r15, 0x78(%r14)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/vm.c
// Function: ficlVmExecuteXT
int ficlVmExecuteXT(ficlVm *vm, ficlWord *pWord)
{
    int        except;
    jmp_buf    vmState;
    jmp_buf   *oldState;
    ficlWord *oldRunningWord;

    FICL_VM_ASSERT(vm, vm);
    FICL_VM_ASSERT(vm, vm->callback.system->exitInnerWord);
    
    /* 
    ** Save the runningword so that RESTART behaves correctly
    ** over nested calls.
    */
    oldRunningWord = vm->runningWord;
    /*
    ** Save and restore VM's jmp_buf to enable nested calls
    */
    oldState = vm->exceptionHandler;
    vm->exceptionHandler = &vmState; /* This has to come before the setjmp! */
    except = setjmp(vmState);

    if (except)
        ficlVmPopIP(vm);
    else
        ficlVmPushIP(vm, &(vm->callback.system->exitInnerWord));

    switch (except)
    {
    case 0:
        ficlVmExecuteWord(vm, pWord);
        ficlVmInnerLoop(vm, 0);
        break;

    case FICL_VM_STATUS_INNER_EXIT:
    case FICL_VM_STATUS_BREAK:
        break;

    case FICL_VM_STATUS_RESTART:
    case FICL_VM_STATUS_OUT_OF_TEXT:
    case FICL_VM_STATUS_USER_EXIT:
    case FICL_VM_STATUS_QUIT:
    case FICL_VM_STATUS_ERROR_EXIT:
    case FICL_VM_STATUS_ABORT:
    case FICL_VM_STATUS_ABORTQ:
    default:    /* user defined exit code?? */
        if (oldState)
        {
            vm->exceptionHandler = oldState;
            ficlVmThrow(vm, except);
        }
        break;
    }

    vm->exceptionHandler    = oldState;
    vm->runningWord = oldRunningWord;
    return (except);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r15
movq %rdi, %r14
movq 0x30(%rdi), %rbx
movq 0x48(%rdi), %r13
movq %rsp, %rdi
movq %rdi, 0x30(%r14)
callq 0x3180
movl %eax, %r12d
testl %eax, %eax
je 0x6ef0
movq 0x68(%r14), %rdi
callq 0x42f1
movq %rax, 0x40(%r14)
jmp 0x6f0a
movl $0xa0, %ebp
addq 0x18(%r14), %rbp
movq 0x40(%r14), %rsi
movq 0x68(%r14), %rdi
callq 0x436a
movq %rbp, 0x40(%r14)
movl %r12d, %ebp
cmpl $0xfffffefb, %r12d      # imm = 0xFFFFFEFB
je 0x6f42
cmpl $0xffffff00, %r12d      # imm = 0xFFFFFF00
je 0x6f42
testl %r12d, %r12d
jne 0x6f3d
movq %r14, %rdi
movq %r15, %rsi
callq 0x53ba
xorl %eax, %eax
movl %eax, %esi
movq %r14, %rdi
callq 0x53ba
jmp 0x6f42
testq %rbx, %rbx
jne 0x6f5e
movq %rbx, 0x30(%r14)
movq %r13, 0x48(%r14)
movl %ebp, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, 0x30(%r14)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x3280
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/vm.c
// Function: ficlVmParseNumber
int ficlVmParseNumber(ficlVm *vm, ficlString s)
{
    ficlInteger accumulator  = 0;
    char isNegative      = 0;
	char isDouble      = 0;
    unsigned base   = vm->base;
    char *trace        = FICL_STRING_GET_POINTER(s);
    ficlUnsigned8 length = (ficlUnsigned8)FICL_STRING_GET_LENGTH(s);
    unsigned c;
    unsigned digit;

    if (length > 1)
    {
        switch (*trace)
        {
        case '-':
            trace++;
            length--;
            isNegative = 1;
            break;
        case '+':
            trace++;
            length--;
            isNegative = 0;
            break;
        default:
            break;
        }
    }

    if ((length > 0) && (trace[length - 1] == '.')) /* detect & remove trailing decimal */
    {
        isDouble = 1;
        length--;
    }

    if (length == 0)        /* detect "+", "-", ".", "+." etc */
        return 0; /* false */

    while ((length--) && ((c = *trace++) != '\0'))
    {
        if (!isalnum(c))
            return 0; /* false */

        digit = c - '0';

        if (digit > 9)
            digit = tolower(c) - 'a' + 10;

        if (digit >= base)
            return 0; /* false */

        accumulator = accumulator * base + digit;
    }

	if (isDouble)		/* simple (required) DOUBLE support */
		ficlStackPushInteger(vm->dataStack, 0);

    if (isNegative)
        accumulator = -accumulator;

    ficlStackPushInteger(vm->dataStack, accumulator);
    if (vm->state == FICL_VM_STATE_COMPILE)
        ficlPrimitiveLiteralIm(vm);

    return 1; /* true */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movb $0x1, %cl
testb $-0x2, %sil
je 0x6fa4
movzbl (%r14), %eax
cmpl $0x2b, %eax
je 0x6f9e
cmpl $0x2d, %eax
jne 0x6fa4
incq %r14
decb %sil
xorl %r8d, %r8d
jmp 0x6fa7
incq %r14
decb %sil
movb $0x1, %r8b
testb %sil, %sil
je 0x6fc0
movzbl %sil, %eax
decl %eax
cmpb $0x2e, (%r14,%rax)
setne %cl
sete %al
subb %al, %sil
testb %sil, %sil
je 0x7080
movl %r8d, 0xc(%rsp)
movb %cl, 0xb(%rsp)
movq %rdi, 0x10(%rsp)
movq 0x58(%rdi), %r12
movl %r12d, %eax
movq %rax, 0x20(%rsp)
movzbl %sil, %eax
movq %rax, 0x18(%rsp)
xorl %ebx, %ebx
xorl %r13d, %r13d
xorl %ebp, %ebp
movsbl (%r14,%rbx), %r15d
testl %r15d, %r15d
je 0x703b
callq 0x3340
movq (%rax), %rax
movslq %r15d, %rcx
testb $0x8, (%rax,%rcx,2)
je 0x7082
leal -0x30(%r15), %eax
cmpl $0xa, %eax
jb 0x7022
movl %r15d, %edi
callq 0x3220
addl $-0x57, %eax
cmpl %r12d, %eax
jae 0x7082
imulq 0x20(%rsp), %r13
movl %eax, %eax
addq %rax, %r13
incq %rbx
cmpb %bl, 0x18(%rsp)
jne 0x6ff3
cmpb $0x0, 0xb(%rsp)
movq 0x10(%rsp), %rbx
jne 0x7052
movq 0x60(%rbx), %rdi
xorl %esi, %esi
callq 0x437b
movq %r13, %rsi
negq %rsi
cmpb $0x0, 0xc(%rsp)
cmovneq %r13, %rsi
movq 0x60(%rbx), %rdi
callq 0x437b
movl $0x1, %ebp
cmpq $0x1, 0x50(%rbx)
jne 0x7082
movq %rbx, %rdi
callq 0x718a
jmp 0x7082
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/primitives.c
// Function: ficlPrimitiveParseStepParen
void ficlPrimitiveParseStepParen(ficlVm *vm)
{
    ficlString s;
    ficlWord *word = vm->runningWord;
    ficlParseStep pStep = (ficlParseStep)(word->param->fn);

    FICL_STRING_SET_LENGTH(s, ficlStackPopInteger(vm->dataStack));
    FICL_STRING_SET_POINTER(s, ficlStackPopPointer(vm->dataStack));
    
    ficlStackPushInteger(vm->dataStack, (*pStep)(vm, s));

    return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x48(%rdi), %rax
movq 0x60(%rdi), %rdi
movq 0x28(%rax), %r12
callq 0x4311
movq %rax, %r14
movq 0x60(%rbx), %rdi
callq 0x42f1
movq 0x60(%rbx), %r15
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq *%r12
movslq %eax, %rsi
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x437b
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/primitives.c
// Function: ficlPrimitiveTick
void ficlPrimitiveTick(ficlVm *vm)
{
    ficlWord *word = NULL;
    ficlString name = ficlVmGetWord(vm);

    FICL_STACK_CHECK(vm->dataStack, 0, 1);

    word = ficlDictionaryLookup(ficlVmGetDictionary(vm), name);
    if (!word)
        ficlVmThrowError(vm, "%.*s not found", FICL_STRING_GET_LENGTH(name), FICL_STRING_GET_POINTER(name));
    ficlStackPushPointer(vm->dataStack, word);
    return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x6a72
movq %rax, %r14
movq %rdx, %r15
movq %rbx, %rdi
callq 0x699a
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0xc314
movq %rax, %r12
testq %rax, %rax
jne 0x722a
leaq 0x77bf(%rip), %rsi      # 0xe9d9
movq %rbx, %rdi
movq %r14, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x6879
movq 0x60(%rbx), %rdi
movq %r12, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x436a
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/primitives.c
// Function: ficlPrimitiveNumberSign
static void ficlPrimitiveNumberSign(ficlVm *vm)
{
    ficlCountedString *counted;
    ficl2Unsigned u;
    ficl2UnsignedQR uqr;

    FICL_STACK_CHECK(vm->dataStack, 2, 2);

    counted = FICL_POINTER_TO_COUNTED_STRING(vm->pad);
    u = ficlStackPop2Unsigned(vm->dataStack);
    uqr = ficl2UnsignedDivide(u, (ficlUnsigned16)(vm->base));
    counted->text[counted->length++] = ficlDigitToCharacter(uqr.remainder);
    ficlStackPush2Unsigned(vm->dataStack, uqr.quotient);
    return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x60(%rdi), %rdi
callq 0x433d
movzwl 0x58(%rbx), %ecx
movq %rsp, %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0xd7ee
movq (%r14), %r15
movq 0x8(%r14), %r12
movl 0x10(%r14), %edi
callq 0xb51c
movzbl 0x118(%rbx), %ecx
leal 0x1(%rcx), %edx
movb %dl, 0x118(%rbx)
movb %al, 0x119(%rbx,%rcx)
movq 0x60(%rbx), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x439d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/primitives.c
// Function: ficlPrimitiveNumberSignGreater
static void ficlPrimitiveNumberSignGreater(ficlVm *vm)
{
    ficlCountedString *counted;

    FICL_STACK_CHECK(vm->dataStack, 2, 2);

    counted = FICL_POINTER_TO_COUNTED_STRING(vm->pad);
    counted->text[counted->length] = 0;
    ficlStringReverse(counted->text);
    ficlStackDrop(vm->dataStack, 2);
    ficlStackPushPointer(vm->dataStack, counted->text);
    ficlStackPushUnsigned(vm->dataStack, counted->length);
    return;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x119(%rdi), %r14
movzbl 0x118(%rdi), %eax
movb $0x0, 0x119(%rdi,%rax)
movq %r14, %rdi
callq 0xb4d4
movq 0x60(%rbx), %rdi
movl $0x2, %esi
callq 0x4286
movq 0x60(%rbx), %rdi
movq %r14, %rsi
callq 0x436a
movq 0x60(%rbx), %rdi
movzbl 0x118(%rbx), %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x438c
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/primitives.c
// Function: ficlPrimitiveNumberSignS
static void ficlPrimitiveNumberSignS(ficlVm *vm)
{
    ficlCountedString *counted;
    ficl2Unsigned u;
    ficl2UnsignedQR uqr;

    FICL_STACK_CHECK(vm->dataStack, 2, 2);

    counted = FICL_POINTER_TO_COUNTED_STRING(vm->pad);
    u = ficlStackPop2Unsigned(vm->dataStack);

    do 
    {
        uqr = ficl2UnsignedDivide(u, (ficlUnsigned16)(vm->base));
        counted->text[counted->length++] = ficlDigitToCharacter(uqr.remainder);
		u = uqr.quotient;
    }
    while (FICL_2UNSIGNED_NOT_ZERO(u));

    ficlStackPush2Unsigned(vm->dataStack, u);
    return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x60(%rdi), %rdi
callq 0x433d
movq %rax, %r15
movq %rdx, %r12
movq %rsp, %r14
movzwl 0x58(%rbx), %ecx
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xd7ee
movq (%rsp), %r15
movq 0x8(%rsp), %r12
movl 0x10(%rsp), %edi
callq 0xb51c
movzbl 0x118(%rbx), %ecx
leal 0x1(%rcx), %edx
movb %dl, 0x118(%rbx)
movb %al, 0x119(%rbx,%rcx)
movq %r12, %rax
orq %r15, %rax
jne 0x9007
movq 0x60(%rbx), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x439d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/primitives.c
// Function: ficlPrimitivePlusLoopCoIm
static void ficlPrimitivePlusLoopCoIm(ficlVm *vm)
{
    ficlDictionary *dictionary = ficlVmGetDictionary(vm);

    ficlDictionaryAppendUnsigned(dictionary, ficlInstructionPlusLoopParen);
    resolveBackBranch(dictionary, vm, doTag);
    resolveAbsBranch(dictionary, vm, leaveTag);
    return;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x699a
movq %rax, %r14
movl $0x37, %esi
movq %rax, %rdi
callq 0xc094
leaq 0xee20(%rip), %rdx      # 0x17eb2
movq %r14, %rdi
movq %rbx, %rsi
callq 0xb05b
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xb092
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/primitives.c
// Function: ficlPrimitiveDot
static void ficlPrimitiveDot(ficlVm *vm)
{
    ficlCell c;

    FICL_STACK_CHECK(vm->dataStack, 1, 0);

    c = ficlStackPop(vm->dataStack);
    ficlLtoa((c).i, vm->pad, vm->base);
    strcat(vm->pad, " ");
    ficlVmTextOut(vm, vm->pad);
    return;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x60(%rdi), %rdi
callq 0x42e1
leaq 0x118(%rbx), %r14
movl 0x58(%rbx), %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0xb557
movq %r14, %rdi
callq 0x30e0
movw $0x20, 0x118(%rbx,%rax)
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x6c86
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/primitives.c
// Function: ficlPrimitiveDotQuoteCoIm
static void ficlPrimitiveDotQuoteCoIm(ficlVm *vm)
{
    ficlDictionary *dictionary = ficlVmGetDictionary(vm);
    ficlWord *pType = ficlSystemLookup(vm->callback.system, "type");
    FICL_VM_ASSERT(vm, pType);
    ficlDictionaryAppendUnsigned(dictionary, ficlInstructionStringLiteralParen);
    dictionary->here = FICL_POINTER_TO_CELL(ficlVmGetString(vm, (ficlCountedString *)dictionary->here, '\"'));
    ficlDictionaryAlign(dictionary);
    ficlDictionaryAppendCell(dictionary, FICL_LVALUE_TO_CELL(pType));
    return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x699a
movq %rax, %r14
movq 0x18(%rbx), %rdi
leaq 0x6174(%rip), %rsi      # 0xf287
callq 0x3a0f
movq %rax, %r15
movl $0x50, %esi
movq %r14, %rdi
callq 0xc094
movq (%r14), %rsi
movq %rbx, %rdi
movl $0x22, %edx
callq 0x69a3
movq %rax, (%r14)
movq %r14, %rdi
callq 0xc056
movq %r14, %rdi
movq %r15, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0xc079
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/primitives.c
// Function: ficlPrimitiveColon
static void ficlPrimitiveColon(ficlVm *vm)
{
    ficlDictionary *dictionary = ficlVmGetDictionary(vm);
    ficlString name = ficlVmGetWord(vm);

    vm->state = FICL_VM_STATE_COMPILE;
    markControlTag(vm, colonTag);
    ficlDictionaryAppendWord(dictionary, name, (ficlPrimitive)ficlInstructionColonParen, FICL_WORD_DEFAULT | FICL_WORD_SMUDGED);
#if FICL_WANT_LOCALS
    vm->callback.system->localsCount = 0;
#endif
    return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x699a
movq %rax, %r14
movq %rbx, %rdi
callq 0x6a72
movq %rax, %r15
movq %rdx, %r12
movq $0x1, 0x50(%rbx)
movq 0x60(%rbx), %rdi
leaq 0xed34(%rip), %rsi      # 0x17ebb
callq 0x436a
movl $0x46, %ecx
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movl $0x4, %r8d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xc134
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/primitives.c
// Function: ficlPrimitiveToNumber
static void ficlPrimitiveToNumber(ficlVm *vm)
{
    ficlUnsigned length;
    char *trace;
    ficl2Unsigned accumulator;
    ficlUnsigned base = vm->base;
    ficlUnsigned c;
    ficlUnsigned digit;

    FICL_STACK_CHECK(vm->dataStack,4,4);

    length = ficlStackPopUnsigned(vm->dataStack);
    trace = (char *)ficlStackPopPointer(vm->dataStack);
    accumulator = ficlStackPop2Unsigned(vm->dataStack);

    for (c = *trace; length > 0; c = *++trace, length--)
    {
        if (c < '0')
            break;

        digit = c - '0';

        if (digit > 9)
            digit = tolower(c) - 'a' + 10;
        /* 
        ** Note: following test also catches chars between 9 and a
        ** because 'digit' is unsigned! 
        */
        if (digit >= base)
            break;

        accumulator = ficl2UnsignedMultiplyAccumulate(accumulator, base, digit);
    }

    ficlStackPush2Unsigned(vm->dataStack, accumulator);
    ficlStackPushPointer(vm->dataStack, trace);
    ficlStackPushUnsigned(vm->dataStack, length);

    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movq 0x58(%rdi), %r13
movq 0x60(%rdi), %rdi
callq 0x4301
movq %rax, %rbx
movq 0x60(%r14), %rdi
callq 0x42f1
movq %rax, %r12
movq %r14, 0x8(%rsp)
movq 0x60(%r14), %rdi
callq 0x433d
movq %rax, %r15
movq %rdx, %r14
movb (%r12), %al
testq %rbx, %rbx
sete %cl
cmpb $0x30, %al
setb %dl
orb %cl, %dl
je 0x92bc
movq %r12, %rbp
movq %rbx, %r13
movq 0x8(%rsp), %rbx
movq 0x60(%rbx), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x439d
movq 0x60(%rbx), %rdi
movq %rbp, %rsi
callq 0x436a
movq 0x60(%rbx), %rdi
movq %r13, %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x438c
movq %r13, 0x10(%rsp)
movsbq %al, %rcx
addq $-0x30, %rcx
cmpq $0xa, %rcx
jb 0x92dd
movsbl %al, %edi
callq 0x3220
addl $-0x57, %eax
movslq %eax, %rcx
movq 0x10(%rsp), %rdx
cmpq %rdx, %rcx
jae 0x927c
movq %r15, %rdi
movq %r14, %rsi
callq 0xd683
movq %rax, %r15
movq %rdx, %r14
leaq 0x1(%r12), %rbp
leaq -0x1(%rbx), %r13
cmpq $0x1, %rbx
je 0x9282
movb 0x1(%r12), %al
movq %r13, %rbx
movq %rbp, %r12
cmpb $0x2f, %al
ja 0x92c1
jmp 0x9282
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/primitives.c
// Function: ficlPrimitiveAccept
static void ficlPrimitiveAccept(ficlVm *vm)
{
    ficlUnsigned size;
    char *address;

	ficlUnsigned length;
	char *trace;
	char *end;

    FICL_STACK_CHECK(vm->dataStack, 2, 1);

    trace = ficlVmGetInBuf(vm);
    end = ficlVmGetInBufEnd(vm);
    length = end - trace;
    if (length == 0)
        ficlVmThrow(vm, FICL_VM_STATUS_RESTART);

    /*
    ** Now we have something in the text buffer - use it 
    */
    size = ficlStackPopInteger(vm->dataStack);
    address = ficlStackPopPointer(vm->dataStack);

    length = (size < length) ? size : length;
    strncpy(address, trace, length);
    trace += length;
    ficlVmUpdateTib(vm, trace);
    ficlStackPushInteger(vm->dataStack, length);

    return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x88(%rdi), %rbx
movq 0x90(%rdi), %r15
addq 0x80(%rdi), %r15
subq %r15, %rbx
jne 0x935b
movq %r14, %rdi
movl $0xfffffefe, %esi       # imm = 0xFFFFFEFE
callq 0x6869
movq 0x60(%r14), %rdi
callq 0x4311
movq %rax, %r12
movq 0x60(%r14), %rdi
callq 0x42f1
cmpq %rbx, %r12
cmovbq %r12, %rbx
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x3060
addq %rbx, %r15
subq 0x90(%r14), %r15
movq %r15, 0x80(%r14)
movq 0x60(%r14), %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x437b
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/primitives.c
// Function: ficlPrimitiveCreate
static void ficlPrimitiveCreate(ficlVm *vm)
{
    ficlDictionary *dictionary = ficlVmGetDictionary(vm);
    ficlString name = ficlVmGetWord(vm);

    ficlDictionaryAppendWord(dictionary, name, (ficlPrimitive)ficlInstructionCreateParen, FICL_WORD_DEFAULT);
    ficlVmDictionaryAllotCells(vm, dictionary, 1);
    return;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x699a
movq %rax, %r14
movq %rbx, %rdi
callq 0x6a72
movl $0x4f, %ecx
movq %r14, %rdi
movq %rax, %rsi
xorl %r8d, %r8d
callq 0xc134
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x709f
// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/primitives.c
// Function: ficlPrimitiveDoCoIm
static void ficlPrimitiveDoCoIm(ficlVm *vm)
{
    ficlDictionary *dictionary = ficlVmGetDictionary(vm);

    ficlDictionaryAppendUnsigned(dictionary, ficlInstructionDoParen);
    /*
    ** Allot space for a pointer to the end
    ** of the loop - "leave" uses this...
    */
    markBranch(dictionary, vm, leaveTag);
    ficlDictionaryAppendUnsigned(dictionary, 0);
    /*
    ** Mark location of head of loop...
    */
    markBranch(dictionary, vm, doTag);

    return;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x699a
movq %rax, %r14
movl $0x4c, %esi
movq %rax, %rdi
callq 0xc094
movq 0x60(%rbx), %rdi
movq (%r14), %rsi
callq 0x436a
movq 0x60(%rbx), %rdi
leaq 0xe8fd(%rip), %rsi      # 0x17eb5
callq 0x436a
movq %r14, %rdi
xorl %esi, %esi
callq 0xc094
movq 0x60(%rbx), %rdi
movq (%r14), %rsi
callq 0x436a
movq 0x60(%rbx), %rdi
leaq 0xe8d4(%rip), %rsi      # 0x17eb2
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x436a