// File: /workspace/github_c_makefile_star2_O1/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 0xb987(%rip), %rdi      # 0x13da8
callq 0x2240
movl %eax, %ebx
cmpl $0xa, %eax
je 0x8437
cmpl $-0x1, %ebx
jne 0x843d
jmp 0x8751
incl 0xb963(%rip)            # 0x13da0
callq 0x2260
movq %rax, %r14
movq (%rax), %rax
movslq %ebx, %rcx
movzwl (%rax,%rcx,2), %eax
btl $0xd, %eax
jb 0x841a
cmpl $0x5f, %ebx
je 0x8771
movl %eax, %ecx
andl $0x400, %ecx            # imm = 0x400
jne 0x8771
btl $0xb, %eax
jb 0x8847
cmpl $0x2f, %ebx
jne 0x8512
movq 0xb922(%rip), %rdi      # 0x13da8
callq 0x2240
cmpl $0xa, %eax
jne 0x8496
incl 0xb90a(%rip)            # 0x13da0
cmpl $0x2a, %eax
je 0x84cc
cmpl $0x2f, %eax
je 0x84c5
cmpl $0x3d, %eax
jne 0x84d8
movq 0xb904(%rip), %rdi      # 0x13db0
movl 0xb8ee(%rip), %esi      # 0x13da0
callq 0x8db4
movq %rax, 0xb8fa(%rip)      # 0x13db8
movl $0x1, %eax
jmp 0x84f6
callq 0x83be
jmp 0x84d1
callq 0x83dd
movl $0x2, %eax
jmp 0x84f6
cmpl $0xa, %eax
jne 0x84e3
decl 0xb8bd(%rip)            # 0x13da0
movq 0xb8be(%rip), %rsi      # 0x13da8
movl %eax, %edi
callq 0x2170
movl $0x17, %eax
cmpl $0x2, %eax
je 0x841a
cmpl $0x17, %eax
je 0x8d35
movl $0x115, %ebp            # imm = 0x115
jmp 0x8d50
leal -0x21(%rbx), %eax
cmpl $0x1d, %eax
ja 0x8595
leaq 0x5cc7(%rip), %rcx      # 0xe1e8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xb877(%rip), %rdi      # 0x13da8
callq 0x2240
movl %eax, %r14d
cmpl $0xa, %eax
jne 0x8544
incl 0xb85c(%rip)            # 0x13da0
cmpl $0x3d, %r14d
jne 0x8602
cmpl $0x29, %ebx
jle 0x8a45
cmpl $0x7e, %ebx
je 0x8b78
cmpl $0x3d, %ebx
je 0x8b9b
cmpl $0x2a, %ebx
jne 0x8d93
movq 0xb837(%rip), %rdi      # 0x13db0
movl 0xb821(%rip), %esi      # 0x13da0
callq 0x8db4
movq %rax, 0xb82d(%rip)      # 0x13db8
movl $0x114, %ebp            # imm = 0x114
jmp 0x8622
cmpl $0x7c, %ebx
je 0x85a4
cmpl $0x7e, %ebx
je 0x852a
jmp 0x8d35
movq 0xb7fd(%rip), %rdi      # 0x13da8
callq 0x2240
cmpl $0xa, %eax
jne 0x85bb
incl 0xb7e5(%rip)            # 0x13da0
cmpl $0x3d, %eax
jne 0x870b
cmpl $0x2c, %ebx
jg 0x8a7a
cmpl $0x26, %ebx
je 0x8c35
cmpl $0x2b, %ebx
jne 0x8c12
movq 0xb7ca(%rip), %rdi      # 0x13db0
movl 0xb7b4(%rip), %esi      # 0x13da0
callq 0x8db4
movq %rax, 0xb7c0(%rip)      # 0x13db8
movl $0x112, %ebp            # imm = 0x112
jmp 0x8d2f
cmpl $0xa, %r14d
jne 0x860e
decl 0xb792(%rip)            # 0x13da0
movq 0xb793(%rip), %rsi      # 0x13da8
movl %r14d, %edi
callq 0x2170
movl $0x115, %ebp            # imm = 0x115
cmpl $0x3d, %r14d
jne 0x8d35
jmp 0x8d50
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x2160
movq %rax, %r14
movl %ebx, %edi
callq 0x817a
cmpl $-0x1, %eax
je 0x8677
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 0x817a
movl %eax, %ebp
movq %r15, %r12
cmpl $-0x1, %eax
jne 0x864f
cmpl $0x22, %ebx
jne 0x8940
leaq 0x1(%r15), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2190
movb $0x0, (%rax,%r15)
movq %rax, 0xb725(%rip)      # 0x13dc0
movq %rbx, 0xb726(%rip)      # 0x13dc8
movl $0x11e, %ebp            # imm = 0x11E
jmp 0x8962
movq 0xb6f5(%rip), %rdi      # 0x13da8
callq 0x2240
movl %eax, %r14d
cmpl $0xa, %eax
jne 0x86c6
incl 0xb6da(%rip)            # 0x13da0
cmpl %ebx, %r14d
jne 0x8980
movq 0xb6d2(%rip), %rdi      # 0x13da8
callq 0x2240
cmpl $0xa, %eax
jne 0x86e6
incl 0xb6ba(%rip)            # 0x13da0
cmpl $0x3d, %eax
jne 0x8aaf
cmpl $0x3c, %ebx
je 0x8cce
cmpl $0x3e, %ebx
jne 0x8aaf
movl $0x118, %ebp            # imm = 0x118
jmp 0x8cd3
cmpl %ebx, %eax
jne 0x8c12
cmpl $0x2c, %ebx
jg 0x8be1
cmpl $0x26, %ebx
je 0x8c8b
cmpl $0x2b, %ebx
jne 0x8c12
movq 0xb67b(%rip), %rdi      # 0x13db0
movl 0xb665(%rip), %esi      # 0x13da0
callq 0x8db4
movq %rax, 0xb671(%rip)      # 0x13db8
movl $0x11d, %ebp            # imm = 0x11D
jmp 0x8d2f
movq 0xb658(%rip), %rdi      # 0x13db0
movl 0xb642(%rip), %esi      # 0x13da0
callq 0x8db4
movq %rax, 0xb64e(%rip)      # 0x13db8
xorl %ebp, %ebp
jmp 0x8d50
xorl %edi, %edi
callq 0x2160
movl $0x1, %esi
movq %rax, %rdi
callq 0x2190
movq %rax, %r15
movb %bl, (%rax)
movl $0x2, %ebx
movq 0xb612(%rip), %rdi      # 0x13da8
callq 0x2240
movl %eax, %ebp
cmpl $0xa, %eax
jne 0x87a8
incl 0xb5f8(%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 0x87cc
andl $0x8, %r12d
je 0x87d6
movb %bpl, -0x1(%r15,%rbx)
incq %rbx
jmp 0x878f
movb $0x0, -0x1(%r15,%rbx)
cmpl $0xa, %ebp
jne 0x87e7
decl 0xb5b9(%rip)            # 0x13da0
movq 0xb5ba(%rip), %rsi      # 0x13da8
movl %ebp, %edi
callq 0x2170
movq 0xa954(%rip), %rsi      # 0x13150
movq %r15, %rdi
callq 0x2100
leaq 0xa945(%rip), %rbx      # 0x13150
testl %eax, %eax
je 0x8ae4
xorl %r14d, %r14d
cmpq $0x12, %r14
je 0x8b3c
movq 0x10(%rbx), %rsi
addq $0x10, %rbx
movq %r15, %rdi
callq 0x2100
incq %r14
testl %eax, %eax
jne 0x8816
decq %r14
cmpq $0x12, %r14
setae %r14b
jmp 0x8ae7
xorl %edi, %edi
callq 0x2160
movl $0x1, %esi
movq %rax, %rdi
callq 0x2190
movq %rax, %r15
movb %bl, (%rax)
movl $0x2, %ebx
movq 0xb53c(%rip), %rdi      # 0x13da8
callq 0x2240
movl %eax, %ebp
cmpl $0xa, %eax
jne 0x887e
incl 0xb522(%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 0x88a2
andl $0x8, %r12d
je 0x88ac
movb %bpl, -0x1(%r15,%rbx)
incq %rbx
jmp 0x8865
movb $0x0, -0x1(%r15,%rbx)
cmpl $0xa, %ebp
jne 0x88bd
decl 0xb4e3(%rip)            # 0x13da0
movq 0xb4e4(%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 0x890e
movq 0xb4c1(%rip), %rdi      # 0x13db0
movl 0xb4ab(%rip), %esi      # 0x13da0
callq 0x8db4
leaq 0x5bbd(%rip), %rsi      # 0xe4be
movq %rax, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x4e18
movq %r15, %rdi
callq 0x2030
movq %rbx, 0xb4a3(%rip)      # 0x13dc0
movq 0xb48c(%rip), %rdi      # 0x13db0
movl 0xb476(%rip), %esi      # 0x13da0
callq 0x8db4
movq %rax, 0xb482(%rip)      # 0x13db8
movl $0x11f, %ebp            # imm = 0x11F
jmp 0x8d50
cmpq $0x1, %r15
jne 0x8d5f
movsbq (%r14), %rax
movq %rax, 0xb46b(%rip)      # 0x13dc0
movq %r14, %rdi
callq 0x2030
movl $0x11f, %ebp            # imm = 0x11F
movq 0xb447(%rip), %rdi      # 0x13db0
movl 0xb431(%rip), %esi      # 0x13da0
callq 0x8db4
movq %rax, 0xb43d(%rip)      # 0x13db8
jmp 0x8d50
movl $0x115, %ebp            # imm = 0x115
cmpl $0x3d, %r14d
jne 0x8cf2
cmpl $0x3e, %ebx
je 0x8d11
cmpl $0x3c, %ebx
jne 0x8cf2
movq 0xb408(%rip), %rdi      # 0x13db0
movl 0xb3f2(%rip), %esi      # 0x13da0
callq 0x8db4
movq %rax, 0xb3fe(%rip)      # 0x13db8
movl $0x10d, %ebp            # imm = 0x10D
jmp 0x8d2f
movq 0xb3dd(%rip), %rdi      # 0x13da8
callq 0x2240
movl %eax, %r14d
cmpl $0xa, %eax
jne 0x89de
incl 0xb3c2(%rip)            # 0x13da0
cmpl $0x2e, %r14d
jne 0x8b0d
movq 0xb3b9(%rip), %rdi      # 0x13da8
callq 0x2240
cmpl $0xa, %eax
jne 0x89ff
incl 0xb3a1(%rip)            # 0x13da0
movl $0x122, %ebp            # imm = 0x122
cmpl $0x2e, %eax
je 0x8a27
cmpl $0xa, %eax
jne 0x8a14
decl 0xb38c(%rip)            # 0x13da0
movq 0xb38d(%rip), %rsi      # 0x13da8
movl %eax, %edi
callq 0x2170
movl $0x12f, %ebp            # imm = 0x12F
movq 0xb382(%rip), %rdi      # 0x13db0
movl 0xb36c(%rip), %esi      # 0x13da0
callq 0x8db4
movq %rax, 0xb378(%rip)      # 0x13db8
jmp 0x8b2d
cmpl $0x21, %ebx
je 0x8bbe
cmpl $0x25, %ebx
jne 0x8d93
movq 0xb352(%rip), %rdi      # 0x13db0
movl 0xb33c(%rip), %esi      # 0x13da0
callq 0x8db4
movq %rax, 0xb348(%rip)      # 0x13db8
movl $0x116, %ebp            # imm = 0x116
jmp 0x8622
cmpl $0x2d, %ebx
je 0x8c58
cmpl $0x7c, %ebx
jne 0x8c12
movq 0xb31d(%rip), %rdi      # 0x13db0
movl 0xb307(%rip), %esi      # 0x13da0
callq 0x8db4
movq %rax, 0xb313(%rip)      # 0x13db8
movl $0x119, %ebp            # imm = 0x119
jmp 0x8d2f
cmpl $0xa, %eax
jne 0x8aba
decl 0xb2e6(%rip)            # 0x13da0
movq 0xb2e7(%rip), %rsi      # 0x13da8
movl %eax, %edi
callq 0x2170
cmpl $0x3c, %ebx
je 0x8c7b
cmpl $0x3e, %ebx
jne 0x8c82
movl $0x111, %ebp            # imm = 0x111
jmp 0x8cd3
xorl %r14d, %r14d
movq %r15, %rdi
callq 0x2030
movq 0xb2ba(%rip), %rdi      # 0x13db0
movl 0xb2a4(%rip), %esi      # 0x13da0
callq 0x8db4
movq %rax, 0xb2b0(%rip)      # 0x13db8
movl 0x8(%rbx), %ebp
jmp 0x8b45
cmpl $0xa, %r14d
jne 0x8b19
decl 0xb287(%rip)            # 0x13da0
movq 0xb288(%rip), %rsi      # 0x13da8
movl %r14d, %edi
callq 0x2170
movl $0x115, %ebp            # imm = 0x115
cmpl $0x2e, %r14d
jne 0x8d35
jmp 0x8d50
setae %r14b
movl $0x115, %ebp            # imm = 0x115
testb %r14b, %r14b
je 0x8d50
movq %r15, 0xb26b(%rip)      # 0x13dc0
movq 0xb254(%rip), %rdi      # 0x13db0
movl 0xb23e(%rip), %esi      # 0x13da0
callq 0x8db4
movq %rax, 0xb24a(%rip)      # 0x13db8
movl $0x120, %ebp            # imm = 0x120
jmp 0x8d50
movq 0xb231(%rip), %rdi      # 0x13db0
movl 0xb21b(%rip), %esi      # 0x13da0
callq 0x8db4
movq %rax, 0xb227(%rip)      # 0x13db8
movl $0x11a, %ebp            # imm = 0x11A
jmp 0x8622
movq 0xb20e(%rip), %rdi      # 0x13db0
movl 0xb1f8(%rip), %esi      # 0x13da0
callq 0x8db4
movq %rax, 0xb204(%rip)      # 0x13db8
movl $0x10e, %ebp            # imm = 0x10E
jmp 0x8622
movq 0xb1eb(%rip), %rdi      # 0x13db0
movl 0xb1d5(%rip), %esi      # 0x13da0
callq 0x8db4
movq %rax, 0xb1e1(%rip)      # 0x13db8
movl $0x10f, %ebp            # imm = 0x10F
jmp 0x8622
cmpl $0x2d, %ebx
je 0x8cae
cmpl $0x7c, %ebx
jne 0x8c12
movq 0xb1ba(%rip), %rdi      # 0x13db0
movl 0xb1a4(%rip), %esi      # 0x13da0
callq 0x8db4
movq %rax, 0xb1b0(%rip)      # 0x13db8
movl $0x10b, %ebp            # imm = 0x10B
jmp 0x8d2f
cmpl $0xa, %eax
jne 0x8c1d
decl 0xb183(%rip)            # 0x13da0
movq 0xb184(%rip), %rsi      # 0x13da8
movl %eax, %edi
callq 0x2170
movl $0x115, %ebp            # imm = 0x115
jmp 0x8d0d
movq 0xb174(%rip), %rdi      # 0x13db0
movl 0xb15e(%rip), %esi      # 0x13da0
callq 0x8db4
movq %rax, 0xb16a(%rip)      # 0x13db8
movl $0x11b, %ebp            # imm = 0x11B
jmp 0x8d2f
movq 0xb151(%rip), %rdi      # 0x13db0
movl 0xb13b(%rip), %esi      # 0x13da0
callq 0x8db4
movq %rax, 0xb147(%rip)      # 0x13db8
movl $0x113, %ebp            # imm = 0x113
jmp 0x8d2f
movl $0x110, %ebp            # imm = 0x110
jmp 0x8cd3
movl $0x115, %ebp            # imm = 0x115
movb $0x1, %al
jmp 0x8cee
movq 0xb11e(%rip), %rdi      # 0x13db0
movl 0xb108(%rip), %esi      # 0x13da0
callq 0x8db4
movq %rax, 0xb114(%rip)      # 0x13db8
movl $0x10a, %ebp            # imm = 0x10A
jmp 0x8d2f
movq 0xb0fb(%rip), %rdi      # 0x13db0
movl 0xb0e5(%rip), %esi      # 0x13da0
callq 0x8db4
movq %rax, 0xb0f1(%rip)      # 0x13db8
movl $0x11c, %ebp            # imm = 0x11C
jmp 0x8d2f
movl $0x117, %ebp            # imm = 0x117
movq 0xb0d6(%rip), %rdi      # 0x13db0
movl 0xb0c0(%rip), %esi      # 0x13da0
callq 0x8db4
movq %rax, 0xb0cc(%rip)      # 0x13db8
xorl %eax, %eax
testb %al, %al
je 0x8d2f
cmpl $0xa, %r14d
jne 0x8cfe
decl 0xb0a2(%rip)            # 0x13da0
movq 0xb0a3(%rip), %rsi      # 0x13da8
movl %r14d, %edi
callq 0x2170
movb $0x1, %al
jmp 0x8d31
movq 0xb098(%rip), %rdi      # 0x13db0
movl 0xb082(%rip), %esi      # 0x13da0
callq 0x8db4
movq %rax, 0xb08e(%rip)      # 0x13db8
movl $0x10c, %ebp            # imm = 0x10C
xorl %eax, %eax
testb %al, %al
je 0x8d50
movq 0xb074(%rip), %rdi      # 0x13db0
movl 0xb05e(%rip), %esi      # 0x13da0
callq 0x8db4
movq %rax, 0xb06a(%rip)      # 0x13db8
movl %ebx, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
testq %r15, %r15
jne 0x8d70
callq 0x229b
xorl %eax, %eax
jmp 0x894e
movq 0xb039(%rip), %rdi      # 0x13db0
movl 0xb023(%rip), %esi      # 0x13da0
callq 0x8db4
leaq 0x5766(%rip), %rsi      # 0xe4ef
movq %rax, %rdi
xorl %eax, %eax
callq 0x5011
leaq 0x5126(%rip), %rdi      # 0xdec0
leaq 0x577d(%rip), %rsi      # 0xe51e
leaq 0x577c(%rip), %rcx      # 0xe524
movl $0x11b, %edx            # imm = 0x11B
xorl %eax, %eax
callq 0x4f1c