// File: /workspace/github_c_makefile_star2_O3/ebb[P]chisa/./lexer.c
// Function: yylex
int yylex(void)
{
    int c;
    char *buf;
    int i;
    int isNumber;

    buf = yylval.text;

    for (;;) {
        do {
            c = fgetc(stdin);
            if (c == '\n')
                lexer_lineNr++;
        } while (c == ' ' || c == '\n');
        if (c != '#')
            break;
        do c = fgetc(stdin); while (c != '\n');
        lexer_lineNr++;
    }

    if (c == EOF)
        return EOF;

    if (c == '(' || c == ')')
        return c;

    if (c == '"') {
        for (i = 0; ; buf[i++] = c) {
            if (i == sizeof(yylval.text))
                die("String is too large.");
            c = fgetc(stdin);
            if (c == '"')
                break;
            if (c == EOF)
                die("Incomplete input.");
        }
        buf[i] = '\0';
        yylval.syntax = runtime_makeString(buf);
        return STRING;
    }

    if (!isalnum(c))
        die("Bad token.");
    isNumber = isdigit(c);

    i = 0;
    do {
        buf[i++] = (char)c;
        if (i == sizeof(yylval.text))
            die("Token is too large.");
        c = fgetc(stdin);
        if (isNumber && isalpha(c))
            die("Bad token.");
    } while(isalnum(c));
    buf[i] = '\0';

    if (ungetc(c, stdin) == EOF)
        die("File stream error.");

    if (isNumber) {
        yylval.syntax = runtime_makeNumber(atol(buf));
        return NUMBER;
    }

    for (i = 0; i < ARRAY_SIZE(keywords); i++)
        if (!strcmp(keywords[i].keyword, buf))
            return keywords[i].token;

    yylval.syntax = runtime_makeTuple1(CLASS_Id, runtime_makeString(buf));
    return ID;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x56b8(%rip), %r13      # 0x7fd8
movq (%r13), %rdi
callq 0x1090
movl %eax, %ebx
cmpl $0x1f, %eax
jle 0x294a
cmpl $0x20, %ebx
je 0x2920
cmpl $0x23, %ebx
jne 0x2960
movq (%r13), %rdi
callq 0x1090
cmpl $0xa, %eax
jne 0x293a
jmp 0x294f
cmpl $0xa, %ebx
jne 0x2957
incl 0x15887(%rip)           # 0x181dc
jmp 0x2920
cmpl $-0x1, %ebx
je 0x2b09
movl %ebx, %eax
andl $-0x2, %eax
cmpl $0x28, %eax
je 0x2b09
cmpl $0x22, %ebx
jne 0x29c4
xorl %r12d, %r12d
leaq 0x2aeb(%rip), %r14      # 0x5468
leaq 0x2af9(%rip), %r15      # 0x547d
leaq 0x15805(%rip), %rbx     # 0x18190
cmpq $0x40, %r12
jne 0x2999
movq %r14, %rdi
callq 0x4434
movq (%r13), %rdi
callq 0x1090
movl %eax, %ebp
cmpl $-0x1, %eax
je 0x29b3
cmpl $0x22, %ebp
jne 0x29bb
jmp 0x2ac8
movq %r15, %rdi
callq 0x4434
movb %bpl, (%r12,%rbx)
incq %r12
jmp 0x298b
callq 0x1120
movq %rax, %r14
movq (%rax), %rax
movslq %ebx, %r15
movzwl (%rax,%r15,2), %ebp
testb $0x8, %bpl
jne 0x29f1
leaq 0x2aab(%rip), %rdi      # 0x548f
callq 0x4434
movq (%r14), %rax
movzwl (%rax,%r15,2), %ebp
xorl %r15d, %r15d
leaq 0x15795(%rip), %r12     # 0x18190
movb %bl, (%r15,%r12)
cmpq $0x3f, %r15
jne 0x2a11
leaq 0x2a8e(%rip), %rdi      # 0x549a
callq 0x4434
movq (%r13), %rdi
callq 0x1090
btl $0xb, %ebp
movq (%r14), %rcx
movslq %eax, %rbx
jae 0x2a3c
testb $0x4, 0x1(%rcx,%rbx,2)
je 0x2a3c
leaq 0x2a5b(%rip), %rdi      # 0x548f
callq 0x4434
movq (%r14), %rcx
incq %r15
testb $0x8, (%rcx,%rbx,2)
jne 0x29fb
movl %r15d, %eax
movb $0x0, (%rax,%r12)
movq (%r13), %rsi
movl %ebx, %edi
callq 0x10e0
cmpl $-0x1, %eax
jne 0x2a69
leaq 0x2a4a(%rip), %rdi      # 0x54ae
callq 0x4434
btl $0xb, %ebp
jb 0x2ae3
movl $0x8, %r14d
leaq 0x5634(%rip), %r15      # 0x80b0
leaq 0x1570d(%rip), %rbx     # 0x18190
movq -0x8(%r14,%r15), %rdi
movq %rbx, %rsi
callq 0x10a0
testl %eax, %eax
je 0x2b05
addq $0x10, %r14
cmpq $0xc8, %r14
jne 0x2a83
leaq 0x156e8(%rip), %rdi     # 0x18190
callq 0x3e8c
movl $0x4, %edi
movq %rax, %rsi
callq 0x4034
movq %rax, 0x156cf(%rip)     # 0x18190
movl $0x102, %ebx            # imm = 0x102
jmp 0x2b09
movb $0x0, (%r12,%rbx)
movq %rbx, %rdi
callq 0x3e8c
movq %rax, 0x156b4(%rip)     # 0x18190
movl $0x104, %ebx            # imm = 0x104
jmp 0x2b09
leaq 0x156a6(%rip), %rdi     # 0x18190
callq 0x1100
movq %rax, %rdi
callq 0x3fd7
movq %rax, 0x15692(%rip)     # 0x18190
movl $0x103, %ebx            # imm = 0x103
jmp 0x2b09
movl (%r14,%r15), %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq