// File: /workspace/github_c_makefile_star2_O2/MaoKo[P]FGFX/fgfl/src/fgfl.c
// Function: main
int
main(int argc, char const* argv[]) {
    if (argc <= 1)
        { return (EXIT_FAILURE); }

    int filde = open(argv[1], O_RDONLY);
    if (filde == -1) {
        errorf(0, "Can't open %s.", argv[1]);
        return (EXIT_FAILURE);
    }

    lexical_spec_t* spec = parse_lexical_spec(filde);
    if (!spec)
        { exit(EXIT_FAILURE); }
    
    if (spec_sanity_check(spec) == ERROR) {
        del_lexical_spec(spec);
        return (EXIT_FAILURE);
    }

//  print_token_entry(spec);
    if (build_nfa(spec) == ERROR) {
        errorf(0, "Impossible to construct the NFA automaton.");
        return (EXIT_FAILURE);
    }

    int exit_st = gen_fgfl_file(spec, get_filename(argv[1]));
    del_lexical_spec(spec);

    if (close(filde) == -1) {
        errorf(0, "Can't close %s.", argv[1]);
        return (EXIT_FAILURE);
    }

    return (exit_st);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
pushq $0x1
popq %r14
cmpl $0x2, %edi
jl 0x3f6a
movq %rsi, %rbx
movq 0x8(%rsi), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x21a0
cmpl $-0x1, %eax
je 0x3f3a
movl %eax, %r12d
movl %eax, %edi
callq 0x42c3
testq %rax, %rax
je 0x4050
movq %rax, %r15
movq %rax, %rdi
callq 0x4333
cmpl $-0x1, %eax
je 0x3f50
movq %r15, %rdi
callq 0x5368
cmpl $-0x1, %eax
je 0x3f5a
movl %r12d, -0x2c(%rbp)
movq %rbx, -0x38(%rbp)
movq 0x8(%rbx), %rdi
callq 0x3766
movq %rax, %rbx
leaq 0x7198(%rip), %rsi      # 0xafee
movq %rax, %rdi
callq 0x36b7
movq %rax, %r13
movq %rax, %rdi
callq 0x3974
cmpl $-0x1, %eax
je 0x3f7f
movl %eax, %r12d
movl %eax, %edi
movq %rbx, -0x40(%rbp)
movq %rbx, %rsi
callq 0x3aca
movl 0x18(%r15), %r14d
cmpl $-0x1, %r14d
je 0x3e98
movl %r12d, %edi
movq %r15, %rsi
callq 0x8704
movl %r12d, %edi
movq %r15, %rsi
callq 0x87df
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
callq 0x88a6
cmpb $0x0, 0x1c(%r15)
movq -0x38(%rbp), %rbx
jne 0x3ffa
leaq 0x712a(%rip), %rsi      # 0xaff1
movl %r12d, %edi
xorl %eax, %eax
callq 0x2110
cmpl $-0x1, %r14d
je 0x3f8c
movl %r12d, %edi
movq %r13, %rsi
movq %r15, %rdx
callq 0x8d7d
leaq 0x711e(%rip), %rsi      # 0xb00e
xorl %r14d, %r14d
movl %r12d, %edi
xorl %eax, %eax
callq 0x2110
leaq 0x7121(%rip), %rsi      # 0xb025
movl %r12d, %edi
xorl %eax, %eax
callq 0x2110
movq 0x10(%r15), %rax
cmpq 0x10(%rax), %r14
jae 0x3fc3
movq (%rax), %rax
movq (%rax,%r14,8), %r8
movq 0x18(%r8), %rdx
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rcx
callq 0x4058
incq %r14
jmp 0x3f0e
movq 0x8(%rbx), %rdx
leaq 0x705f(%rip), %rsi      # 0xafa4
xorl %edi, %edi
xorl %eax, %eax
callq 0x3bdc
jmp 0x3f6a
movq %r15, %rdi
callq 0x40cc
jmp 0x3f6a
leaq 0x7052(%rip), %rsi      # 0xafb3
xorl %edi, %edi
xorl %eax, %eax
callq 0x3bdc
movl %r14d, %r12d
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x1
popq %r12
movq -0x38(%rbp), %rbx
jmp 0x4027
leaq 0x707b(%rip), %rsi      # 0xb00e
movl %r12d, %edi
xorl %eax, %eax
callq 0x2110
leaq 0x7081(%rip), %rsi      # 0xb025
movl %r12d, %edi
xorl %eax, %eax
callq 0x2110
movq 0x20(%r15), %rdx
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rcx
xorl %r8d, %r8d
callq 0x4058
callq 0x50f8
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x9073
pushq $0x1
popq %rcx
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
callq 0x9073
leaq 0x704c(%rip), %rsi      # 0xb03c
movl %r12d, %edi
xorl %eax, %eax
callq 0x2110
movl %r12d, %edi
movq -0x40(%rbp), %rsi
callq 0x3b3c
movq %r13, %rdi
callq 0x2040
movl %r12d, %edi
callq 0x2100
xorl %r12d, %r12d
cmpl $-0x1, %eax
sete %r12b
negl %r12d
pushq $0x1
popq %r14
movq %r15, %rdi
callq 0x40cc
movl -0x2c(%rbp), %edi
callq 0x2100
cmpl $-0x1, %eax
jne 0x3f6d
movq 0x8(%rbx), %rdx
leaq 0x6f93(%rip), %rsi      # 0xafde
jmp 0x3f45
pushq $0x1
popq %rdi
callq 0x21d0