// File: /workspace/github_c_makefile_star2_O0/MaoKo[P]FGFX/fgfl/src/lexical_spec.c
// Function: spec_state_token_list
int
spec_state_token_list(lexical_spec_t* spec, int kind_section) {
    if (peek_token(spec->lex) == T_RBRACE)
        { return (DONE); }
    else if (advance_token(spec->lex) == T_TERMINAL) {
        spec_entry_t* entry = add_entry_lexeme(spec, kind_section);
        if (!entry)
            { return (ERROR); }

        ++(entry->count);
        if (kind_section == T_STATE)
            { entry->is_defined = true; }

        if (peek_token(spec->lex) == T_BARROW) {
            if (kind_section == T_KEYWORD) {
                errorf(CURRENT_LINE(spec->lex),
                            "A '=>' can't appear in the $KEYWORD section.");
                return (ERROR);
            }

            advance_token(spec->lex);
            if (advance_token(spec->lex) != T_INITIAL) {
                errorf(CURRENT_LINE(spec->lex),
                            "Missing $INITIAL after the '=>' in the $STATE.");
                return (ERROR);
            }
            else if (spec->start_state != -1)
                { warnf(CURRENT_LINE(spec->lex), "Override initial state."); }
            spec->start_state = GET_INDEX(entry);
        }

        if (peek_token(spec->lex) == T_COMMA) {
            advance_token(spec->lex);
            return (spec_state_token_list(spec, kind_section));
        }
    }
    else {
        errorf(CURRENT_LINE(spec->lex),
                            "Expected identifier in the %s section.",
                            STATE_TYPE_LST_SECT(kind_section));
        return (ERROR);
    }
    return (DONE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x3300
cmpl $0x33, %eax
jne 0x527c
movl $0x0, -0x4(%rbp)
jmp 0x53fe
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2cc0
cmpq $0x2d, %rax
jne 0x53bb
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x5600
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x52b5
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x53fe
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x28(%rax)
cmpl $0x43, -0x14(%rbp)
jne 0x52d3
movq -0x20(%rbp), %rax
movb $0x1, 0x20(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x3300
cmpl $0x2f, %eax
jne 0x538b
cmpl $0x42, -0x14(%rbp)
jne 0x5313
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq 0x28(%rax), %rdi
leaq 0x973c(%rip), %rsi      # 0xea3c
movb $0x0, %al
callq 0x4230
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x53fe
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2cc0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2cc0
cmpq $0x45, %rax
je 0x5356
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq 0x28(%rax), %rdi
leaq 0x9726(%rip), %rsi      # 0xea69
movb $0x0, %al
callq 0x4230
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x53fe
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x18(%rax)
je 0x5379
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq 0x28(%rax), %rdi
leaq 0x9726(%rip), %rsi      # 0xea98
movb $0x0, %al
callq 0x43e0
jmp 0x537b
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x3300
cmpl $0x31, %eax
jne 0x53b9
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2cc0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x5250
movl %eax, -0x4(%rbp)
jmp 0x53fe
jmp 0x53f5
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq 0x28(%rax), %rdi
movl -0x14(%rbp), %ecx
leaq 0x8c85(%rip), %rdx      # 0xe055
leaq 0x8c87(%rip), %rax      # 0xe05e
cmpl $0x43, %ecx
cmoveq %rax, %rdx
leaq 0x96cb(%rip), %rsi      # 0xeab0
movb $0x0, %al
callq 0x4230
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x53fe
jmp 0x53f7
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)