// File: /workspace/github_c_makefile_star2_O3/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
movl $0x1, %r14d
cmpl $0x2, %edi
jl 0x430a
movq %rsi, %rbx
movq 0x8(%rsi), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x21a0
cmpl $-0x1, %eax
je 0x41b2
movl %eax, %r14d
movl %eax, %edi
callq 0x4521
testq %rax, %rax
je 0x431c
movq %rax, %r15
movq %rax, %rdi
callq 0x4596
cmpl $-0x1, %eax
je 0x41cb
movq %r15, %rdi
callq 0x5685
cmpl $-0x1, %eax
je 0x41d8
movq 0x8(%rbx), %rdi
callq 0x3a85
leaq 0x6f96(%rip), %rsi      # 0xb007
movq %rax, -0x38(%rbp)
movq %rax, %rdi
callq 0x39d6
movq %rax, %r13
movq %rax, %rdi
callq 0x3cd2
cmpl $-0x1, %eax
movl %r14d, -0x2c(%rbp)
je 0x41ed
movl %eax, %r12d
movq %rbx, -0x40(%rbp)
movl %eax, %edi
movq -0x38(%rbp), %r14
movq %r14, %rsi
callq 0x3e3d
movl 0x18(%r15), %ebx
cmpl $-0x1, %ebx
je 0x40be
movl %r12d, %edi
movq %r15, %rsi
callq 0x8e6c
movl %r12d, %edi
movq %r15, %rsi
callq 0x8f4a
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
callq 0x9014
cmpb $0x0, 0x1c(%r15)
jne 0x42af
leaq 0x6f21(%rip), %rsi      # 0xb00a
movl %r12d, %edi
xorl %eax, %eax
callq 0x2110
cmpl $-0x1, %ebx
je 0x41f8
movl %r12d, %edi
movq %r13, %rsi
movq %r15, %rdx
callq 0x9562
leaq 0x6f16(%rip), %rsi      # 0xb027
movl %r12d, %edi
xorl %eax, %eax
callq 0x2110
leaq 0x6f1c(%rip), %rsi      # 0xb03e
movl %r12d, %edi
xorl %eax, %eax
callq 0x2110
movq 0x10(%r15), %rax
cmpq $0x0, 0x10(%rax)
je 0x4272
xorl %ebx, %ebx
movq (%rax), %rax
movq (%rax,%rbx,8), %r14
movq 0x18(%r14), %rdi
movq %r15, %rsi
callq 0x86f6
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x90ef
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x9290
movl $0x2, %r8d
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x93d2
movl $0x3, %r8d
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x93d2
incq %rbx
movq 0x10(%r15), %rax
cmpq 0x10(%rax), %rbx
jb 0x413d
jmp 0x4272
movq 0x8(%rbx), %rdx
leaq 0x6e00(%rip), %rsi      # 0xafbd
xorl %edi, %edi
xorl %eax, %eax
callq 0x3f64
jmp 0x430a
movq %r15, %rdi
callq 0x4328
jmp 0x4304
leaq 0x6ded(%rip), %rsi      # 0xafcc
xorl %edi, %edi
xorl %eax, %eax
callq 0x3f64
jmp 0x4304
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x42db
leaq 0x6e28(%rip), %rsi      # 0xb027
movl %r12d, %edi
xorl %eax, %eax
callq 0x2110
leaq 0x6e2e(%rip), %rsi      # 0xb03e
movl %r12d, %edi
xorl %eax, %eax
callq 0x2110
movq 0x20(%r15), %rdi
movq %r15, %rsi
callq 0x86f6
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x90ef
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x9290
movl $0x2, %r8d
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x93d2
movl $0x3, %r8d
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x93d2
callq 0x5408
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x99e2
movl $0x1, %ecx
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
callq 0x99e2
leaq 0x6db4(%rip), %rsi      # 0xb055
movl %r12d, %edi
xorl %eax, %eax
callq 0x2110
movq -0x38(%rbp), %r14
movl %r12d, %edi
movq %r14, %rsi
callq 0x3eaf
movq %r13, %rdi
callq 0x2040
movl %r12d, %edi
callq 0x2100
xorl %r14d, %r14d
cmpl $-0x1, %eax
sete %r14b
negl %r14d
movq -0x40(%rbp), %rbx
movq %r15, %rdi
callq 0x4328
movl -0x2c(%rbp), %edi
callq 0x2100
cmpl $-0x1, %eax
jne 0x430a
movq 0x8(%rbx), %rdx
leaq 0x6cfc(%rip), %rsi      # 0xaff7
xorl %edi, %edi
xorl %eax, %eax
callq 0x3f64
movl $0x1, %r14d
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %edi
callq 0x21d0
nop