// File: /workspace/github_cpp_makefile_star2_O3/bobverity[P]MavericK/writeOut.cpp
// Function: openFileStreams(globals&)
void openFileStreams(globals &globals) {
    
    // Likelihood
    if (globals.outputLikelihood_on) {
        // open file stream
        globals.outputLikelihood_fileStream = safe_ofstream(globals.outputLikelihood_filePath, globals.outputLog_on, globals.outputLog_fileStream);
        // fixed headers
        globals.outputLikelihood_fileStream << "K,mainRep,MCMCsample,loglike_marginal,loglike_joint";
        // alpha if admixture model
        if (globals.admix_on)
            globals.outputLikelihood_fileStream << ",alpha";
        
        globals.outputLikelihood_fileStream << "\n";
        globals.outputLikelihood_fileStream.flush();
    }
    
    // Evidence
    if (globals.outputEvidence_on) {
        // open file stream
        globals.outputEvidence_fileStream = safe_ofstream(globals.outputEvidence_filePath, globals.outputLog_on, globals.outputLog_fileStream);
        // exhaustive
        globals.outputEvidence_fileStream << "K,logEvidence_exhaustive";
        // harmonic
        for (int mainRep=0; mainRep<globals.mainRepeats; mainRep++) {
            globals.outputEvidence_fileStream << ",logEvidence_harmonic_rep" << mainRep+1;
        }
        globals.outputEvidence_fileStream << ",logEvidence_harmonic_grandMean,logEvidence_harmonic_grandSE";
        // structure
        for (int mainRep=0; mainRep<globals.mainRepeats; mainRep++) {
            globals.outputEvidence_fileStream << ",logEvidence_structure_rep" << mainRep+1;
        }
        globals.outputEvidence_fileStream << ",logEvidence_structure_grandMean,logEvidence_structure_grandSE";
        // TI
        globals.outputEvidence_fileStream << ",logEvidence_TI,logEvidence_TI_SE";
        
        globals.outputEvidence_fileStream << "\n";
        globals.outputEvidence_fileStream.flush();
        
    }
    
    // ComparisonStatistics
    if (globals.outputComparisonStatistics_on) {
        // open file stream
        globals.outputComparisonStatistics_fileStream = safe_ofstream(globals.outputComparisonStatistics_filePath, globals.outputLog_on, globals.outputLog_fileStream);
        // fixed headers
        globals.outputComparisonStatistics_fileStream << "K,AIC,BIC,DIC_S,DIC_G";
        
        globals.outputComparisonStatistics_fileStream << "\n";
        globals.outputComparisonStatistics_fileStream.flush();
        
    }
    
    // Evanno
    if (globals.outputEvanno_on) {
        // open file stream
        globals.outputEvanno_fileStream = safe_ofstream(globals.outputEvanno_filePath, globals.outputLog_on, globals.outputLog_fileStream);
        // fixed headers
        globals.outputEvanno_fileStream << "K,delta_K";
        
        globals.outputEvanno_fileStream << "\n";
        globals.outputEvanno_fileStream.flush();
        
    }
    
    // EvidenceDetails
    if (globals.outputEvidenceDetails_on) {
        // open file stream
        globals.outputEvidenceDetails_fileStream = safe_ofstream(globals.outputEvidenceDetails_filePath, globals.outputLog_on, globals.outputLog_fileStream);
        // fixed headers
        globals.outputEvidenceDetails_fileStream << "K";
        // structure mean and variance
        for (int mainRep=0; mainRep<globals.mainRepeats; mainRep++) {
            globals.outputEvidenceDetails_fileStream << ",structure_loglike_mean_rep" << mainRep+1;
        }
        for (int mainRep=0; mainRep<globals.mainRepeats; mainRep++) {
            globals.outputEvidenceDetails_fileStream << ",structure_loglike_var_rep" << mainRep+1;
        }
        // TI mean and standard error
        if (globals.thermodynamic_on) {
            for (int TIrep=0; TIrep<globals.thermodynamicRungs; TIrep++) {
                globals.outputEvidenceDetails_fileStream << ",TIpoint_mean_rung" << TIrep+1;
            }
            for (int TIrep=0; TIrep<globals.thermodynamicRungs; TIrep++) {
                globals.outputEvidenceDetails_fileStream << ",TIpoint_SE_rung" << TIrep+1;
            }
        }
        
        globals.outputEvidenceDetails_fileStream << "\n";
        globals.outputEvidenceDetails_fileStream.flush();
        
    }
    
    // PosteriorGrouping
    if (globals.outputPosteriorGrouping_on) {
        // open file stream
        globals.outputPosteriorGrouping_fileStream = safe_ofstream(globals.outputPosteriorGrouping_filePath, globals.outputLog_on, globals.outputLog_fileStream);
        // fixed headers
        globals.outputPosteriorGrouping_fileStream << "K,mainRep,MCMCsample";
        // non-admixture version
        if (!globals.admix_on) {
            for (int i=0; i<globals.n; i++) {
                globals.outputPosteriorGrouping_fileStream << ",ind" << i+1;
            }
        }
        // admixture version
        if (globals.admix_on) {
            for (int i=0; i<globals.n; i++) {
                for (int l=0; l<globals.loci; l++) {
                    for (int p=0; p<globals.ploidy_vec[i]; p++) {
                        globals.outputPosteriorGrouping_fileStream << ",ind" << i+1 << "_loc" << l+1 << "_copy" << p+1;
                    }
                }
            }
        }
        globals.outputPosteriorGrouping_fileStream << "\n";
        globals.outputPosteriorGrouping_fileStream.flush();
    }
    
    // MaxLike_alleleFreqs
    if (globals.outputMaxLike_alleleFreqs_on) {
        // open file stream
        globals.outputMaxLike_alleleFreqs_fileStream = safe_ofstream(globals.outputMaxLike_alleleFreqs_filePath, globals.outputLog_on, globals.outputLog_fileStream);
        // fixed headers
        globals.outputMaxLike_alleleFreqs_fileStream << "K,deme,locus,allele,frequency";
        
        globals.outputMaxLike_alleleFreqs_fileStream << "\n";
        globals.outputMaxLike_alleleFreqs_fileStream.flush();
    }
    
    // MaxLike_admixFreqs
    if (globals.outputMaxLike_admixFreqs_on) {
        // open file stream
        globals.outputMaxLike_admixFreqs_fileStream = safe_ofstream(globals.outputMaxLike_admixFreqs_filePath, globals.outputLog_on, globals.outputLog_fileStream);
        // fixed headers
        globals.outputMaxLike_admixFreqs_fileStream << "K,ind,deme,admixture_proportion";
        
        globals.outputMaxLike_admixFreqs_fileStream << "\n";
        globals.outputMaxLike_admixFreqs_fileStream.flush();
    }
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x328, %rsp            # imm = 0x328
movq %rdi, %r12
cmpb $0x1, 0x2c3d(%rdi)
movq %rdi, 0x8(%rsp)
jne 0x302c1
movq %r12, %r13
leaq 0x118(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x340(%r13), %rsi
movq 0x348(%r13), %rdx
addq %rsi, %rdx
leaq 0x108(%rsp), %rbx
movq %rbx, %rdi
callq 0xbb9a
movzbl 0x2c3c(%r13), %edx
leaq 0x970(%r13), %rcx
leaq 0x128(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2eff8
leaq 0xb70(%r13), %r14
movq 0xb70(%r13), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
leaq 0x130(%rsp), %rbx
movq -0x8(%rbx), %rax
addq -0x18(%rax), %r15
movq %r15, %rsi
callq 0x35d0
leaq 0xb78(%r13), %rdi
movq %rbx, %rsi
callq 0x3340
movq 0x10d77(%rip), %rax     # 0x40fa0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x220(%rsp), %r15
movq %rcx, -0xf8(%r15)
movq -0x18(%rcx), %rcx
movq %rax, 0x128(%rsp,%rcx)
movq %rbx, %rdi
callq 0x32b0
movq %r15, %rdi
callq 0x30f0
movq 0x108(%rsp), %rdi
cmpq %r12, %rdi
je 0x3026d
callq 0x3310
leaq 0x84c6(%rip), %rsi      # 0x3873a
movl $0x33, %edx
movq %r14, %rdi
callq 0x3390
movq 0x8(%rsp), %r12
cmpb $0x1, 0x2bd0(%r12)
jne 0x302a5
leaq 0x84d6(%rip), %rsi      # 0x3876e
movl $0x6, %edx
movq %r14, %rdi
callq 0x3390
leaq 0x6676(%rip), %rsi      # 0x36922
movl $0x1, %edx
movq %r14, %rdi
callq 0x3390
movq %r14, %rdi
callq 0x31f0
cmpb $0x1, 0x2c45(%r12)
jne 0x3048f
movq %r12, %r13
leaq 0xf8(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x440(%r13), %rsi
movq 0x448(%r13), %rdx
addq %rsi, %rdx
leaq 0xe8(%rsp), %rbx
movq %rbx, %rdi
callq 0xbb9a
movzbl 0x2c3c(%r13), %edx
leaq 0x970(%r13), %rcx
leaq 0x128(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2eff8
leaq 0x1970(%r13), %r14
movq 0x1970(%r13), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
leaq 0x130(%rsp), %rbx
movq -0x8(%rbx), %rax
addq -0x18(%rax), %r15
movq %r15, %rsi
callq 0x35d0
leaq 0x1978(%r13), %rdi
movq %rbx, %rsi
callq 0x3340
movq 0x10c3a(%rip), %rax     # 0x40fa0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x220(%rsp), %r15
movq %rcx, -0xf8(%r15)
movq -0x18(%rcx), %rcx
movq %rax, 0x128(%rsp,%rcx)
movq %rbx, %rdi
callq 0x32b0
movq %r15, %rdi
callq 0x30f0
movq 0xe8(%rsp), %rdi
cmpq %r12, %rdi
je 0x303aa
callq 0x3310
leaq 0x83c4(%rip), %rsi      # 0x38775
movl $0x18, %edx
movq %r14, %rdi
callq 0x3390
movq 0x8(%rsp), %r12
cmpl $0x0, 0x2c0c(%r12)
jle 0x303fd
xorl %ebx, %ebx
leaq 0x83b7(%rip), %r15      # 0x3878e
movl $0x19, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3390
incl %ebx
movq %r14, %rdi
movl %ebx, %esi
callq 0x3550
cmpl 0x2c0c(%r12), %ebx
jl 0x303d7
leaq 0x83a4(%rip), %rsi      # 0x387a8
movl $0x3c, %edx
movq %r14, %rdi
callq 0x3390
cmpl $0x0, 0x2c0c(%r12)
jle 0x3044b
xorl %ebx, %ebx
leaq 0x83c0(%rip), %r15      # 0x387e5
movl $0x1a, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3390
incl %ebx
movq %r14, %rdi
movl %ebx, %esi
callq 0x3550
cmpl 0x2c0c(%r12), %ebx
jl 0x30425
leaq 0x83ae(%rip), %rsi      # 0x38800
movl $0x3e, %edx
movq %r14, %rdi
callq 0x3390
leaq 0x83d9(%rip), %rsi      # 0x3883f
movl $0x21, %edx
movq %r14, %rdi
callq 0x3390
leaq 0x64a8(%rip), %rsi      # 0x36922
movl $0x1, %edx
movq %r14, %rdi
callq 0x3390
movq %r14, %rdi
callq 0x31f0
cmpb $0x1, 0x2c49(%r12)
jne 0x305ad
movq %r12, %r13
leaq 0xd8(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x4c0(%r13), %rsi
movq 0x4c8(%r13), %rdx
addq %rsi, %rdx
leaq 0xc8(%rsp), %rbx
movq %rbx, %rdi
callq 0xbb9a
movzbl 0x2c3c(%r13), %edx
leaq 0x970(%r13), %rcx
leaq 0x128(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2eff8
leaq 0x2170(%r13), %rbx
movq 0x2170(%r13), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
leaq 0x130(%rsp), %r14
movq -0x8(%r14), %rax
addq -0x18(%rax), %r15
movq %r15, %rsi
callq 0x35d0
leaq 0x2178(%r13), %rdi
movq %r14, %rsi
callq 0x3340
movq 0x10a6c(%rip), %rax     # 0x40fa0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x220(%rsp), %r15
movq %rcx, -0xf8(%r15)
movq -0x18(%rcx), %rcx
movq %rax, 0x128(%rsp,%rcx)
movq %r14, %rdi
callq 0x32b0
movq %r15, %rdi
callq 0x30f0
movq 0xc8(%rsp), %rdi
cmpq %r12, %rdi
je 0x30578
callq 0x3310
leaq 0x82e2(%rip), %rsi      # 0x38861
movl $0x15, %edx
movq %rbx, %rdi
callq 0x3390
leaq 0x638f(%rip), %rsi      # 0x36922
movl $0x1, %edx
movq %rbx, %rdi
callq 0x3390
movq %rbx, %rdi
callq 0x31f0
movq 0x8(%rsp), %r12
cmpb $0x1, 0x2c4a(%r12)
jne 0x306cb
movq %r12, %r13
leaq 0xb8(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x4e0(%r13), %rsi
movq 0x4e8(%r13), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %rbx
movq %rbx, %rdi
callq 0xbb9a
movzbl 0x2c3c(%r13), %edx
leaq 0x970(%r13), %rcx
leaq 0x128(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2eff8
leaq 0x2370(%r13), %rbx
movq 0x2370(%r13), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
leaq 0x130(%rsp), %r14
movq -0x8(%r14), %rax
addq -0x18(%rax), %r15
movq %r15, %rsi
callq 0x35d0
leaq 0x2378(%r13), %rdi
movq %r14, %rsi
callq 0x3340
movq 0x1094e(%rip), %rax     # 0x40fa0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x220(%rsp), %r15
movq %rcx, -0xf8(%r15)
movq -0x18(%rcx), %rcx
movq %rax, 0x128(%rsp,%rcx)
movq %r14, %rdi
callq 0x32b0
movq %r15, %rdi
callq 0x30f0
movq 0xa8(%rsp), %rdi
cmpq %r12, %rdi
je 0x30696
callq 0x3310
leaq 0x81da(%rip), %rsi      # 0x38877
movl $0x9, %edx
movq %rbx, %rdi
callq 0x3390
leaq 0x6271(%rip), %rsi      # 0x36922
movl $0x1, %edx
movq %rbx, %rdi
callq 0x3390
movq %rbx, %rdi
callq 0x31f0
movq 0x8(%rsp), %r12
cmpb $0x1, 0x2c47(%r12)
jne 0x308d2
movq %r12, %r13
leaq 0x98(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x480(%r13), %rsi
movq 0x488(%r13), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %rbx
movq %rbx, %rdi
callq 0xbb9a
movzbl 0x2c3c(%r13), %edx
leaq 0x970(%r13), %rcx
leaq 0x128(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2eff8
leaq 0x1d70(%r13), %r14
movq 0x1d70(%r13), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
leaq 0x130(%rsp), %rbx
movq -0x8(%rbx), %rax
addq -0x18(%rax), %r15
movq %r15, %rsi
callq 0x35d0
leaq 0x1d78(%r13), %rdi
movq %rbx, %rsi
callq 0x3340
movq 0x10830(%rip), %rax     # 0x40fa0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x220(%rsp), %r15
movq %rcx, -0xf8(%r15)
movq -0x18(%rcx), %rcx
movq %rax, 0x128(%rsp,%rcx)
movq %rbx, %rdi
callq 0x32b0
movq %r15, %rdi
callq 0x30f0
movq 0x88(%rsp), %rdi
cmpq %r12, %rdi
je 0x307b4
callq 0x3310
leaq 0x80c4(%rip), %rsi      # 0x3887f
movl $0x1, %edx
movq %r14, %rdi
callq 0x3390
movq 0x8(%rsp), %r12
cmpl $0x0, 0x2c0c(%r12)
jle 0x3083c
xorl %ebx, %ebx
leaq 0x80a0(%rip), %r15      # 0x38881
movl $0x1b, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3390
incl %ebx
movq %r14, %rdi
movl %ebx, %esi
callq 0x3550
movl 0x2c0c(%r12), %eax
cmpl %eax, %ebx
jl 0x307e1
testl %eax, %eax
jle 0x3083c
xorl %ebx, %ebx
leaq 0x8087(%rip), %r15      # 0x3889d
movl $0x1a, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3390
incl %ebx
movq %r14, %rdi
movl %ebx, %esi
callq 0x3550
cmpl 0x2c0c(%r12), %ebx
jl 0x30816
cmpb $0x1, 0x2c1c(%r12)
jne 0x308b6
cmpl $0x0, 0x2c20(%r12)
jle 0x308b6
xorl %ebx, %ebx
leaq 0x805d(%rip), %r15      # 0x388b8
movl $0x12, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3390
incl %ebx
movq %r14, %rdi
movl %ebx, %esi
callq 0x3550
movl 0x2c20(%r12), %eax
cmpl %eax, %ebx
jl 0x3085b
testl %eax, %eax
jle 0x308b6
xorl %ebx, %ebx
leaq 0x803b(%rip), %r15      # 0x388cb
movl $0x10, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3390
incl %ebx
movq %r14, %rdi
movl %ebx, %esi
callq 0x3550
cmpl 0x2c20(%r12), %ebx
jl 0x30890
leaq 0x6065(%rip), %rsi      # 0x36922
movl $0x1, %edx
movq %r14, %rdi
callq 0x3390
movq %r14, %rdi
callq 0x31f0
cmpb $0x1, 0x2c48(%r12)
jne 0x30b46
movq %r12, %r13
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x4a0(%r13), %rsi
movq 0x4a8(%r13), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rbx
movq %rbx, %rdi
callq 0xbb9a
movzbl 0x2c3c(%r13), %edx
leaq 0x970(%r13), %rcx
leaq 0x128(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2eff8
leaq 0x1f70(%r13), %r14
movq 0x1f70(%r13), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
leaq 0x130(%rsp), %rbx
movq -0x8(%rbx), %rax
addq -0x18(%rax), %r15
movq %r15, %rsi
callq 0x35d0
leaq 0x1f78(%r13), %rdi
movq %rbx, %rsi
callq 0x3340
movq 0x1062f(%rip), %rax     # 0x40fa0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x220(%rsp), %r15
movq %rcx, -0xf8(%r15)
movq -0x18(%rcx), %rcx
movq %rax, 0x128(%rsp,%rcx)
movq %rbx, %rdi
callq 0x32b0
movq %r15, %rdi
callq 0x30f0
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x309b2
callq 0x3310
leaq 0x7f23(%rip), %rsi      # 0x388dc
movl $0x14, %edx
movq %r14, %rdi
callq 0x3390
movq 0x8(%rsp), %r12
movb 0x2bd0(%r12), %al
testb %al, %al
jne 0x30a19
cmpl $0x0, 0x2d18(%r12)
jle 0x30a19
xorl %ebx, %ebx
leaq 0x7f06(%rip), %r15      # 0x388f1
movl $0x4, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3390
incl %ebx
movq %r14, %rdi
movl %ebx, %esi
callq 0x3550
cmpl 0x2d18(%r12), %ebx
jl 0x309eb
movb 0x2bd0(%r12), %al
movq %r14, 0x18(%rsp)
testb $0x1, %al
je 0x30b25
movl 0x2d18(%r12), %ecx
testl %ecx, %ecx
jle 0x30b25
movl 0x2d1c(%r12), %eax
xorl %ebp, %ebp
leaq 0x7eaa(%rip), %r14      # 0x388f1
movq 0x18(%rsp), %r13
leaq 0x1(%rbp), %rsi
testl %eax, %eax
jle 0x30b16
movq 0x2cd0(%r12), %rcx
xorl %edx, %edx
movq %rsi, 0x20(%rsp)
incl %edx
cmpl $0x0, (%rcx,%rbp,4)
jle 0x30b06
xorl %r15d, %r15d
leaq 0x7fe2(%rip), %rbx      # 0x38a5f
movl %edx, 0x14(%rsp)
movl $0x4, %edx
movq %r13, %rdi
movq %r14, %rsi
callq 0x3390
movq %r13, %rdi
movq 0x20(%rsp), %rsi
callq 0x3550
movq %rax, %r12
movl $0x4, %edx
movq %rax, %rdi
leaq 0x7e46(%rip), %rsi      # 0x388f6
callq 0x3390
movq %r12, %rdi
movl 0x14(%rsp), %esi
callq 0x3550
movq %rax, %r12
movl $0x5, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3390
incl %r15d
movq %r12, %rdi
movq 0x8(%rsp), %r12
movl %r15d, %esi
callq 0x3550
movq 0x2cd0(%r12), %rcx
cmpl (%rcx,%rbp,4), %r15d
jl 0x30a81
movl 0x2d1c(%r12), %eax
movq 0x20(%rsp), %rsi
movl 0x14(%rsp), %edx
cmpl %eax, %edx
jl 0x30a67
movl 0x2d18(%r12), %ecx
movslq %ecx, %rdx
movq %rsi, %rbp
cmpq %rdx, %rsi
jl 0x30a4c
leaq 0x5df6(%rip), %rsi      # 0x36922
movl $0x1, %edx
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x3390
movq %rbx, %rdi
callq 0x31f0
cmpb $0x1, 0x2c4b(%r12)
jne 0x30c5b
movq %r12, %r13
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x500(%r13), %rsi
movq 0x508(%r13), %rdx
addq %rsi, %rdx
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0xbb9a
movzbl 0x2c3c(%r13), %edx
leaq 0x970(%r13), %rcx
leaq 0x128(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2eff8
leaq 0x2570(%r13), %rbx
movq 0x2570(%r13), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
leaq 0x130(%rsp), %r14
movq -0x8(%r14), %rax
addq -0x18(%rax), %r15
movq %r15, %rsi
callq 0x35d0
leaq 0x2578(%r13), %rdi
movq %r14, %rsi
callq 0x3340
movq 0x103bb(%rip), %rax     # 0x40fa0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x220(%rsp), %r15
movq %rcx, -0xf8(%r15)
movq -0x18(%rcx), %rcx
movq %rax, 0x128(%rsp,%rcx)
movq %r14, %rdi
callq 0x32b0
movq %r15, %rdi
callq 0x30f0
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x30c26
callq 0x3310
leaq 0x7cce(%rip), %rsi      # 0x388fb
movl $0x1d, %edx
movq %rbx, %rdi
callq 0x3390
leaq 0x5ce1(%rip), %rsi      # 0x36922
movl $0x1, %edx
movq %rbx, %rdi
callq 0x3390
movq %rbx, %rdi
callq 0x31f0
movq 0x8(%rsp), %r12
cmpb $0x1, 0x2c4c(%r12)
jne 0x30d6e
movq %r12, %r13
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x520(%r13), %rsi
movq 0x528(%r13), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0xbb9a
movzbl 0x2c3c(%r13), %edx
leaq 0x970(%r13), %rcx
leaq 0x128(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2eff8
leaq 0x2770(%r13), %rbx
movq 0x2770(%r13), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
leaq 0x130(%rsp), %r14
movq -0x8(%r14), %rax
addq -0x18(%rax), %r15
movq %r15, %rsi
callq 0x35d0
addq $0x2778, %r13           # imm = 0x2778
movq %r13, %rdi
movq %r14, %rsi
callq 0x3340
movq 0x102a3(%rip), %rax     # 0x40fa0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x220(%rsp), %r15
movq %rcx, -0xf8(%r15)
movq -0x18(%rcx), %rcx
movq %rax, 0x128(%rsp,%rcx)
movq %r14, %rdi
callq 0x32b0
movq %r15, %rdi
callq 0x30f0
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x30d3e
callq 0x3310
leaq 0x7bd4(%rip), %rsi      # 0x38919
movl $0x1f, %edx
movq %rbx, %rdi
callq 0x3390
leaq 0x5bc9(%rip), %rsi      # 0x36922
movl $0x1, %edx
movq %rbx, %rdi
callq 0x3390
movq %rbx, %rdi
callq 0x31f0
addq $0x328, %rsp            # imm = 0x328
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x3440
jmp 0x30d95
movq %rax, %rbx
movq 0x28(%rsp), %rdi
jmp 0x30e76
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x3440
jmp 0x30db4
movq %rax, %rbx
movq 0x48(%rsp), %rdi
jmp 0x30e76
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x3440
jmp 0x30dd3
movq %rax, %rbx
movq 0x68(%rsp), %rdi
jmp 0x30e76
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x3440
jmp 0x30df2
movq %rax, %rbx
movq 0x88(%rsp), %rdi
jmp 0x30e76
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x3440
jmp 0x30e11
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
jmp 0x30e76
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x3440
jmp 0x30e30
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
jmp 0x30e76
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x3440
jmp 0x30e4f
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
jmp 0x30e76
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x3440
jmp 0x30e6e
movq %rax, %rbx
movq 0x108(%rsp), %rdi
cmpq %r12, %rdi
je 0x30e80
callq 0x3310
movq %rbx, %rdi
callq 0x3580