// File: /workspace/github_c_makefile_star2_O3/ryvnf[P]czc/lex.c
// Function: yylex
int yylex(void)
{
    int c;
    while ((c = lex_getc()) != EOF) {
        if (isspace(c)) {
            continue;
        }

        if (isident(c)) {
            size_t n = 0;
            char *s = malloc(n);
            appendc(&s, &n, c);

            while (isidnum(c = lex_getc())) {
                appendc(&s, &n, c);
            }
            appendc(&s, &n, '\0');
            lex_ungetc(c);

            for (int i = 0; i < ARRAY_LEN(keywords); i++) {
                if (strcmp(s, keywords[i].str) == 0) {
                    free(s);
                    RETURN(keywords[i].tok);
                }
            }

            yylval.u.s = s;
            RETURN(IDENT_TOK);
        }

        if (isdigit(c)) {
            size_t n = 0;
            char *s = malloc(n);
            appendc(&s, &n, c);

            while (isidnum(c = lex_getc())) {
                appendc(&s, &n, c);
            }
            appendc(&s, &n, '\0');
            lex_ungetc(c);

            char *p;
            long long res = strtoll(s, &p, 0);
            if (*p != '\0') {
                error(loc_new(lex_filepath, linenr),
                        "not a valid number %s\n", s);
            }

            free(s);
            yylval.u.i = res;
            RETURN(NUM_TOK);
        }

        if (c == '\'' || c == '"') {
            int quote = c;
            size_t n = 0;
            char *s = malloc(n);

            while ((c = esc_char(quote, yyin)) != EOF) {
                appendc(&s, &n, c);
            }

            if (quote == '"') {
                appendc(&s, &n, '\0');
                yylval.u.chars.s = s;
                yylval.u.chars.n = n;
                RETURN(STR_TOK);
            }

            if (n == 0) {
                fprintf(stderr, "empty character constant\n");
                yylval.u.i = 0;
            } else {
                if (n > 1) {
                    fatal(loc_new(lex_filepath, linenr),
                            "more than one character in character constant\n");
                }
                yylval.u.i = s[0];
            }

            free(s);
            RETURN(NUM_TOK);
        }

        switch (c) {
            case '*':
            case '%':
            case '~':
            case '=':
            case '!': {
                int c2 = lex_getc();
                if (c2 == '=') {
                    switch (c) {
                        case '*': RETURN(MUL_ASGN_TOK);
                        case '%': RETURN(REM_ASGN_TOK);
                        case '~': RETURN(XOR_ASGN_TOK);
                        case '=': RETURN(EQ_TOK);
                        case '!': RETURN(NE_TOK);
                    }
                    unreachable();
                }
                lex_ungetc(c2);
                break;
            }

            case '<':
            case '>': {
                int c2 = lex_getc();
                if (c2 == c) {
                    int c3 = lex_getc();
                    if (c3  == '=') {
                        switch (c) {
                            case '<': RETURN(SHL_ASGN_TOK);
                            case '>': RETURN(SHR_ASGN_TOK);
                        }
                    }
                    lex_ungetc(c3);

                    switch (c) {
                        case '<': RETURN(SHL_TOK);
                        case '>': RETURN(SHR_TOK);
                    }
                } else if (c2 == '=') {
                    switch (c) {
                        case '<': RETURN(LE_TOK);
                        case '>': RETURN(GE_TOK);
                    }
                }
                lex_ungetc(c2);
                break;
            }

            case '+':
            case '-':
            case '|':
            case '&': {
                int c2 = lex_getc();
                if (c2 == '=') {
                    switch (c) {
                        case '+': RETURN(ADD_ASGN_TOK);
                        case '-': RETURN(SUB_ASGN_TOK);
                        case '|': RETURN(OR_ASGN_TOK);
                        case '&': RETURN(AND_ASGN_TOK);
                    }
                } else if (c2 == c) {
                    switch (c) {
                        case '+': RETURN(INC_TOK);
                        case '-': RETURN(DEC_TOK);
                        case '|': RETURN(OROR_TOK);
                        case '&': RETURN(ANDAND_TOK);
                    }
                }
                lex_ungetc(c2);
                break;
            }

            case '.': {
                int c2 = lex_getc();
                if (c2 == '.') {
                    int c3 = lex_getc();
                    if (c3 == '.') {
                        RETURN(ELLIPSIS_TOK);
                    }
                    lex_ungetc(c3);

                    RETURN(STRCAT_TOK);
                }

                lex_ungetc(c2);
                break;
            }

            case '/': {
                int c2 = lex_getc();
                if (c2 == '=') {
                    RETURN(DIV_ASGN_TOK);
                } else if (c2 == '/') {
                    skip_line_comment();
                    continue;
                } else if (c2 == '*') {
                    skip_block_comment();
                    continue;
                }
                lex_ungetc(c2);
                break;
            }
        }

        RETURN(c);
    }

    RETURN(EOF_TOK);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq 0xb9e9(%rip), %rdi      # 0x13da8
callq 0x2240
movl %eax, %ebx
cmpl $0xa, %eax
je 0x83d5
cmpl $-0x1, %ebx
jne 0x83db
jmp 0x85e0
incl 0xb9c5(%rip)            # 0x13da0
callq 0x2260
movq %rax, %r14
movq (%rax), %rax
movslq %ebx, %rcx
movzwl (%rax,%rcx,2), %eax
btl $0xd, %eax
jb 0x83b8
cmpl $0x5f, %ebx
je 0x8600
movl %eax, %ecx
andl $0x400, %ecx            # imm = 0x400
jne 0x8600
btl $0xb, %eax
jb 0x86dc
cmpl $0x2f, %ebx
jne 0x8447
movq 0xb988(%rip), %rdi      # 0x13da8
callq 0x2240
cmpl $0x2a, %eax
je 0x843d
cmpl $0x2f, %eax
jne 0x88ec
callq 0x835c
jmp 0x83b8
callq 0x837b
jmp 0x83b8
leal -0x21(%rbx), %eax
cmpl $0x1d, %eax
ja 0x84c4
leaq 0x5d92(%rip), %rcx      # 0xe1e8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xb942(%rip), %rdi      # 0x13da8
callq 0x2240
cmpl $0xa, %eax
je 0x85cf
cmpl $0x3d, %eax
jne 0x8abe
cmpl $0x29, %ebx
jle 0x8942
cmpl $0x7e, %ebx
je 0x8a2d
cmpl $0x3d, %ebx
je 0x8a50
cmpl $0x2a, %ebx
jne 0x8c14
movq 0xb908(%rip), %rdi      # 0x13db0
movl 0xb8f2(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb8fe(%rip)      # 0x13db8
movl $0x114, %ebx            # imm = 0x114
jmp 0x8ae5
cmpl $0x7c, %ebx
je 0x84d3
cmpl $0x7e, %ebx
je 0x845f
jmp 0x8acc
movq 0xb8ce(%rip), %rdi      # 0x13da8
callq 0x2240
cmpl $0xa, %eax
je 0x8abe
cmpl $0x3d, %eax
jne 0x87d5
cmpl $0x2c, %ebx
jg 0x8977
cmpl $0x26, %ebx
je 0x8af4
cmpl $0x2b, %ebx
jne 0x8abe
movq 0xb89d(%rip), %rdi      # 0x13db0
movl 0xb887(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb893(%rip)      # 0x13db8
movl $0x112, %ebx            # imm = 0x112
jmp 0x8ae5
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x2160
movq %rax, %r14
movl %ebx, %edi
callq 0x8123
cmpl $-0x1, %eax
je 0x8575
movl %eax, %ebp
xorl %r12d, %r12d
leaq 0x1(%r12), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2190
movq %rax, %r14
movb %bpl, (%rax,%r12)
movl %ebx, %edi
callq 0x8123
movl %eax, %ebp
movq %r15, %r12
cmpl $-0x1, %eax
jne 0x854d
cmpl $0x22, %ebx
jne 0x881b
leaq 0x1(%r15), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2190
movb $0x0, (%rax,%r15)
movq %rax, 0xb827(%rip)      # 0x13dc0
movq %rbx, 0xb828(%rip)      # 0x13dc8
movl $0x11e, %ebx            # imm = 0x11E
jmp 0x8acc
movq 0xb7f7(%rip), %rdi      # 0x13da8
callq 0x2240
movl %eax, %ebp
cmpl $0xa, %eax
jne 0x8842
movq 0xb7e0(%rip), %rsi      # 0x13da8
movl %ebp, %edi
jmp 0x8ac7
movq 0xb7d2(%rip), %rsi      # 0x13da8
movl $0xa, %edi
jmp 0x8ac7
movq 0xb7c9(%rip), %rdi      # 0x13db0
movl 0xb7b3(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb7bf(%rip)      # 0x13db8
xorl %ebx, %ebx
jmp 0x8ae5
xorl %edi, %edi
callq 0x2160
movl $0x1, %esi
movq %rax, %rdi
callq 0x2190
movq %rax, %r15
movb %bl, (%rax)
movl $0x2, %ebx
movq 0xb783(%rip), %rdi      # 0x13da8
callq 0x2240
movl %eax, %ebp
cmpl $0xa, %eax
jne 0x8637
incl 0xb769(%rip)            # 0x13da0
movq (%r14), %rax
movslq %ebp, %rcx
movzwl (%rax,%rcx,2), %r12d
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2190
movq %rax, %r15
cmpl $0x5f, %ebp
je 0x865b
andl $0x8, %r12d
je 0x8665
movb %bpl, -0x1(%r15,%rbx)
incq %rbx
jmp 0x861e
movb $0x0, -0x1(%r15,%rbx)
cmpl $0xa, %ebp
jne 0x8676
decl 0xb72a(%rip)            # 0x13da0
movq 0xb72b(%rip), %rsi      # 0x13da8
movl %ebp, %edi
callq 0x2170
movl $0x8, %ebx
leaq 0xaac0(%rip), %r14      # 0x13150
movq -0x8(%rbx,%r14), %rsi
movq %r15, %rdi
callq 0x2100
testl %eax, %eax
je 0x8918
addq $0x10, %rbx
cmpq $0x138, %rbx            # imm = 0x138
jne 0x8690
movq %r15, 0xb707(%rip)      # 0x13dc0
movq 0xb6f0(%rip), %rdi      # 0x13db0
movl 0xb6da(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb6e6(%rip)      # 0x13db8
movl $0x120, %ebx            # imm = 0x120
jmp 0x8ae5
xorl %edi, %edi
callq 0x2160
movl $0x1, %esi
movq %rax, %rdi
callq 0x2190
movq %rax, %r15
movb %bl, (%rax)
movl $0x2, %ebx
movq 0xb6a7(%rip), %rdi      # 0x13da8
callq 0x2240
movl %eax, %ebp
cmpl $0xa, %eax
jne 0x8713
incl 0xb68d(%rip)            # 0x13da0
movq (%r14), %rax
movslq %ebp, %rcx
movzwl (%rax,%rcx,2), %r12d
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2190
movq %rax, %r15
cmpl $0x5f, %ebp
je 0x8737
andl $0x8, %r12d
je 0x8741
movb %bpl, -0x1(%r15,%rbx)
incq %rbx
jmp 0x86fa
movb $0x0, -0x1(%r15,%rbx)
cmpl $0xa, %ebp
jne 0x8752
decl 0xb64e(%rip)            # 0x13da0
movq 0xb64f(%rip), %rsi      # 0x13da8
movl %ebp, %edi
callq 0x2170
leaq 0x8(%rsp), %r14
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2120
movq %rax, %rbx
movq (%r14), %rax
cmpb $0x0, (%rax)
je 0x87a3
movq 0xb62c(%rip), %rdi      # 0x13db0
movl 0xb616(%rip), %esi      # 0x13da0
callq 0x8c38
leaq 0x5d28(%rip), %rsi      # 0xe4be
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x4da8
movq %r15, %rdi
callq 0x2030
movq %rbx, 0xb60e(%rip)      # 0x13dc0
movq 0xb5f7(%rip), %rdi      # 0x13db0
movl 0xb5e1(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb5ed(%rip)      # 0x13db8
movl $0x11f, %ebx            # imm = 0x11F
jmp 0x8ae5
cmpl %ebx, %eax
jne 0x8abe
cmpl $0x2c, %ebx
jg 0x8a90
cmpl $0x26, %ebx
je 0x8b34
cmpl $0x2b, %ebx
jne 0x8abe
movq 0xb5b1(%rip), %rdi      # 0x13db0
movl 0xb59b(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb5a7(%rip)      # 0x13db8
movl $0x11d, %ebx            # imm = 0x11D
jmp 0x8ae5
cmpq $0x1, %r15
jne 0x8be0
movsbq (%r14), %rax
movq %rax, 0xb590(%rip)      # 0x13dc0
movq %r14, %rdi
callq 0x2030
movl $0x11f, %ebx            # imm = 0x11F
jmp 0x8acc
cmpl %ebx, %ebp
jne 0x89ac
movq 0xb557(%rip), %rdi      # 0x13da8
callq 0x2240
cmpl $0x3d, %eax
jne 0x89ea
cmpl $0x3e, %ebx
je 0x8b9a
movl $0x3d, %eax
cmpl $0x3c, %ebx
jne 0x89ea
movq 0xb533(%rip), %rdi      # 0x13db0
movl 0xb51d(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb529(%rip)      # 0x13db8
movl $0x117, %ebx            # imm = 0x117
jmp 0x8ae5
movq 0xb508(%rip), %rdi      # 0x13da8
callq 0x2240
movq 0xb4fc(%rip), %rsi      # 0x13da8
cmpl $0xa, %eax
je 0x85d6
cmpl $0x2e, %eax
jne 0x8ac5
movq %rsi, %rdi
callq 0x2240
movl $0x122, %ebx            # imm = 0x122
cmpl $0x2e, %eax
je 0x8acc
movq 0xb4cd(%rip), %rsi      # 0x13da8
movl %eax, %edi
callq 0x2170
movl $0x12f, %ebx            # imm = 0x12F
jmp 0x8acc
cmpl $0x3d, %eax
jne 0x8abe
movq 0xb4b4(%rip), %rdi      # 0x13db0
movl 0xb49e(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb4aa(%rip)      # 0x13db8
movl $0x115, %ebx            # imm = 0x115
jmp 0x8ae5
movq %r15, %rdi
callq 0x2030
movq 0xb489(%rip), %rdi      # 0x13db0
movl 0xb473(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb47f(%rip)      # 0x13db8
movl (%rbx,%r14), %ebx
jmp 0x8ae5
cmpl $0x21, %ebx
je 0x8a70
cmpl $0x25, %ebx
jne 0x8c14
movq 0xb455(%rip), %rdi      # 0x13db0
movl 0xb43f(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb44b(%rip)      # 0x13db8
movl $0x116, %ebx            # imm = 0x116
jmp 0x8ae5
cmpl $0x2d, %ebx
je 0x8b14
cmpl $0x7c, %ebx
jne 0x8abe
movq 0xb420(%rip), %rdi      # 0x13db0
movl 0xb40a(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb416(%rip)      # 0x13db8
movl $0x119, %ebx            # imm = 0x119
jmp 0x8ae5
cmpl $0x3d, %ebp
jne 0x85c1
cmpl $0x3e, %ebx
je 0x8bbd
cmpl $0x3c, %ebx
jne 0x85c1
movq 0xb3e2(%rip), %rdi      # 0x13db0
movl 0xb3cc(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb3d8(%rip)      # 0x13db8
movl $0x10d, %ebx            # imm = 0x10D
jmp 0x8ae5
movq 0xb3b7(%rip), %rsi      # 0x13da8
movl %eax, %edi
callq 0x2170
cmpl $0x3e, %ebx
je 0x8b77
cmpl $0x3c, %ebx
jne 0x85c1
movq 0xb39f(%rip), %rdi      # 0x13db0
movl 0xb389(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb395(%rip)      # 0x13db8
movl $0x110, %ebx            # imm = 0x110
jmp 0x8ae5
movq 0xb37c(%rip), %rdi      # 0x13db0
movl 0xb366(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb372(%rip)      # 0x13db8
movl $0x11a, %ebx            # imm = 0x11A
jmp 0x8ae5
movq 0xb359(%rip), %rdi      # 0x13db0
movl 0xb343(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb34f(%rip)      # 0x13db8
movl $0x10e, %ebx            # imm = 0x10E
jmp 0x8ae5
movq 0xb339(%rip), %rdi      # 0x13db0
movl 0xb323(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb32f(%rip)      # 0x13db8
movl $0x10f, %ebx            # imm = 0x10F
jmp 0x8ae5
cmpl $0x2d, %ebx
je 0x8b54
cmpl $0x7c, %ebx
jne 0x8abe
movq 0xb30b(%rip), %rdi      # 0x13db0
movl 0xb2f5(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb301(%rip)      # 0x13db8
movl $0x10b, %ebx            # imm = 0x10B
jmp 0x8ae5
movq 0xb2e3(%rip), %rsi      # 0x13da8
movl %eax, %edi
callq 0x2170
movq 0xb2dd(%rip), %rdi      # 0x13db0
movl 0xb2c7(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb2d3(%rip)      # 0x13db8
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0xb2b5(%rip), %rdi      # 0x13db0
movl 0xb29f(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb2ab(%rip)      # 0x13db8
movl $0x11b, %ebx            # imm = 0x11B
jmp 0x8ae5
movq 0xb295(%rip), %rdi      # 0x13db0
movl 0xb27f(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb28b(%rip)      # 0x13db8
movl $0x113, %ebx            # imm = 0x113
jmp 0x8ae5
movq 0xb275(%rip), %rdi      # 0x13db0
movl 0xb25f(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb26b(%rip)      # 0x13db8
movl $0x10a, %ebx            # imm = 0x10A
jmp 0x8ae5
movq 0xb255(%rip), %rdi      # 0x13db0
movl 0xb23f(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb24b(%rip)      # 0x13db8
movl $0x11c, %ebx            # imm = 0x11C
jmp 0x8ae5
movq 0xb232(%rip), %rdi      # 0x13db0
movl 0xb21c(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb228(%rip)      # 0x13db8
movl $0x111, %ebx            # imm = 0x111
jmp 0x8ae5
movq 0xb20f(%rip), %rdi      # 0x13db0
movl 0xb1f9(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb205(%rip)      # 0x13db8
movl $0x118, %ebx            # imm = 0x118
jmp 0x8ae5
movq 0xb1ec(%rip), %rdi      # 0x13db0
movl 0xb1d6(%rip), %esi      # 0x13da0
callq 0x8c38
movq %rax, 0xb1e2(%rip)      # 0x13db8
movl $0x10c, %ebx            # imm = 0x10C
jmp 0x8ae5
testq %r15, %r15
jne 0x8bf1
callq 0x22a2
xorl %eax, %eax
jmp 0x8829
movq 0xb1b8(%rip), %rdi      # 0x13db0
movl 0xb1a2(%rip), %esi      # 0x13da0
callq 0x8c38
leaq 0x58e5(%rip), %rsi      # 0xe4ef
movq %rax, %rdi
xorl %eax, %eax
callq 0x4fa1
leaq 0x52a5(%rip), %rdi      # 0xdec0
leaq 0x58fc(%rip), %rsi      # 0xe51e
leaq 0x58fb(%rip), %rcx      # 0xe524
movl $0x11b, %edx            # imm = 0x11B
xorl %eax, %eax
callq 0x4eac
nopl (%rax)