// File: /workspace/github_c_makefile_star2_O1/afi-lambda[P]a_little_smalltalk/src/lex.c
// Function: nextToken
tokentype nextToken()
{
    char *tp;
    boolean sign;

    /* skip over blanks and comments */
    while (nextChar() && (isspace(cc) || (cc == '"')))
        if (cc == '"')
        {
            /* read comment */
            while (nextChar() && (cc != '"'))
                ;
            if (!cc)
                break; /* break if we run into eof */
        }

    tp = tokenString;
    *tp++ = cc;

    if (!cc) /* end of input */
        token = inputend;

    else if (isalpha(cc))   /* identifier */
    {
        while (nextChar() && isalnum(cc))
            *tp++ = cc;
        if (cc == ':')
        {
            *tp++ = cc;
            token = namecolon;
        }
        else
        {
            pushBack(cc);
            token = nameconst;
        }
    }

    else if (isdigit(cc))   /* number */
    {
        longresult = cc - '0';
        while (nextChar() && isdigit(cc))
        {
            *tp++ = cc;
            longresult = (longresult * 10) + (cc - '0');
        }
        if (longCanBeInt(longresult))
        {
            tokenInteger = longresult;
            token = intconst;
        }
        else
        {
            token = floatconst;
            tokenFloat = (double) longresult;
        }
        if (cc == '.')   /* possible float */
        {
            if (nextChar() && isdigit(cc))
            {
                *tp++ = '.';
                do
                    *tp++ = cc;
                while (nextChar() && isdigit(cc));
                if (cc)
                    pushBack(cc);
                token = floatconst;
                *tp = '\0';
                tokenFloat = atof(tokenString);
            }
            else
            {
                /* nope, just an ordinary period */
                if (cc)
                    pushBack(cc);
                pushBack('.');
            }
        }
        else
            pushBack(cc);

        if (nextChar() && cc == 'e')   /* possible float */
        {
            if (nextChar() && cc == '-')
            {
                sign = true;
                nextChar();
            }
            else
                sign = false;
            if (cc && isdigit(cc))   /* yep, its a float */
            {
                *tp++ = 'e';
                if (sign)
                    *tp++ = '-';
                while (cc && isdigit(cc))
                {
                    *tp++ = cc;
                    nextChar();
                }
                if (cc)
                    pushBack(cc);
                *tp = '\0';
                token = floatconst;
                tokenFloat = atof(tokenString);
            }
            else     /* nope, wrong again */
            {
                if (cc)
                    pushBack(cc);
                if (sign)
                    pushBack('-');
                pushBack('e');
            }
        }
        else if (cc)
            pushBack(cc);
    }

    else if (cc == '$')   /* character constant */
    {
        tokenInteger = (int) nextChar();
        token = charconst;
    }

    else if (cc == '#')   /* symbol */
    {
        tp--; /* erase pound sign */
        if (nextChar() == '(')
            token = arraybegin;
        else
        {
            pushBack(cc);
            while (nextChar() && isSymbolChar(cc))
                *tp++ = cc;
            pushBack(cc);
            token = symconst;
        }
    }

    else if (cc == '\'')   /* string constant */
    {
        tp--; /* erase pound sign */
strloop:
        while (nextChar() && (cc != '\''))
            *tp++ = cc;
        /* check for nested quote marks */
        if (cc && nextChar() && (cc == '\''))
        {
            *tp++ = cc;
            goto strloop;
        }
        pushBack(cc);
        token = strconst;
    }

    else if (isClosing(cc)) /* closing expressions */
        token = closing;

    else if (singleBinary(cc))   /* single binary expressions */
    {
        token = binary;
    }

    else   /* anything else is binary */
    {
        if (nextChar() && binarySecond(cc))
            *tp++ = cc;
        else
            pushBack(cc);
        token = binary;
    }

    *tp = '\0';
    return (token);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl 0x22330(%rip), %ebx     # 0x284b0
movq 0x22331(%rip), %r15     # 0x284b8
leaq 0x223a2(%rip), %r14     # 0x28530
testl %ebx, %ebx
jle 0x61a0
decl %ebx
movl %ebx, 0x22316(%rip)     # 0x284b0
movb (%rbx,%r14), %bpl
jmp 0x61b6
movb (%r15), %bpl
testb %bpl, %bpl
je 0x61b4
incq %r15
movq %r15, 0x22306(%rip)     # 0x284b8
jmp 0x61b6
xorl %ebp, %ebp
movb %bpl, 0x22303(%rip)     # 0x284c0
testb %bpl, %bpl
je 0x6221
callq 0x2240
cmpb $0x22, %bpl
je 0x61df
movq (%rax), %rax
movsbq %bpl, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
je 0x6221
cmpb $0x22, %bpl
jne 0x618e
testl %ebx, %ebx
jle 0x61f7
decl %ebx
movl %ebx, 0x222bf(%rip)     # 0x284b0
movb (%rbx,%r14), %al
jmp 0x620c
movb (%r15), %al
testb %al, %al
je 0x620a
incq %r15
movq %r15, 0x222b0(%rip)     # 0x284b8
jmp 0x620c
xorl %eax, %eax
movb %al, 0x222ae(%rip)      # 0x284c0
movzbl %al, %eax
cmpb $0x22, %al
je 0x618e
testl %eax, %eax
jne 0x61e5
movsbq 0x22297(%rip), %r12     # 0x284c0
movb %r12b, 0x222a0(%rip)    # 0x284d0
testq %r12, %r12
je 0x629d
callq 0x2240
movq %rax, %rbx
movq (%rax), %rax
movzwl (%rax,%r12,2), %eax
btl $0xa, %eax
jb 0x62b3
btl $0xb, %eax
jb 0x6315
movzbl %r12b, %eax
cmpl $0x3a, %eax
jg 0x643a
addl $-0x22, %eax
cmpl $0xc, %eax
ja 0x655a
leaq 0x35f7(%rip), %rcx      # 0x986c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x2222c(%rip), %eax     # 0x284b0
testl %eax, %eax
jle 0x678d
decl %eax
movl %eax, 0x2221c(%rip)     # 0x284b0
movb (%rax,%r14), %cl
jmp 0x68fc
movl $0xb, 0x22279(%rip)     # 0x28520
leaq 0x22223(%rip), %r15     # 0x284d1
jmp 0x63dd
movl 0x221f7(%rip), %eax     # 0x284b0
leaq 0x22211(%rip), %r15     # 0x284d1
movq 0x221f1(%rip), %rcx     # 0x284b8
testl %eax, %eax
jle 0x62d9
decl %eax
movl %eax, 0x221dd(%rip)     # 0x284b0
movb (%rax,%r14), %dl
jmp 0x62ed
movb (%rcx), %dl
testb %dl, %dl
je 0x62eb
incq %rcx
movq %rcx, 0x221cf(%rip)     # 0x284b8
jmp 0x62ed
xorl %edx, %edx
testb %dl, %dl
je 0x630a
movq (%rbx), %rsi
movsbq %dl, %rdi
testb $0x8, (%rsi,%rdi,2)
je 0x63a2
movb %dl, (%r15)
incq %r15
jmp 0x62c7
movb %dl, 0x221b0(%rip)      # 0x284c0
jmp 0x63bf
addq $-0x30, %r12
movl 0x22191(%rip), %eax     # 0x284b0
leaq 0x221ab(%rip), %r15     # 0x284d1
movq 0x2218b(%rip), %rcx     # 0x284b8
testl %eax, %eax
jle 0x633f
decl %eax
movl %eax, 0x22177(%rip)     # 0x284b0
movb (%rax,%r14), %dl
jmp 0x6353
movb (%rcx), %dl
testb %dl, %dl
je 0x6351
incq %rcx
movq %rcx, 0x22169(%rip)     # 0x284b8
jmp 0x6353
xorl %edx, %edx
testb %dl, %dl
je 0x6379
movq (%rbx), %rdi
movsbq %dl, %rsi
testb $0x8, 0x1(%rdi,%rsi,2)
je 0x6379
movb %dl, (%r15)
incq %r15
leaq (%r12,%r12,4), %rdx
leaq (%rsi,%rdx,2), %r12
addq $-0x30, %r12
jmp 0x632d
movb %dl, 0x22141(%rip)      # 0x284c0
leaq 0x3fff(%r12), %rax
cmpq $0x7ffe, %rax           # imm = 0x7FFE
ja 0x63f0
movl %r12d, 0x2218e(%rip)    # 0x28524
movl $0x3, 0x22180(%rip)     # 0x28520
jmp 0x6407
movb %dl, 0x22118(%rip)      # 0x284c0
cmpb $0x3a, %dl
jne 0x63bf
movb %dl, (%r15)
incq %r15
movl $0x2, 0x22163(%rip)     # 0x28520
jmp 0x63dd
movslq 0x220ea(%rip), %rax     # 0x284b0
leal 0x1(%rax), %ecx
movl %ecx, 0x220e1(%rip)     # 0x284b0
movb %dl, (%rax,%r14)
movl $0x1, 0x22143(%rip)     # 0x28520
movb $0x0, (%r15)
movl 0x22139(%rip), %eax     # 0x28520
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x4, 0x22126(%rip)     # 0x28520
cvtsi2sd %r12, %xmm0
movsd %xmm0, 0x22121(%rip)    # 0x28528
movslq 0x220a2(%rip), %rax     # 0x284b0
cmpb $0x2e, %dl
jne 0x6428
testl %eax, %eax
jle 0x645c
decl %eax
movl %eax, 0x22091(%rip)     # 0x284b0
movb (%rax,%r14), %al
jmp 0x65ca
leal 0x1(%rax), %ecx
movl %ecx, 0x2207f(%rip)     # 0x284b0
movb %dl, (%rax,%r14)
jmp 0x66bd
cmpl $0x3b, %eax
je 0x644d
cmpl $0x5b, %eax
je 0x647c
cmpl $0x5d, %eax
jne 0x655a
movl $0xa, 0x220c9(%rip)     # 0x28520
jmp 0x62a7
movq 0x22055(%rip), %rcx     # 0x284b8
movb (%rcx), %al
testb %al, %al
je 0x65c8
incq %rcx
movq %rcx, 0x22041(%rip)     # 0x284b8
jmp 0x65ca
movl $0x9, 0x2209a(%rip)     # 0x28520
jmp 0x62a7
movl 0x2201f(%rip), %eax     # 0x284b0
leaq 0x22038(%rip), %r15     # 0x284d0
movq 0x22019(%rip), %rcx     # 0x284b8
testl %eax, %eax
jle 0x64b1
decl %eax
movl %eax, 0x22005(%rip)     # 0x284b0
movb (%rax,%r14), %dl
jmp 0x64c5
movb (%rcx), %dl
testb %dl, %dl
je 0x64c3
incq %rcx
movq %rcx, 0x21ff7(%rip)     # 0x284b8
jmp 0x64c5
xorl %edx, %edx
movb %dl, 0x21ff5(%rip)      # 0x284c0
cmpb $0x27, %dl
je 0x64d9
movzbl %dl, %esi
testl %esi, %esi
jne 0x650a
jmp 0x6512
testl %eax, %eax
jle 0x64eb
decl %eax
movl %eax, 0x21fcb(%rip)     # 0x284b0
movb (%rax,%r14), %dl
jmp 0x64ff
movb (%rcx), %dl
testb %dl, %dl
je 0x64fd
incq %rcx
movq %rcx, 0x21fbd(%rip)     # 0x284b8
jmp 0x64ff
xorl %edx, %edx
movb %dl, 0x21fbb(%rip)      # 0x284c0
cmpb $0x27, %dl
jne 0x6512
movb %dl, (%r15)
incq %r15
jmp 0x649f
movb 0x21fa8(%rip), %al      # 0x284c0
movslq 0x21f91(%rip), %rcx     # 0x284b0
leal 0x1(%rcx), %edx
movl %edx, 0x21f88(%rip)     # 0x284b0
movb %al, (%rcx,%r14)
movl $0x8, 0x21fea(%rip)     # 0x28520
jmp 0x63dd
movl 0x21f6f(%rip), %eax     # 0x284b0
testl %eax, %eax
jle 0x67ad
decl %eax
movl %eax, 0x21f5f(%rip)     # 0x284b0
movb (%rax,%r14), %al
jmp 0x69d6
callq 0x6a59
testb %al, %al
je 0x6598
movsbq 0x21f55(%rip), %rax     # 0x284c0
movq (%rbx), %rcx
testb $0x2c, 0x1(%rcx,%rax,2)
jne 0x6598
movzbl %al, %ecx
addl $-0x22, %ecx
cmpl $0x3b, %ecx
ja 0x69f4
movabsq $0xa000000020010e1, %rdx # imm = 0xA000000020010E1
btq %rcx, %rdx
jae 0x69f4
movb 0x21f22(%rip), %al      # 0x284c0
movslq 0x21f0b(%rip), %rcx     # 0x284b0
leal 0x1(%rcx), %edx
movl %edx, 0x21f02(%rip)     # 0x284b0
movb %al, (%rcx,%r14)
leaq 0x21f18(%rip), %r15     # 0x284d1
movl $0x9, 0x21f5d(%rip)     # 0x28520
jmp 0x63dd
xorl %eax, %eax
movb %al, 0x21ef0(%rip)      # 0x284c0
testb %al, %al
je 0x65fa
movq (%rbx), %rcx
movsbq %al, %rdx
testb $0x8, 0x1(%rcx,%rdx,2)
jne 0x6614
testb %al, %al
je 0x65fa
movslq 0x21ec3(%rip), %rcx     # 0x284b0
leal 0x1(%rcx), %edx
movl %edx, 0x21eba(%rip)     # 0x284b0
movb %al, (%rcx,%r14)
movslq 0x21eaf(%rip), %rax     # 0x284b0
leal 0x1(%rax), %ecx
movl %ecx, 0x21ea6(%rip)     # 0x284b0
movb $0x2e, (%rax,%r14)
jmp 0x66bd
movb $0x2e, (%r15)
addq $0x2, %r15
movb 0x21e9e(%rip), %al      # 0x284c0
movl 0x21e88(%rip), %ecx     # 0x284b0
movq 0x21e89(%rip), %rdx     # 0x284b8
movq %r15, %rsi
movq %rsi, %r15
movb %al, -0x1(%rsi)
testl %ecx, %ecx
jle 0x664a
decl %ecx
movl %ecx, 0x21e6c(%rip)     # 0x284b0
movb (%rcx,%r14), %al
jmp 0x665e
movb (%rdx), %al
testb %al, %al
je 0x665c
incq %rdx
movq %rdx, 0x21e5e(%rip)     # 0x284b8
jmp 0x665e
xorl %eax, %eax
testb %al, %al
je 0x6695
movq (%rbx), %rdi
movsbq %al, %r8
leaq 0x1(%r15), %rsi
testb $0x8, 0x1(%rdi,%r8,2)
jne 0x6632
movb %al, 0x21e45(%rip)      # 0x284c0
testb %al, %al
je 0x669b
movslq 0x21e2a(%rip), %rcx     # 0x284b0
leal 0x1(%rcx), %edx
movl %edx, 0x21e21(%rip)     # 0x284b0
movb %al, (%rcx,%r14)
jmp 0x669b
movb %al, 0x21e25(%rip)      # 0x284c0
movl $0x4, 0x21e7b(%rip)     # 0x28520
movb $0x0, (%r15)
leaq 0x21e20(%rip), %rdi     # 0x284d0
callq 0x2080
movsd %xmm0, 0x21e6b(%rip)    # 0x28528
movl 0x21ded(%rip), %eax     # 0x284b0
testl %eax, %eax
jle 0x66d5
decl %eax
movl %eax, 0x21de1(%rip)     # 0x284b0
movb (%rax,%r14), %al
jmp 0x66f0
movq 0x21ddc(%rip), %rcx     # 0x284b8
movb (%rcx), %al
testb %al, %al
je 0x66ee
incq %rcx
movq %rcx, 0x21dcc(%rip)     # 0x284b8
jmp 0x66f0
xorl %eax, %eax
movb %al, 0x21dca(%rip)      # 0x284c0
testb %al, %al
je 0x63dd
movzbl %al, %ecx
cmpl $0x65, %ecx
jne 0x671e
movl 0x21da4(%rip), %eax     # 0x284b0
testl %eax, %eax
jle 0x6737
decl %eax
movl %eax, 0x21d98(%rip)     # 0x284b0
movb (%rax,%r14), %al
jmp 0x6752
movslq 0x21d8b(%rip), %rcx     # 0x284b0
leal 0x1(%rcx), %edx
movl %edx, 0x21d82(%rip)     # 0x284b0
movb %al, (%rcx,%r14)
jmp 0x63dd
movq 0x21d7a(%rip), %rcx     # 0x284b8
movb (%rcx), %al
testb %al, %al
je 0x6750
incq %rcx
movq %rcx, 0x21d6a(%rip)     # 0x284b8
jmp 0x6752
xorl %eax, %eax
movb %al, 0x21d68(%rip)      # 0x284c0
cmpb $0x2d, %al
jne 0x67d5
movl 0x21d4e(%rip), %ecx     # 0x284b0
testl %ecx, %ecx
jle 0x6774
decl %ecx
movl %ecx, 0x21d42(%rip)     # 0x284b0
movb (%rcx,%r14), %cl
jmp 0x67cf
movq 0x21d3d(%rip), %rdx     # 0x284b8
movb (%rdx), %cl
testb %cl, %cl
je 0x67cd
incq %rdx
movq %rdx, 0x21d2d(%rip)     # 0x284b8
jmp 0x67cf
movq 0x21d24(%rip), %rax     # 0x284b8
movb (%rax), %cl
testb %cl, %cl
je 0x68fa
incq %rax
movq %rax, 0x21d10(%rip)     # 0x284b8
jmp 0x68fc
movq 0x21d04(%rip), %rcx     # 0x284b8
movb (%rcx), %al
testb %al, %al
je 0x69d4
incq %rcx
movq %rcx, 0x21cf0(%rip)     # 0x284b8
jmp 0x69d6
xorl %ecx, %ecx
movb %cl, 0x21ceb(%rip)      # 0x284c0
movsbq 0x21ce3(%rip), %rcx     # 0x284c0
testq %rcx, %rcx
je 0x6804
movq (%rbx), %rdx
testb $0x8, 0x1(%rdx,%rcx,2)
jne 0x6837
testb %cl, %cl
je 0x6804
movslq 0x21cb9(%rip), %rdx     # 0x284b0
leal 0x1(%rdx), %esi
movl %esi, 0x21cb0(%rip)     # 0x284b0
movb %cl, (%rdx,%r14)
cmpb $0x2d, %al
jne 0x681d
movslq 0x21ca1(%rip), %rax     # 0x284b0
leal 0x1(%rax), %ecx
movl %ecx, 0x21c98(%rip)     # 0x284b0
movb $0x2d, (%rax,%r14)
movslq 0x21c8c(%rip), %rax     # 0x284b0
leal 0x1(%rax), %ecx
movl %ecx, 0x21c83(%rip)     # 0x284b0
movb $0x65, (%rax,%r14)
jmp 0x63dd
movb $0x65, (%r15)
cmpb $0x2d, %al
jne 0x684a
movb $0x2d, 0x1(%r15)
addq $0x2, %r15
jmp 0x684d
incq %r15
movsbq 0x21c6b(%rip), %rax     # 0x284c0
testq %rax, %rax
sete %cl
je 0x68d3
movq (%rbx), %rdx
testb $0x8, 0x1(%rdx,%rax,2)
je 0x68bb
movb %al, (%r15)
movl 0x21c40(%rip), %eax     # 0x284b0
testl %eax, %eax
jle 0x6882
decl %eax
movl %eax, 0x21c34(%rip)     # 0x284b0
movb (%rax,%r14), %al
jmp 0x689d
movq 0x21c2f(%rip), %rcx     # 0x284b8
movb (%rcx), %al
testb %al, %al
je 0x689b
incq %rcx
movq %rcx, 0x21c1f(%rip)     # 0x284b8
jmp 0x689d
xorl %eax, %eax
incq %r15
movb %al, 0x21c1a(%rip)      # 0x284c0
testb %al, %al
sete %cl
je 0x68d3
movq (%rbx), %rdx
movsbq %al, %rsi
testb $0x8, 0x1(%rdx,%rsi,2)
jne 0x6867
testb %cl, %cl
jne 0x68d3
movslq 0x21bea(%rip), %rcx     # 0x284b0
leal 0x1(%rcx), %edx
movl %edx, 0x21be1(%rip)     # 0x284b0
movb %al, (%rcx,%r14)
movb $0x0, (%r15)
movl $0x4, 0x21c3f(%rip)     # 0x28520
leaq 0x21be8(%rip), %rdi     # 0x284d0
callq 0x2080
movsd %xmm0, 0x21c33(%rip)    # 0x28528
jmp 0x63dd
xorl %ecx, %ecx
movb %cl, 0x21bbe(%rip)      # 0x284c0
cmpb $0x28, %cl
jne 0x691d
movl $0x7, 0x21c0f(%rip)     # 0x28520
leaq 0x21bb8(%rip), %r15     # 0x284d0
jmp 0x63dd
movslq 0x21b8c(%rip), %rdx     # 0x284b0
leal 0x1(%rdx), %eax
movl %eax, 0x21b83(%rip)     # 0x284b0
movb %cl, (%rdx,%r14)
leaq 0x21b98(%rip), %r15     # 0x284d0
movq 0x21b79(%rip), %rcx     # 0x284b8
movabsq $0x8000000020010a1, %rdx # imm = 0x8000000020010A1
testl %eax, %eax
jle 0x695b
decl %eax
movl %eax, 0x21b5b(%rip)     # 0x284b0
movb (%rax,%r14), %sil
jmp 0x6971
movb (%rcx), %sil
testb %sil, %sil
je 0x696f
incq %rcx
movq %rcx, 0x21b4b(%rip)     # 0x284b8
jmp 0x6971
xorl %esi, %esi
testb %sil, %sil
je 0x69aa
movq (%rbx), %rdi
movsbq %sil, %r8
movzwl (%rdi,%r8,2), %edi
testl $0xc00, %edi            # imm = 0xC00
je 0x6992
movb %sil, (%r15)
incq %r15
jmp 0x6949
btl $0xd, %edi
jb 0x69aa
movzbl %sil, %edi
addl $-0x22, %edi
cmpl $0x3b, %edi
ja 0x698a
btq %rdi, %rdx
jae 0x698a
movb %sil, 0x21b0f(%rip)     # 0x284c0
movslq 0x21af8(%rip), %rax     # 0x284b0
leal 0x1(%rax), %ecx
movl %ecx, 0x21aef(%rip)     # 0x284b0
movb %sil, (%rax,%r14)
movl $0x6, 0x21b51(%rip)     # 0x28520
jmp 0x63dd
xorl %eax, %eax
movb %al, 0x21ae4(%rip)      # 0x284c0
movsbl %al, %eax
movl %eax, 0x21b3f(%rip)     # 0x28524
movl $0x5, 0x21b31(%rip)     # 0x28520
jmp 0x62a7
movb %al, 0x21ad7(%rip)      # 0x284d1
leaq 0x21ad1(%rip), %r15     # 0x284d2
jmp 0x65b9