// File: zeeev[P]DASVC/bamtools/src/toolkit/bamtools_revert.cpp
// Function: BamTools::RevertTool::RevertTool()
RevertTool::RevertTool(void)
    : AbstractTool()
    , m_settings(new RevertSettings)
    , m_impl(0)
{
    // set program details
    Options::SetProgramInfo("bamtools revert", "removes duplicate marks and restores original (non-recalibrated) base qualities", "[-in <filename> -in <filename> ...] [-out <filename> | [-forceCompression]] [revertOptions]");
    
    // set up options 
    OptionGroup* IO_Opts = Options::CreateOptionGroup("Input & Output");
    Options::AddValueOption("-in",  "BAM filename", "the input BAM file",  "", m_settings->HasInput,  m_settings->InputFilename,  IO_Opts, Options::StandardIn());
    Options::AddValueOption("-out", "BAM filename", "the output BAM file", "", m_settings->HasOutput, m_settings->OutputFilename, IO_Opts, Options::StandardOut());
    Options::AddOption("-forceCompression", "if results are sent to stdout (like when piping to another tool), default behavior is to leave output uncompressed. Use this flag to override and force compression", m_settings->IsForceCompression, IO_Opts);

    OptionGroup* RevertOpts = Options::CreateOptionGroup("Revert Options");
    Options::AddOption("-keepDuplicate", "keep duplicates marked", m_settings->IsKeepDuplicateFlag, RevertOpts);
    Options::AddOption("-keepQualities", "keep base qualities (do not replace with OQ contents)", m_settings->IsKeepQualities, RevertOpts);
}

