// File: /workspace/github_c_makefile_star2_O1/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 0x4406
movq %rsi, %rbx
movq 0x8(%rsi), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x21a0
cmpl $-0x1, %eax
je 0x42ae
movl %eax, %r14d
movl %eax, %edi
callq 0x4644
testq %rax, %rax
je 0x4418
movq %rax, %r15
movq %rax, %rdi
callq 0x46bd
cmpl $-0x1, %eax
je 0x42c7
movq %r15, %rdi
callq 0x57f0
cmpl $-0x1, %eax
je 0x42d4
movq 0x8(%rbx), %rdi
callq 0x3b81
leaq 0x6e9a(%rip), %rsi      # 0xb007
movq %rax, -0x38(%rbp)
movq %rax, %rdi
callq 0x3ad2
movq %rax, %r13
movq %rax, %rdi
callq 0x3dce
cmpl $-0x1, %eax
movl %r14d, -0x2c(%rbp)
je 0x42e9
movl %eax, %r12d
movq %rbx, -0x40(%rbp)
movl %eax, %edi
movq -0x38(%rbp), %r14
movq %r14, %rsi
callq 0x3f39
movl 0x18(%r15), %ebx
cmpl $-0x1, %ebx
je 0x41ba
movl %r12d, %edi
movq %r15, %rsi
callq 0x8fe0
movl %r12d, %edi
movq %r15, %rsi
callq 0x90be
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
callq 0x9188
cmpb $0x0, 0x1c(%r15)
jne 0x43ab
leaq 0x6e25(%rip), %rsi      # 0xb00a
movl %r12d, %edi
xorl %eax, %eax
callq 0x2110
cmpl $-0x1, %ebx
je 0x42f4
movl %r12d, %edi
movq %r13, %rsi
movq %r15, %rdx
callq 0x96b0
leaq 0x6e1a(%rip), %rsi      # 0xb027
movl %r12d, %edi
xorl %eax, %eax
callq 0x2110
leaq 0x6e20(%rip), %rsi      # 0xb03e
movl %r12d, %edi
xorl %eax, %eax
callq 0x2110
movq 0x10(%r15), %rax
cmpq $0x0, 0x10(%rax)
je 0x436e
xorl %ebx, %ebx
movq (%rax), %rax
movq (%rax,%rbx,8), %r14
movq 0x18(%r14), %rdi
movq %r15, %rsi
callq 0x8876
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x9263
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x93f7
movl $0x2, %r8d
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x9539
movl $0x3, %r8d
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
movq %r14, %rcx
callq 0x9539
incq %rbx
movq 0x10(%r15), %rax
cmpq 0x10(%rax), %rbx
jb 0x4239
jmp 0x436e
movq 0x8(%rbx), %rdx
leaq 0x6d04(%rip), %rsi      # 0xafbd
xorl %edi, %edi
xorl %eax, %eax
callq 0x4060
jmp 0x4406
movq %r15, %rdi
callq 0x4424
jmp 0x4400
leaq 0x6cf1(%rip), %rsi      # 0xafcc
xorl %edi, %edi
xorl %eax, %eax
callq 0x4060
jmp 0x4400
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x43d7
leaq 0x6d2c(%rip), %rsi      # 0xb027
movl %r12d, %edi
xorl %eax, %eax
callq 0x2110
leaq 0x6d32(%rip), %rsi      # 0xb03e
movl %r12d, %edi
xorl %eax, %eax
callq 0x2110
movq 0x20(%r15), %rdi
movq %r15, %rsi
callq 0x8876
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x9263
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x93f7
movl $0x2, %r8d
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x9539
movl $0x3, %r8d
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x9539
callq 0x558c
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x9b3d
movl $0x1, %ecx
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
callq 0x9b3d
leaq 0x6cb8(%rip), %rsi      # 0xb055
movl %r12d, %edi
xorl %eax, %eax
callq 0x2110
movq -0x38(%rbp), %r14
movl %r12d, %edi
movq %r14, %rsi
callq 0x3fab
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 0x4424
movl -0x2c(%rbp), %edi
callq 0x2100
cmpl $-0x1, %eax
jne 0x4406
movq 0x8(%rbx), %rdx
leaq 0x6c00(%rip), %rsi      # 0xaff7
xorl %edi, %edi
xorl %eax, %eax
callq 0x4060
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