// File: 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:
subq $0x1188, %rsp           # imm = 0x1188
movq %rdi, 0x1180(%rsp)
movq 0x1180(%rsp), %rax
testb $0x1, 0x2c3d(%rax)
je 0x5512e
movq 0x1180(%rsp), %rsi
addq $0x340, %rsi            # imm = 0x340
leaq 0xf60(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x4180
movq 0x40(%rsp), %rsi
movq 0x1180(%rsp), %rax
movq %rax, %rcx
addq $0x970, %rcx            # imm = 0x970
movzbl 0x2c3c(%rax), %edx
andl $0x1, %edx
leaq 0xf80(%rsp), %rdi
callq 0x52e90
jmp 0x55035
movq 0x1180(%rsp), %rdi
addq $0xb70, %rdi            # imm = 0xB70
leaq 0xf80(%rsp), %rsi
callq 0x44e0
jmp 0x55053
leaq 0xf80(%rsp), %rdi
callq 0x45d0
leaq 0xf60(%rsp), %rdi
callq 0x4270
movq 0x1180(%rsp), %rdi
addq $0xb70, %rdi            # imm = 0xB70
leaq 0x962f(%rip), %rsi      # 0x5e6b2
callq 0x4430
movq 0x1180(%rsp), %rax
testb $0x1, 0x2bd0(%rax)
je 0x550ff
movq 0x1180(%rsp), %rdi
addq $0xb70, %rdi            # imm = 0xB70
leaq 0x9637(%rip), %rsi      # 0x5e6e6
callq 0x4430
jmp 0x550ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf58(%rsp)
movl %eax, 0xf54(%rsp)
jmp 0x550ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf58(%rsp)
movl %eax, 0xf54(%rsp)
leaq 0xf80(%rsp), %rdi
callq 0x45d0
leaq 0xf60(%rsp), %rdi
callq 0x4270
jmp 0x55e0d
movq 0x1180(%rsp), %rdi
addq $0xb70, %rdi            # imm = 0xB70
leaq 0x777d(%rip), %rsi      # 0x5c892
callq 0x4430
movq 0x1180(%rsp), %rdi
addq $0xb70, %rdi            # imm = 0xB70
callq 0x42b0
movq 0x1180(%rsp), %rax
testb $0x1, 0x2c45(%rax)
je 0x55378
movq 0x1180(%rsp), %rsi
addq $0x440, %rsi            # imm = 0x440
leaq 0xd30(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x4180
movq 0x38(%rsp), %rsi
movq 0x1180(%rsp), %rax
movq %rax, %rcx
addq $0x970, %rcx            # imm = 0x970
movzbl 0x2c3c(%rax), %edx
andl $0x1, %edx
leaq 0xd50(%rsp), %rdi
callq 0x52e90
jmp 0x55194
movq 0x1180(%rsp), %rdi
addq $0x1970, %rdi           # imm = 0x1970
leaq 0xd50(%rsp), %rsi
callq 0x44e0
jmp 0x551b2
leaq 0xd50(%rsp), %rdi
callq 0x45d0
leaq 0xd30(%rsp), %rdi
callq 0x4270
movq 0x1180(%rsp), %rdi
addq $0x1970, %rdi           # imm = 0x1970
leaq 0x950b(%rip), %rsi      # 0x5e6ed
callq 0x4430
movl $0x0, 0xd2c(%rsp)
movl 0xd2c(%rsp), %eax
movq 0x1180(%rsp), %rcx
cmpl 0x2c0c(%rcx), %eax
jge 0x55296
movq 0x1180(%rsp), %rdi
addq $0x1970, %rdi           # imm = 0x1970
leaq 0x94e3(%rip), %rsi      # 0x5e706
callq 0x4430
movq %rax, %rdi
movl 0xd2c(%rsp), %esi
addl $0x1, %esi
callq 0x4700
movl 0xd2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd2c(%rsp)
jmp 0x551f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf58(%rsp)
movl %eax, 0xf54(%rsp)
jmp 0x55284
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf58(%rsp)
movl %eax, 0xf54(%rsp)
leaq 0xd50(%rsp), %rdi
callq 0x45d0
leaq 0xd30(%rsp), %rdi
callq 0x4270
jmp 0x55e0d
movq 0x1180(%rsp), %rdi
addq $0x1970, %rdi           # imm = 0x1970
leaq 0x9474(%rip), %rsi      # 0x5e720
callq 0x4430
movl $0x0, 0xd28(%rsp)
movl 0xd28(%rsp), %eax
movq 0x1180(%rsp), %rcx
cmpl 0x2c0c(%rcx), %eax
jge 0x55313
movq 0x1180(%rsp), %rdi
addq $0x1970, %rdi           # imm = 0x1970
leaq 0x9474(%rip), %rsi      # 0x5e75d
callq 0x4430
movq %rax, %rdi
movl 0xd28(%rsp), %esi
addl $0x1, %esi
callq 0x4700
movl 0xd28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xd28(%rsp)
jmp 0x552bc
movq 0x1180(%rsp), %rdi
addq $0x1970, %rdi           # imm = 0x1970
leaq 0x944f(%rip), %rsi      # 0x5e778
callq 0x4430
movq 0x1180(%rsp), %rdi
addq $0x1970, %rdi           # imm = 0x1970
leaq 0x9473(%rip), %rsi      # 0x5e7b7
callq 0x4430
movq 0x1180(%rsp), %rdi
addq $0x1970, %rdi           # imm = 0x1970
leaq 0x7533(%rip), %rsi      # 0x5c892
callq 0x4430
movq 0x1180(%rsp), %rdi
addq $0x1970, %rdi           # imm = 0x1970
callq 0x42b0
movq 0x1180(%rsp), %rax
testb $0x1, 0x2c49(%rax)
je 0x554ab
movq 0x1180(%rsp), %rsi
addq $0x4c0, %rsi            # imm = 0x4C0
leaq 0xb08(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x4180
movq 0x30(%rsp), %rsi
movq 0x1180(%rsp), %rax
movq %rax, %rcx
addq $0x970, %rcx            # imm = 0x970
movzbl 0x2c3c(%rax), %edx
andl $0x1, %edx
leaq 0xb28(%rsp), %rdi
callq 0x52e90
jmp 0x553de
movq 0x1180(%rsp), %rdi
addq $0x2170, %rdi           # imm = 0x2170
leaq 0xb28(%rsp), %rsi
callq 0x44e0
jmp 0x553fc
leaq 0xb28(%rsp), %rdi
callq 0x45d0
leaq 0xb08(%rsp), %rdi
callq 0x4270
movq 0x1180(%rsp), %rdi
addq $0x2170, %rdi           # imm = 0x2170
leaq 0x93ad(%rip), %rsi      # 0x5e7d9
callq 0x4430
movq 0x1180(%rsp), %rdi
addq $0x2170, %rdi           # imm = 0x2170
leaq 0x744b(%rip), %rsi      # 0x5c892
callq 0x4430
movq 0x1180(%rsp), %rdi
addq $0x2170, %rdi           # imm = 0x2170
callq 0x42b0
jmp 0x554ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf58(%rsp)
movl %eax, 0xf54(%rsp)
jmp 0x55499
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf58(%rsp)
movl %eax, 0xf54(%rsp)
leaq 0xb28(%rsp), %rdi
callq 0x45d0
leaq 0xb08(%rsp), %rdi
callq 0x4270
jmp 0x55e0d
movq 0x1180(%rsp), %rax
testb $0x1, 0x2c4a(%rax)
je 0x555de
movq 0x1180(%rsp), %rsi
addq $0x4e0, %rsi            # imm = 0x4E0
leaq 0x8e8(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x4180
movq 0x28(%rsp), %rsi
movq 0x1180(%rsp), %rax
movq %rax, %rcx
addq $0x970, %rcx            # imm = 0x970
movzbl 0x2c3c(%rax), %edx
andl $0x1, %edx
leaq 0x908(%rsp), %rdi
callq 0x52e90
jmp 0x55511
movq 0x1180(%rsp), %rdi
addq $0x2370, %rdi           # imm = 0x2370
leaq 0x908(%rsp), %rsi
callq 0x44e0
jmp 0x5552f
leaq 0x908(%rsp), %rdi
callq 0x45d0
leaq 0x8e8(%rsp), %rdi
callq 0x4270
movq 0x1180(%rsp), %rdi
addq $0x2370, %rdi           # imm = 0x2370
leaq 0x9290(%rip), %rsi      # 0x5e7ef
callq 0x4430
movq 0x1180(%rsp), %rdi
addq $0x2370, %rdi           # imm = 0x2370
leaq 0x7318(%rip), %rsi      # 0x5c892
callq 0x4430
movq 0x1180(%rsp), %rdi
addq $0x2370, %rdi           # imm = 0x2370
callq 0x42b0
jmp 0x555de
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf58(%rsp)
movl %eax, 0xf54(%rsp)
jmp 0x555cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf58(%rsp)
movl %eax, 0xf54(%rsp)
leaq 0x908(%rsp), %rdi
callq 0x45d0
leaq 0x8e8(%rsp), %rdi
callq 0x4270
jmp 0x55e0d
movq 0x1180(%rsp), %rax
testb $0x1, 0x2c47(%rax)
je 0x558b2
movq 0x1180(%rsp), %rsi
addq $0x480, %rsi            # imm = 0x480
leaq 0x6c8(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x4180
movq 0x20(%rsp), %rsi
movq 0x1180(%rsp), %rax
movq %rax, %rcx
addq $0x970, %rcx            # imm = 0x970
movzbl 0x2c3c(%rax), %edx
andl $0x1, %edx
leaq 0x6e8(%rsp), %rdi
callq 0x52e90
jmp 0x55644
movq 0x1180(%rsp), %rdi
addq $0x1d70, %rdi           # imm = 0x1D70
leaq 0x6e8(%rsp), %rsi
callq 0x44e0
jmp 0x55662
leaq 0x6e8(%rsp), %rdi
callq 0x45d0
leaq 0x6c8(%rsp), %rdi
callq 0x4270
movq 0x1180(%rsp), %rdi
addq $0x1d70, %rdi           # imm = 0x1D70
leaq 0x9165(%rip), %rsi      # 0x5e7f7
callq 0x4430
movl $0x0, 0x6c4(%rsp)
movl 0x6c4(%rsp), %eax
movq 0x1180(%rsp), %rcx
cmpl 0x2c0c(%rcx), %eax
jge 0x55746
movq 0x1180(%rsp), %rdi
addq $0x1d70, %rdi           # imm = 0x1D70
leaq 0x9126(%rip), %rsi      # 0x5e7f9
callq 0x4430
movq %rax, %rdi
movl 0x6c4(%rsp), %esi
addl $0x1, %esi
callq 0x4700
movl 0x6c4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6c4(%rsp)
jmp 0x556a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf58(%rsp)
movl %eax, 0xf54(%rsp)
jmp 0x55734
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf58(%rsp)
movl %eax, 0xf54(%rsp)
leaq 0x6e8(%rsp), %rdi
callq 0x45d0
leaq 0x6c8(%rsp), %rdi
callq 0x4270
jmp 0x55e0d
movl $0x0, 0x6c0(%rsp)
movl 0x6c0(%rsp), %eax
movq 0x1180(%rsp), %rcx
cmpl 0x2c0c(%rcx), %eax
jge 0x557a8
movq 0x1180(%rsp), %rdi
addq $0x1d70, %rdi           # imm = 0x1D70
leaq 0x9097(%rip), %rsi      # 0x5e815
callq 0x4430
movq %rax, %rdi
movl 0x6c0(%rsp), %esi
addl $0x1, %esi
callq 0x4700
movl 0x6c0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6c0(%rsp)
jmp 0x55751
movq 0x1180(%rsp), %rax
testb $0x1, 0x2c1c(%rax)
je 0x55883
movl $0x0, 0x6bc(%rsp)
movl 0x6bc(%rsp), %eax
movq 0x1180(%rsp), %rcx
cmpl 0x2c20(%rcx), %eax
jge 0x5581f
movq 0x1180(%rsp), %rdi
addq $0x1d70, %rdi           # imm = 0x1D70
leaq 0x903b(%rip), %rsi      # 0x5e830
callq 0x4430
movq %rax, %rdi
movl 0x6bc(%rsp), %esi
addl $0x1, %esi
callq 0x4700
movl 0x6bc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6bc(%rsp)
jmp 0x557c8
movl $0x0, 0x6b8(%rsp)
movl 0x6b8(%rsp), %eax
movq 0x1180(%rsp), %rcx
cmpl 0x2c20(%rcx), %eax
jge 0x55881
movq 0x1180(%rsp), %rdi
addq $0x1d70, %rdi           # imm = 0x1D70
leaq 0x8fec(%rip), %rsi      # 0x5e843
callq 0x4430
movq %rax, %rdi
movl 0x6b8(%rsp), %esi
addl $0x1, %esi
callq 0x4700
movl 0x6b8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6b8(%rsp)
jmp 0x5582a
jmp 0x55883
movq 0x1180(%rsp), %rdi
addq $0x1d70, %rdi           # imm = 0x1D70
leaq 0x6ff9(%rip), %rsi      # 0x5c892
callq 0x4430
movq 0x1180(%rsp), %rdi
addq $0x1d70, %rdi           # imm = 0x1D70
callq 0x42b0
movq 0x1180(%rsp), %rax
testb $0x1, 0x2c48(%rax)
je 0x55bb9
movq 0x1180(%rsp), %rsi
addq $0x4a0, %rsi            # imm = 0x4A0
leaq 0x498(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x4180
movq 0x18(%rsp), %rsi
movq 0x1180(%rsp), %rax
movq %rax, %rcx
addq $0x970, %rcx            # imm = 0x970
movzbl 0x2c3c(%rax), %edx
andl $0x1, %edx
leaq 0x4b8(%rsp), %rdi
callq 0x52e90
jmp 0x55918
movq 0x1180(%rsp), %rdi
addq $0x1f70, %rdi           # imm = 0x1F70
leaq 0x4b8(%rsp), %rsi
callq 0x44e0
jmp 0x55936
leaq 0x4b8(%rsp), %rdi
callq 0x45d0
leaq 0x498(%rsp), %rdi
callq 0x4270
movq 0x1180(%rsp), %rdi
addq $0x1f70, %rdi           # imm = 0x1F70
leaq 0x8eee(%rip), %rsi      # 0x5e854
callq 0x4430
movq 0x1180(%rsp), %rax
testb $0x1, 0x2bd0(%rax)
jne 0x55a31
movl $0x0, 0x494(%rsp)
movl 0x494(%rsp), %eax
movq 0x1180(%rsp), %rcx
cmpl 0x2d18(%rcx), %eax
jge 0x55a2f
movq 0x1180(%rsp), %rdi
addq $0x1f70, %rdi           # imm = 0x1F70
leaq 0x8ead(%rip), %rsi      # 0x5e869
callq 0x4430
movq %rax, %rdi
movl 0x494(%rsp), %esi
addl $0x1, %esi
callq 0x4700
movl 0x494(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x494(%rsp)
jmp 0x5598b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf58(%rsp)
movl %eax, 0xf54(%rsp)
jmp 0x55a1d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf58(%rsp)
movl %eax, 0xf54(%rsp)
leaq 0x4b8(%rsp), %rdi
callq 0x45d0
leaq 0x498(%rsp), %rdi
callq 0x4270
jmp 0x55e0d
jmp 0x55a31
movq 0x1180(%rsp), %rax
testb $0x1, 0x2bd0(%rax)
je 0x55b8a
movl $0x0, 0x490(%rsp)
movl 0x490(%rsp), %eax
movq 0x1180(%rsp), %rcx
cmpl 0x2d18(%rcx), %eax
jge 0x55b88
movl $0x0, 0x48c(%rsp)
movl 0x48c(%rsp), %eax
movq 0x1180(%rsp), %rcx
cmpl 0x2d1c(%rcx), %eax
jge 0x55b70
movl $0x0, 0x488(%rsp)
movl 0x488(%rsp), %eax
movl %eax, 0x14(%rsp)
movq 0x1180(%rsp), %rdi
addq $0x2cd0, %rdi           # imm = 0x2CD0
movslq 0x490(%rsp), %rsi
callq 0x8ba0
movq %rax, %rcx
movl 0x14(%rsp), %eax
cmpl (%rcx), %eax
jge 0x55b58
movq 0x1180(%rsp), %rdi
addq $0x1f70, %rdi           # imm = 0x1F70
leaq 0x8d80(%rip), %rsi      # 0x5e869
callq 0x4430
movq %rax, %rdi
movl 0x490(%rsp), %esi
addl $0x1, %esi
callq 0x4700
movq %rax, %rdi
leaq 0x8d64(%rip), %rsi      # 0x5e86e
callq 0x4430
movq %rax, %rdi
movl 0x48c(%rsp), %esi
addl $0x1, %esi
callq 0x4700
movq %rax, %rdi
leaq 0x8eac(%rip), %rsi      # 0x5e9d7
callq 0x4430
movq %rax, %rdi
movl 0x488(%rsp), %esi
addl $0x1, %esi
callq 0x4700
movl 0x488(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x488(%rsp)
jmp 0x55a9d
jmp 0x55b5a
movl 0x48c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x48c(%rsp)
jmp 0x55a77
jmp 0x55b72
movl 0x490(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x490(%rsp)
jmp 0x55a51
jmp 0x55b8a
movq 0x1180(%rsp), %rdi
addq $0x1f70, %rdi           # imm = 0x1F70
leaq 0x6cf2(%rip), %rsi      # 0x5c892
callq 0x4430
movq 0x1180(%rsp), %rdi
addq $0x1f70, %rdi           # imm = 0x1F70
callq 0x42b0
movq 0x1180(%rsp), %rax
testb $0x1, 0x2c4b(%rax)
je 0x55cec
movq 0x1180(%rsp), %rsi
addq $0x500, %rsi            # imm = 0x500
leaq 0x268(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x4180
movq 0x8(%rsp), %rsi
movq 0x1180(%rsp), %rax
movq %rax, %rcx
addq $0x970, %rcx            # imm = 0x970
movzbl 0x2c3c(%rax), %edx
andl $0x1, %edx
leaq 0x288(%rsp), %rdi
callq 0x52e90
jmp 0x55c1f
movq 0x1180(%rsp), %rdi
addq $0x2570, %rdi           # imm = 0x2570
leaq 0x288(%rsp), %rsi
callq 0x44e0
jmp 0x55c3d
leaq 0x288(%rsp), %rdi
callq 0x45d0
leaq 0x268(%rsp), %rdi
callq 0x4270
movq 0x1180(%rsp), %rdi
addq $0x2570, %rdi           # imm = 0x2570
leaq 0x8c06(%rip), %rsi      # 0x5e873
callq 0x4430
movq 0x1180(%rsp), %rdi
addq $0x2570, %rdi           # imm = 0x2570
leaq 0x6c0a(%rip), %rsi      # 0x5c892
callq 0x4430
movq 0x1180(%rsp), %rdi
addq $0x2570, %rdi           # imm = 0x2570
callq 0x42b0
jmp 0x55cec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf58(%rsp)
movl %eax, 0xf54(%rsp)
jmp 0x55cda
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf58(%rsp)
movl %eax, 0xf54(%rsp)
leaq 0x288(%rsp), %rdi
callq 0x45d0
leaq 0x268(%rsp), %rdi
callq 0x4270
jmp 0x55e0d
movq 0x1180(%rsp), %rax
testb $0x1, 0x2c4c(%rax)
je 0x55e05
movq 0x1180(%rsp), %rsi
addq $0x520, %rsi            # imm = 0x520
leaq 0x48(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x4180
movq (%rsp), %rsi
movq 0x1180(%rsp), %rax
movq %rax, %rcx
addq $0x970, %rcx            # imm = 0x970
movzbl 0x2c3c(%rax), %edx
andl $0x1, %edx
leaq 0x68(%rsp), %rdi
callq 0x52e90
jmp 0x55d4a
movq 0x1180(%rsp), %rdi
addq $0x2770, %rdi           # imm = 0x2770
leaq 0x68(%rsp), %rsi
callq 0x44e0
jmp 0x55d65
leaq 0x68(%rsp), %rdi
callq 0x45d0
leaq 0x48(%rsp), %rdi
callq 0x4270
movq 0x1180(%rsp), %rdi
addq $0x2770, %rdi           # imm = 0x2770
leaq 0x8b02(%rip), %rsi      # 0x5e891
callq 0x4430
movq 0x1180(%rsp), %rdi
addq $0x2770, %rdi           # imm = 0x2770
leaq 0x6ae8(%rip), %rsi      # 0x5c892
callq 0x4430
movq 0x1180(%rsp), %rdi
addq $0x2770, %rdi           # imm = 0x2770
callq 0x42b0
jmp 0x55e05
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf58(%rsp)
movl %eax, 0xf54(%rsp)
jmp 0x55df9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf58(%rsp)
movl %eax, 0xf54(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x45d0
leaq 0x48(%rsp), %rdi
callq 0x4270
jmp 0x55e0d
addq $0x1188, %rsp           # imm = 0x1188
retq
movq 0xf58(%rsp), %rdi
callq 0x4730
nopw (%rax,%rax)