// File: zeeev[P]DASVC/bamtools/src/toolkit/bamtools_convert.cpp
// Function: BamTools::ConvertTool::ConvertToolPrivate::Run()
bool ConvertTool::ConvertToolPrivate::Run(void) {
 
    // ------------------------------------
    // initialize conversion input/output
        
    // set to default input if none provided
    if ( !m_settings->HasInput && !m_settings->HasInputFilelist )
        m_settings->InputFiles.push_back(Options::StandardIn());
    
    // add files in the filelist to the input file list
    if ( m_settings->HasInputFilelist ) {

        ifstream filelist(m_settings->InputFilelist.c_str(), ios::in);
        if ( !filelist.is_open() ) {
            cerr << "bamtools convert ERROR: could not open input BAM file list... Aborting." << endl;
            return false;
        }

        string line;
        while ( getline(filelist, line) )
            m_settings->InputFiles.push_back(line);
    }

    // open input files
    BamMultiReader reader;
    if ( !reader.Open(m_settings->InputFiles) ) {
        cerr << "bamtools convert ERROR: could not open input BAM file(s)... Aborting." << endl;
        return false;
    }

    // if input is not stdin & a region is provided, look for index files
    if ( m_settings->HasInput && m_settings->HasRegion ) {
        if ( !reader.LocateIndexes() ) {
            cerr << "bamtools convert ERROR: could not locate index file(s)... Aborting." << endl;
            return false;
        }
    }

    // retrieve reference data
    m_references = reader.GetReferenceData();

    // set region if specified
    BamRegion region;
    if ( m_settings->HasRegion ) {
        if ( Utilities::ParseRegionString(m_settings->Region, reader, region) ) {

            if ( reader.HasIndexes() ) {
                if ( !reader.SetRegion(region) ) {
                    cerr << "bamtools convert ERROR: set region failed. Check that REGION describes a valid range" << endl;
                    reader.Close();
                    return false;
                }
            }

        } else {
            cerr << "bamtools convert ERROR: could not parse REGION: " << m_settings->Region << endl;
            cerr << "Check that REGION is in valid format (see documentation) and that the coordinates are valid"
                 << endl;
            reader.Close();
            return false;
        }
    }
        
    // if output file given
    ofstream outFile;
    if ( m_settings->HasOutput ) {
      
        // open output file stream
        outFile.open(m_settings->OutputFilename.c_str());
        if ( !outFile ) {
            cerr << "bamtools convert ERROR: could not open " << m_settings->OutputFilename
                 << " for output" << endl;
            return false; 
        }
        
        // set m_out to file's streambuf
        m_out.rdbuf(outFile.rdbuf()); 
    }
    
    // -------------------------------------
    // do conversion based on format
    
     bool convertedOk = true;
    
    // pileup is special case
    // conversion not done per alignment, like the other formats
    if ( m_settings->Format == FORMAT_PILEUP )
        convertedOk = RunPileupConversion(&reader);
    
    // all other formats
    else {
    
        bool formatError = false;
        
        // set function pointer to proper conversion method
        void (BamTools::ConvertTool::ConvertToolPrivate::*pFunction)(const BamAlignment&) = 0;
        if      ( m_settings->Format == FORMAT_BED )   pFunction = &BamTools::ConvertTool::ConvertToolPrivate::PrintBed;
        else if ( m_settings->Format == FORMAT_FASTA ) pFunction = &BamTools::ConvertTool::ConvertToolPrivate::PrintFasta;
        else if ( m_settings->Format == FORMAT_FASTQ ) pFunction = &BamTools::ConvertTool::ConvertToolPrivate::PrintFastq;
        else if ( m_settings->Format == FORMAT_JSON )  pFunction = &BamTools::ConvertTool::ConvertToolPrivate::PrintJson;
        else if ( m_settings->Format == FORMAT_SAM )   pFunction = &BamTools::ConvertTool::ConvertToolPrivate::PrintSam;
        else if ( m_settings->Format == FORMAT_YAML )  pFunction = &BamTools::ConvertTool::ConvertToolPrivate::PrintYaml;
        else { 
            cerr << "bamtools convert ERROR: unrecognized format: " << m_settings->Format << endl;
            cerr << "Please see documentation for list of supported formats " << endl;
            formatError = true;
            convertedOk = false;
        }
        
        // if format selected ok
        if ( !formatError ) {
        
            // if SAM format & not omitting header, print SAM header first
            if ( (m_settings->Format == FORMAT_SAM) && !m_settings->IsOmittingSamHeader ) 
                m_out << reader.GetHeaderText();
            
            // iterate through file, doing conversion
            BamAlignment a;
            while ( reader.GetNextAlignment(a) )
                (this->*pFunction)(a);
            
            // set flag for successful conversion
            convertedOk = true;
        }
    }
    
    // ------------------------
    // clean up & exit
    reader.Close();
    if ( m_settings->HasOutput )
        outFile.close();
    return convertedOk;   
}

