// File: /workspace/github_c_makefile_star2_O0/hoobaa[P]ficl/tools.c
// Function: ficlPrimitiveWords
static void ficlPrimitiveWords(ficlVm *vm)
{
    ficlDictionary *dictionary = ficlVmGetDictionary(vm);
    ficlHash *hash = dictionary->wordlists[dictionary->wordlistCount - 1];
    ficlWord *wp;
    int nChars = 0;
    int len;
    unsigned i;
    int nWords = 0;
    char *cp;
    char *pPad = vm->pad;

    for (i = 0; i < hash->size; i++)
    {
        for (wp = hash->table[i]; wp != NULL; wp = wp->link, nWords++)
        {
            if (wp->length == 0) /* ignore :noname defs */
                continue;

            cp = wp->name;
            nChars += sprintf(pPad + nChars, "%s", cp);

            if (nChars > 70)
            {
                pPad[nChars++] = '\n';
                pPad[nChars] = '\0';
                nChars = 0;
                ficlVmTextOut(vm, pPad);
            }
            else
            {
                len = nCOLWIDTH - nChars % nCOLWIDTH;
                while (len-- > 0)
                    pPad[nChars++] = ' ';
            }

            if (nChars > 70)
            {
                pPad[nChars++] = '\n';
                pPad[nChars] = '\0';
                nChars = 0;
                ficlVmTextOut(vm, pPad);
            }
        }
    }

    if (nChars > 0)
    {
        pPad[nChars++] = '\n';
        pPad[nChars] = '\0';
        nChars = 0;
        ficlVmTextOut(vm, pPad);
    }

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8f80
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0xa8(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq 0x28(%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x8(%rbp), %rax
addq $0x118, %rax            # imm = 0x118
movq %rax, -0x40(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x5a59
movq -0x18(%rbp), %rax
movl -0x2c(%rbp), %ecx
movq 0x18(%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x5a49
movq -0x20(%rbp), %rax
movzbl 0xb(%rax), %eax
cmpl $0x0, %eax
jne 0x5946
jmp 0x5a30
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %rdi
movslq -0x24(%rbp), %rax
addq %rax, %rdi
movq -0x38(%rbp), %rdx
leaq 0x10cd8(%rip), %rsi     # 0x16640
movb $0x0, %al
callq 0x32d0
addl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
cmpl $0x46, -0x24(%rbp)
jle 0x59b3
movq -0x40(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x24(%rbp)
movslq %ecx, %rcx
movb $0xa, (%rax,%rcx)
movq -0x40(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl $0x0, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x95e0
jmp 0x59f2
movl -0x24(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl $0x8, %eax
subl %edx, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x28(%rbp)
cmpl $0x0, %eax
jle 0x59f0
movq -0x40(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x24(%rbp)
movslq %ecx, %rcx
movb $0x20, (%rax,%rcx)
jmp 0x59c8
jmp 0x59f2
cmpl $0x46, -0x24(%rbp)
jle 0x5a2e
movq -0x40(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x24(%rbp)
movslq %ecx, %rcx
movb $0xa, (%rax,%rcx)
movq -0x40(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl $0x0, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x95e0
jmp 0x5a30
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x5929
jmp 0x5a4b
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x5909
cmpl $0x0, -0x24(%rbp)
jle 0x5a95
movq -0x40(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x24(%rbp)
movslq %ecx, %rcx
movb $0xa, (%rax,%rcx)
movq -0x40(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl $0x0, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x95e0
movq -0x8(%rbp), %rdi
addq $0x118, %rdi            # imm = 0x118
movl -0x30(%rbp), %edx
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
addq $0xb8, %rax
subq %rax, %rcx
sarq $0x3, %rcx
movq -0x10(%rbp), %rax
movl 0xac(%rax), %r8d
leaq 0xfa0e(%rip), %rsi      # 0x154db
movb $0x0, %al
callq 0x32d0
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x118, %rsi            # imm = 0x118
callq 0x95e0
addq $0x40, %rsp
popq %rbp
retq
nop