// File: /workspace/github_c_makefile_star2_O0/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
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movl $0x0, -0x28(%rbp)
xorl %eax, %eax
movl %eax, %esi
movq %rsi, %rdi
callq 0x1340
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
je 0x36c7
movl -0x18(%rbp), %eax
andl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x34(%rbp), %eax
addl $-0x9, %eax
movl %eax, %ecx
movq %rcx, -0x68(%rbp)
subl $0x30, %eax
ja 0x357b
movq -0x68(%rbp), %rax
leaq 0xcc82(%rip), %rcx      # 0x10038
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x3696
movq -0x40(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x1340
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
shlq %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
shlq %rax
movq %rax, -0x20(%rbp)
movslq -0x28(%rbp), %rax
orq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x3696
movq -0x40(%rbp), %rdi
callq 0x14f0
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
callq 0x1520
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rdi
callq 0x30f0
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x40(%rbp), %rdi
callq 0x14f0
movq -0x80(%rbp), %rdi
movq %rax, %rsi
callq 0x1340
movq %rax, -0x78(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x28(%rbp)
movb %al, -0x69(%rbp)
je 0x3474
movq -0x20(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
setne %al
xorb $-0x1, %al
movb %al, -0x69(%rbp)
movq -0x78(%rbp), %rsi
movq -0x88(%rbp), %rdi
movb -0x69(%rbp), %al
andb $0x1, %al
movzbl %al, %edx
callq 0x1640
movq -0x20(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x28(%rbp)
movq -0x20(%rbp), %rax
shrq %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
shrq %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
andq $0x1, %rax
movl %eax, -0x24(%rbp)
jmp 0x3696
jmp 0x34cd
movq -0x10(%rbp), %rdi
leaq -0x10(%rbp), %rsi
xorl %edx, %edx
callq 0x10a0
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x60(%rbp), %rdi
callq 0x1380
movq %rax, -0x98(%rbp)
movq -0x40(%rbp), %rdi
callq 0x14f0
movq -0x98(%rbp), %rdi
movq %rax, %rsi
callq 0x1340
movq -0x90(%rbp), %rdi
movq %rax, %rsi
movl -0x28(%rbp), %edx
callq 0x1640
jmp 0x3696
jmp 0x3696
movl $0x1, -0x24(%rbp)
jmp 0x3696
movl $0x0, -0x24(%rbp)
jmp 0x3696
callq 0x1150
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movsbl 0x1(%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
jne 0x3576
jmp 0x35b0
jmp 0x34cd
callq 0x1150
movq (%rax), %rax
movslq -0x34(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
jne 0x35ae
movl -0x34(%rbp), %esi
leaq 0xcbeb(%rip), %rdi      # 0x1018a
callq 0x1050
cmpq $0x0, %rax
je 0x3683
jmp 0x35b0
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
callq 0x1150
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movsbl 0x1(%rcx), %ecx
movl %ecx, -0x34(%rbp)
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %ecx
andl $0x8, %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, -0x99(%rbp)
jne 0x3609
movl -0x34(%rbp), %esi
leaq 0xcb93(%rip), %rdi      # 0x1018a
callq 0x1050
cmpq $0x0, %rax
setne %al
movb %al, -0x99(%rbp)
movb -0x99(%rbp), %al
testb $0x1, %al
jne 0x3615
jmp 0x3617
jmp 0x35b8
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
movl %eax, %edx
callq 0x2f70
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x40(%rbp), %rdi
callq 0x14f0
movq -0xb0(%rbp), %rdi
movq %rax, %rsi
callq 0x1340
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
movl -0x28(%rbp), %edx
callq 0x1640
jmp 0x3694
movl -0x34(%rbp), %esi
leaq 0xcb02(%rip), %rdi      # 0x1018f
movb $0x0, %al
callq 0x1260
jmp 0x3696
movl -0x28(%rbp), %edx
movl $0x1, %eax
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
cltq
orq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x337a
movq -0x40(%rbp), %rdi
callq 0x14f0
movq %rax, %rdi
callq 0x32a0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax)