// File: /workspace/github_c_makefile_star2_O0/MaoKo[P]FGFX/fgfl/src/lexical_spec.c
// Function: spec_regex_list
int
spec_regex_list(lexical_spec_t* spec, int kind_section) {
    if (peek_token(spec->lex) == T_RBRACE)
        { return (DONE); }

    bool all_state = false;
    trans_list_t* state_seen = NULL;

    if (spec_state_prefix(spec, &state_seen, &all_state) == ERROR)
        { return (ERROR); }

    if (peek_token(spec->lex) == T_TERMINAL) {
        spec->miss_regex = false;
        spec_entry_t* entry = add_entry_lexeme(spec, advance_token(spec->lex));

        if (!entry)
            { return (ERROR); }

        entry->all_state = all_state;
        entry->state_lst = state_seen;

        if (spec_regex_assign(spec, entry, kind_section) == ERROR)
            { return (ERROR); }
        else if (advance_token(spec->lex) != T_SEMI) {
            errorf(CURRENT_LINE(spec->lex),
                        "Missing a ';' after the regex definition.");
            return (ERROR);
        }
        return (spec_regex_list(spec, kind_section));
    }
    else if (peek_token(spec->lex) != T_RBRACE) {
        errorf(CURRENT_LINE(spec->lex),
                            "Missing a local or global token in %s section",
                            REGEX_LST_SECT(kind_section));
        return (ERROR);
    }
    return (DONE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x3300
cmpl $0x33, %eax
jne 0x50ec
movl $0x0, -0x4(%rbp)
jmp 0x5242
movb $0x0, -0x15(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x20(%rbp), %rsi
leaq -0x15(%rbp), %rdx
callq 0x5410
cmpl $-0x1, %eax
jne 0x511a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5242
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x3300
cmpl $0x2d, %eax
jne 0x51ee
movq -0x10(%rbp), %rax
movb $0x0, 0x1c(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2cc0
movq -0x30(%rbp), %rdi
movl %eax, %esi
callq 0x5600
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x516d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5242
movb -0x15(%rbp), %cl
movq -0x28(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x34(%rax)
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x58d0
cmpl $-0x1, %eax
jne 0x51a7
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5242
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2cc0
cmpq $0x30, %rax
je 0x51db
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq 0x28(%rax), %rdi
leaq 0x9316(%rip), %rsi      # 0xe4e1
movb $0x0, %al
callq 0x4230
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5242
jmp 0x51dd
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x50c0
movl %eax, -0x4(%rbp)
jmp 0x5242
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x3300
cmpl $0x33, %eax
je 0x5239
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq 0x28(%rax), %rdi
movl -0x14(%rbp), %ecx
leaq 0x8e34(%rip), %rdx      # 0xe048
leaq 0x8e33(%rip), %rax      # 0xe04e
cmpl $0x41, %ecx
cmoveq %rax, %rdx
leaq 0x92e2(%rip), %rsi      # 0xe50b
movb $0x0, %al
callq 0x4230
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5242
jmp 0x523b
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)