// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x1, -0x8(%rbp)
jne 0x371c
callq 0x3f30
movl %eax, -0x4(%rbp)
jmp 0x3b96
cmpl $0x3, -0x8(%rbp)
jl 0x3b8f
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x118(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x3500
movq -0x118(%rbp), %rsi
movq -0x110(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0x3bb0
jmp 0x375e
leaq -0x31(%rbp), %rdi
callq 0x3330
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x128(%rbp)
leaq -0x69(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x3500
movq -0x128(%rbp), %rsi
movq -0x120(%rbp), %rdx
leaq -0x68(%rbp), %rdi
callq 0x3bb0
jmp 0x379f
leaq -0x69(%rbp), %rdi
callq 0x3330
leaq 0x5855(%rip), %rsi      # 0x9004
leaq -0x68(%rbp), %rdi
callq 0x3c60
movb %al, -0x129(%rbp)
jmp 0x37c0
movb -0x129(%rbp), %al
testb $0x1, %al
jne 0x37cf
jmp 0x3862
leaq -0x90(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3100
jmp 0x37e1
leaq -0x90(%rbp), %rdi
callq 0x4240
jmp 0x37ef
leaq -0x90(%rbp), %rdi
callq 0x31b0
jmp 0x3b67
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x3330
jmp 0x3ba2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x69(%rbp), %rdi
callq 0x3330
jmp 0x3b84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3b7b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x31b0
jmp 0x3b7b
leaq 0x57a1(%rip), %rsi      # 0x900a
leaq -0x68(%rbp), %rdi
callq 0x3c60
movb %al, -0x12a(%rbp)
jmp 0x387a
movb -0x12a(%rbp), %al
testb $0x1, %al
jne 0x3889
jmp 0x3921
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x33a0
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0xa0(%rbp)
cmpl $0x5, -0x8(%rbp)
jne 0x38c5
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x33a0
movq %rax, -0xa0(%rbp)
leaq -0xc0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3100
jmp 0x38d7
movq -0x98(%rbp), %rsi
movq -0xa0(%rbp), %rdx
leaq -0xc0(%rbp), %rdi
callq 0x4a80
jmp 0x38f3
leaq -0xc0(%rbp), %rdi
callq 0x31b0
jmp 0x3b65
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x31b0
jmp 0x3b7b
leaq 0x56e7(%rip), %rsi      # 0x900f
leaq -0x68(%rbp), %rdi
callq 0x3c60
movb %al, -0x12b(%rbp)
jmp 0x3939
movb -0x12b(%rbp), %al
testb $0x1, %al
jne 0x3945
jmp 0x39b0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x3490
cltq
movq %rax, -0xc8(%rbp)
leaq -0xe8(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3100
jmp 0x396d
movq -0xc8(%rbp), %rsi
leaq -0xe8(%rbp), %rdi
callq 0x4e40
jmp 0x3982
leaq -0xe8(%rbp), %rdi
callq 0x31b0
jmp 0x3b63
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x31b0
jmp 0x3b7b
leaq 0x565f(%rip), %rsi      # 0x9016
leaq -0x68(%rbp), %rdi
callq 0x3c60
movb %al, -0x12c(%rbp)
jmp 0x39c8
movb -0x12c(%rbp), %al
testb $0x1, %al
jne 0x39d4
jmp 0x3a37
leaq -0x30(%rbp), %rdi
callq 0x30f0
movq %rax, %rdi
callq 0x7de0
movl %eax, -0x130(%rbp)
jmp 0x39ed
movl -0x130(%rbp), %eax
subl $0x1, %eax
leaq 0x561f(%rip), %rax      # 0x901c
leaq 0x561c(%rip), %rsi      # 0x9020
cmoveq %rax, %rsi
movq 0x95c1(%rip), %rdi      # 0xcfd0
callq 0x32b0
movq %rax, -0x138(%rbp)
jmp 0x3a1d
movq -0x138(%rbp), %rdi
leaq 0x5a3e(%rip), %rsi      # 0x9469
callq 0x32b0
jmp 0x3a32
jmp 0x3b61
leaq 0x562b(%rip), %rsi      # 0x9069
leaq -0x68(%rbp), %rdi
callq 0x3c60
movb %al, -0x139(%rbp)
jmp 0x3a4f
movb -0x139(%rbp), %al
testb $0x1, %al
jne 0x3a5e
jmp 0x3ae2
leaq -0x108(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3100
jmp 0x3a70
leaq -0x108(%rbp), %rdi
callq 0x5300
movl %eax, -0x140(%rbp)
jmp 0x3a84
movl -0x140(%rbp), %esi
movq 0x953f(%rip), %rdi      # 0xcfd0
callq 0x34e0
movq %rax, -0x148(%rbp)
jmp 0x3a9f
movq -0x148(%rbp), %rdi
leaq 0x59bc(%rip), %rsi      # 0x9469
callq 0x32b0
jmp 0x3ab4
leaq -0x108(%rbp), %rdi
callq 0x31b0
jmp 0x3b5f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x31b0
jmp 0x3b7b
movq 0x94e7(%rip), %rdi      # 0xcfd0
leaq 0x5533(%rip), %rsi      # 0x9023
callq 0x32b0
movq %rax, -0x150(%rbp)
jmp 0x3afe
movq -0x150(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x3280
movq %rax, -0x158(%rbp)
jmp 0x3b17
movq -0x158(%rbp), %rdi
movq 0x949b(%rip), %rsi      # 0xcfc0
callq 0x32f0
jmp 0x3b2c
movq 0x949d(%rip), %rdi      # 0xcfd0
leaq 0x54fb(%rip), %rsi      # 0x9035
callq 0x32b0
movq %rax, -0x160(%rbp)
jmp 0x3b48
movq -0x160(%rbp), %rdi
movq 0x946a(%rip), %rsi      # 0xcfc0
callq 0x32f0
jmp 0x3b5d
jmp 0x3b5f
jmp 0x3b61
jmp 0x3b63
jmp 0x3b65
jmp 0x3b67
leaq -0x68(%rbp), %rdi
callq 0x31b0
leaq -0x30(%rbp), %rdi
callq 0x31b0
jmp 0x3b8f
leaq -0x68(%rbp), %rdi
callq 0x31b0
leaq -0x30(%rbp), %rdi
callq 0x31b0
jmp 0x3ba2
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x34f0
nopl (%rax,%rax)