// File: /workspace/github_c_makefile_star2_O0/MaoKo[P]FGFX/fgfl/src/lexical_spec.c
// Function: check_validity_state
static int
check_validity_state(lexical_spec_t* spec) {
    int exit_st = DONE;
    for (size_t i = 0; i < SIZE_VECTOR(spec->state_vect); ++i) {
        spec_entry_t* crt_state = (spec_entry_t*)AT_VECTOR(spec->state_vect, i);
        if (!crt_state->is_defined) {
            errorf(0, "The state %s is used but not defined.",
                                crt_state->name);
            exit_st = ERROR;
        }
        if ((!crt_state->is_used)
                    && ((size_t)spec->start_state != GET_INDEX(crt_state))) {
            warnf(0, "The state %s is defined but not used.",
                                crt_state->name);
//          del_useless_state(spec, GET_INDEX(crt_state));
        }
        if (!crt_state->is_reach
                && ((size_t)spec->start_state != GET_INDEX(crt_state))) {
            warnf(0, "The state %s is actualy unreachable.",
                                crt_state->name);
//          del_useless_state(spec, GET_INDEX(crt_state));
        }
        if (crt_state->count > 1) {
            warnf(0, "The state '%s' appear %zu in the $STATE section.",
                                crt_state->name, crt_state->count);
        }
    }

    if ((exit_st != ERROR) && (SIZE_VECTOR(spec->state_vect) == 1)) {
        warnf(0, "Useless to have only 1 state. It's an implicit state.");
        POP_BACK_VECTOR(spec->state_vect);
        spec->start_state = -1;
    }

    return (exit_st);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
cmpq 0x10(%rcx), %rax
jae 0x4fcd
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
testb $0x1, 0x20(%rax)
jne 0x4f23
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdx
xorl %eax, %eax
movl %eax, %edi
leaq 0x9c6e(%rip), %rsi      # 0xeb83
movb $0x0, %al
callq 0x4230
movl $0xffffffff, -0xc(%rbp) # imm = 0xFFFFFFFF
movq -0x20(%rbp), %rax
testb $0x1, 0xc(%rax)
jne 0x4f58
movq -0x8(%rbp), %rax
movslq 0x18(%rax), %rax
movq -0x20(%rbp), %rcx
cmpq (%rcx), %rax
je 0x4f58
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdx
xorl %eax, %eax
movl %eax, %edi
leaq 0x9c58(%rip), %rsi      # 0xeba9
movb $0x0, %al
callq 0x43e0
movq -0x20(%rbp), %rax
testb $0x1, 0x21(%rax)
jne 0x4f8d
movq -0x8(%rbp), %rax
movslq 0x18(%rax), %rax
movq -0x20(%rbp), %rcx
cmpq (%rcx), %rax
je 0x4f8d
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdx
xorl %eax, %eax
movl %eax, %edi
leaq 0x9c49(%rip), %rsi      # 0xebcf
movb $0x0, %al
callq 0x43e0
movq -0x20(%rbp), %rax
cmpq $0x1, 0x28(%rax)
jbe 0x4fba
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rcx
xorl %eax, %eax
movl %eax, %edi
leaq 0x9c41(%rip), %rsi      # 0xebf4
movb $0x0, %al
callq 0x43e0
jmp 0x4fbc
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x4ecb
cmpl $-0x1, -0xc(%rbp)
je 0x501c
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
cmpq $0x1, 0x10(%rax)
jne 0x501c
xorl %eax, %eax
movl %eax, %edi
leaq 0x9c38(%rip), %rsi      # 0xec25
movb $0x0, %al
callq 0x43e0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rsi
subq $0x1, %rsi
callq 0x21c0
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x18(%rax) # imm = 0xFFFFFFFF
movl -0xc(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)