// File: /workspace/github_c_makefile_star2_O0/MaoKo[P]FGFX/fgfl/src/lexical_spec.c
// Function: spec_regex_assign
int
spec_regex_assign(lexical_spec_t* spec,
                            spec_entry_t* entry, int kind_section) {
    if (peek_token(spec->lex) == T_EQUAL) {
        if (kind_section == T_SKIP)
            { entry->must_skip = true; }
        advance_token(spec->lex);
    
        if (advance_token(spec->lex) != T_OPEN_REGEX) {
            errorf(CURRENT_LINE(spec->lex),
                        "No found regex after %s = .", entry->name);
            return (ERROR);
        }

        regex_node_t* root = build_regex(spec, entry);
        if (!root)
            { return (ERROR); }
        else if (entry->regex_ast) {
            errorf(CURRENT_LINE(spec->lex),
                           "Attempt to re-assign the token '%s'", entry->name);
            return (ERROR);
        }
    
        entry->regex_ast = root;
        if (advance_token(spec->lex) != T_CLOSE_REGEX) {
            errorf(CURRENT_LINE(spec->lex),
                            "No found the end of the regex '/'.");
            return (ERROR);
        }
        else if (spec_regex_opt_fragment(spec, entry) == ERROR)
            { return (ERROR); }

        if (peek_token(spec->lex) == T_COMMA) {
            advance_token(spec->lex);
            if (spec_action_state(spec, entry) == ERROR)
                { return (ERROR); }
        }
    }
    else {
        errorf(CURRENT_LINE(spec->lex),
                "An equal sign ('=') must follow the token %s.", entry->name);
        return (ERROR);
    }
    return (DONE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x3300
cmpl $0x0, %eax
jne 0x5a4b
cmpl $0x40, -0x1c(%rbp)
jne 0x5906
movq -0x18(%rbp), %rax
movb $0x1, 0x1b(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2cc0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2cc0
cmpq $0x2, %rax
je 0x5951
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq 0x28(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdx
leaq 0x8cfa(%rip), %rsi      # 0xe638
movb $0x0, %al
callq 0x4230
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5a7c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x7a40
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x5975
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5a7c
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x59ad
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq 0x28(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdx
leaq 0x8cba(%rip), %rsi      # 0xe654
movb $0x0, %al
callq 0x4230
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5a7c
jmp 0x59af
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2cc0
cmpq $0x3, %rax
je 0x59f2
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq 0x28(%rax), %rdi
leaq 0x8c99(%rip), %rsi      # 0xe678
movb $0x0, %al
callq 0x4230
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5a7c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x5a90
cmpl $-0x1, %eax
jne 0x5a0d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5a7c
jmp 0x5a0f
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x3300
cmpl $0x31, %eax
jne 0x5a49
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x2cc0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x5b60
cmpl $-0x1, %eax
jne 0x5a47
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5a7c
jmp 0x5a49
jmp 0x5a75
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq 0x28(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdx
leaq 0x8c36(%rip), %rsi      # 0xe69b
movb $0x0, %al
callq 0x4230
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5a7c
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)