// File: /workspace/github_c_makefile_star2_O0/naleksiev[P]fin/src/fin_lex.c
// Function: fin_lex_next_token
static fin_lex_token_t fin_lex_next_token(fin_lex_t* lex) {
    fin_lex_state_t state = lex->states[lex->state_idx];

    if (state.type == fin_lex_state_type_string) {
        return fin_lex_create_string_token(lex);
    }

    if (*lex->cstr == '\0')
        return fin_lex_create_token(lex, fin_lex_type_eof);

    while (true) {
        char c = *lex->cstr++;
        switch (c) {
            case '\0': return fin_lex_create_token(lex, fin_lex_type_eof);
            case '(': return fin_lex_create_token(lex, fin_lex_type_l_paren);
            case ')': return fin_lex_create_token(lex, fin_lex_type_r_paren);
            case '[': return fin_lex_create_token(lex, fin_lex_type_l_bracket);
            case ']': return fin_lex_create_token(lex, fin_lex_type_r_bracket);
            case '{': return fin_lex_create_token(lex, fin_lex_type_l_brace);
            case '.': return fin_lex_create_token(lex, fin_lex_type_dot);
            case ',': return fin_lex_create_token(lex, fin_lex_type_comma);
            case '?': return fin_lex_create_token(lex, fin_lex_type_question);
            case ':': return fin_lex_create_token(lex, fin_lex_type_colon);
            case ';': return fin_lex_create_token(lex, fin_lex_type_semicolon);
            case '~': return fin_lex_create_token(lex, fin_lex_type_tilde);
            case '=': return fin_lex_create_token(lex, fin_lex_match_char(lex, '=') ? fin_lex_type_eq_eq : fin_lex_type_eq);
            case '!': return fin_lex_create_token(lex, fin_lex_match_char(lex, '=') ? fin_lex_type_bang_eq : fin_lex_type_bang);
            case '*': return fin_lex_create_token(lex, fin_lex_match_char(lex, '=') ? fin_lex_type_star_eq : fin_lex_type_star);
            case '%': return fin_lex_create_token(lex, fin_lex_match_char(lex, '=') ? fin_lex_type_percent_eq : fin_lex_type_percent);
            case '^': return fin_lex_create_token(lex, fin_lex_match_char(lex, '=') ? fin_lex_type_caret_eq : fin_lex_type_caret);
            case '+':
                return fin_lex_create_token(lex, fin_lex_match_char(lex, '+') ?
                    fin_lex_type_plus_plus :
                    fin_lex_match_char(lex, '=') ? fin_lex_type_plus_eq : fin_lex_type_plus);
            case '-':
                return fin_lex_create_token(lex, fin_lex_match_char(lex, '-') ?
                    fin_lex_type_minus_minus :
                    fin_lex_match_char(lex, '=') ? fin_lex_type_minus_eq : fin_lex_type_minus);
            case '|':
                return fin_lex_create_token(lex, fin_lex_match_char(lex, '|') ?
                    fin_lex_type_pipe_pipe :
                    fin_lex_match_char(lex, '=') ? fin_lex_type_pipe_eq : fin_lex_type_pipe);
            case '&':
                return fin_lex_create_token(lex, fin_lex_match_char(lex, '&') ?
                    fin_lex_type_amp_amp :
                    fin_lex_match_char(lex, '=') ? fin_lex_type_amp_eq : fin_lex_type_amp);
            case '<':
                return fin_lex_create_token(lex, fin_lex_match_char(lex, '<') ?
                    (fin_lex_match_char(lex, '=') ? fin_lex_type_lt_lt_eq : fin_lex_type_lt_lt) :
                    (fin_lex_match_char(lex, '=') ? fin_lex_type_lt_eq : fin_lex_type_lt));
            case '>':
                return fin_lex_create_token(lex, fin_lex_match_char(lex, '>') ?
                    (fin_lex_match_char(lex, '=') ? fin_lex_type_gt_gt_eq : fin_lex_type_gt_gt) :
                    (fin_lex_match_char(lex, '=') ? fin_lex_type_gt_eq : fin_lex_type_gt));
            case '/':
                if (fin_lex_match_char(lex, '/')) { fin_lex_skip_line_comment(lex); break; }
                if (fin_lex_match_char(lex, '*')) { fin_lex_skip_block_comment(lex); break; }
                return fin_lex_create_token(lex, fin_lex_match_char(lex, '=') ? fin_lex_type_slash_eq : fin_lex_type_slash);
            case ' ':
            case '\t':
            case '\r':
                fin_lex_skip_whitespaces(lex);
                break;
            case '\n':
                lex->line++;
                break;
            case '"':
                if (fin_lex_match_char(lex, '"')) {
                    fin_lex_token_t token;
                    token.type = fin_lex_type_string;
                    token.cstr = lex->cstr - 2;
                    token.line = lex->line;
                    token.len = 0;
                    return token;
                }
                lex->state_idx++;
                lex->states[lex->state_idx].cstr = lex->cstr - 1;
                lex->states[lex->state_idx].type = fin_lex_state_type_string;
                return fin_lex_create_token(lex, fin_lex_type_quot);
            case '}':
                if (lex->states[lex->state_idx].type == fin_lex_state_type_interp) {
                    lex->state_idx--;
                    return fin_lex_create_token(lex, fin_lex_type_r_str_interp);
                }
                return fin_lex_create_token(lex, fin_lex_type_r_brace);
            default:
                if (fin_lex_is_name(c))
                    return fin_lex_create_name_token(lex);
                if (fin_lex_is_digit(c))
                    return fin_lex_create_number_token(lex);
                fin_lex_error(lex, "Unterminated character.");
                return fin_lex_create_token(lex, fin_lex_type_error);
        }
    };
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x30(%rbp)
movq %rdi, -0x28(%rbp)
movq %rsi, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x28, %rax
movq -0x8(%rbp), %rcx
movslq 0x128(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x18(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
cmpl $0x1, -0x18(%rbp)
jne 0x6568
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x6ec0
jmp 0x6cc3
movq -0x8(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x658e
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x41, %edx
callq 0x7080
jmp 0x6cc3
jmp 0x6590
movq -0x8(%rbp), %rcx
movq (%rcx), %rax
movq %rax, %rdx
incq %rdx
movq %rdx, (%rcx)
movb (%rax), %al
movb %al, -0x19(%rbp)
movsbl -0x19(%rbp), %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x7e, %eax
ja 0x6c5c
movq -0x38(%rbp), %rax
leaq 0x6d35(%rip), %rcx      # 0xd2f8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x41, %edx
callq 0x7080
jmp 0x6cc3
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x2e, %edx
callq 0x7080
jmp 0x6cc3
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x2f, %edx
callq 0x7080
jmp 0x6cc3
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x30, %edx
callq 0x7080
jmp 0x6cc3
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x31, %edx
callq 0x7080
jmp 0x6cc3
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x32, %edx
callq 0x7080
jmp 0x6cc3
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x8, %edx
callq 0x7080
jmp 0x6cc3
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x9, %edx
callq 0x7080
jmp 0x6cc3
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0xa, %edx
callq 0x7080
jmp 0x6cc3
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0xb, %edx
callq 0x7080
jmp 0x6cc3
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0xc, %edx
callq 0x7080
jmp 0x6cc3
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0xe, %edx
callq 0x7080
jmp 0x6cc3
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movl $0x3d, %esi
callq 0x70b0
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
movb %al, %cl
movl $0x10, %edx
movl $0x1c, %eax
testb $0x1, %cl
cmovnel %eax, %edx
callq 0x7080
jmp 0x6cc3
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movl $0x3d, %esi
callq 0x70b0
movq -0x30(%rbp), %rdi
movq -0x48(%rbp), %rsi
movb %al, %cl
movl $0x11, %edx
movl $0x1d, %eax
testb $0x1, %cl
cmovnel %eax, %edx
callq 0x7080
jmp 0x6cc3
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
movl $0x3d, %esi
callq 0x70b0
movq -0x30(%rbp), %rdi
movq -0x50(%rbp), %rsi
movb %al, %cl
movl $0x14, %edx
movl $0x20, %eax
testb $0x1, %cl
cmovnel %eax, %edx
callq 0x7080
jmp 0x6cc3
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rdi
movl $0x3d, %esi
callq 0x70b0
movq -0x30(%rbp), %rdi
movq -0x58(%rbp), %rsi
movb %al, %cl
movl $0x17, %edx
movl $0x22, %eax
testb $0x1, %cl
cmovnel %eax, %edx
callq 0x7080
jmp 0x6cc3
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
movl $0x3d, %esi
callq 0x70b0
movq -0x30(%rbp), %rdi
movq -0x60(%rbp), %rsi
movb %al, %cl
movl $0xd, %edx
movl $0x25, %eax
testb $0x1, %cl
cmovnel %eax, %edx
callq 0x7080
jmp 0x6cc3
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rdi
movl $0x2b, %esi
callq 0x70b0
testb $0x1, %al
jne 0x681e
jmp 0x6828
movl $0x18, %eax
movl %eax, -0x6c(%rbp)
jmp 0x684b
movq -0x8(%rbp), %rdi
movl $0x3d, %esi
callq 0x70b0
movb %al, %dl
movl $0x12, %eax
movl $0x1e, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x6c(%rbp)
movq -0x68(%rbp), %rsi
movq -0x30(%rbp), %rdi
movl -0x6c(%rbp), %edx
callq 0x7080
jmp 0x6cc3
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x8(%rbp), %rdi
movl $0x2d, %esi
callq 0x70b0
testb $0x1, %al
jne 0x687c
jmp 0x6886
movl $0x19, %eax
movl %eax, -0x7c(%rbp)
jmp 0x68a9
movq -0x8(%rbp), %rdi
movl $0x3d, %esi
callq 0x70b0
movb %al, %dl
movl $0x13, %eax
movl $0x1f, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x7c(%rbp)
movq -0x78(%rbp), %rsi
movq -0x30(%rbp), %rdi
movl -0x7c(%rbp), %edx
callq 0x7080
jmp 0x6cc3
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x8(%rbp), %rdi
movl $0x7c, %esi
callq 0x70b0
testb $0x1, %al
jne 0x68dd
jmp 0x68ea
movl $0x1a, %eax
movl %eax, -0x8c(%rbp)
jmp 0x6910
movq -0x8(%rbp), %rdi
movl $0x3d, %esi
callq 0x70b0
movb %al, %dl
movl $0x16, %eax
movl $0x24, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x8c(%rbp)
movq -0x88(%rbp), %rsi
movq -0x30(%rbp), %rdi
movl -0x8c(%rbp), %edx
callq 0x7080
jmp 0x6cc3
movq -0x8(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x8(%rbp), %rdi
movl $0x26, %esi
callq 0x70b0
testb $0x1, %al
jne 0x694a
jmp 0x6957
movl $0x1b, %eax
movl %eax, -0x9c(%rbp)
jmp 0x697d
movq -0x8(%rbp), %rdi
movl $0x3d, %esi
callq 0x70b0
movb %al, %dl
movl $0xf, %eax
movl $0x23, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x9c(%rbp)
movq -0x98(%rbp), %rsi
movq -0x30(%rbp), %rdi
movl -0x9c(%rbp), %edx
callq 0x7080
jmp 0x6cc3
movq -0x8(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x3c, %esi
callq 0x70b0
testb $0x1, %al
jne 0x69b7
jmp 0x69df
movq -0x8(%rbp), %rdi
movl $0x3d, %esi
callq 0x70b0
movb %al, %dl
movl $0x27, %eax
movl $0x29, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0xac(%rbp)
jmp 0x6a05
movq -0x8(%rbp), %rdi
movl $0x3d, %esi
callq 0x70b0
movb %al, %dl
movl $0x26, %eax
movl $0x28, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0xac(%rbp)
movq -0xa8(%rbp), %rsi
movq -0x30(%rbp), %rdi
movl -0xac(%rbp), %edx
callq 0x7080
jmp 0x6cc3
movq -0x8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x3e, %esi
callq 0x70b0
testb $0x1, %al
jne 0x6a3f
jmp 0x6a67
movq -0x8(%rbp), %rdi
movl $0x3d, %esi
callq 0x70b0
movb %al, %dl
movl $0x2b, %eax
movl $0x2d, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0xbc(%rbp)
jmp 0x6a8d
movq -0x8(%rbp), %rdi
movl $0x3d, %esi
callq 0x70b0
movb %al, %dl
movl $0x2a, %eax
movl $0x2c, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0xbc(%rbp)
movq -0xb8(%rbp), %rsi
movq -0x30(%rbp), %rdi
movl -0xbc(%rbp), %edx
callq 0x7080
jmp 0x6cc3
movq -0x8(%rbp), %rdi
movl $0x2f, %esi
callq 0x70b0
testb $0x1, %al
jne 0x6abc
jmp 0x6aca
movq -0x8(%rbp), %rdi
callq 0x70f0
jmp 0x6cbe
movq -0x8(%rbp), %rdi
movl $0x2a, %esi
callq 0x70b0
testb $0x1, %al
jne 0x6ade
jmp 0x6aec
movq -0x8(%rbp), %rdi
callq 0x7140
jmp 0x6cbe
movq -0x8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x3d, %esi
callq 0x70b0
movq -0x30(%rbp), %rdi
movq -0xc8(%rbp), %rsi
movb %al, %cl
movl $0x15, %edx
movl $0x21, %eax
testb $0x1, %cl
cmovnel %eax, %edx
callq 0x7080
jmp 0x6cc3
movq -0x8(%rbp), %rdi
callq 0x71c0
jmp 0x6cbe
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
jmp 0x6cbe
movq -0x8(%rbp), %rdi
movl $0x22, %esi
callq 0x70b0
testb $0x1, %al
jne 0x6b60
jmp 0x6b8f
movq -0x30(%rbp), %rax
movl $0x3, (%rax)
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
addq $-0x2, %rcx
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rcx
movl 0x8(%rcx), %ecx
movl %ecx, 0x14(%rax)
movl $0x0, 0x10(%rax)
jmp 0x6cc3
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x128(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x128(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $-0x1, %rcx
movq -0x8(%rbp), %rax
addq $0x28, %rax
movq -0x8(%rbp), %rdx
movslq 0x128(%rdx), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
addq $0x28, %rax
movq -0x8(%rbp), %rcx
movslq 0x128(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl $0x1, (%rax)
movq -0x8(%rbp), %rsi
movl $0x5, %edx
callq 0x7080
jmp 0x6cc3
movq -0x8(%rbp), %rax
addq $0x28, %rax
movq -0x8(%rbp), %rcx
movslq 0x128(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpl $0x2, (%rax)
jne 0x6c48
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x128(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x128(%rax)
movq -0x8(%rbp), %rsi
movl $0x7, %edx
callq 0x7080
jmp 0x6cc3
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x33, %edx
callq 0x7080
jmp 0x6cc3
movsbl -0x19(%rbp), %edi
callq 0x7220
testb $0x1, %al
jne 0x6c6b
jmp 0x6c7a
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x7280
jmp 0x6cc3
movsbl -0x19(%rbp), %edi
callq 0x73b0
testb $0x1, %al
jne 0x6c89
jmp 0x6c98
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x73e0
jmp 0x6cc3
movq -0x8(%rbp), %rdi
leaq 0x6851(%rip), %rsi      # 0xd4f4
movb $0x0, %al
callq 0x74a0
movq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x40, %edx
callq 0x7080
jmp 0x6cc3
jmp 0x6590
movq -0x28(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq