// File: /workspace/github_c_makefile_star2_O0/chbarts[P]aa-tree/nuniq.c
// Function: main
int main(int argc, char *argv[])
{
    aa *tree;
    char *pnam;
    FILE *fin;
    int i, lind, c;
    extern int optind;
    struct option longopts[] = {
        {"help", 0, 0, 0},
        {"version", 0, 0, 0},
        {"duplicates", 0, 0, 0},
        {0, 0, 0, 0}
    };

    if (1 == argc) {
        if ((tree = aa_new(comparator)) == NULL) {
            fprintf(stderr, "aa_new() error\n");
            exit(EXIT_FAILURE);
        }

        dofile("stdin", stdin, tree);
        cleanup(tree);
        return 0;
    }

    pnam = argv[0];

    while ((c = getopt_long(argc, argv, "hvd", longopts, &lind)) != -1) {
        switch (c) {
        case 0:
            switch (lind) {
            case 0:
                usage(pnam);
                return 0;
                break;
            case 1:
                version();
                return 0;
                break;
            case 2:
                d = 1;
                break;
            default:
                usage(pnam);
                exit(EXIT_FAILURE);
                break;
            }

            break;
        case 'h':
            usage(pnam);
            return 0;
            break;
        case 'v':
            version();
            return 0;
            break;
        case 'd':
            d = 1;
            break;
        default:
            usage(pnam);
            exit(EXIT_FAILURE);
            break;
        }
    }

    if ((tree = aa_new(comparator)) == NULL) {
        fprintf(stderr, "aa_new() error\n");
        exit(EXIT_FAILURE);
    }

    if (optind >= argc) {
        dofile("stdin", stdin, tree);
    } else {
        for (i = optind; i < argc; i++) {
            if ((fin = fopen(argv[i], "rb")) == NULL) {
                handle_ferr(argv[i], "nuniq");
                continue;
            }

            dofile(argv[i], fin, tree);

            if (fclose(fin) == EOF) {
                handle_ferr(argv[i], "nuniq");
            }
        }
    }

    cleanup(tree);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0xc0(%rbp), %rdi
leaq 0x28e9(%rip), %rsi      # 0x4d60
movl $0x80, %edx
callq 0x10d0
movl $0x1, %eax
cmpl -0x8(%rbp), %eax
jne 0x24f2
leaq 0x2be(%rip), %rdi       # 0x2750
callq 0x1420
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x24c3
movq 0x2b50(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xc10(%rip), %rsi       # 0x30c2
movb $0x0, %al
callq 0x10c0
movl $0x1, %edi
callq 0x1130
movq 0x2b06(%rip), %rax      # 0x4fd0
movq (%rax), %rsi
movq -0x18(%rbp), %rdx
leaq 0xbfa(%rip), %rdi       # 0x30d2
callq 0x27b0
movq -0x18(%rbp), %rdi
callq 0x28a0
movl $0x0, -0x4(%rbp)
jmp 0x2740
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq -0xc0(%rbp), %rcx
leaq 0xbc6(%rip), %rdx       # 0x30d8
leaq -0x30(%rbp), %r8
callq 0x1070
movl %eax, -0x34(%rbp)
cmpl $-0x1, %eax
je 0x2626
movl -0x34(%rbp), %eax
movl %eax, -0xc4(%rbp)
testl %eax, %eax
je 0x256c
jmp 0x2536
movl -0xc4(%rbp), %eax
subl $0x64, %eax
je 0x2602
jmp 0x2547
movl -0xc4(%rbp), %eax
subl $0x68, %eax
je 0x25dc
jmp 0x2558
movl -0xc4(%rbp), %eax
subl $0x76, %eax
je 0x25f1
jmp 0x260e
movl -0x30(%rbp), %eax
movl %eax, -0xc8(%rbp)
testl %eax, %eax
je 0x2595
jmp 0x257b
movl -0xc8(%rbp), %eax
subl $0x1, %eax
je 0x25aa
jmp 0x2588
movl -0xc8(%rbp), %eax
subl $0x2, %eax
je 0x25bb
jmp 0x25c7
movq -0x20(%rbp), %rdi
callq 0x28d0
movl $0x0, -0x4(%rbp)
jmp 0x2740
callq 0x2960
movl $0x0, -0x4(%rbp)
jmp 0x2740
movl $0x1, 0x2afb(%rip)      # 0x50c0
jmp 0x25da
movq -0x20(%rbp), %rdi
callq 0x28d0
movl $0x1, %edi
callq 0x1130
jmp 0x2621
movq -0x20(%rbp), %rdi
callq 0x28d0
movl $0x0, -0x4(%rbp)
jmp 0x2740
callq 0x2960
movl $0x0, -0x4(%rbp)
jmp 0x2740
movl $0x1, 0x2ab4(%rip)      # 0x50c0
jmp 0x2621
movq -0x20(%rbp), %rdi
callq 0x28d0
movl $0x1, %edi
callq 0x1130
jmp 0x24fd
leaq 0x123(%rip), %rdi       # 0x2750
callq 0x1420
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x265e
movq 0x29b5(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xa75(%rip), %rsi       # 0x30c2
movb $0x0, %al
callq 0x10c0
movl $0x1, %edi
callq 0x1130
movq 0x2973(%rip), %rax      # 0x4fd8
movl (%rax), %eax
cmpl -0x8(%rbp), %eax
jl 0x268b
movq 0x295d(%rip), %rax      # 0x4fd0
movq (%rax), %rsi
movq -0x18(%rbp), %rdx
leaq 0xa51(%rip), %rdi       # 0x30d2
callq 0x27b0
jmp 0x2730
movq 0x2946(%rip), %rax      # 0x4fd8
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x272e
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa26(%rip), %rsi       # 0x30dc
callq 0x1110
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x26df
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xa07(%rip), %rsi       # 0x30df
callq 0x13d0
jmp 0x2720
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x27b0
movq -0x28(%rbp), %rdi
callq 0x1060
cmpl $-0x1, %eax
jne 0x271e
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x9c6(%rip), %rsi       # 0x30df
callq 0x13d0
jmp 0x2720
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2697
jmp 0x2730
movq -0x18(%rbp), %rdi
callq 0x28a0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xd0, %rsp
popq %rbp
retq
nopl (%rax)