// File: /workspace/github_c_makefile_star2_O1/arq5x[P]grabix/grabix_main.cpp
// Function: main
int main (int argc, char **argv)
{
    if (argc == 1) { return usage(); }
    if (argc >= 3)
    {
        // create input file for the purpose of the example
        string bgzf_file = argv[2];

        string sub_command = argv[1];
        if (sub_command == "index")
        {
            create_grabix_index(bgzf_file);
        }
        else if (sub_command == "grab")
        {
            int64_t from_line = atol(argv[3]);
            int64_t to_line = from_line;
            if (argc == 5)
                to_line = atol(argv[4]);

            grab(bgzf_file, from_line, to_line);
        }
        else if (sub_command == "random")
        {
            size_t N = atoi(argv[3]);
            random(bgzf_file, N);
        }
        else if (sub_command == "check")
        {
          cout << ((bgzf_is_bgzf(bgzf_file.c_str()) == 1) ? "yes" : "no") << "\n";
        }
        else if (sub_command == "size")
        {
          cout << size(bgzf_file) << "\n";
        } else {
          cout << "unknown command: " << sub_command << endl;
          cout << "available commands are: index, grab, random, check, size" << endl;
        }
    }

    return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xd0, %rsp
cmpl $0x1, %edi
jne 0x25e4
addq $0xd0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2aec
movl %edi, %ebp
cmpl $0x3, %edi
jl 0x28c9
movq %rsi, %rbx
movq 0x10(%rsi), %rsi
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rdx
callq 0x298c
movq 0x8(%rbx), %rsi
leaq 0x30(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x298c
leaq 0x29e5(%rip), %rsi      # 0x5004
leaq 0x30(%rsp), %rdi
callq 0x2080
testl %eax, %eax
je 0x26f4
leaq 0x29d2(%rip), %rsi      # 0x500a
leaq 0x30(%rsp), %rdi
callq 0x2080
testl %eax, %eax
je 0x2735
leaq 0x29be(%rip), %rsi      # 0x500f
leaq 0x30(%rsp), %rdi
callq 0x2080
testl %eax, %eax
je 0x279c
leaq 0x29ac(%rip), %rsi      # 0x5016
leaq 0x30(%rsp), %rdi
callq 0x2080
testl %eax, %eax
je 0x27e2
leaq 0x29e8(%rip), %rsi      # 0x506b
leaq 0x30(%rsp), %rdi
callq 0x2080
testl %eax, %eax
je 0x2830
movq 0x5934(%rip), %rdi      # 0x7fd0
leaq 0x2982(%rip), %rsi      # 0x5025
movl $0x11, %edx
callq 0x22a0
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq 0x5912(%rip), %rdi      # 0x7fd0
callq 0x22a0
movq %rax, %rdi
callq 0x20e0
movq 0x58fe(%rip), %rdi      # 0x7fd0
leaq 0x295e(%rip), %rsi      # 0x5037
movl $0x38, %edx
callq 0x22a0
movq 0x58e6(%rip), %rdi      # 0x7fd0
callq 0x20e0
jmp 0x2893
leaq 0xc0(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0xb0(%rsp), %rdi
callq 0x29ca
leaq 0xb0(%rsp), %rdi
callq 0x2fd8
movq 0xb0(%rsp), %rdi
jmp 0x2882
movq 0x18(%rbx), %rdi
callq 0x22e0
movq %rax, %r14
movq %rax, %r15
cmpl $0x5, %ebp
jne 0x2755
movq 0x20(%rbx), %rdi
callq 0x22e0
movq %rax, %r15
leaq 0xa0(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rdi
callq 0x29ca
leaq 0x90(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3743
movq 0x90(%rsp), %rdi
jmp 0x2882
movq 0x18(%rbx), %rdi
callq 0x23a0
movl %eax, %ebx
leaq 0x80(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0x29ca
movslq %ebx, %rsi
leaq 0x70(%rsp), %rdi
callq 0x39ed
movq 0x70(%rsp), %rdi
jmp 0x2882
movq 0x10(%rsp), %rdi
callq 0x4bcd
xorl %edx, %edx
cmpl $0x1, %eax
sete %dl
leaq 0x2821(%rip), %rax      # 0x501c
leaq 0x281e(%rip), %rsi      # 0x5020
cmoveq %rax, %rsi
orq $0x2, %rdx
movq 0x57bf(%rip), %rdi      # 0x7fd0
callq 0x22a0
movq 0x57b3(%rip), %rdi      # 0x7fd0
leaq 0x27ff(%rip), %rsi      # 0x5023
movl $0x1, %edx
callq 0x22a0
jmp 0x2893
leaq 0x60(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0x50(%rsp), %rdi
callq 0x29ca
leaq 0x50(%rsp), %rdi
callq 0x3d94
movq 0x576e(%rip), %rdi      # 0x7fd0
movl %eax, %esi
callq 0x23e0
leaq 0x27b3(%rip), %rsi      # 0x5023
movl $0x1, %edx
movq %rax, %rdi
callq 0x22a0
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x2893
movq (%r12), %rsi
incq %rsi
callq 0x2260
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x28ae
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2260
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x28c9
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2260
xorl %eax, %eax
addq $0xd0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x70(%rsp), %rdi
cmpq %r12, %rdi
je 0x294e
movq 0x80(%rsp), %rsi
jmp 0x293c
jmp 0x294b
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x294e
movq 0x60(%rsp), %rsi
jmp 0x293c
movq %rax, %rbx
movq 0x90(%rsp), %rdi
cmpq %r12, %rdi
je 0x294e
movq 0xa0(%rsp), %rsi
jmp 0x293c
jmp 0x294b
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
cmpq %r12, %rdi
je 0x294e
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x2260
jmp 0x294e
movq %rax, %rbx
jmp 0x2969
movq %rax, %rbx
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2969
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2260
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2984
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2260
movq %rbx, %rdi
callq 0x23f0