// File: /workspace/github_c_makefile_star2_O1/hoobaa[P]ficl/dictionary.c
// Function: ficlDictionarySee
void ficlDictionarySee(ficlDictionary *dictionary, ficlWord *word, ficlCallback *callback)
{
    char *trace;
    ficlCell *cell = word->param;
    ficlCell *param0 = cell;
    char buffer[128];

    for (; cell->i != ficlInstructionSemiParen; cell++)
    {
        ficlWord *word = (ficlWord *)(cell->p);

        trace = buffer;
        if ((void *)cell == (void *)buffer)
            *trace++ = '>';
        else
            *trace++ = ' ';
        trace += sprintf(trace, "%3d   ", cell - param0);
        
        if (ficlDictionaryIsAWord(dictionary, word))
        {
            ficlWordKind kind = ficlWordClassify(word);
            ficlCell c, c2;

            switch (kind)
            {
            case FICL_WORDKIND_INSTRUCTION:
                sprintf(trace, "%s (instruction %ld)", ficlDictionaryInstructionNames[(long)word], (long)word);
                break;
            case FICL_WORDKIND_INSTRUCTION_WITH_ARGUMENT:
                c = *++cell;
                sprintf(trace, "%s (instruction %ld), with argument %ld (%#lx)", ficlDictionaryInstructionNames[(long)word], (long)word, c.i, c.u);
                break;
            case FICL_WORDKIND_INSTRUCTION_WORD:
                sprintf(trace, "%s :: executes %s (instruction word %ld)", word->name, ficlDictionaryInstructionNames[(long)word->code], (long)word->code);
                break;
            case FICL_WORDKIND_LITERAL:
                c = *++cell;
                if (ficlDictionaryIsAWord(dictionary, c.p) && (c.i >= ficlInstructionLast))
                {
                    ficlWord *word = (ficlWord *)c.p;
                    sprintf(trace, "%.*s ( %#lx literal )", 
                        word->length, word->name, c.u);
                }
                else
                    sprintf(trace, "literal %ld (%#lx)", c.i, c.u);
                break;
            case FICL_WORDKIND_2LITERAL:
                c = *++cell;
                c2 = *++cell;
                sprintf(trace, "2literal %d %d (%#lx %#lx)", c2.i, c.i, c2.u, c.u);
                break;
#if FICL_WANT_FLOAT
            case FICL_WORDKIND_FLITERAL:
                c = *++cell;
                sprintf(trace, "fliteral %f (%#lx)", c.f, c.u);
                break;
#endif /* FICL_WANT_FLOAT */
            case FICL_WORDKIND_STRING_LITERAL:
                {
                    ficlCountedString *counted = (ficlCountedString *)(void *)++cell;
                    cell = (ficlCell *)ficlAlignPointer(counted->text + counted->length + 1) - 1;
                    sprintf(trace, "s\" %.*s\"", counted->length, counted->text);
                }
                break;
            case FICL_WORDKIND_CSTRING_LITERAL:
                {
                    ficlCountedString *counted = (ficlCountedString *)(void *)++cell;
                    cell = (ficlCell *)ficlAlignPointer(counted->text + counted->length + 1) - 1;
                    sprintf(trace, "c\" %.*s\"", counted->length, counted->text);
                }
                break;
            case FICL_WORDKIND_BRANCH0:
                c = *++cell;
                sprintf(trace, "branch0 %d", cell + c.i - param0);
                break;                                                           
            case FICL_WORDKIND_BRANCH:
                c = *++cell;
                sprintf(trace, "branch %d",     cell + c.i - param0);
                break;

            case FICL_WORDKIND_QDO:
                c = *++cell;
                sprintf(trace, "?do (leave %d)",  (ficlCell *)c.p - param0);
                break;
            case FICL_WORDKIND_DO:
                c = *++cell;
                sprintf(trace, "do (leave %d)", (ficlCell *)c.p - param0);
                break;
            case FICL_WORDKIND_LOOP:
                c = *++cell;
                sprintf(trace, "loop (branch %d)", cell + c.i - param0);
                break;
            case FICL_WORDKIND_OF:
                c = *++cell;
                sprintf(trace, "of (branch %d)",      cell + c.i - param0);
                break;
            case FICL_WORDKIND_PLOOP:
                c = *++cell;
                sprintf(trace, "+loop (branch %d)", cell + c.i - param0);
                break;
            default:
                sprintf(trace, "%.*s", word->length, word->name);
                break;
            }
 
        }
        else /* probably not a word - punt and print value */
        {
            sprintf(trace, "%ld ( %#lx )", cell->i, cell->u);
        }

        ficlCallbackTextOut(callback, buffer);
        ficlCallbackTextOut(callback, "\n");
    }

    ficlCallbackTextOut(callback, ";\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, %rbx
movq %rdi, 0x8(%rsp)
cmpq $0x2b, 0x28(%rsi)
jne 0xc8a1
leaq 0x2f1b(%rip), %rsi      # 0xf7a2
movq %rbx, %rdi
callq 0xb9d4
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %r12
addq $0x28, %r12
leaq 0x10(%rsp), %r15
movq %r12, (%rsp)
movq (%r12), %r13
movq %r15, %r14
cmpq %r15, %r12
movl $0x20, %eax
movl $0x3e, %ecx
cmovel %ecx, %eax
movb %al, 0x10(%rsp)
movq %r12, %rdx
subq (%rsp), %rdx
sarq $0x3, %rdx
leaq 0x11(%rsp), %r15
movq %r15, %rdi
leaq 0x2d88(%rip), %rsi      # 0xf66e
xorl %eax, %eax
callq 0x32f0
movslq %eax, %rbp
addq %r15, %rbp
movq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0xc75d
testl %eax, %eax
je 0xc953
movq %r13, %rdi
callq 0xbab6
cmpl $0x16, %eax
movq %r14, %r15
ja 0xca7c
movl %eax, %eax
leaq 0x2c8b(%rip), %rcx      # 0xf5ac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x8(%r12), %r13
movq 0x8(%r12), %rax
leaq (%r12,%rax,8), %rdx
addq $0x8, %rdx
subq (%rsp), %rdx
sarq $0x3, %rdx
movq %rbp, %rdi
leaq 0x2e08(%rip), %rsi      # 0xf756
jmp 0xcc02
movq (%r12), %rcx
movq %rbp, %rdi
leaq 0x2e34(%rip), %rsi      # 0xf795
movq %rcx, %rdx
xorl %eax, %eax
callq 0x32f0
movq %r14, %r15
jmp 0xcc0c
movq 0x10(%r13), %rdx
movq 0x18(%r13), %r8
leaq 0xb56e(%rip), %rax      # 0x17ef0
movq (%rax,%r8,8), %rcx
movq %rbp, %rdi
leaq 0x2d29(%rip), %rsi      # 0xf6b9
xorl %eax, %eax
callq 0x32f0
jmp 0xcc0c
leaq 0x9(%r12), %r14
movzbl 0x8(%r12), %eax
leaq (%r12,%rax), %rdi
addq $0xa, %rdi
callq 0xb4c0
movq %rax, %r13
addq $-0x8, %r13
movzbl 0x8(%r12), %edx
movq %rbp, %rdi
leaq 0x2d6e(%rip), %rsi      # 0xf739
jmp 0xca6d
leaq 0xb519(%rip), %rax      # 0x17ef0
movq (%rax,%r13,8), %rdx
movq %rbp, %rdi
leaq 0x2c90(%rip), %rsi      # 0xf675
jmp 0xcc49
movq 0x8(%r12), %rdx
addq $0x8, %r12
subq (%rsp), %rdx
sarq $0x3, %rdx
movq %rbp, %rdi
leaq 0x2d5c(%rip), %rsi      # 0xf761
jmp 0xcbd5
leaq 0x8(%r12), %r13
movl 0x8(%r12), %eax
movl 0xc(%r12), %edx
movd %eax, %xmm0
cvtss2sd %xmm0, %xmm0
shlq $0x20, %rdx
orq %rax, %rdx
movq %rbp, %rdi
leaq 0x2cf4(%rip), %rsi      # 0xf726
movb $0x1, %al
callq 0x32f0
jmp 0xcc09
leaq 0x9(%r12), %r14
movzbl 0x8(%r12), %eax
leaq (%r12,%rax), %rdi
addq $0xa, %rdi
callq 0xb4c0
movq %rax, %r13
addq $-0x8, %r13
movzbl 0x8(%r12), %edx
movq %rbp, %rdi
leaq 0x2cd5(%rip), %rsi      # 0xf742
movq %r14, %rcx
xorl %eax, %eax
callq 0x32f0
jmp 0xcc09
movzbl 0xb(%r13), %edx
movq 0x10(%r13), %rcx
movq %rbp, %rdi
leaq 0x2d01(%rip), %rsi      # 0xf790
xorl %eax, %eax
callq 0x32f0
jmp 0xcc0c
leaq 0x8(%r12), %r13
movq 0x8(%r12), %rax
leaq (%r12,%rax,8), %rdx
addq $0x8, %rdx
subq (%rsp), %rdx
sarq $0x3, %rdx
movq %rbp, %rdi
leaq 0x2c8c(%rip), %rsi      # 0xf74b
jmp 0xcc02
leaq 0x8(%r12), %r13
movq 0x8(%r12), %rax
leaq (%r12,%rax,8), %rdx
addq $0x8, %rdx
subq (%rsp), %rdx
sarq $0x3, %rdx
movq %rbp, %rdi
leaq 0x2c97(%rip), %rsi      # 0xf77f
jmp 0xcc02
leaq 0x8(%r12), %r13
movq 0x8(%r12), %rax
leaq (%r12,%rax,8), %rdx
addq $0x8, %rdx
subq (%rsp), %rdx
sarq $0x3, %rdx
movq %rbp, %rdi
leaq 0x2c5e(%rip), %rsi      # 0xf76f
jmp 0xcc02
leaq 0xb3d3(%rip), %rax      # 0x17ef0
movq (%rax,%r13,8), %rdx
movq 0x8(%r12), %r8
addq $0x8, %r12
movq %rbp, %rdi
leaq 0x2b56(%rip), %rsi      # 0xf68a
movq %r13, %rcx
movq %r8, %r9
xorl %eax, %eax
callq 0x32f0
jmp 0xcc0c
movq 0x8(%r12), %r13
addq $0x8, %r12
movq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0xc75d
testl %eax, %eax
sete %al
cmpq $0xb4, %r13
setl %cl
orb %al, %cl
jne 0xcc3c
movzbl 0xb(%r13), %edx
movq 0x10(%r13), %rcx
movq %rbp, %rdi
leaq 0x2b5c(%rip), %rsi      # 0xf6e2
movq %r13, %r8
xorl %eax, %eax
callq 0x32f0
jmp 0xcc0c
leaq 0x10(%r12), %r13
movq 0x8(%r12), %rcx
movq 0x10(%r12), %rdx
movq %rbp, %rdi
leaq 0x2b60(%rip), %rsi      # 0xf70b
movq %rdx, %r8
movq %rcx, %r9
xorl %eax, %eax
callq 0x32f0
jmp 0xcc09
movq 0x8(%r12), %rdx
addq $0x8, %r12
subq (%rsp), %rdx
sarq $0x3, %rdx
movq %rbp, %rdi
leaq 0x2b8b(%rip), %rsi      # 0xf760
xorl %eax, %eax
callq 0x32f0
jmp 0xcc0c
leaq 0x8(%r12), %r13
movq 0x8(%r12), %rax
leaq (%r12,%rax,8), %rdx
addq $0x8, %rdx
subq (%rsp), %rdx
sarq $0x3, %rdx
movq %rbp, %rdi
leaq 0x2b7c(%rip), %rsi      # 0xf77e
xorl %eax, %eax
callq 0x32f0
movq %r13, %r12
movq %rbx, %rdi
movq %r15, %rsi
callq 0xb9d4
movq %rbx, %rdi
leaq 0x1748(%rip), %rsi      # 0xe369
callq 0xb9d4
cmpq $0x2b, 0x8(%r12)
leaq 0x8(%r12), %r12
jne 0xc8b1
jmp 0xc880
movq %rbp, %rdi
leaq 0x2ab2(%rip), %rsi      # 0xf6f8
movq %r13, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x32f0
jmp 0xcc0c