// File: /workspace/github_c_makefile_star2_O3/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 %rsi, %r13
movq %rdi, -0x58(%rbp)
movq %rsi, -0x50(%rbp)
movl $0x18, %edi
callq 0x10e0
movl $0x0, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movb (%r13), %sil
testb %sil, %sil
je 0x2aa2
movq %rax, -0x30(%rbp)
xorl %edi, %edi
xorl %r12d, %r12d
xorl %r14d, %r14d
movl %edi, %eax
andl $0x1, %eax
movl %eax, -0x3c(%rbp)
movzbl %sil, %ecx
addl $-0x9, %ecx
cmpl $0x30, %ecx
ja 0x2890
leaq 0x986f(%rip), %rdx      # 0xc024
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq %rdi, -0x38(%rbp)
movq %r12, -0x48(%rbp)
movq %r13, %rdi
leaq -0x50(%rbp), %rsi
xorl %edx, %edx
callq 0x10c0
movq %rax, %r15
movq -0x50(%rbp), %r13
decq %r13
movq %r13, -0x50(%rbp)
movl $0x18, %edi
callq 0x10e0
movq %rax, %rbx
movl $0x1, (%rax)
movq %r15, 0x8(%rax)
movq -0x30(%rbp), %r12
testq %r12, %r12
je 0x2809
movq 0x8(%r12), %r15
jmp 0x280c
xorl %r15d, %r15d
movl $0x18, %edi
callq 0x10e0
movl $0x0, (%rax)
movq %rbx, 0x8(%rax)
movq %r15, 0x10(%rax)
testq %r12, %r12
je 0x282e
movq %rax, 0x8(%r12)
testl %r14d, %r14d
movl -0x3c(%rbp), %edx
movq -0x38(%rbp), %rdi
je 0x2845
orb $-0x80, (%rax)
movl $0x1, %r14d
jmp 0x2848
xorl %r14d, %r14d
movq -0x48(%rbp), %r12
jmp 0x2a69
movl -0x3c(%rbp), %edx
jmp 0x2a69
movq %rdi, %rbx
callq 0x1180
movq %rbx, %rdi
movq %rax, %rbx
movq (%rax), %rax
movsbq 0x1(%r13), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x2946
jmp 0x27be
xorl %edx, %edx
jmp 0x2a69
movl $0x1, %edx
jmp 0x2a69
movq %rdi, -0x38(%rbp)
movsbl %sil, %r15d
callq 0x1180
movq %rax, %rbx
movq (%rax), %rax
movslq %r15d, %rcx
testb $0x4, 0x1(%rax,%rcx,2)
jne 0x2942
movl $0x5, %edx
leaq 0x98c8(%rip), %rdi      # 0xc185
movl %r15d, %esi
callq 0x1090
testq %rax, %rax
movq -0x38(%rbp), %rdi
jne 0x2946
jmp 0x2ae7
movq %rdi, %rbx
movl $0x18, %edi
callq 0x10e0
movq %rbx, %rdi
movl $0x0, (%rax)
movq $0x0, 0x8(%rax)
movq -0x30(%rbp), %rcx
movq %rcx, 0x10(%rax)
addq %rbx, %rdi
addq %r12, %r12
movl %r14d, %ecx
orq %rcx, %rdi
movq %rax, -0x30(%rbp)
movl %r14d, %edx
jmp 0x2a69
movq -0x30(%rbp), %rax
testq %rax, %rax
movq %rdi, -0x38(%rbp)
movq %r12, -0x48(%rbp)
jne 0x29ed
xorl %edi, %edi
callq 0x2692
movb $0x1, %r15b
xorl %ebx, %ebx
movq $0x0, -0x30(%rbp)
xorl %r12d, %r12d
jmp 0x2a15
movq -0x38(%rbp), %rdi
movq %r12, -0x48(%rbp)
movq %rdi, -0x38(%rbp)
movq (%rbx), %r12
movl $0x1, %ebx
movq %r13, %r15
movsbq 0x1(%r15), %rsi
testb $0x8, (%r12,%rsi,2)
jne 0x297b
movl $0x5, %edx
leaq 0x9814(%rip), %rdi      # 0xc185
callq 0x1090
testq %rax, %rax
je 0x2982
incq %r15
incl %ebx
jmp 0x2959
movq -0x58(%rbp), %rdi
movq %r13, %rsi
movl %ebx, %edx
callq 0x2538
movq %rax, %rbx
movq %r15, -0x50(%rbp)
movq -0x30(%rbp), %r13
testq %r13, %r13
je 0x29a6
movq 0x8(%r13), %r12
jmp 0x29a9
xorl %r12d, %r12d
movl $0x18, %edi
callq 0x10e0
movl $0x0, (%rax)
movq %rbx, 0x8(%rax)
movq %r12, 0x10(%rax)
testq %r13, %r13
je 0x29ca
movq %rax, 0x8(%r13)
testl %r14d, %r14d
movq -0x38(%rbp), %rdi
movq -0x48(%rbp), %r12
movl -0x3c(%rbp), %edx
je 0x29e5
orb $-0x80, (%rax)
movl $0x1, %r14d
jmp 0x29e8
xorl %r14d, %r14d
movq %r15, %r13
jmp 0x2a69
movq 0x8(%rax), %rbx
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq %rbx, %rdi
callq 0x2692
movq -0x30(%rbp), %rax
testq %rax, %rax
je 0x2a91
movq 0x8(%rax), %r12
xorl %r15d, %r15d
movl $0x18, %edi
callq 0x10e0
movl $0x0, (%rax)
movq %rbx, 0x8(%rax)
movq %r12, 0x10(%rax)
testl %r14d, %r14d
sete %cl
testb %r15b, %r15b
jne 0x2a40
movq -0x30(%rbp), %rdx
movq %rax, 0x8(%rdx)
movq -0x48(%rbp), %r12
orb %r12b, %cl
testb $0x1, %cl
movq -0x38(%rbp), %rdi
jne 0x2a53
orb $-0x80, (%rax)
movl %r12d, %r14d
andl $0x1, %r14d
xorl $0x1, %r14d
shrq %r12
shrq %rdi
movl %edi, %edx
andl $0x1, %edx
xorl %eax, %eax
testl %r14d, %r14d
sete %al
orq %rax, %r12
leaq 0x1(%r13), %rcx
movq %rcx, -0x50(%rbp)
movb 0x1(%r13), %sil
movq %rcx, %r13
movl %edx, %r14d
testb %sil, %sil
jne 0x2796
jmp 0x2a99
movb $0x1, %r15b
jmp 0x2932
movq -0x30(%rbp), %rax
testq %rax, %rax
je 0x2ad1
movq 0x8(%rax), %rcx
testq %rcx, %rcx
je 0x2ad1
movq 0x10(%rcx), %rdx
movq $0x0, 0x10(%rcx)
testq %rdx, %rdx
je 0x2ad5
movq %rdx, %rax
movq 0x10(%rdx), %rdx
movq %rcx, 0x10(%rax)
movq %rax, %rcx
testq %rdx, %rdx
jne 0x2abc
jmp 0x2ad8
xorl %eax, %eax
jmp 0x2ad8
movq %rcx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x969c(%rip), %rdi      # 0xc18a
movl %r15d, %esi
xorl %eax, %eax
callq 0x130c