// Assembly:
subq $0x438, %rsp            # imm = 0x438
movq %rdi, 0x430(%rsp)
movq 0x430(%rsp), %rdi
movq %rdi, 0x100(%rsp)
callq 0x91a20
movq 0x100(%rsp), %rax
leaq 0x8adad(%rip), %rcx     # 0x164b10
movq %rcx, (%rax)
addq $0x8, %rax
movq %rax, 0x108(%rsp)
movl $0x48, %edi
callq 0x86720
movq %rax, 0x110(%rsp)
jmp 0xd9d86
movq 0x110(%rsp), %rdi
callq 0xdac80
jmp 0xd9d95
movq 0x100(%rsp), %rax
movq 0x108(%rsp), %rcx
movq 0x110(%rsp), %rdx
movq %rdx, (%rcx)
movq $0x0, 0x10(%rax)
leaq 0x3ff(%rsp), %rdi
movq %rdi, 0xf8(%rsp)
callq 0x86da0
movq 0xf8(%rsp), %rdx
leaq 0x58315(%rip), %rsi     # 0x1320f1
leaq 0x400(%rsp), %rdi
callq 0x86a00
jmp 0xd9deb
leaq 0x3d7(%rsp), %rdi
movq %rdi, 0xf0(%rsp)
callq 0x86da0
movq 0xf0(%rsp), %rdx
leaq 0x582f2(%rip), %rsi     # 0x132101
leaq 0x3d8(%rsp), %rdi
callq 0x86a00
jmp 0xd9e1e
leaq 0x3af(%rsp), %rdi
movq %rdi, 0xe8(%rsp)
callq 0x86da0
movq 0xe8(%rsp), %rdx
leaq 0x5830f(%rip), %rsi     # 0x132151
leaq 0x3b0(%rsp), %rdi
callq 0x86a00
jmp 0xd9e51
leaq 0x400(%rsp), %rdi
leaq 0x3d8(%rsp), %rsi
leaq 0x3b0(%rsp), %rdx
callq 0x10f230
jmp 0xd9e70
leaq 0x3b0(%rsp), %rdi
callq 0x86f68
jmp 0xd9e7f
leaq 0x3af(%rsp), %rdi
callq 0x867b0
leaq 0x3d8(%rsp), %rdi
callq 0x86f68
jmp 0xd9e9b
leaq 0x3d7(%rsp), %rdi
callq 0x867b0
leaq 0x400(%rsp), %rdi
callq 0x86f68
jmp 0xd9eb7
leaq 0x3ff(%rsp), %rdi
callq 0x867b0
leaq 0x37f(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
callq 0x86da0
movq 0xe0(%rsp), %rdx
leaq 0x54783(%rip), %rsi     # 0x12e66b
leaq 0x380(%rsp), %rdi
callq 0x86a00
jmp 0xd9ef7
leaq 0x380(%rsp), %rdi
callq 0x10d3e0
movq %rax, 0xd8(%rsp)
jmp 0xd9f0e
leaq 0x380(%rsp), %rdi
callq 0x86f68
jmp 0xd9f1d
leaq 0x37f(%rsp), %rdi
callq 0x867b0
movq 0xd8(%rsp), %rax
movq %rax, 0x3a0(%rsp)
leaq 0x357(%rsp), %rdi
movq %rdi, 0xd0(%rsp)
callq 0x86da0
movq 0xd0(%rsp), %rdx
leaq 0x5471c(%rip), %rsi     # 0x12e67a
leaq 0x358(%rsp), %rdi
callq 0x86a00
jmp 0xd9f6d
leaq 0x32f(%rsp), %rdi
movq %rdi, 0xc8(%rsp)
callq 0x86da0
movq 0xc8(%rsp), %rdx
leaq 0x546ed(%rip), %rsi     # 0x12e67e
leaq 0x330(%rsp), %rdi
callq 0x86a00
jmp 0xd9fa0
leaq 0x307(%rsp), %rdi
movq %rdi, 0xc0(%rsp)
callq 0x86da0
movq 0xc0(%rsp), %rdx
leaq 0x59970(%rip), %rsi     # 0x133934
leaq 0x308(%rsp), %rdi
callq 0x86a00
jmp 0xd9fd3
leaq 0x2df(%rsp), %rdi
movq %rdi, 0xb8(%rsp)
callq 0x86da0
movq 0xb8(%rsp), %rdx
leaq 0x5ac7c(%rip), %rsi     # 0x134c73
leaq 0x2e0(%rsp), %rdi
callq 0x86a00
jmp 0xda006
movq 0x100(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x98(%rsp)
addq $0x8, %rax
movq %rax, 0xa0(%rsp)
movq 0x3a0(%rsp), %rax
movq %rax, 0xa8(%rsp)
callq 0x10f280
movq %rax, 0xb0(%rsp)
jmp 0xda045
movq 0xa0(%rsp), %r9
movq 0x98(%rsp), %r8
movq 0xa8(%rsp), %rcx
movq 0xb0(%rsp), %rdx
movq %rsp, %rax
movq %rdx, 0x8(%rax)
movq %rcx, (%rax)
leaq 0x358(%rsp), %rdi
leaq 0x330(%rsp), %rsi
leaq 0x308(%rsp), %rdx
leaq 0x2e0(%rsp), %rcx
callq 0x92150
jmp 0xda096
leaq 0x2e0(%rsp), %rdi
callq 0x86f68
jmp 0xda0a5
leaq 0x2df(%rsp), %rdi
callq 0x867b0
leaq 0x308(%rsp), %rdi
callq 0x86f68
jmp 0xda0c1
leaq 0x307(%rsp), %rdi
callq 0x867b0
leaq 0x330(%rsp), %rdi
callq 0x86f68
jmp 0xda0dd
leaq 0x32f(%rsp), %rdi
callq 0x867b0
leaq 0x358(%rsp), %rdi
callq 0x86f68
jmp 0xda0f9
leaq 0x357(%rsp), %rdi
callq 0x867b0
leaq 0x2b7(%rsp), %rdi
movq %rdi, 0x90(%rsp)
callq 0x86da0
movq 0x90(%rsp), %rdx
leaq 0x545a8(%rip), %rsi     # 0x12e6d2
leaq 0x2b8(%rsp), %rdi
callq 0x86a00
jmp 0xda139
leaq 0x28f(%rsp), %rdi
movq %rdi, 0x88(%rsp)
callq 0x86da0
movq 0x88(%rsp), %rdx
leaq 0x54521(%rip), %rsi     # 0x12e67e
leaq 0x290(%rsp), %rdi
callq 0x86a00
jmp 0xda16c
leaq 0x267(%rsp), %rdi
movq %rdi, 0x80(%rsp)
callq 0x86da0
movq 0x80(%rsp), %rdx
leaq 0x54547(%rip), %rsi     # 0x12e6d7
leaq 0x268(%rsp), %rdi
callq 0x86a00
jmp 0xda19f
leaq 0x23f(%rsp), %rdi
movq %rdi, 0x78(%rsp)
callq 0x86da0
movq 0x78(%rsp), %rdx
leaq 0x5aab6(%rip), %rsi     # 0x134c73
leaq 0x240(%rsp), %rdi
callq 0x86a00
jmp 0xda1cc
movq 0x100(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, %rcx
incq %rcx
movq %rcx, 0x58(%rsp)
addq $0x28, %rax
movq %rax, 0x60(%rsp)
movq 0x3a0(%rsp), %rax
movq %rax, 0x68(%rsp)
callq 0x10f290
movq %rax, 0x70(%rsp)
jmp 0xda205
movq 0x60(%rsp), %r9
movq 0x58(%rsp), %r8
movq 0x68(%rsp), %rcx
movq 0x70(%rsp), %rdx
movq %rsp, %rax
movq %rdx, 0x8(%rax)
movq %rcx, (%rax)
leaq 0x2b8(%rsp), %rdi
leaq 0x290(%rsp), %rsi
leaq 0x268(%rsp), %rdx
leaq 0x240(%rsp), %rcx
callq 0x92150
jmp 0xda24a
leaq 0x240(%rsp), %rdi
callq 0x86f68
jmp 0xda259
leaq 0x23f(%rsp), %rdi
callq 0x867b0
leaq 0x268(%rsp), %rdi
callq 0x86f68
jmp 0xda275
leaq 0x267(%rsp), %rdi
callq 0x867b0
leaq 0x290(%rsp), %rdi
callq 0x86f68
jmp 0xda291
leaq 0x28f(%rsp), %rdi
callq 0x867b0
leaq 0x2b8(%rsp), %rdi
callq 0x86f68
jmp 0xda2ad
leaq 0x2b7(%rsp), %rdi
callq 0x867b0
leaq 0x217(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0x86da0
movq 0x50(%rsp), %rdx
leaq 0x555f4(%rip), %rsi     # 0x12f8cc
leaq 0x218(%rsp), %rdi
callq 0x86a00
jmp 0xda2e7
leaq 0x1ef(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x86da0
movq 0x48(%rsp), %rdx
leaq 0x5551b(%rip), %rsi     # 0x12f820
leaq 0x1f0(%rsp), %rdi
callq 0x86a00
jmp 0xda314
movq 0x100(%rsp), %rax
movq 0x8(%rax), %rdx
addq $0x2, %rdx
movq 0x3a0(%rsp), %rcx
leaq 0x218(%rsp), %rdi
leaq 0x1f0(%rsp), %rsi
callq 0x10d2a0
jmp 0xda343
leaq 0x1f0(%rsp), %rdi
callq 0x86f68
jmp 0xda352
leaq 0x1ef(%rsp), %rdi
callq 0x867b0
leaq 0x218(%rsp), %rdi
callq 0x86f68
jmp 0xda36e
leaq 0x217(%rsp), %rdi
callq 0x867b0
leaq 0x1bf(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x86da0
movq 0x40(%rsp), %rdx
leaq 0x57e14(%rip), %rsi     # 0x1321ad
leaq 0x1c0(%rsp), %rdi
callq 0x86a00
jmp 0xda3a8
leaq 0x1c0(%rsp), %rdi
callq 0x10d3e0
movq %rax, 0x38(%rsp)
jmp 0xda3bc
leaq 0x1c0(%rsp), %rdi
callq 0x86f68
jmp 0xda3cb
leaq 0x1bf(%rsp), %rdi
callq 0x867b0
movq 0x38(%rsp), %rax
movq %rax, 0x1e0(%rsp)
leaq 0x197(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x86da0
movq 0x30(%rsp), %rdx
leaq 0x57db9(%rip), %rsi     # 0x1321bc
leaq 0x198(%rsp), %rdi
callq 0x86a00
jmp 0xda412
leaq 0x16f(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x86da0
movq 0x28(%rsp), %rdx
leaq 0x57d9b(%rip), %rsi     # 0x1321cb
leaq 0x170(%rsp), %rdi
callq 0x86a00
jmp 0xda43f
movq 0x100(%rsp), %rax
movq 0x8(%rax), %rdx
addq $0x3, %rdx
movq 0x1e0(%rsp), %rcx
leaq 0x198(%rsp), %rdi
leaq 0x170(%rsp), %rsi
callq 0x10d2a0
jmp 0xda46e
leaq 0x170(%rsp), %rdi
callq 0x86f68
jmp 0xda47d
leaq 0x16f(%rsp), %rdi
callq 0x867b0
leaq 0x198(%rsp), %rdi
callq 0x86f68
jmp 0xda499
leaq 0x197(%rsp), %rdi
callq 0x867b0
leaq 0x147(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x86da0
movq 0x20(%rsp), %rdx
leaq 0x57d1e(%rip), %rsi     # 0x1321e2
leaq 0x148(%rsp), %rdi
callq 0x86a00
jmp 0xda4d3
leaq 0x11f(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x86da0
movq 0x18(%rsp), %rdx
leaq 0x57d00(%rip), %rsi     # 0x1321f1
leaq 0x120(%rsp), %rdi
callq 0x86a00
jmp 0xda500
movq 0x100(%rsp), %rax
movq 0x8(%rax), %rdx
addq $0x4, %rdx
movq 0x1e0(%rsp), %rcx
leaq 0x148(%rsp), %rdi
leaq 0x120(%rsp), %rsi
callq 0x10d2a0
jmp 0xda52f
leaq 0x120(%rsp), %rdi
callq 0x86f68
jmp 0xda53e
leaq 0x11f(%rsp), %rdi
callq 0x867b0
leaq 0x148(%rsp), %rdi
callq 0x86f68
jmp 0xda55a
leaq 0x147(%rsp), %rdi
callq 0x867b0
addq $0x438, %rsp            # imm = 0x438
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
jmp 0xdaa59
movq 0x110(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
callq 0x866a0
jmp 0xdaa59
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
jmp 0xda654
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
jmp 0xda636
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
jmp 0xda618
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
leaq 0x3b0(%rsp), %rdi
callq 0x86f68
jmp 0xda616
jmp 0xda618
leaq 0x3af(%rsp), %rdi
callq 0x867b0
leaq 0x3d8(%rsp), %rdi
callq 0x86f68
jmp 0xda634
jmp 0xda636
leaq 0x3d7(%rsp), %rdi
callq 0x867b0
leaq 0x400(%rsp), %rdi
callq 0x86f68
jmp 0xda652
jmp 0xda654
leaq 0x3ff(%rsp), %rdi
callq 0x867b0
jmp 0xdaa59
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
jmp 0xda6a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
leaq 0x380(%rsp), %rdi
callq 0x86f68
jmp 0xda69f
jmp 0xda6a1
leaq 0x37f(%rsp), %rdi
callq 0x867b0
jmp 0xdaa59
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
jmp 0xda790
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
jmp 0xda772
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
jmp 0xda754
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
jmp 0xda736
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
leaq 0x2e0(%rsp), %rdi
callq 0x86f68
jmp 0xda734
jmp 0xda736
leaq 0x2df(%rsp), %rdi
callq 0x867b0
leaq 0x308(%rsp), %rdi
callq 0x86f68
jmp 0xda752
jmp 0xda754
leaq 0x307(%rsp), %rdi
callq 0x867b0
leaq 0x330(%rsp), %rdi
callq 0x86f68
jmp 0xda770
jmp 0xda772
leaq 0x32f(%rsp), %rdi
callq 0x867b0
leaq 0x358(%rsp), %rdi
callq 0x86f68
jmp 0xda78e
jmp 0xda790
leaq 0x357(%rsp), %rdi
callq 0x867b0
jmp 0xdaa59
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
jmp 0xda87f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
jmp 0xda861
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
jmp 0xda843
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
jmp 0xda825
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
leaq 0x240(%rsp), %rdi
callq 0x86f68
jmp 0xda823
jmp 0xda825
leaq 0x23f(%rsp), %rdi
callq 0x867b0
leaq 0x268(%rsp), %rdi
callq 0x86f68
jmp 0xda841
jmp 0xda843
leaq 0x267(%rsp), %rdi
callq 0x867b0
leaq 0x290(%rsp), %rdi
callq 0x86f68
jmp 0xda85f
jmp 0xda861
leaq 0x28f(%rsp), %rdi
callq 0x867b0
leaq 0x2b8(%rsp), %rdi
callq 0x86f68
jmp 0xda87d
jmp 0xda87f
leaq 0x2b7(%rsp), %rdi
callq 0x867b0
jmp 0xdaa59
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
jmp 0xda900
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
jmp 0xda8e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
leaq 0x1f0(%rsp), %rdi
callq 0x86f68
jmp 0xda8e0
jmp 0xda8e2
leaq 0x1ef(%rsp), %rdi
callq 0x867b0
leaq 0x218(%rsp), %rdi
callq 0x86f68
jmp 0xda8fe
jmp 0xda900
leaq 0x217(%rsp), %rdi
callq 0x867b0
jmp 0xdaa59
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
jmp 0xda94d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
leaq 0x1c0(%rsp), %rdi
callq 0x86f68
jmp 0xda94b
jmp 0xda94d
leaq 0x1bf(%rsp), %rdi
callq 0x867b0
jmp 0xdaa59
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
jmp 0xda9ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
jmp 0xda9b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
leaq 0x170(%rsp), %rdi
callq 0x86f68
jmp 0xda9ae
jmp 0xda9b0
leaq 0x16f(%rsp), %rdi
callq 0x867b0
leaq 0x198(%rsp), %rdi
callq 0x86f68
jmp 0xda9cc
jmp 0xda9ce
leaq 0x197(%rsp), %rdi
callq 0x867b0
jmp 0xdaa59
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
jmp 0xdaa4c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
jmp 0xdaa2e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x428(%rsp)
movl %eax, 0x424(%rsp)
leaq 0x120(%rsp), %rdi
callq 0x86f68
jmp 0xdaa2c
jmp 0xdaa2e
leaq 0x11f(%rsp), %rdi
callq 0x867b0
leaq 0x148(%rsp), %rdi
callq 0x86f68
jmp 0xdaa4a
jmp 0xdaa4c
leaq 0x147(%rsp), %rdi
callq 0x867b0
movq 0x100(%rsp), %rdi
callq 0x92a20
jmp 0xdaa68
jmp 0xdaa6a
movq 0x428(%rsp), %rdi
callq 0x86d80
movq %rax, %rdi
callq 0x91290
nop