// Assembly:
subq $0x738, %rsp            # imm = 0x738
movq %rdi, 0x728(%rsp)
movq 0x728(%rsp), %rax
movq %rax, 0x110(%rsp)
movq (%rax), %rax
testb $0x1, (%rax)
jne 0x8b6e4
movq 0x110(%rsp), %rax
movq (%rax), %rax
testb $0x1, 0x1(%rax)
jne 0x8b6e4
movq 0x110(%rsp), %rax
movq (%rax), %rax
addq $0x8, %rax
movq %rax, 0x108(%rsp)
callq 0x10f280
movq 0x108(%rsp), %rdi
movq %rax, %rsi
callq 0x91220
movq 0x110(%rsp), %rax
movq (%rax), %rax
testb $0x1, 0x1(%rax)
je 0x8b8a4
movq 0x110(%rsp), %rax
movq (%rax), %rdi
addq $0x20, %rdi
callq 0x86320
movq %rax, %rsi
leaq 0x520(%rsp), %rdi
movq %rdi, 0xf8(%rsp)
movl $0x8, %edx
callq 0x86e30
movq 0xf8(%rsp), %rdi
callq 0x86c10
movb %al, 0x107(%rsp)
jmp 0x8b740
movb 0x107(%rsp), %al
testb $0x1, %al
jne 0x8b7b1
jmp 0x8b74d
movq 0xd988c(%rip), %rdi     # 0x164fe0
leaq 0xa2aa1(%rip), %rsi     # 0x12e1fc
callq 0x86700
movq %rax, 0xf0(%rsp)
jmp 0x8b76a
movq 0xf0(%rsp), %rdi
movq 0xd97f7(%rip), %rsi     # 0x164f70
callq 0x86770
jmp 0x8b780
movb $0x0, 0x737(%rsp)
movl $0x1, 0x510(%rsp)
jmp 0x8b86d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x518(%rsp)
movl %eax, 0x514(%rsp)
jmp 0x8b890
leaq 0x4f0(%rsp), %rdi
callq 0x86a30
jmp 0x8b7c0
jmp 0x8b7c2
leaq 0x520(%rsp), %rdi
leaq 0x4f0(%rsp), %rsi
callq 0x86140
movq %rax, 0xe8(%rsp)
jmp 0x8b7e1
movq 0xe8(%rsp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x86b60
movq %rax, 0xe0(%rsp)
jmp 0x8b802
movq 0xe0(%rsp), %rax
cmpq $0x0, %rax
je 0x8b853
movq 0x110(%rsp), %rax
movq (%rax), %rdi
addq $0x8, %rdi
leaq 0x4f0(%rsp), %rsi
callq 0x91220
jmp 0x8b82e
jmp 0x8b7c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x518(%rsp)
movl %eax, 0x514(%rsp)
leaq 0x4f0(%rsp), %rdi
callq 0x86f68
jmp 0x8b88e
leaq 0x4f0(%rsp), %rdi
callq 0x86f68
jmp 0x8b862
movl $0x0, 0x510(%rsp)
leaq 0x520(%rsp), %rdi
callq 0x861c0
movl 0x510(%rsp), %eax
testl %eax, %eax
je 0x8b88c
jmp 0x8b887
jmp 0x8c2f4
jmp 0x8b8a4
jmp 0x8b890
leaq 0x520(%rsp), %rdi
callq 0x861c0
jmp 0x8b89f
jmp 0x8c305
leaq 0x4e8(%rsp), %rdi
movq %rdi, 0xd0(%rsp)
callq 0x86db0
movq 0x110(%rsp), %rax
movq 0xd0(%rsp), %rdi
movq (%rax), %rsi
addq $0x8, %rsi
callq 0x864a0
movb %al, 0xdf(%rsp)
jmp 0x8b8de
movb 0xdf(%rsp), %al
testb $0x1, %al
jne 0x8b94f
jmp 0x8b8eb
movq 0xd96ee(%rip), %rdi     # 0x164fe0
leaq 0xa294b(%rip), %rsi     # 0x12e244
callq 0x86700
movq %rax, 0xc8(%rsp)
jmp 0x8b908
movq 0xc8(%rsp), %rdi
movq 0xd9659(%rip), %rsi     # 0x164f70
callq 0x86770
jmp 0x8b91e
movb $0x0, 0x737(%rsp)
movl $0x1, 0x510(%rsp)
jmp 0x8c2d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x518(%rsp)
movl %eax, 0x514(%rsp)
jmp 0x8c2e3
movq 0x110(%rsp), %rax
movq (%rax), %rax
testb $0x1, (%rax)
je 0x8b9fd
movq 0x110(%rsp), %rax
movq (%rax), %rax
testb $0x1, 0x4(%rax)
je 0x8b9fd
movl $0x1, 0x4e4(%rsp)
leaq 0x4e8(%rsp), %rdi
leaq 0x4e4(%rsp), %rsi
callq 0x86950
movb %al, 0xc7(%rsp)
jmp 0x8b9a1
movb 0xc7(%rsp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x8b9b0
jmp 0x8b9fb
movq 0xd9629(%rip), %rdi     # 0x164fe0
leaq 0xa28cc(%rip), %rsi     # 0x12e28a
callq 0x86700
movq %rax, 0xb8(%rsp)
jmp 0x8b9cd
movq 0xb8(%rsp), %rdi
movq 0xd9594(%rip), %rsi     # 0x164f70
callq 0x86770
jmp 0x8b9e3
movb $0x0, 0x737(%rsp)
movl $0x1, 0x510(%rsp)
jmp 0x8c2d4
jmp 0x8b9fd
leaq 0x4c8(%rsp), %rdi
leaq 0x4e8(%rsp), %rsi
callq 0x862c0
jmp 0x8ba14
movq 0x110(%rsp), %rdi
addq $0x8, %rdi
leaq 0x4c8(%rsp), %rsi
callq 0x912a0
jmp 0x8ba2f
leaq 0x4c8(%rsp), %rdi
callq 0x91560
jmp 0x8ba3e
movl $0xffffffff, 0x4b4(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x4b0(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x4ac(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x4a8(%rsp) # imm = 0xFFFFFFFF
leaq 0x4b8(%rsp), %rdi
leaq 0x4b4(%rsp), %rsi
leaq 0x4b0(%rsp), %rdx
leaq 0x4ac(%rsp), %rcx
leaq 0x4a8(%rsp), %r8
callq 0x915e0
jmp 0x8ba99
movq 0x110(%rsp), %rax
movq (%rax), %rax
testb $0x1, 0x4(%rax)
je 0x8bc7e
movq 0x110(%rsp), %rax
movq (%rax), %rdi
subq $-0x80, %rdi
leaq 0x4e8(%rsp), %rsi
leaq 0x4b8(%rsp), %rdx
callq 0x115500
movb %al, 0xb7(%rsp)
jmp 0x8badb
movb 0xb7(%rsp), %al
testb $0x1, %al
jne 0x8baeb
jmp 0x8bbc9
leaq 0x4e8(%rsp), %rdi
callq 0x864c0
movb %al, 0xb6(%rsp)
jmp 0x8bb01
movb 0xb6(%rsp), %al
testb $0x1, %al
jne 0x8bb11
jmp 0x8bbc4
leaq 0x4e8(%rsp), %rdi
leaq 0x4b8(%rsp), %rsi
callq 0x86d60
movb %al, 0xb5(%rsp)
jmp 0x8bb2f
movb 0xb5(%rsp), %al
testb $0x1, %al
jne 0x8bbc2
jmp 0x8bb40
movq 0xd9499(%rip), %rdi     # 0x164fe0
leaq 0xa2780(%rip), %rsi     # 0x12e2ce
callq 0x86700
movq %rax, 0xa8(%rsp)
jmp 0x8bb5d
movq 0xa8(%rsp), %rdi
movq 0xd9404(%rip), %rsi     # 0x164f70
callq 0x86770
jmp 0x8bb73
leaq 0x4e8(%rsp), %rdi
callq 0x861e0
jmp 0x8bb82
movb $0x0, 0x737(%rsp)
movl $0x1, 0x510(%rsp)
jmp 0x8c2d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x518(%rsp)
movl %eax, 0x514(%rsp)
leaq 0x4c8(%rsp), %rdi
callq 0x91560
jmp 0x8bbbd
jmp 0x8c2e3
jmp 0x8bbc4
jmp 0x8bc7c
movq 0xd9410(%rip), %rdi     # 0x164fe0
leaq 0xa274c(%rip), %rsi     # 0x12e323
callq 0x86700
movq %rax, 0xa0(%rsp)
jmp 0x8bbe6
movq 0xa0(%rsp), %rdi
movq 0x110(%rsp), %rax
movq (%rax), %rsi
subq $-0x80, %rsi
callq 0x86640
movq %rax, 0x98(%rsp)
jmp 0x8bc0c
movq 0x98(%rsp), %rdi
movq 0xd9355(%rip), %rsi     # 0x164f70
callq 0x86770
jmp 0x8bc22
movq 0xd93b7(%rip), %rdi     # 0x164fe0
leaq 0xa2724(%rip), %rsi     # 0x12e354
callq 0x86700
movq %rax, 0x90(%rsp)
jmp 0x8bc3f
movq 0x90(%rsp), %rdi
movq 0xd9322(%rip), %rsi     # 0x164f70
callq 0x86770
jmp 0x8bc55
leaq 0x4e8(%rsp), %rdi
callq 0x861e0
jmp 0x8bc64
movb $0x0, 0x737(%rsp)
movl $0x1, 0x510(%rsp)
jmp 0x8c2d4
jmp 0x8bc7e
leaq 0x2a8(%rsp), %rdi
callq 0x86d10
jmp 0x8bc8d
movq 0x110(%rsp), %rax
movq (%rax), %rax
testb $0x1, 0x2(%rax)
je 0x8bde5
movq 0x110(%rsp), %rax
movq (%rax), %rdi
addq $0x40, %rdi
callq 0x86320
movq %rax, 0x88(%rsp)
jmp 0x8bcc0
movq 0x88(%rsp), %rsi
leaq 0x2a8(%rsp), %rdi
movl $0x10, %edx
callq 0x86090
jmp 0x8bcdc
movq 0x2a8(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x2a8(%rsp,%rax), %rdi
callq 0x863b0
movb %al, 0x87(%rsp)
jmp 0x8bcfe
movb 0x87(%rsp), %al
testb $0x1, %al
jne 0x8bd0e
jmp 0x8bda4
movq 0xd92cb(%rip), %rdi     # 0x164fe0
leaq 0xa2694(%rip), %rsi     # 0x12e3b0
callq 0x86700
movq %rax, 0x78(%rsp)
jmp 0x8bd28
movq 0x78(%rsp), %rdi
movq 0x110(%rsp), %rax
movq (%rax), %rsi
addq $0x40, %rsi
callq 0x86640
movq %rax, 0x70(%rsp)
jmp 0x8bd48
movq 0x70(%rsp), %rdi
leaq 0xa2684(%rip), %rsi     # 0x12e3d8
callq 0x86700
movq %rax, 0x68(%rsp)
jmp 0x8bd60
movq 0x68(%rsp), %rdi
movq 0xd9204(%rip), %rsi     # 0x164f70
callq 0x86770
jmp 0x8bd73
movb $0x0, 0x737(%rsp)
movl $0x1, 0x510(%rsp)
jmp 0x8c2b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x518(%rsp)
movl %eax, 0x514(%rsp)
jmp 0x8c2c3
movq 0x110(%rsp), %rax
movq 0x20(%rax), %rcx
movq -0x18(%rcx), %rcx
leaq 0x20(%rax,%rcx), %rax
movq %rax, 0x58(%rsp)
leaq 0x2a8(%rsp), %rdi
callq 0x86e70
movq %rax, 0x60(%rsp)
jmp 0x8bdd2
movq 0x60(%rsp), %rsi
movq 0x58(%rsp), %rdi
callq 0x86ea0
jmp 0x8bde3
jmp 0x8bde5
movq 0x110(%rsp), %rax
movb $0x1, 0x2a7(%rsp)
movq (%rax), %rdi
addq $0x60, %rdi
leaq 0xd9a85(%rip), %rsi     # 0x165888
callq 0x91630
movb %al, 0x57(%rsp)
jmp 0x8be0e
movb 0x57(%rsp), %al
testb $0x1, %al
jne 0x8be18
jmp 0x8be45
movq 0x110(%rsp), %rdi
leaq 0x4e8(%rsp), %rsi
callq 0x8c320
movb %al, 0x56(%rsp)
jmp 0x8be33
movb 0x56(%rsp), %al
andb $0x1, %al
movb %al, 0x2a7(%rsp)
jmp 0x8c266
movq 0x110(%rsp), %rax
movb $0x0, 0x2a6(%rsp)
movq $0x0, 0x298(%rsp)
movq $0x0, 0x290(%rsp)
movq (%rax), %rdi
addq $0x60, %rdi
leaq 0xd996d(%rip), %rsi     # 0x1657e8
callq 0x91630
movb %al, 0x55(%rsp)
jmp 0x8be86
movb 0x55(%rsp), %al
testb $0x1, %al
jne 0x8be90
jmp 0x8beb0
leaq 0x679(%rip), %rax       # 0x8c510
movq %rax, 0x290(%rsp)
movq $0x0, 0x298(%rsp)
jmp 0x8c0bb
movq 0x110(%rsp), %rax
movq (%rax), %rdi
addq $0x60, %rdi
leaq 0xd9942(%rip), %rsi     # 0x165808
callq 0x91630
movb %al, 0x54(%rsp)
jmp 0x8bed1
movb 0x54(%rsp), %al
testb $0x1, %al
jne 0x8bedb
jmp 0x8befb
leaq 0x76e(%rip), %rax       # 0x8c650
movq %rax, 0x290(%rsp)
movq $0x0, 0x298(%rsp)
jmp 0x8c0b9
movq 0x110(%rsp), %rax
movq (%rax), %rdi
addq $0x60, %rdi
leaq 0xd9917(%rip), %rsi     # 0x165828
callq 0x91630
movb %al, 0x53(%rsp)
jmp 0x8bf1c
movb 0x53(%rsp), %al
testb $0x1, %al
jne 0x8bf26
jmp 0x8bf46
leaq 0x9e3(%rip), %rax       # 0x8c910
movq %rax, 0x290(%rsp)
movq $0x0, 0x298(%rsp)
jmp 0x8c0b7
movq 0x110(%rsp), %rax
movq (%rax), %rdi
addq $0x60, %rdi
leaq 0xd98ec(%rip), %rsi     # 0x165848
callq 0x91630
movb %al, 0x52(%rsp)
jmp 0x8bf67
movb 0x52(%rsp), %al
testb $0x1, %al
jne 0x8bf71
jmp 0x8bf91
leaq 0xc48(%rip), %rax       # 0x8cbc0
movq %rax, 0x290(%rsp)
movq $0x0, 0x298(%rsp)
jmp 0x8c0b5
movq 0x110(%rsp), %rax
movq (%rax), %rdi
addq $0x60, %rdi
leaq 0xd98c1(%rip), %rsi     # 0x165868
callq 0x91630
movb %al, 0x51(%rsp)
jmp 0x8bfb2
movb 0x51(%rsp), %al
testb $0x1, %al
jne 0x8bfbc
jmp 0x8bfdc
leaq 0x172d(%rip), %rax      # 0x8d6f0
movq %rax, 0x290(%rsp)
movq $0x0, 0x298(%rsp)
jmp 0x8c0b3
movq 0x110(%rsp), %rax
movq (%rax), %rdi
addq $0x60, %rdi
leaq 0xd98b6(%rip), %rsi     # 0x1658a8
callq 0x91630
movb %al, 0x50(%rsp)
jmp 0x8bffd
movb 0x50(%rsp), %al
testb $0x1, %al
jne 0x8c007
jmp 0x8c027
leaq 0x2132(%rip), %rax      # 0x8e140
movq %rax, 0x290(%rsp)
movq $0x0, 0x298(%rsp)
jmp 0x8c0b1
movq 0xd8fb2(%rip), %rdi     # 0x164fe0
leaq 0xa23af(%rip), %rsi     # 0x12e3e4
callq 0x86700
movq %rax, 0x48(%rsp)
jmp 0x8c041
movq 0x48(%rsp), %rdi
movq 0x110(%rsp), %rax
movq (%rax), %rsi
addq $0x60, %rsi
callq 0x86640
movq %rax, 0x40(%rsp)
jmp 0x8c061
movq 0x40(%rsp), %rdi
movq 0xd8f03(%rip), %rsi     # 0x164f70
callq 0x86770
jmp 0x8c074
movq 0xd8f65(%rip), %rdi     # 0x164fe0
leaq 0xa2390(%rip), %rsi     # 0x12e412
callq 0x86700
movq %rax, 0x38(%rsp)
jmp 0x8c08e
movq 0x38(%rsp), %rdi
movq 0xd8ed6(%rip), %rsi     # 0x164f70
callq 0x86770
jmp 0x8c0a1
movb $0x1, 0x2a6(%rsp)
movb $0x0, 0x2a7(%rsp)
jmp 0x8c0b3
jmp 0x8c0b5
jmp 0x8c0b7
jmp 0x8c0b9
jmp 0x8c0bb
testb $0x1, 0x2a6(%rsp)
jne 0x8c264
movq 0x110(%rsp), %rax
movq (%rax), %rdi
addq $0x60, %rdi
leaq 0xd9789(%rip), %rsi     # 0x165868
callq 0x91630
movb %al, 0x37(%rsp)
jmp 0x8c0ea
movb 0x37(%rsp), %al
testb $0x1, %al
jne 0x8c0f7
jmp 0x8c17d
movq 0x110(%rsp), %rax
movq (%rax), %rax
testb $0x1, 0x6(%rax)
jne 0x8c17d
movq 0x110(%rsp), %rax
addq $0x20, %rax
movq %rax, 0x28(%rsp)
leaq 0x270(%rsp), %rdi
leaq 0x4e8(%rsp), %rsi
callq 0x865f0
jmp 0x8c130
movq 0x28(%rsp), %rdi
leaq 0x270(%rsp), %rsi
callq 0x86640
jmp 0x8c144
leaq 0x270(%rsp), %rdi
callq 0x86f68
jmp 0x8c153
jmp 0x8c17d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x518(%rsp)
movl %eax, 0x514(%rsp)
leaq 0x270(%rsp), %rdi
callq 0x86f68
jmp 0x8c178
jmp 0x8c2c3
leaq 0x118(%rsp), %rdi
callq 0x86260
jmp 0x8c18c
jmp 0x8c18e
leaq 0x4e8(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x86330
movb %al, 0x27(%rsp)
jmp 0x8c1a9
movb 0x27(%rsp), %al
testb $0x1, %al
jne 0x8c1b6
jmp 0x8c249
movq 0x110(%rsp), %rcx
movq 0x290(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x298(%rsp), %rdx
addq %rdx, %rcx
movq %rcx, 0x18(%rsp)
andq $0x1, %rax
cmpq $0x0, %rax
je 0x8c224
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rax
movq (%rax), %rax
subq $0x1, %rcx
movq (%rax,%rcx), %rax
movq %rax, 0x8(%rsp)
jmp 0x8c22e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x518(%rsp)
movl %eax, 0x514(%rsp)
leaq 0x118(%rsp), %rdi
callq 0x86b30
jmp 0x8c262
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x18(%rsp), %rdi
movq 0x8(%rsp), %rax
leaq 0x118(%rsp), %rsi
callq *%rax
jmp 0x8c244
jmp 0x8c18e
movb $0x1, 0x2a7(%rsp)
leaq 0x118(%rsp), %rdi
callq 0x86b30
jmp 0x8c260
jmp 0x8c264
jmp 0x8c2c3
jmp 0x8c266
leaq 0x4e8(%rsp), %rdi
callq 0x861e0
jmp 0x8c275
movq 0x110(%rsp), %rax
movq (%rax), %rax
testb $0x1, 0x2(%rax)
je 0x8c297
leaq 0x2a8(%rsp), %rdi
callq 0x86a70
jmp 0x8c295
jmp 0x8c297
movb 0x2a7(%rsp), %al
andb $0x1, %al
movb %al, 0x737(%rsp)
movl $0x1, 0x510(%rsp)
leaq 0x2a8(%rsp), %rdi
callq 0x86ab0
jmp 0x8c2c1
jmp 0x8c2d4
leaq 0x2a8(%rsp), %rdi
callq 0x86ab0
jmp 0x8c2d2
jmp 0x8c2e3
leaq 0x4e8(%rsp), %rdi
callq 0x86150
jmp 0x8c2f4
leaq 0x4e8(%rsp), %rdi
callq 0x86150
jmp 0x8c2f2
jmp 0x8c305
movb 0x737(%rsp), %al
andb $0x1, %al
addq $0x738, %rsp            # imm = 0x738
retq
movq 0x518(%rsp), %rdi
callq 0x86d80
movq %rax, %rdi
callq 0x91290
nopw (%rax,%rax)