// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/toolkit/bamtools_sort.cpp
// Function: BamTools::SortTool::SortTool()
SortTool::SortTool(void)
    : AbstractTool()
    , m_settings(new SortSettings)
    , m_impl(0)
{
    // set program details
    Options::SetProgramInfo("bamtools sort", "sorts a BAM file", "[-in <filename>] [-out <filename>] [sortOptions]");

    // set up options
    OptionGroup* IO_Opts = Options::CreateOptionGroup("Input & Output");
    Options::AddValueOption("-in",  "BAM filename", "the input BAM file",  "",
                            m_settings->HasInputBamFilename,  m_settings->InputBamFilename,
                            IO_Opts, Options::StandardIn());
    Options::AddValueOption("-out", "BAM filename", "the output BAM file", "",
                            m_settings->HasOutputBamFilename, m_settings->OutputBamFilename,
                            IO_Opts, Options::StandardOut());

    OptionGroup* SortOpts = Options::CreateOptionGroup("Sorting Methods");
    Options::AddOption("-byname", "sort by alignment name", m_settings->IsSortingByName, SortOpts);

    OptionGroup* MemOpts = Options::CreateOptionGroup("Memory Settings");
    Options::AddValueOption("-n",   "count", "max number of alignments per tempfile", "",
                            m_settings->HasMaxBufferCount,  m_settings->MaxBufferCount,
                            MemOpts, SORT_DEFAULT_MAX_BUFFER_COUNT);
    Options::AddValueOption("-mem", "Mb", "max memory to use", "",
                            m_settings->HasMaxBufferMemory, m_settings->MaxBufferMemory,
                            MemOpts, SORT_DEFAULT_MAX_BUFFER_MEMORY);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %rbx
leaq 0x412f5(%rip), %rax     # 0x8fb50
movq %rax, (%rdi)
movl $0x50, %edi
callq 0x275c0
movq %rax, %r14
movq %rax, %rdi
callq 0x4f272
movq %r14, 0x8(%rbx)
movq $0x0, 0x10(%rbx)
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x272f3(%rip), %rsi     # 0x75b83
leaq 0x272f9(%rip), %rdx     # 0x75b90
leaq 0x8(%rsp), %rdi
callq 0x2f1b2
leaq 0x58(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x272e0(%rip), %rsi     # 0x75b91
leaq 0x272e9(%rip), %rdx     # 0x75ba1
leaq 0x48(%rsp), %rdi
callq 0x2f1b2
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x272d0(%rip), %rsi     # 0x75ba2
leaq 0x272f9(%rip), %rdx     # 0x75bd2
leaq 0x28(%rsp), %rdi
callq 0x2f1b2
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x28(%rsp), %rdx
callq 0x646a4
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x4e906
callq 0x27560
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x4e915
callq 0x27560
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4e924
callq 0x27560
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x23bde(%rip), %rsi     # 0x72511
leaq 0x23be5(%rip), %rdx     # 0x7251f
callq 0x2f1b2
leaq 0x8(%rsp), %rdi
callq 0x63a0c
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4e95b
callq 0x27560
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x23bb6(%rip), %rsi     # 0x72520
leaq 0x23bb2(%rip), %rdx     # 0x72523
callq 0x2f1b2
leaq 0x48(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x23b9f(%rip), %rsi     # 0x72524
leaq 0x23ba4(%rip), %rdx     # 0x72530
callq 0x2f1b2
leaq 0x28(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x27e1e(%rip), %rsi     # 0x767be
leaq 0x27e29(%rip), %rdx     # 0x767d0
callq 0x2f1b2
leaq 0x78(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x28e5f(%rip), %rdx     # 0x7781b
leaq 0x68(%rsp), %rdi
movq %rdx, %rsi
callq 0x2f1b2
movq 0x8(%rbx), %r15
callq 0x646e2
leaq 0x8(%r15), %r9
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x68(%rsp), %rcx
movq %r15, %r8
pushq %rax
pushq %r14
callq 0x2ebcc
addq $0x10, %rsp
movq 0x68(%rsp), %rdi
cmpq %rbp, %rdi
je 0x4ea08
callq 0x27560
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %r15
cmpq %r15, %rdi
je 0x4ea1c
callq 0x27560
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x4ea2b
callq 0x27560
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4ea3a
callq 0x27560
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x23b2f(%rip), %rsi     # 0x72578
leaq 0x23b2c(%rip), %rdx     # 0x7257c
callq 0x2f1b2
leaq 0x48(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x23ac0(%rip), %rsi     # 0x72524
leaq 0x23ac5(%rip), %rdx     # 0x72530
callq 0x2f1b2
leaq 0x28(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x23afe(%rip), %rsi     # 0x7257d
leaq 0x23b0a(%rip), %rdx     # 0x72590
callq 0x2f1b2
leaq 0x68(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x28d81(%rip), %rdx     # 0x7781b
movq %rdx, %rsi
callq 0x2f1b2
movq 0x8(%rbx), %r15
callq 0x646ea
leaq 0x28(%r15), %r9
addq $0x3, %r15
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x68(%rsp), %rcx
movq %r15, %r8
pushq %rax
pushq %r14
callq 0x2ebcc
addq $0x10, %rsp
movq 0x68(%rsp), %rdi
cmpq %rbp, %rdi
je 0x4eae5
callq 0x27560
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %r15
cmpq %r15, %rdi
je 0x4eaf9
callq 0x27560
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x4eb08
callq 0x27560
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4eb17
callq 0x27560
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x270ad(%rip), %rsi     # 0x75bd3
leaq 0x270b5(%rip), %rdx     # 0x75be2
callq 0x2f1b2
leaq 0x8(%rsp), %rdi
callq 0x63a0c
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4eb4e
callq 0x27560
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x27086(%rip), %rsi     # 0x75be3
leaq 0x27086(%rip), %rdx     # 0x75bea
callq 0x2f1b2
leaq 0x48(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x27073(%rip), %rsi     # 0x75beb
leaq 0x27082(%rip), %rdx     # 0x75c01
callq 0x2f1b2
movq 0x8(%rbx), %rdx
addq $0x4, %rdx
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
movq %r14, %rcx
callq 0x63808
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x4ebad
callq 0x27560
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4ebbc
callq 0x27560
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x27037(%rip), %rsi     # 0x75c02
leaq 0x2703f(%rip), %rdx     # 0x75c11
callq 0x2f1b2
leaq 0x8(%rsp), %rdi
callq 0x63a0c
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4ebf3
callq 0x27560
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x25335(%rip), %rsi     # 0x73f37
leaq 0x25330(%rip), %rdx     # 0x73f39
callq 0x2f1b2
leaq 0x48(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x23dab(%rip), %rsi     # 0x729c8
leaq 0x23da9(%rip), %rdx     # 0x729cd
callq 0x2f1b2
leaq 0x28(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x26fda(%rip), %rsi     # 0x75c12
leaq 0x26ff8(%rip), %rdx     # 0x75c37
callq 0x2f1b2
leaq 0x68(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x28bc8(%rip), %rdx     # 0x7781b
movq %rdx, %rsi
callq 0x2f1b2
movq 0x8(%rbx), %r9
leaq 0x1(%r9), %r8
addq $0x48, %r9
leaq 0x26fe6(%rip), %rax     # 0x75c54
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x68(%rsp), %rcx
pushq %rax
pushq %r14
callq 0x45de2
addq $0x10, %rsp
movq 0x68(%rsp), %rdi
cmpq %rbp, %rdi
je 0x4ec9d
callq 0x27560
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x4ecac
callq 0x27560
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x4ecbb
callq 0x27560
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4ecca
callq 0x27560
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x26f5f(%rip), %rsi     # 0x75c38
leaq 0x26f5c(%rip), %rdx     # 0x75c3c
callq 0x2f1b2
leaq 0x48(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x26f49(%rip), %rsi     # 0x75c3d
leaq 0x26f44(%rip), %rdx     # 0x75c3f
callq 0x2f1b2
leaq 0x28(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x26f31(%rip), %rsi     # 0x75c40
leaq 0x26f3b(%rip), %rdx     # 0x75c51
callq 0x2f1b2
leaq 0x68(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x28af1(%rip), %rdx     # 0x7781b
movq %rdx, %rsi
callq 0x2f1b2
movq 0x8(%rbx), %r9
leaq 0x2(%r9), %r8
addq $0x4c, %r9
leaq 0x26f13(%rip), %rax     # 0x75c58
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x68(%rsp), %rcx
pushq %rax
pushq %r14
callq 0x45de2
addq $0x10, %rsp
movq 0x68(%rsp), %rdi
cmpq %rbp, %rdi
je 0x4ed74
callq 0x27560
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x4ed83
callq 0x27560
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x4ed92
callq 0x27560
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4eda1
callq 0x27560
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %rbp, %rdi
je 0x4edca
callq 0x27560
jmp 0x4edca
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x4ede3
callq 0x27560
jmp 0x4ede3
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x4edf7
callq 0x27560
jmp 0x4edf7
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4eff2
jmp 0x4efed
jmp 0x4ef5a
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %rbp, %rdi
je 0x4ee26
callq 0x27560
jmp 0x4ee26
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x4ee3f
callq 0x27560
jmp 0x4ee3f
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x4ee53
callq 0x27560
jmp 0x4ee53
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4eff2
jmp 0x4efed
jmp 0x4ef5a
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4eff2
jmp 0x4efed
jmp 0x4ef5a
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x4ee9d
callq 0x27560
jmp 0x4ee9d
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4eff2
jmp 0x4efed
jmp 0x4ef5a
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4eff2
jmp 0x4efed
jmp 0x4ef5a
movq %rax, %rbx
jmp 0x4ef7f
movq %rax, %rbx
jmp 0x4ef93
movq %rax, %rbx
jmp 0x4efa2
jmp 0x4ef5a
movq %rax, %rbx
jmp 0x4efc0
movq %rax, %rbx
jmp 0x4efd4
movq %rax, %rbx
jmp 0x4efe3
jmp 0x4ef5a
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4eff2
jmp 0x4efed
jmp 0x4ef5a
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x4ef33
callq 0x27560
jmp 0x4ef33
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x4ef47
callq 0x27560
jmp 0x4ef47
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4eff2
jmp 0x4efed
movq %rax, %rbx
jmp 0x4eff2
movq %rax, %rbx
movq %r14, %rdi
jmp 0x4efed
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %rbp, %rdi
je 0x4ef7f
callq 0x27560
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x4ef93
callq 0x27560
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x4efa2
callq 0x27560
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4eff2
jmp 0x4efed
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %rbp, %rdi
je 0x4efc0
callq 0x27560
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x4efd4
callq 0x27560
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x4efe3
callq 0x27560
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x4eff2
callq 0x27560
movq %rbx, %rdi
callq 0x27b20