// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0x15311(%rip), %rax     # 0x191b0
movq %rax, -0x10(%rbp)
jmp 0x3ea5
movq 0x512c(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
callq 0x1070
movl %eax, -0x8(%rbp)
cmpl $0xa, -0x8(%rbp)
jne 0x3ecc
movl 0x15339(%rip), %eax     # 0x191fc
addl $0x1, %eax
movl %eax, 0x15330(%rip)     # 0x191fc
jmp 0x3ece
movb $0x1, %al
cmpl $0x20, -0x8(%rbp)
movb %al, -0x19(%rbp)
je 0x3ee3
cmpl $0xa, -0x8(%rbp)
sete %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
testb $0x1, %al
jne 0x3ea5
cmpl $0x23, -0x8(%rbp)
je 0x3ef2
jmp 0x3f1d
jmp 0x3ef4
movq 0x50dd(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
callq 0x1070
movl %eax, -0x8(%rbp)
cmpl $0xa, -0x8(%rbp)
jne 0x3ef4
movl 0x152ea(%rip), %eax     # 0x191fc
addl $0x1, %eax
movl %eax, 0x152e1(%rip)     # 0x191fc
jmp 0x3ea3
cmpl $-0x1, -0x8(%rbp)
jne 0x3f2f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4183
cmpl $0x28, -0x8(%rbp)
je 0x3f3b
cmpl $0x29, -0x8(%rbp)
jne 0x3f46
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x4183
cmpl $0x22, -0x8(%rbp)
jne 0x3fdf
movl $0x0, -0x14(%rbp)
movslq -0x14(%rbp), %rax
cmpq $0x40, %rax
jne 0x3f6d
leaq 0x25b4(%rip), %rdi      # 0x651c
callq 0x5ed0
movq 0x5064(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
callq 0x1070
movl %eax, -0x8(%rbp)
cmpl $0x22, -0x8(%rbp)
jne 0x3f87
jmp 0x3fb7
cmpl $-0x1, -0x8(%rbp)
jne 0x3f99
leaq 0x259d(%rip), %rdi      # 0x6531
callq 0x5ed0
jmp 0x3f9b
movl -0x8(%rbp), %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x14(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
jmp 0x3f57
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x10(%rbp), %rdi
callq 0x55a0
movq %rax, 0x151dd(%rip)     # 0x191b0
movl $0x104, -0x4(%rbp)      # imm = 0x104
jmp 0x4183
callq 0x1100
movq (%rax), %rax
movslq -0x8(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x4003
leaq 0x2545(%rip), %rdi      # 0x6543
callq 0x5ed0
callq 0x1100
movq (%rax), %rax
movslq -0x8(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
movl %eax, -0x18(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x8(%rbp), %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x14(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movslq -0x14(%rbp), %rax
cmpq $0x40, %rax
jne 0x4052
leaq 0x2501(%rip), %rdi      # 0x654e
callq 0x5ed0
movq 0x4f7f(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
callq 0x1070
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x4090
callq 0x1100
movq (%rax), %rax
movslq -0x8(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x4090
leaq 0x24b8(%rip), %rdi      # 0x6543
callq 0x5ed0
jmp 0x4092
callq 0x1100
movq (%rax), %rax
movslq -0x8(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x4022
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl -0x8(%rbp), %edi
movq 0x4f14(%rip), %rax      # 0x8fd8
movq (%rax), %rsi
callq 0x10c0
cmpl $-0x1, %eax
jne 0x40dd
leaq 0x248a(%rip), %rdi      # 0x6562
callq 0x5ed0
cmpl $0x0, -0x18(%rbp)
je 0x4104
movq -0x10(%rbp), %rdi
callq 0x10e0
movq %rax, %rdi
callq 0x57a0
movq %rax, 0x150b5(%rip)     # 0x191b0
movl $0x103, -0x4(%rbp)      # imm = 0x103
jmp 0x4183
movl $0x0, -0x14(%rbp)
movslq -0x14(%rbp), %rax
cmpq $0xc, %rax
jae 0x415f
movslq -0x14(%rbp), %rcx
leaq 0x4f80(%rip), %rax      # 0x90a0
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x1080
cmpl $0x0, %eax
jne 0x4152
movslq -0x14(%rbp), %rcx
leaq 0x4f5d(%rip), %rax      # 0x90a0
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x4183
jmp 0x4154
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x410b
movq -0x10(%rbp), %rdi
callq 0x55a0
movq %rax, %rsi
movl $0x4, %edi
callq 0x58c0
movq %rax, 0x15034(%rip)     # 0x191b0
movl $0x102, -0x4(%rbp)      # imm = 0x102
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)