// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/test/test_faidx.c
// Function: main
int main(int argc, char **argv) {
    int opt;
    const char *fn = NULL;
    const char *fnout = NULL;
    const char *fnfai = NULL;
    const char *fngzi = NULL;
    const char *expected = NULL;
    const char *func = "";
    int flags = 0;
    enum fai_format_options format = FAI_FASTA;
    int res;

    while ((opt = getopt(argc, argv, "i:f:g:o:e:t:cQh")) > 0) {
        switch (opt) {
        case 'i':
            fn = optarg;
            break;
        case 'f':
            fnfai = optarg;
            break;
        case 'g':
            fngzi = optarg;
            break;
        case 'o':
            fnout = optarg;
            break;
        case 'e':
            expected = optarg;
            break;
        case 'c':
            flags |= FAI_CREATE;
            break;
        case 'Q':
            format = FAI_FASTQ;
            break;
        case 't':
            func = optarg;
            break;
        case 'h':
            help(stdout, argv[0]);
            return EXIT_SUCCESS;
        default:
            usage(stderr, argv[0]);
            return EXIT_FAILURE;
        }
    }

    if (!fn) {
        usage(stderr, argv[0]);
        return EXIT_FAILURE;
    }

    if (optind == argc) {
        // Index building mode
        res = fai_build3(fn, fnfai, fngzi);
        if (res) {
            fprintf(stderr, "Failed: fai_build3(%s, %s, %s)\n",
                    fn, fnfai ? fnfai : "NULL", fngzi ? fngzi : "NULL");
        } else if (expected) {
            res = file_compare(fnfai, expected);
        }
    } else {
        if (strcmp(func, "fai_line_length") == 0) {
            res = test_fai_line_length(fn, fnfai, fngzi, format, expected,
                                       argv[optind]);
        } else if (strcmp(func, "faidx_has_seq") == 0) {
            res = test_faidx_has_seq(fn, fnfai, fngzi, format, expected,
                                     argv[optind]);
        } else if (strcmp(func, "faidx_iseq") == 0) {
            res = test_faidx_iseq(fn, fnfai, fngzi, format, expected,
                                  argv[optind]);
        } else if (strcmp(func, "faidx_seq_len") == 0) {
            res = test_faidx_seq_len(fn, fnfai, fngzi, format, expected,
                                     argv[optind]);
        } else if (strcmp(func, "faidx_seq_len64") == 0) {
            res = test_faidx_seq_len64(fn, fnfai, fngzi, format, expected,
                                       argv[optind]);
        } else {
            res =  do_retrieval(fn, fnfai, fngzi, flags, format, fnout,
                                func, argc - optind, &argv[optind]);
            if (res == 0 && fnout && expected) {
                res = file_compare(fnout, expected);
            }
        }
    }
    return res == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0xa8, %rsp
movl $0x0, -0xc(%rbp)
movl %edi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
leaq 0xe1e01(%rip), %rax     # 0xe89ba
movq %rax, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
movl $0x1, -0x58(%rbp)
movl -0x10(%rbp), %edi
movq -0x18(%rbp), %rsi
leaq 0xe0ba8(%rip), %rdx     # 0xe7781
callq 0x40d0
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jle 0x6cd9
movl -0x1c(%rbp), %eax
addl $-0x51, %eax
movl %eax, %ecx
movq %rcx, -0x68(%rbp)
subl $0x23, %eax
ja 0x6cb2
movq -0x68(%rbp), %rax
leaq 0xe03fa(%rip), %rcx     # 0xe7004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xfe3a6(%rip), %rax     # 0x104fc0
movq (%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x6cd4
movq 0xfe393(%rip), %rax     # 0x104fc0
movq (%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x6cd4
movq 0xfe380(%rip), %rax     # 0x104fc0
movq (%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x6cd4
movq 0xfe36d(%rip), %rax     # 0x104fc0
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x6cd4
movq 0xfe35d(%rip), %rax     # 0x104fc0
movq (%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x6cd4
movl -0x54(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x6cd4
movl $0x2, -0x58(%rbp)
jmp 0x6cd4
movq 0xfe339(%rip), %rax     # 0x104fc0
movq (%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x6cd4
movq 0xfe319(%rip), %rax     # 0x104fb0
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x6b30
movl $0x0, -0xc(%rbp)
jmp 0x6fd0
movq 0xfe31f(%rip), %rax     # 0x104fd8
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x6af0
movl $0x1, -0xc(%rbp)
jmp 0x6fd0
jmp 0x6bcb
cmpq $0x0, -0x28(%rbp)
jne 0x6d02
movq 0xfe2f1(%rip), %rax     # 0x104fd8
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x6af0
movl $0x1, -0xc(%rbp)
jmp 0x6fd0
movq 0xfe2d7(%rip), %rax     # 0x104fe0
movl (%rax), %eax
cmpl -0x10(%rbp), %eax
jne 0x6dd9
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x70c0
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x5c(%rbp)
je 0x6dbb
movq 0xfe29f(%rip), %rax     # 0x104fd8
movq (%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x6d59
movq -0x38(%rbp), %rax
movq %rax, -0x80(%rbp)
jmp 0x6d66
leaq 0xe279e(%rip), %rax     # 0xe94fe
movq %rax, -0x80(%rbp)
jmp 0x6d66
movq -0x80(%rbp), %rax
movq %rax, -0x88(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x6d85
movq -0x40(%rbp), %rax
movq %rax, -0x90(%rbp)
jmp 0x6d95
leaq 0xe2772(%rip), %rax     # 0xe94fe
movq %rax, -0x90(%rbp)
jmp 0x6d95
movq -0x88(%rbp), %rcx
movq -0x70(%rbp), %rdx
movq -0x78(%rbp), %rdi
movq -0x90(%rbp), %r8
leaq 0xe09df(%rip), %rsi     # 0xe7791
movb $0x0, %al
callq 0x46e0
jmp 0x6dd4
cmpq $0x0, -0x48(%rbp)
je 0x6dd2
movq -0x38(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x5ac0
movl %eax, -0x5c(%rbp)
jmp 0x6dd4
jmp 0x6fbd
movq -0x50(%rbp), %rdi
leaq 0xe09cd(%rip), %rsi     # 0xe77b1
callq 0x46a0
cmpl $0x0, %eax
jne 0x6e20
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl -0x58(%rbp), %ecx
movq -0x48(%rbp), %r8
movq -0x18(%rbp), %rax
movq 0xfe1d4(%rip), %r9      # 0x104fe0
movslq (%r9), %r9
movq (%rax,%r9,8), %r9
callq 0x6600
movl %eax, -0x5c(%rbp)
jmp 0x6fbb
movq -0x50(%rbp), %rdi
leaq 0xe0996(%rip), %rsi     # 0xe77c1
callq 0x46a0
cmpl $0x0, %eax
jne 0x6e67
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl -0x58(%rbp), %ecx
movq -0x48(%rbp), %r8
movq -0x18(%rbp), %rax
movq 0xfe18d(%rip), %r9      # 0x104fe0
movslq (%r9), %r9
movq (%rax,%r9,8), %r9
callq 0x66f0
movl %eax, -0x5c(%rbp)
jmp 0x6fb9
movq -0x50(%rbp), %rdi
leaq 0xe095d(%rip), %rsi     # 0xe77cf
callq 0x46a0
cmpl $0x0, %eax
jne 0x6eae
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl -0x58(%rbp), %ecx
movq -0x48(%rbp), %r8
movq -0x18(%rbp), %rax
movq 0xfe146(%rip), %r9      # 0x104fe0
movslq (%r9), %r9
movq (%rax,%r9,8), %r9
callq 0x67e0
movl %eax, -0x5c(%rbp)
jmp 0x6fb7
movq -0x50(%rbp), %rdi
leaq 0xe0921(%rip), %rsi     # 0xe77da
callq 0x46a0
cmpl $0x0, %eax
jne 0x6ef5
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl -0x58(%rbp), %ecx
movq -0x48(%rbp), %r8
movq -0x18(%rbp), %rax
movq 0xfe0ff(%rip), %r9      # 0x104fe0
movslq (%r9), %r9
movq (%rax,%r9,8), %r9
callq 0x6920
movl %eax, -0x5c(%rbp)
jmp 0x6fb5
movq -0x50(%rbp), %rdi
leaq 0xe08e8(%rip), %rsi     # 0xe77e8
callq 0x46a0
cmpl $0x0, %eax
jne 0x6f39
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl -0x58(%rbp), %ecx
movq -0x48(%rbp), %r8
movq -0x18(%rbp), %rax
movq 0xfe0b8(%rip), %r9      # 0x104fe0
movslq (%r9), %r9
movq (%rax,%r9,8), %r9
callq 0x6a00
movl %eax, -0x5c(%rbp)
jmp 0x6fb3
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl -0x54(%rbp), %ecx
movl -0x58(%rbp), %r8d
movq -0x30(%rbp), %r9
movq -0x50(%rbp), %r11
movl -0x10(%rbp), %r10d
movq 0xfe081(%rip), %rax     # 0x104fe0
subl (%rax), %r10d
movq -0x18(%rbp), %rax
movq 0xfe073(%rip), %rbx     # 0x104fe0
movslq (%rbx), %rbx
shlq $0x3, %rbx
addq %rbx, %rax
movq %r11, (%rsp)
movl %r10d, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x5e30
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x5c(%rbp)
jne 0x6fb1
cmpq $0x0, -0x30(%rbp)
je 0x6fb1
cmpq $0x0, -0x48(%rbp)
je 0x6fb1
movq -0x30(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x5ac0
movl %eax, -0x5c(%rbp)
jmp 0x6fb3
jmp 0x6fb5
jmp 0x6fb7
jmp 0x6fb9
jmp 0x6fbb
jmp 0x6fbd
movl -0x5c(%rbp), %edx
movl $0x1, %eax
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
addq $0xa8, %rsp
popq %rbx
popq %rbp
retq
nopl (%rax)