// File: /workspace/github_cpp_makefile_star2_O1/zeeev[P]DASVC/bamtools/src/toolkit/bamtools_split.cpp
// Function: BamTools::SplitTool::SplitTool()
SplitTool::SplitTool(void)
    : AbstractTool()
    , m_settings(new SplitSettings)
    , m_impl(0)
{
    // set program details
    const string name = "bamtools split";
    const string description = "splits a BAM file on user-specified property, creating a new BAM output file for each value found";
    const string args = "[-in <filename>] [-stub <filename stub>] < -mapped | -paired | -reference [-refPrefix <prefix>] | -tag <TAG> > ";
    Options::SetProgramInfo(name, description, args);
    
    // set up options 
    OptionGroup* IO_Opts = Options::CreateOptionGroup("Input & Output");
    Options::AddValueOption("-in",   "BAM filename",  "the input BAM file",  "",
                            m_settings->HasInputFilename,  m_settings->InputFilename,  IO_Opts, Options::StandardIn());
    Options::AddValueOption("-refPrefix", "string", "custom prefix for splitting by references. Currently files end with REF_<refName>.bam. This option allows you to replace \"REF_\" with a prefix of your choosing.", "",
                            m_settings->HasCustomRefPrefix, m_settings->CustomRefPrefix, IO_Opts);
    Options::AddValueOption("-tagPrefix", "string", "custom prefix for splitting by tags. Current files end with TAG_<tagname>_<tagvalue>.bam. This option allows you to replace \"TAG_\" with a prefix of your choosing.", "",
                            m_settings->HasCustomTagPrefix, m_settings->CustomTagPrefix, IO_Opts);
    Options::AddValueOption("-stub", "filename stub", "prefix stub for output BAM files (default behavior is to use input filename, without .bam extension, as stub). If input is stdin and no stub provided, a timestamp is generated as the stub.", "",
                            m_settings->HasCustomOutputStub, m_settings->CustomOutputStub, IO_Opts);
    Options::AddValueOption("-tagListDelim", "string", "delimiter used to separate values in the filenames generated from splitting on list-type tags [--]", "",
                            m_settings->HasListTagDelimiter, m_settings->ListTagDelimiter, IO_Opts);
    
    OptionGroup* SplitOpts = Options::CreateOptionGroup("Split Options");
    Options::AddOption("-mapped",    "split mapped/unmapped alignments",       m_settings->IsSplittingMapped,    SplitOpts);
    Options::AddOption("-paired",    "split single-end/paired-end alignments", m_settings->IsSplittingPaired,    SplitOpts);
    Options::AddOption("-reference", "split alignments by reference",          m_settings->IsSplittingReference, SplitOpts);
    Options::AddValueOption("-tag", "tag name", "splits alignments based on all values of TAG encountered (i.e. -tag RG creates a BAM file for each read group in original BAM file)", "", 
                            m_settings->IsSplittingTag, m_settings->TagToSplit, SplitOpts);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdi, %rbx
leaq 0x3b627(%rip), %rax     # 0x8fb98
movq %rax, (%rdi)
movl $0xd0, %edi
callq 0x275c0
movq %rax, %r14
movq %rax, %rdi
callq 0x5c7f4
movq %r14, 0x8(%rbx)
movq $0x0, 0x10(%rbx)
leaq 0xe8(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x218ea(%rip), %rsi     # 0x75e92
leaq 0x218f1(%rip), %rdx     # 0x75ea0
leaq 0xd8(%rsp), %rdi
callq 0x2f1b2
leaq 0xc8(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x218d2(%rip), %rsi     # 0x75ea1
leaq 0x2192c(%rip), %rdx     # 0x75f02
leaq 0xb8(%rsp), %rdi
callq 0x2f1b2
leaq 0xa8(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x2190d(%rip), %rsi     # 0x75f03
leaq 0x21975(%rip), %rdx     # 0x75f72
leaq 0x98(%rsp), %rdi
callq 0x2f1b2
leaq 0xd8(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
leaq 0x98(%rsp), %rdx
callq 0x646a4
leaq 0x28(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1ded9(%rip), %rsi     # 0x72511
leaq 0x1dee0(%rip), %rdx     # 0x7251f
leaq 0x18(%rsp), %rdi
callq 0x2f1b2
leaq 0x18(%rsp), %rdi
callq 0x63a0c
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x54665
callq 0x27560
leaq 0x18(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x1deac(%rip), %rsi     # 0x72520
leaq 0x1dea8(%rip), %rdx     # 0x72523
callq 0x2f1b2
leaq 0x48(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x1de94(%rip), %rsi     # 0x72524
leaq 0x1de99(%rip), %rdx     # 0x72530
leaq 0x38(%rsp), %rdi
callq 0x2f1b2
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x2210d(%rip), %rsi     # 0x767be
leaq 0x22118(%rip), %rdx     # 0x767d0
leaq 0x58(%rsp), %rdi
callq 0x2f1b2
leaq 0x88(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x23146(%rip), %rdx     # 0x7781b
leaq 0x78(%rsp), %rdi
movq %rdx, %rsi
callq 0x2f1b2
movq 0x8(%rbx), %r15
callq 0x646e2
leaq 0x70(%r15), %r9
movq %rax, 0x8(%rsp)
movq %r14, (%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x58(%rsp), %rdx
leaq 0x78(%rsp), %rcx
movq %r15, %r8
callq 0x2ebcc
movq 0x78(%rsp), %rdi
cmpq %rbp, %rdi
je 0x54723
callq 0x27560
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %r15
cmpq %r15, %rdi
je 0x54737
callq 0x27560
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0x54746
callq 0x27560
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x54755
callq 0x27560
leaq 0x18(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x2180f(%rip), %rsi     # 0x75f73
leaq 0x21812(%rip), %rdx     # 0x75f7d
callq 0x2f1b2
leaq 0x38(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x22be4(%rip), %rsi     # 0x77363
leaq 0x22be3(%rip), %rdx     # 0x77369
callq 0x2f1b2
leaq 0x58(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x217e4(%rip), %rsi     # 0x75f7e
leaq 0x2187c(%rip), %rdx     # 0x7601d
callq 0x2f1b2
leaq 0x78(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x23066(%rip), %rdx     # 0x7781b
movq %rdx, %rsi
callq 0x2f1b2
movq 0x8(%rbx), %r9
leaq 0x2(%r9), %r8
addq $0x30, %r9
movq %r14, (%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x58(%rsp), %rdx
leaq 0x78(%rsp), %rcx
callq 0x2e8ba
movq 0x78(%rsp), %rdi
cmpq %rbp, %rdi
je 0x547f5
callq 0x27560
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
je 0x54804
callq 0x27560
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0x54813
callq 0x27560
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x54822
callq 0x27560
leaq 0x18(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x217ed(%rip), %rsi     # 0x7601e
leaq 0x217f0(%rip), %rdx     # 0x76028
callq 0x2f1b2
leaq 0x38(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x22b17(%rip), %rsi     # 0x77363
leaq 0x22b16(%rip), %rdx     # 0x77369
callq 0x2f1b2
leaq 0x58(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x217c2(%rip), %rsi     # 0x76029
leaq 0x2185d(%rip), %rdx     # 0x760cb
callq 0x2f1b2
leaq 0x78(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x22f99(%rip), %rdx     # 0x7781b
movq %rdx, %rsi
callq 0x2f1b2
movq 0x8(%rbx), %r9
leaq 0x3(%r9), %r8
addq $0x50, %r9
movq %r14, (%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x58(%rsp), %rdx
leaq 0x78(%rsp), %rcx
callq 0x2e8ba
movq 0x78(%rsp), %rdi
cmpq %rbp, %rdi
je 0x548c2
callq 0x27560
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
je 0x548d1
callq 0x27560
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0x548e0
callq 0x27560
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x548ef
callq 0x27560
leaq 0x18(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x217ce(%rip), %rsi     # 0x760cc
leaq 0x217cc(%rip), %rdx     # 0x760d1
callq 0x2f1b2
leaq 0x38(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x217b9(%rip), %rsi     # 0x760d2
leaq 0x217bf(%rip), %rdx     # 0x760df
callq 0x2f1b2
leaq 0x58(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x217ac(%rip), %rsi     # 0x760e0
leaq 0x21861(%rip), %rdx     # 0x7619c
callq 0x2f1b2
leaq 0x78(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x22ecc(%rip), %rdx     # 0x7781b
movq %rdx, %rsi
callq 0x2f1b2
movq 0x8(%rbx), %r9
leaq 0x1(%r9), %r8
addq $0x10, %r9
movq %r14, (%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x58(%rsp), %rdx
leaq 0x78(%rsp), %rcx
callq 0x2e8ba
movq 0x78(%rsp), %rdi
cmpq %rbp, %rdi
je 0x5498f
callq 0x27560
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
je 0x5499e
callq 0x27560
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0x549ad
callq 0x27560
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x549bc
callq 0x27560
leaq 0x18(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x217d2(%rip), %rsi     # 0x7619d
leaq 0x217d8(%rip), %rdx     # 0x761aa
callq 0x2f1b2
leaq 0x38(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x2297d(%rip), %rsi     # 0x77363
leaq 0x2297c(%rip), %rdx     # 0x77369
callq 0x2f1b2
leaq 0x58(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x217aa(%rip), %rsi     # 0x761ab
leaq 0x21805(%rip), %rdx     # 0x7620d
callq 0x2f1b2
leaq 0x78(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x22dff(%rip), %rdx     # 0x7781b
movq %rdx, %rsi
callq 0x2f1b2
movq 0x8(%rbx), %r9
leaq 0x4(%r9), %r8
addq $0xb0, %r9
movq %r14, (%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x58(%rsp), %rdx
leaq 0x78(%rsp), %rcx
callq 0x2e8ba
movq 0x78(%rsp), %rdi
cmpq %rbp, %rdi
je 0x54a5f
callq 0x27560
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
je 0x54a6e
callq 0x27560
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0x54a7d
callq 0x27560
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x54a8c
callq 0x27560
leaq 0x18(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x21773(%rip), %rsi     # 0x7620e
leaq 0x21779(%rip), %rdx     # 0x7621b
callq 0x2f1b2
leaq 0x18(%rsp), %rdi
callq 0x63a0c
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x54ac3
callq 0x27560
leaq 0x18(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x2174a(%rip), %rsi     # 0x7621c
leaq 0x2174a(%rip), %rdx     # 0x76223
callq 0x2f1b2
leaq 0x38(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x21737(%rip), %rsi     # 0x76224
leaq 0x21750(%rip), %rdx     # 0x76244
callq 0x2f1b2
movq 0x8(%rbx), %rdx
addq $0x5, %rdx
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rsi
movq %r14, %rcx
callq 0x63808
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0x54b22
callq 0x27560
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x54b31
callq 0x27560
leaq 0x18(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x21705(%rip), %rsi     # 0x76245
leaq 0x21705(%rip), %rdx     # 0x7624c
callq 0x2f1b2
leaq 0x38(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x216f2(%rip), %rsi     # 0x7624d
leaq 0x21711(%rip), %rdx     # 0x76273
callq 0x2f1b2
movq 0x8(%rbx), %rdx
addq $0x6, %rdx
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rsi
movq %r14, %rcx
callq 0x63808
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0x54b90
callq 0x27560
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x54b9f
callq 0x27560
leaq 0x18(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x216c6(%rip), %rsi     # 0x76274
leaq 0x216c9(%rip), %rdx     # 0x7627e
callq 0x2f1b2
leaq 0x38(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x216b6(%rip), %rsi     # 0x7627f
leaq 0x216cc(%rip), %rdx     # 0x7629c
callq 0x2f1b2
movq 0x8(%rbx), %rdx
addq $0x7, %rdx
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rsi
movq %r14, %rcx
callq 0x63808
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0x54bfe
callq 0x27560
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x54c0d
callq 0x27560
leaq 0x18(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x1e6a1(%rip), %rsi     # 0x732bd
leaq 0x1e69e(%rip), %rdx     # 0x732c1
callq 0x2f1b2
leaq 0x38(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x21666(%rip), %rsi     # 0x7629d
leaq 0x21667(%rip), %rdx     # 0x762a5
callq 0x2f1b2
leaq 0x58(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x21654(%rip), %rsi     # 0x762a6
leaq 0x216d0(%rip), %rdx     # 0x76329
callq 0x2f1b2
leaq 0x78(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x22bae(%rip), %rdx     # 0x7781b
movq %rdx, %rsi
callq 0x2f1b2
movq 0x8(%rbx), %r9
leaq 0x8(%r9), %r8
addq $0x90, %r9
movq %r14, (%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x58(%rsp), %rdx
leaq 0x78(%rsp), %rcx
callq 0x2e8ba
movq 0x78(%rsp), %rdi
cmpq %rbp, %rdi
je 0x54cb0
callq 0x27560
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
leaq 0xe8(%rsp), %rbx
leaq 0xc8(%rsp), %r14
leaq 0xa8(%rsp), %r15
je 0x54cd7
callq 0x27560
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0x54ce6
callq 0x27560
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x54cf5
callq 0x27560
movq 0x98(%rsp), %rdi
cmpq %r15, %rdi
je 0x54d07
callq 0x27560
movq 0xb8(%rsp), %rdi
cmpq %r14, %rdi
je 0x54d19
callq 0x27560
movq 0xd8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x54d2b
callq 0x27560
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x54dc2
jmp 0x54d88
jmp 0x54d8d
jmp 0x54d96
jmp 0x54d9d
jmp 0x54d8d
jmp 0x54d96
jmp 0x54d9d
jmp 0x54d8d
jmp 0x54d96
jmp 0x54d9d
jmp 0x54d8d
jmp 0x54d96
jmp 0x54d9d
jmp 0x54d96
jmp 0x54d9d
jmp 0x54dc2
jmp 0x54d88
jmp 0x54d8d
jmp 0x54d96
jmp 0x54d9d
jmp 0x54dc2
jmp 0x54d88
jmp 0x54d8d
jmp 0x54d96
jmp 0x54d9d
jmp 0x54dc2
jmp 0x54d88
jmp 0x54d8d
jmp 0x54d96
jmp 0x54d9d
jmp 0x54dc2
jmp 0x54d88
jmp 0x54d8d
jmp 0x54d96
jmp 0x54d9d
movq %rax, %rbx
jmp 0x54dd4
movq %rax, %rbx
jmp 0x54de8
jmp 0x54d96
jmp 0x54d9d
movq %rax, %rbx
jmp 0x54df7
jmp 0x54d9d
movq %rax, %rbx
jmp 0x54e06
movq %rax, %rbx
jmp 0x54e20
movq %rax, %rbx
jmp 0x54e3a
movq %rax, %rbx
jmp 0x54e54
movq %rax, %rbx
movq %r14, %rdi
jmp 0x54e4f
movq %rax, %rbx
movq 0x78(%rsp), %rdi
cmpq %rbp, %rdi
je 0x54dd4
callq 0x27560
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x54de8
callq 0x27560
movq 0x38(%rsp), %rdi
cmpq %r13, %rdi
je 0x54df7
callq 0x27560
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x54e06
callq 0x27560
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x54e20
callq 0x27560
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x54e3a
callq 0x27560
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x54e54
callq 0x27560
movq %rbx, %rdi
callq 0x27b20