// File: /workspace/github_c_makefile_star2_O0/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
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x168(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x6be0
cmpq $0x0, -0x18(%rbp)
je 0x6bc4
movq -0x10(%rbp), %rax
movl 0x170(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x168(%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x6d5e
movq -0x10(%rbp), %rdi
callq 0xefc0
movq %rax, -0x30(%rbp)
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
callq 0x1040
movl %eax, -0x5c(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0xf170
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x6d21
movq -0x50(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5f, %eax
jne 0x6c81
cmpl $0x1, -0x5c(%rbp)
jle 0x6c81
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
addq $0x1, %rsi
movl -0x5c(%rbp), %edx
subl $0x1, %edx
callq 0x2f70
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
je 0x6c7f
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0xf170
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0x6c7d
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
jmp 0x6d49
jmp 0x6c7f
jmp 0x6c81
movq -0x50(%rbp), %rax
movsbl (%rax), %esi
leaq 0x98b8(%rip), %rdi      # 0x10547
callq 0x1050
cmpq $0x0, %rax
je 0x6cbb
callq 0x1150
movq (%rax), %rax
movq -0x50(%rbp), %rcx
movsbl 0x1(%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
jne 0x6cdb
callq 0x1150
movq (%rax), %rax
movq -0x50(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x6d0e
movq -0x50(%rbp), %rdi
leaq -0x48(%rbp), %rsi
xorl %edx, %edx
callq 0x1110
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
movslq -0x5c(%rbp), %rcx
addq %rcx, %rax
cmpq -0x48(%rbp), %rax
jne 0x6d0c
movq -0x58(%rbp), %rdi
callq 0x1380
movq %rax, -0x30(%rbp)
jmp 0x6d0e
cmpq $0x0, -0x18(%rbp)
je 0x6d1f
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
jmp 0x6d56
cmpq $0x0, -0x18(%rbp)
je 0x6d47
movq -0x28(%rbp), %rax
movl (%rax), %edx
shrl $0x4, %edx
andl $0x8, %edx
xorl %ecx, %ecx
movl $0x1, %eax
cmpl $0x0, %edx
cmovnel %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
jmp 0x6d49
movq -0x28(%rbp), %rdi
callq 0x1520
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)