// File: /workspace/github_c_makefile_star2_O1/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 0x565b(%rip), %r13      # 0x7fd8
movq (%r13), %rdi
callq 0x1090
movl %eax, %ebx
cmpl $0x1f, %eax
jle 0x29a7
cmpl $0x20, %ebx
je 0x297d
cmpl $0x23, %ebx
jne 0x29bd
movq (%r13), %rdi
callq 0x1090
cmpl $0xa, %eax
jne 0x2997
jmp 0x29ac
cmpl $0xa, %ebx
jne 0x29b4
incl 0x1582a(%rip)           # 0x181dc
jmp 0x297d
cmpl $-0x1, %ebx
je 0x2b62
movl %ebx, %eax
andl $-0x2, %eax
cmpl $0x28, %eax
je 0x2b62
cmpl $0x22, %ebx
jne 0x2a21
xorl %r12d, %r12d
leaq 0x2a8e(%rip), %r14      # 0x5468
leaq 0x2a9c(%rip), %r15      # 0x547d
leaq 0x157a8(%rip), %rbx     # 0x18190
cmpq $0x40, %r12
jne 0x29f6
movq %r14, %rdi
callq 0x44a0
movq (%r13), %rdi
callq 0x1090
movl %eax, %ebp
cmpl $-0x1, %eax
je 0x2a10
cmpl $0x22, %ebp
jne 0x2a18
jmp 0x2b21
movq %r15, %rdi
callq 0x44a0
movb %bpl, (%r12,%rbx)
incq %r12
jmp 0x29e8
callq 0x1120
movq %rax, %r14
movq (%rax), %rax
movslq %ebx, %r15
testb $0x8, (%rax,%r15,2)
jne 0x2a42
leaq 0x2a52(%rip), %rdi      # 0x548f
callq 0x44a0
movq (%r14), %rax
movzwl (%rax,%r15,2), %ebp
xorl %r15d, %r15d
leaq 0x1573c(%rip), %r12     # 0x18190
movb %bl, (%r15,%r12)
cmpq $0x3f, %r15
jne 0x2a6a
leaq 0x2a35(%rip), %rdi      # 0x549a
callq 0x44a0
movq (%r13), %rdi
callq 0x1090
btl $0xb, %ebp
movslq %eax, %rbx
jae 0x2a92
movq (%r14), %rax
testb $0x4, 0x1(%rax,%rbx,2)
je 0x2a92
leaq 0x2a02(%rip), %rdi      # 0x548f
callq 0x44a0
movq (%r14), %rax
incq %r15
testb $0x8, (%rax,%rbx,2)
jne 0x2a54
movl %r15d, %eax
movb $0x0, (%rax,%r12)
movq (%r13), %rsi
movl %ebx, %edi
callq 0x10e0
cmpl $-0x1, %eax
jne 0x2ac2
leaq 0x29f1(%rip), %rdi      # 0x54ae
callq 0x44a0
btl $0xb, %ebp
jb 0x2b3c
movl $0x8, %r14d
leaq 0x55db(%rip), %r15      # 0x80b0
leaq 0x156b4(%rip), %rbx     # 0x18190
movq -0x8(%r14,%r15), %rdi
movq %rbx, %rsi
callq 0x10a0
testl %eax, %eax
je 0x2b5e
addq $0x10, %r14
cmpq $0xc8, %r14
jne 0x2adc
leaq 0x1568f(%rip), %rdi     # 0x18190
callq 0x3ef8
movl $0x4, %edi
movq %rax, %rsi
callq 0x40a0
movq %rax, 0x15676(%rip)     # 0x18190
movl $0x102, %ebx            # imm = 0x102
jmp 0x2b62
movb $0x0, (%r12,%rbx)
movq %rbx, %rdi
callq 0x3ef8
movq %rax, 0x1565b(%rip)     # 0x18190
movl $0x104, %ebx            # imm = 0x104
jmp 0x2b62
leaq 0x1564d(%rip), %rdi     # 0x18190
callq 0x1100
movq %rax, %rdi
callq 0x4043
movq %rax, 0x15639(%rip)     # 0x18190
movl $0x103, %ebx            # imm = 0x103
jmp 0x2b62
movl (%r14,%r15), %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq