// File: /workspace/github_c_makefile_star2_O1/eiselekd[P]MinimalLisp/./l1.c
// Function: scan
v *
scan(ctx *cctx, char *m) {
    unsigned long scanquote = 0, scaneval = 0; int nextquote, quote = 0;
    char *lft;
    int c; v *cl = mkCons(0,0), *v, *n, *r;
    long val;
    while((c = *m)) {
        nextquote = scanquote & 1;
        switch (c) {
        case '.':
            break;
        case '(':
            cl = mkCons(0,cl);
            scanquote <<= 1;
	    scaneval <<= 1;
            scanquote |= quote; nextquote = quote;
            break;
        case ')':
            v = car(cl);
            cl = cdr(cl);
            r = nreverse(v);
            rplaca_q(cl,mkCons(r,car(cl)),quote && !(scaneval&1));
            quote = !(scaneval&1);
	    scaneval >>= 1;
	    scanquote >>= 1;
	    nextquote = scanquote & 1;
            break;
        case '0': case '1': case '2': case '3': case '4': case '5':
        case '6': case '7': case '8': case '9': 
        num:
            val = strtol(m, &m, 0); m--;
            rplaca_q(cl,mkCons(mkInt(val),car(cl)),quote);
            break;
        case ' ': case '\n': case '\t': 
            break;
        case '\'':
            nextquote = 1;
            break;
        case ',':
            nextquote = 0;
            break;
        case '+': case '-': 
            if (!isdigit(m[1])) {
                goto sym;
            } else {
                goto num;
            }
            break;
        default:
#           define SPECIAL "<=!>"
            if (isalpha(c) || strchr(SPECIAL,c)) {
            sym:
                lft = m;
                while (isalnum(c = *++m) || strchr(SPECIAL,c));
                v = unique(cctx, lft, m-lft); m--;
                rplaca_q(cl,mkCons(v,car(cl)),quote);
            } else {
                error("Invalid char '%c'\n", c);
            }
            break;
        }
	scaneval |= (quote?0:1);
        quote = nextquote;
        m++;
    }
    v = sreverse(car(cl));
    return v;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, -0x50(%rbp)
movq %rsi, -0x40(%rbp)
movl $0x18, %edi
callq 0x10e0
andb $-0x10, (%rax)
xorps %xmm0, %xmm0
movq %rax, -0x38(%rbp)
movups %xmm0, 0x8(%rax)
movq -0x40(%rbp), %r13
movb (%r13), %al
testb %al, %al
je 0x2ab3
movq $0x0, -0x48(%rbp)
xorl %r12d, %r12d
xorl %r14d, %r14d
movq -0x48(%rbp), %rcx
movl %ecx, %r15d
andl $0x1, %r15d
movzbl %al, %ecx
addl $-0x9, %ecx
cmpl $0x30, %ecx
ja 0x291c
leaq 0xb7dd(%rip), %rdx      # 0xe024
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movl %r15d, -0x2c(%rbp)
movq %r14, %r15
movq %r13, %rdi
leaq -0x40(%rbp), %rsi
xorl %edx, %edx
callq 0x10c0
movq %rax, %r13
decq -0x40(%rbp)
movl $0x18, %edi
callq 0x10e0
movq %rax, %rbx
movl (%rax), %eax
andl $-0x10, %eax
incl %eax
movl %eax, (%rbx)
movq %r13, 0x8(%rbx)
movq -0x38(%rbp), %r13
testq %r13, %r13
je 0x2895
movq 0x8(%r13), %r14
jmp 0x2898
xorl %r14d, %r14d
movl $0x18, %edi
callq 0x10e0
andb $-0x10, (%rax)
movq %rbx, 0x8(%rax)
movq %r14, 0x10(%rax)
testq %r13, %r13
je 0x28b6
movq %rax, 0x8(%r13)
movq %r15, %r14
testl %r14d, %r14d
je 0x28c7
orb $-0x80, (%rax)
movl $0x1, %r14d
movl -0x2c(%rbp), %r15d
xorl %eax, %eax
testl %r14d, %r14d
sete %al
orq %rax, %r12
movq -0x40(%rbp), %rax
leaq 0x1(%rax), %r13
movq %r13, -0x40(%rbp)
movb 0x1(%rax), %al
movl %r15d, %r14d
testb %al, %al
jne 0x2826
jmp 0x2ab3
callq 0x1180
movq (%rax), %rax
movsbq 0x1(%r13), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x2850
jmp 0x294d
xorl %r15d, %r15d
jmp 0x28cb
movl $0x1, %r15d
jmp 0x28cb
movsbl %al, %ebx
callq 0x1180
movq (%rax), %rax
movslq %ebx, %rcx
testb $0x4, 0x1(%rax,%rcx,2)
jne 0x294d
movl $0x5, %edx
leaq 0xb846(%rip), %rdi      # 0xe183
movl %ebx, %esi
callq 0x1090
testq %rax, %rax
je 0x2b05
movl %r15d, -0x2c(%rbp)
movq %r14, -0x58(%rbp)
callq 0x1180
movq (%rax), %r15
movq -0x40(%rbp), %r14
movl %r14d, %ebx
subl %r13d, %ebx
incl %ebx
incq %r14
movsbq (%r14), %rsi
testb $0x8, (%r15,%rsi,2)
jne 0x2967
movl $0x5, %edx
leaq 0xb800(%rip), %rdi      # 0xe183
callq 0x1090
testq %rax, %rax
jne 0x2967
movq %r14, -0x40(%rbp)
movq -0x50(%rbp), %rdi
movq %r13, %rsi
movl %ebx, %edx
callq 0x25f6
movq %rax, %rbx
decq %r14
movq %r14, -0x40(%rbp)
movq -0x38(%rbp), %r15
testq %r15, %r15
je 0x2a04
movq 0x8(%r15), %r14
jmp 0x2a07
movl $0x18, %edi
callq 0x10e0
andb $-0x10, (%rax)
movq $0x0, 0x8(%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x48(%rbp), %rdx
addq %rdx, %rdx
addq %r12, %r12
movl %r14d, %ecx
orq %rcx, %rdx
movq %rdx, -0x48(%rbp)
movq %rax, -0x38(%rbp)
movl %r14d, %r15d
jmp 0x28cb
movq -0x38(%rbp), %r13
testq %r13, %r13
je 0x2a32
movq 0x8(%r13), %rbx
jmp 0x2a34
xorl %r14d, %r14d
movl $0x18, %edi
callq 0x10e0
andb $-0x10, (%rax)
movq %rbx, 0x8(%rax)
movq %r14, 0x10(%rax)
testq %r15, %r15
je 0x2a25
movq %rax, 0x8(%r15)
movq %r15, -0x38(%rbp)
movq -0x58(%rbp), %r14
jmp 0x28b9
xorl %ebx, %ebx
testq %r13, %r13
je 0x2a3f
movq 0x10(%r13), %r13
jmp 0x2a42
xorl %r13d, %r13d
movq %r14, %r15
movq %rbx, %rdi
callq 0x2714
testq %r13, %r13
je 0x2a58
movq 0x8(%r13), %r14
jmp 0x2a5b
xorl %r14d, %r14d
movl $0x18, %edi
callq 0x10e0
andb $-0x10, (%rax)
testl %r15d, %r15d
sete %cl
movq %rbx, 0x8(%rax)
movq %r14, 0x10(%rax)
testq %r13, %r13
je 0x2a7f
movq %rax, 0x8(%r13)
movq %r13, -0x38(%rbp)
orb %r12b, %cl
testb $0x1, %cl
jne 0x2a8e
orb $-0x80, (%rax)
movl %r12d, %r14d
andl $0x1, %r14d
xorl $0x1, %r14d
shrq %r12
movq -0x48(%rbp), %rcx
shrq %rcx
movq %rcx, -0x48(%rbp)
movl %ecx, %r15d
andl $0x1, %r15d
jmp 0x28cb
movq -0x38(%rbp), %rax
testq %rax, %rax
je 0x2ac2
movq 0x8(%rax), %rcx
jmp 0x2ac4
xorl %ecx, %ecx
testq %rcx, %rcx
je 0x2aef
movq 0x10(%rcx), %rdx
movq $0x0, 0x10(%rcx)
testq %rdx, %rdx
je 0x2af3
movq %rdx, %rax
movq 0x10(%rdx), %rdx
movq %rcx, 0x10(%rax)
movq %rax, %rcx
testq %rdx, %rdx
jne 0x2ada
jmp 0x2af6
xorl %eax, %eax
jmp 0x2af6
movq %rcx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb67c(%rip), %rdi      # 0xe188
movl %ebx, %esi
xorl %eax, %eax
callq 0x130c