// File: /workspace/github_c_makefile_star2_O0/MaoKo[P]FGFX/fgfl/src/lexical_spec.c
// Function: check_validity_token
static int
check_validity_token(lexical_spec_t* spec) {
    bool state_present = !(EMPTY_VECTOR(spec->state_vect));
    int exit_st = DONE;

    for (int i = SIZE_VECTOR(spec->entry_vect) - 1; i >= 0; --i) {
        spec_entry_t* crt_entry = (spec_entry_t*)
                                    AT_VECTOR(spec->entry_vect, (size_t)i);

        if (crt_entry->kind == T_TERMINAL) {
            if (crt_entry->all_state)
                { foreach_vector(spec->state_vect, &set_used_state); }

            if (crt_entry->fragment) {
                if (!crt_entry->is_used) {
                    warnf(0, "Local token %s is defined but not used.",
                                        crt_entry->name);
                }
                if (crt_entry->state_lst) {
                    warnf(0, "Useless to do a $BEGIN on local token %s.",
                                        crt_entry->name);
                }
                readjust_index(spec->entry_vect,
                        (size_t)i, (void(*)(void*))&del_spec_entry);
            }
            else if (state_present) {
                if (!crt_entry->state_lst && !crt_entry->all_state) {
                    warnf(0, "Token %s is not prefixed by any state.",
                        crt_entry->name);
                }
            }
        }
        else if ((crt_entry->kind == T_KEYWORD) && (crt_entry->count > 1)) {
            warnf(0, "The token '%s' appear %zu in the $KEYWORD section.",
                    crt_entry->name, crt_entry->count);
        }
    }
    return (exit_st);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
cmpq $0x0, 0x10(%rax)
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movb %al, -0x9(%rbp)
movl $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
subq $0x1, %rax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0x4e9d
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x2d, 0x8(%rax)
jne 0x4e54
movq -0x20(%rbp), %rax
testb $0x1, 0x34(%rax)
je 0x4dac
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x15b9(%rip), %rsi      # 0x6360
callq 0x23c0
movq -0x20(%rbp), %rax
testb $0x1, 0x18(%rax)
je 0x4e19
movq -0x20(%rbp), %rax
testb $0x1, 0xc(%rax)
jne 0x4dda
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdx
xorl %eax, %eax
movl %eax, %edi
leaq 0x9d04(%rip), %rsi      # 0xead7
movb $0x0, %al
callq 0x43e0
movq -0x20(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x4dff
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdx
xorl %eax, %eax
movl %eax, %edi
leaq 0x9d07(%rip), %rsi      # 0xeaff
movb $0x0, %al
callq 0x43e0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movslq -0x14(%rbp), %rsi
leaq -0x532(%rip), %rdx      # 0x48e0
callq 0x3970
jmp 0x4e52
testb $0x1, -0x9(%rbp)
je 0x4e50
movq -0x20(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x4e4e
movq -0x20(%rbp), %rax
testb $0x1, 0x34(%rax)
jne 0x4e4e
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdx
xorl %eax, %eax
movl %eax, %edi
leaq 0x9ce2(%rip), %rsi      # 0xeb29
movb $0x0, %al
callq 0x43e0
jmp 0x4e50
jmp 0x4e52
jmp 0x4e8d
movq -0x20(%rbp), %rax
cmpl $0x42, 0x8(%rax)
jne 0x4e8b
movq -0x20(%rbp), %rax
cmpq $0x1, 0x28(%rax)
jbe 0x4e8b
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rcx
xorl %eax, %eax
movl %eax, %edi
leaq 0x9ccc(%rip), %rsi      # 0xeb50
movb $0x0, %al
callq 0x43e0
jmp 0x4e8d
jmp 0x4e8f
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x4d5f
movl -0x10(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)