// File: /workspace/github_c_makefile_star2_O1/eiselekd[P]MinimalLisp/./f1.c
// Function: next
v *
next(fctx *cctx, int *imm) 
{
    char *b;
    v *w= 0, *s, *s2, *nm; char *e, *n; long v; int l;
    if ((s = cctx->peek)) {
        if(imm)
            *imm = cctx->peek_imm; 
        cctx->peek = 0;
        return s;
    }
    nm = s = word(cctx);
    n = str(s); l = strlen(n); 
    if (!(w = find(cctx, s))) {
        if (n[0] == '_' && l > 1) { /* search for maybe immediate version _<name> but return non-imm */
            if ((s2 = unique(&cctx->lctx, n+1, l-1))) {
                if ((w = find(cctx, s2))) {
                    *imm = 0;
                    goto doword;
                }
            }
        }
        if ((strchr("+-",n[0]) && isdigit(n[1])) ||
            isdigit(n[0])) {
            v = (long)strtoul(n, &e, 0);
            if (n + l == e) {
                s = mkInt(v);
            }
        }
        FPRINTF(FDBG, ">"); PRINT(LCTX,FDBG, s); FPRINTF(FDBG, "\n");
        if (imm)
            *imm = 0;
    } else {
        if (imm)
            *imm = FOP_IMMEDIATE(w);
        doword:
        s = cdr(w);
        FPRINTF(FDBG, ">["); PRINT(LCTX,FDBG, nm); FPRINTF(FDBG, "]\n");
    }
    return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r13
movq 0x168(%rdi), %r14
testq %r14, %r14
je 0x578e
testq %rbx, %rbx
je 0x577e
movl 0x170(%r13), %eax
movl %eax, (%rbx)
movq $0x0, 0x168(%r13)
jmp 0x58d5
movq %r13, %rdi
callq 0xd225
movq %rax, %r14
movq 0x8(%rax), %r15
movq %r15, %rdi
callq 0x1050
movq %rax, %r12
movq 0x148(%r13), %rax
testq %rax, %rax
je 0x57d0
movq 0x8(%rax), %rcx
testq %rcx, %rcx
je 0x57c3
movq 0x8(%rcx), %rdx
jmp 0x57c5
xorl %edx, %edx
cmpq %r14, %rdx
je 0x57d2
movq 0x10(%rax), %rax
jmp 0x57af
xorl %ecx, %ecx
testq %rcx, %rcx
je 0x57ef
testq %rbx, %rbx
je 0x57e6
movl (%rcx), %edx
shrl $0x7, %edx
andl $0x1, %edx
movl %edx, (%rbx)
movq 0x10(%rcx), %r14
jmp 0x58d5
cmpb $0x5f, (%r15)
sete %al
cmpl $0x2, %r12d
setge %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x584b
leaq 0x1(%r15), %rsi
leal -0x1(%r12), %edx
movq %r13, %rdi
callq 0x25f6
testq %rax, %rax
je 0x584b
movq 0x148(%r13), %rsi
xorl %edx, %edx
testq %rsi, %rsi
je 0x5844
movq 0x8(%rsi), %rcx
testq %rcx, %rcx
je 0x5837
movq 0x8(%rcx), %rdi
jmp 0x5839
xorl %edi, %edi
cmpq %rax, %rdi
je 0x5846
movq 0x10(%rsi), %rsi
jmp 0x5823
xorl %ecx, %ecx
testq %rcx, %rcx
jne 0x57e4
movsbl (%r15), %r13d
leaq 0x8b7f(%rip), %rdi      # 0xe3d5
movl $0x3, %edx
movl %r13d, %esi
callq 0x1090
testq %rax, %rax
je 0x587c
callq 0x1180
movq (%rax), %rax
movsbq 0x1(%r15), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x588f
movslq %r13d, %r13
callq 0x1180
movq (%rax), %rax
testb $0x8, 0x1(%rax,%r13,2)
je 0x58ca
leaq -0x30(%rbp), %r13
movq %r15, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x1130
movslq %r12d, %rcx
addq %r15, %rcx
cmpq (%r13), %rcx
jne 0x58ca
movl $0x18, %edi
movq %rax, %r15
callq 0x10e0
movq %rax, %r14
movl (%rax), %eax
andl $-0x10, %eax
incl %eax
movl %eax, (%r14)
movq %r15, 0x8(%r14)
testq %rbx, %rbx
je 0x58d5
movl $0x0, (%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq