// File: /workspace/github_c_makefile_star2_O2/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 0x4959(%rip), %r13      # 0x6fd8
movq (%r13), %rdi
callq 0x1090
cmpl $0xa, %eax
je 0x26a7
movl %eax, %ebx
cmpl $0x20, %eax
je 0x267f
cmpl $0x23, %ebx
jne 0x26af
movq (%r13), %rdi
callq 0x1090
cmpl $0xa, %eax
jne 0x2699
incl 0x14b2f(%rip)           # 0x171dc
jmp 0x267f
cmpl $-0x1, %ebx
je 0x285e
movl %ebx, %eax
andl $-0x2, %eax
cmpl $0x28, %eax
je 0x285e
cmpl $0x22, %ebx
jne 0x271c
xorl %r12d, %r12d
leaq 0x1d93(%rip), %r14      # 0x4468
leaq 0x1da1(%rip), %r15      # 0x447d
leaq 0x14aad(%rip), %rbx     # 0x17190
cmpq $0x40, %r12
jne 0x26f1
movq %r14, %rdi
callq 0x3fb8
movq (%r13), %rdi
callq 0x1090
movl %eax, %ebp
cmpl $-0x1, %eax
je 0x270b
cmpl $0x22, %ebp
jne 0x2713
jmp 0x27fe
movq %r15, %rdi
callq 0x3fb8
movb %bpl, (%r12,%rbx)
incq %r12
jmp 0x26e3
callq 0x1120
movq %rax, %r14
movq (%rax), %rax
movslq %ebx, %r15
movzwl (%rax,%r15,2), %ebp
testb $0x8, %bpl
jne 0x2749
leaq 0x1d53(%rip), %rdi      # 0x448f
callq 0x3fb8
movq (%r14), %rax
movzwl (%rax,%r15,2), %ebp
xorl %r15d, %r15d
leaq 0x14a3d(%rip), %r12     # 0x17190
movb %bl, (%r15,%r12)
cmpq $0x3f, %r15
jne 0x2769
leaq 0x1d36(%rip), %rdi      # 0x449a
callq 0x3fb8
movq (%r13), %rdi
callq 0x1090
btl $0xb, %ebp
movq (%r14), %rcx
movslq %eax, %rbx
jae 0x2794
testb $0x4, 0x1(%rcx,%rbx,2)
je 0x2794
leaq 0x1d03(%rip), %rdi      # 0x448f
callq 0x3fb8
movq (%r14), %rcx
incq %r15
testb $0x8, (%rcx,%rbx,2)
jne 0x2753
movl %r15d, %eax
movb $0x0, (%rax,%r12)
movq (%r13), %rsi
movl %ebx, %edi
callq 0x10e0
cmpl $-0x1, %eax
jne 0x27c1
leaq 0x1cf2(%rip), %rdi      # 0x44ae
callq 0x3fb8
btl $0xb, %ebp
jb 0x2819
xorl %ecx, %ecx
leaq 0x48e0(%rip), %r14      # 0x70b0
leaq 0x149b9(%rip), %rbx     # 0x17190
leaq 0x10(%rcx), %r15
cmpq $0xd0, %r15
je 0x283b
movq (%rcx,%r14), %rdi
movq %rbx, %rsi
callq 0x10a0
movq %r15, %rcx
testl %eax, %eax
jne 0x27d7
movl -0x8(%r15,%r14), %ebx
jmp 0x285e
movb $0x0, (%r12,%rbx)
movq %rbx, %rdi
callq 0x3a74
movq %rax, 0x1497e(%rip)     # 0x17190
movl $0x104, %ebx            # imm = 0x104
jmp 0x285e
leaq 0x14970(%rip), %rdi     # 0x17190
callq 0x1100
movq %rax, %rdi
callq 0x3b81
movq %rax, 0x1495c(%rip)     # 0x17190
movl $0x103, %ebx            # imm = 0x103
jmp 0x285e
leaq 0x1494e(%rip), %rdi     # 0x17190
callq 0x3a74
pushq $0x4
popq %rdi
movq %rax, %rsi
callq 0x3c05
movq %rax, 0x14937(%rip)     # 0x17190
movl $0x102, %ebx            # imm = 0x102
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq