// File: bobverity[P]MavericK/writeOut.cpp
// Function: printQmatrix_pop(globals&, int)
void printQmatrix_pop(globals &globals, int Kindex) {
    int K = globals.Kmin+Kindex;
    
    if (globals.outputQmatrix_structureFormat_on) {
        
        // open outputQmatrix_pop filestream for this K
        string s = globals.outputQmatrix_pop_filePath;
        s.erase(end(s)-4,end(s));
        s = s + "_K" + to_string((long long)K) + ".txt";
        globals.outputQmatrix_pop_fileStream = safe_ofstream(s,globals.outputLog_on, globals.outputLog_fileStream);
        
        // write headers
        /*
        globals.outputQmatrix_pop_fileStream << "Given    Inferred Clusters       Number of\n";
        globals.outputQmatrix_pop_fileStream << " Pop       1";
        for (int k=1; k<K; k++) {
            if ((k+1)<10)
                globals.outputQmatrix_pop_fileStream << " ";
            globals.outputQmatrix_pop_fileStream << "     " << k+1;
        }
        globals.outputQmatrix_pop_fileStream << "      Individuals\n\n";
        */
        
        // write results
        for (int i=0; i<int(globals.uniquePops.size()); i++) {
            
            // given pop
            if (globals.uniquePops[i].length()<3)
                globals.outputQmatrix_pop_fileStream << " ";
            if (globals.uniquePops[i].length()<2)
                globals.outputQmatrix_pop_fileStream << " ";
            globals.outputQmatrix_pop_fileStream << globals.uniquePops[i] << ":     ";
            
            // probabilities
            for (int k=0; k<K; k++) {
                char * buffer = new char[256];
                sprintf(buffer, "%.3f", my_round(globals.Qmatrix_pop[Kindex][i][k]*1000)/1000.0);
                string s = buffer;
                delete [] buffer;
                globals.outputQmatrix_pop_fileStream << s << " ";
            }
            
            // number of individuals in each population
            globals.outputQmatrix_pop_fileStream << "     ";
            if (globals.uniquePop_counts[i]<100)
                globals.outputQmatrix_pop_fileStream << " ";
            if (globals.uniquePop_counts[i]<10)
                globals.outputQmatrix_pop_fileStream << " ";
            globals.outputQmatrix_pop_fileStream << globals.uniquePop_counts[i];
            
            globals.outputQmatrix_pop_fileStream << "\n";
        }
        
    } // end of if outputQmatrix_structureFormat_on=true
        
    // open outputQmatrix_pop filestream for this K
    string s = globals.outputQmatrix_pop_filePath;
    s.erase(end(s)-4,end(s));
    s = s + "_K" + to_string((long long)K) + ".csv";
    globals.outputQmatrix_pop_fileStream = safe_ofstream(s,globals.outputLog_on, globals.outputLog_fileStream);
    
    // write headers
    globals.outputQmatrix_pop_fileStream << "given_population,members";
    for (int k=0; k<K; k++)
        globals.outputQmatrix_pop_fileStream << ",deme" << k+1;
    globals.outputQmatrix_pop_fileStream << "\n";
    
    // write results
    for (int i=0; i<int(globals.uniquePops.size()); i++) {
        
        // given population and number of individuals
        globals.outputQmatrix_pop_fileStream << globals.uniquePops[i] << "," << globals.uniquePop_counts[i];
        
        // probabilities
        for (int k=0; k<K; k++) {
            char * buffer = new char[256];
            sprintf(buffer, "%.3f", my_round(globals.Qmatrix_pop[Kindex][i][k]*1000)/1000.0);
            string s = buffer;
            delete [] buffer;
            globals.outputQmatrix_pop_fileStream << "," << s;
        }
        
        globals.outputQmatrix_pop_fileStream << "\n";
        
    }
    
    globals.outputQmatrix_pop_fileStream.flush();
}

// Assembly:
subq $0x798, %rsp            # imm = 0x798
movq %rdi, 0x790(%rsp)
movl %esi, 0x78c(%rsp)
movq 0x790(%rsp), %rax
movl 0x2bc8(%rax), %eax
addl 0x78c(%rsp), %eax
movl %eax, 0x788(%rsp)
movq 0x790(%rsp), %rax
testb $0x1, 0x2c4d(%rax)
je 0x5af1e
movq 0x790(%rsp), %rsi
addq $0x380, %rsi            # imm = 0x380
leaq 0x768(%rsp), %rdi
movq %rdi, 0x110(%rsp)
callq 0x4180
movq 0x110(%rsp), %rdi
callq 0x5bc90
movq %rax, 0x118(%rsp)
jmp 0x5a7f2
movq 0x118(%rsp), %rax
movq %rax, 0x750(%rsp)
leaq 0x750(%rsp), %rdi
movl $0x4, %esi
callq 0x5bcc0
movq %rax, 0x758(%rsp)
leaq 0x760(%rsp), %rdi
leaq 0x758(%rsp), %rsi
callq 0x5bd00
leaq 0x768(%rsp), %rdi
callq 0x5bc90
movq %rax, 0x108(%rsp)
jmp 0x5a848
movq 0x108(%rsp), %rax
movq %rax, 0x730(%rsp)
leaq 0x738(%rsp), %rdi
leaq 0x730(%rsp), %rsi
callq 0x5bd00
movq 0x760(%rsp), %rsi
movq 0x738(%rsp), %rdx
leaq 0x768(%rsp), %rdi
callq 0x40d0
movq %rax, 0x100(%rsp)
jmp 0x5a894
movq 0x100(%rsp), %rax
movq %rax, 0x728(%rsp)
leaq 0x3f4b(%rip), %rdx      # 0x5e7f6
leaq 0x6c8(%rsp), %rdi
leaq 0x768(%rsp), %rsi
callq 0x2af00
jmp 0x5a8c2
movslq 0x788(%rsp), %rsi
leaq 0x6a8(%rsp), %rdi
callq 0xcb30
jmp 0x5a8d9
leaq 0x6e8(%rsp), %rdi
leaq 0x6c8(%rsp), %rsi
leaq 0x6a8(%rsp), %rdx
callq 0xc9f0
jmp 0x5a8f8
leaq 0x195f(%rip), %rdx      # 0x5c25e
leaq 0x708(%rsp), %rdi
leaq 0x6e8(%rsp), %rsi
callq 0x22900
jmp 0x5a916
leaq 0x768(%rsp), %rdi
movq %rdi, 0xf8(%rsp)
leaq 0x708(%rsp), %rsi
movq %rsi, 0xf0(%rsp)
callq 0x4500
movq 0xf0(%rsp), %rdi
callq 0x4270
leaq 0x6e8(%rsp), %rdi
callq 0x4270
leaq 0x6a8(%rsp), %rdi
callq 0x4270
leaq 0x6c8(%rsp), %rdi
callq 0x4270
movq 0xf8(%rsp), %rsi
leaq 0x488(%rsp), %rdi
callq 0x4180
jmp 0x5a986
movq 0x790(%rsp), %rax
movq %rax, %rcx
addq $0x970, %rcx            # imm = 0x970
movzbl 0x2c3c(%rax), %edx
andl $0x1, %edx
leaq 0x4a8(%rsp), %rdi
leaq 0x488(%rsp), %rsi
callq 0x52e90
jmp 0x5a9b9
movq 0x790(%rsp), %rdi
addq $0xf70, %rdi            # imm = 0xF70
leaq 0x4a8(%rsp), %rsi
callq 0x44e0
jmp 0x5a9d7
leaq 0x4a8(%rsp), %rdi
callq 0x45d0
leaq 0x488(%rsp), %rdi
callq 0x4270
movl $0x0, 0x484(%rsp)
movl 0x484(%rsp), %eax
movl %eax, 0xec(%rsp)
movq 0x790(%rsp), %rdi
addq $0x2c88, %rdi           # imm = 0x2C88
callq 0x16bb0
movq %rax, %rcx
movl 0xec(%rsp), %eax
cmpl %ecx, %eax
jge 0x5aefd
movq 0x790(%rsp), %rdi
addq $0x2c88, %rdi           # imm = 0x2C88
movslq 0x484(%rsp), %rsi
callq 0x4fe90
movq %rax, %rdi
callq 0x45f0
cmpq $0x3, %rax
jae 0x5ab4e
movq 0x790(%rsp), %rdi
addq $0xf70, %rdi            # imm = 0xF70
leaq 0x3f87(%rip), %rsi      # 0x5e9fb
callq 0x4430
jmp 0x5aa7b
jmp 0x5ab4e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
jmp 0x5af0c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
jmp 0x5aaf3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
jmp 0x5aae6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x6e8(%rsp), %rdi
callq 0x4270
leaq 0x6a8(%rsp), %rdi
callq 0x4270
leaq 0x6c8(%rsp), %rdi
callq 0x4270
jmp 0x5af0c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
jmp 0x5ab3c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x4a8(%rsp), %rdi
callq 0x45d0
leaq 0x488(%rsp), %rdi
callq 0x4270
jmp 0x5af0c
movq 0x790(%rsp), %rdi
addq $0x2c88, %rdi           # imm = 0x2C88
movslq 0x484(%rsp), %rsi
callq 0x4fe90
movq %rax, %rdi
callq 0x45f0
cmpq $0x2, %rax
jae 0x5ab97
movq 0x790(%rsp), %rdi
addq $0xf70, %rdi            # imm = 0xF70
leaq 0x3e6d(%rip), %rsi      # 0x5e9fb
callq 0x4430
jmp 0x5ab95
jmp 0x5ab97
movq 0x790(%rsp), %rdi
movq %rdi, %rax
addq $0xf70, %rax            # imm = 0xF70
movq %rax, 0xd8(%rsp)
addq $0x2c88, %rdi           # imm = 0x2C88
movslq 0x484(%rsp), %rsi
callq 0x4fe90
movq 0xd8(%rsp), %rdi
movq %rax, %rsi
callq 0x43e0
movq %rax, 0xe0(%rsp)
jmp 0x5abde
movq 0xe0(%rsp), %rdi
leaq 0x3e09(%rip), %rsi      # 0x5e9f6
callq 0x4430
jmp 0x5abf4
movl $0x0, 0x480(%rsp)
movl 0x480(%rsp), %eax
cmpl 0x788(%rsp), %eax
jge 0x5aded
movl $0x100, %edi            # imm = 0x100
callq 0x4030
movq %rax, 0xd0(%rsp)
jmp 0x5ac27
movq 0xd0(%rsp), %rax
movq %rax, 0x478(%rsp)
movq 0x478(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0x790(%rsp), %rdi
addq $0x2dd0, %rdi           # imm = 0x2DD0
movslq 0x78c(%rsp), %rsi
callq 0x8ae0
movq %rax, %rdi
movslq 0x484(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x480(%rsp), %rsi
callq 0x8c20
movsd (%rax), %xmm0
movsd 0x39f1(%rip), %xmm1     # 0x5e680
mulsd %xmm1, %xmm0
callq 0x33950
movl %eax, 0xcc(%rsp)
jmp 0x5aca1
movq 0xc0(%rsp), %rdi
movl 0xcc(%rsp), %eax
cvtsi2sd %eax, %xmm0
movsd 0x39c4(%rip), %xmm1     # 0x5e680
divsd %xmm1, %xmm0
leaq 0x3d1c(%rip), %rsi      # 0x5e9e3
movb $0x1, %al
callq 0x40b0
movq 0x478(%rsp), %rax
movq %rax, 0xb0(%rsp)
leaq 0x457(%rsp), %rdi
movq %rdi, 0xb8(%rsp)
callq 0x4740
movq 0xb0(%rsp), %rsi
movq 0xb8(%rsp), %rdx
leaq 0x458(%rsp), %rdi
callq 0x4580
jmp 0x5ad12
leaq 0x457(%rsp), %rdi
callq 0x4490
movq 0x478(%rsp), %rax
movq %rax, 0xa8(%rsp)
cmpq $0x0, %rax
je 0x5ad42
movq 0xa8(%rsp), %rdi
callq 0x4530
movq 0x790(%rsp), %rdi
addq $0xf70, %rdi            # imm = 0xF70
leaq 0x458(%rsp), %rsi
callq 0x43e0
movq %rax, 0xa0(%rsp)
jmp 0x5ad68
movq 0xa0(%rsp), %rdi
leaq 0x3c84(%rip), %rsi      # 0x5e9fb
callq 0x4430
jmp 0x5ad7e
leaq 0x458(%rsp), %rdi
callq 0x4270
movl 0x480(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x480(%rsp)
jmp 0x5abff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x457(%rsp), %rdi
callq 0x4490
jmp 0x5af0c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x458(%rsp), %rdi
callq 0x4270
jmp 0x5af0c
movq 0x790(%rsp), %rdi
addq $0xf70, %rdi            # imm = 0xF70
leaq 0x3bf4(%rip), %rsi      # 0x5e9f7
callq 0x4430
jmp 0x5ae0a
movq 0x790(%rsp), %rdi
addq $0x2ca0, %rdi           # imm = 0x2CA0
movslq 0x484(%rsp), %rsi
callq 0x8ba0
cmpl $0x64, (%rax)
jge 0x5ae4a
movq 0x790(%rsp), %rdi
addq $0xf70, %rdi            # imm = 0xF70
leaq 0x3bba(%rip), %rsi      # 0x5e9fb
callq 0x4430
jmp 0x5ae48
jmp 0x5ae4a
movq 0x790(%rsp), %rdi
addq $0x2ca0, %rdi           # imm = 0x2CA0
movslq 0x484(%rsp), %rsi
callq 0x8ba0
cmpl $0xa, (%rax)
jge 0x5ae8a
movq 0x790(%rsp), %rdi
addq $0xf70, %rdi            # imm = 0xF70
leaq 0x3b7a(%rip), %rsi      # 0x5e9fb
callq 0x4430
jmp 0x5ae88
jmp 0x5ae8a
movq 0x790(%rsp), %rdi
movq %rdi, %rax
addq $0xf70, %rax            # imm = 0xF70
movq %rax, 0x98(%rsp)
addq $0x2ca0, %rdi           # imm = 0x2CA0
movslq 0x484(%rsp), %rsi
callq 0x8ba0
movq 0x98(%rsp), %rdi
movl (%rax), %esi
callq 0x4700
jmp 0x5aec8
movq 0x790(%rsp), %rdi
addq $0xf70, %rdi            # imm = 0xF70
leaq 0x19b4(%rip), %rsi      # 0x5c892
callq 0x4430
jmp 0x5aee5
jmp 0x5aee7
movl 0x484(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x484(%rsp)
jmp 0x5a9fc
leaq 0x768(%rsp), %rdi
callq 0x4270
jmp 0x5af1e
leaq 0x768(%rsp), %rdi
callq 0x4270
jmp 0x5b5ab
movq 0x790(%rsp), %rsi
addq $0x380, %rsi            # imm = 0x380
leaq 0x430(%rsp), %rdi
movq %rdi, 0x88(%rsp)
callq 0x4180
movq 0x88(%rsp), %rdi
callq 0x5bc90
movq %rax, 0x90(%rsp)
jmp 0x5af59
movq 0x90(%rsp), %rax
movq %rax, 0x418(%rsp)
leaq 0x418(%rsp), %rdi
movl $0x4, %esi
callq 0x5bcc0
movq %rax, 0x420(%rsp)
leaq 0x428(%rsp), %rdi
leaq 0x420(%rsp), %rsi
callq 0x5bd00
leaq 0x430(%rsp), %rdi
callq 0x5bc90
movq %rax, 0x80(%rsp)
jmp 0x5afaf
movq 0x80(%rsp), %rax
movq %rax, 0x408(%rsp)
leaq 0x410(%rsp), %rdi
leaq 0x408(%rsp), %rsi
callq 0x5bd00
movq 0x428(%rsp), %rsi
movq 0x410(%rsp), %rdx
leaq 0x430(%rsp), %rdi
callq 0x40d0
movq %rax, 0x78(%rsp)
jmp 0x5aff8
movq 0x78(%rsp), %rax
movq %rax, 0x400(%rsp)
leaq 0x37ea(%rip), %rdx      # 0x5e7f6
leaq 0x3a0(%rsp), %rdi
leaq 0x430(%rsp), %rsi
callq 0x2af00
jmp 0x5b023
movslq 0x788(%rsp), %rsi
leaq 0x380(%rsp), %rdi
callq 0xcb30
jmp 0x5b03a
leaq 0x3c0(%rsp), %rdi
leaq 0x3a0(%rsp), %rsi
leaq 0x380(%rsp), %rdx
callq 0xc9f0
jmp 0x5b059
leaq 0x12f5(%rip), %rdx      # 0x5c355
leaq 0x3e0(%rsp), %rdi
leaq 0x3c0(%rsp), %rsi
callq 0x22900
jmp 0x5b077
leaq 0x430(%rsp), %rdi
movq %rdi, 0x70(%rsp)
leaq 0x3e0(%rsp), %rsi
movq %rsi, 0x68(%rsp)
callq 0x4500
movq 0x68(%rsp), %rdi
callq 0x4270
leaq 0x3c0(%rsp), %rdi
callq 0x4270
leaq 0x380(%rsp), %rdi
callq 0x4270
leaq 0x3a0(%rsp), %rdi
callq 0x4270
movq 0x70(%rsp), %rsi
leaq 0x160(%rsp), %rdi
callq 0x4180
jmp 0x5b0db
movq 0x790(%rsp), %rax
movq %rax, %rcx
addq $0x970, %rcx            # imm = 0x970
movzbl 0x2c3c(%rax), %edx
andl $0x1, %edx
leaq 0x180(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x52e90
jmp 0x5b10e
movq 0x790(%rsp), %rdi
addq $0xf70, %rdi            # imm = 0xF70
leaq 0x180(%rsp), %rsi
callq 0x44e0
jmp 0x5b12c
leaq 0x180(%rsp), %rdi
callq 0x45d0
leaq 0x160(%rsp), %rdi
callq 0x4270
movq 0x790(%rsp), %rdi
addq $0xf70, %rdi            # imm = 0xF70
leaq 0x38a1(%rip), %rsi      # 0x5e9fd
callq 0x4430
jmp 0x5b163
movl $0x0, 0x15c(%rsp)
movl 0x15c(%rsp), %eax
cmpl 0x788(%rsp), %eax
jge 0x5b29c
movq 0x790(%rsp), %rdi
addq $0xf70, %rdi            # imm = 0xF70
leaq 0x3845(%rip), %rsi      # 0x5e9dd
callq 0x4430
movq %rax, 0x60(%rsp)
jmp 0x5b1a4
movq 0x60(%rsp), %rdi
movl 0x15c(%rsp), %esi
incl %esi
callq 0x4700
jmp 0x5b1b9
jmp 0x5b1bb
movl 0x15c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x15c(%rsp)
jmp 0x5b16e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
jmp 0x5b59e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
jmp 0x5b241
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
jmp 0x5b234
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x3c0(%rsp), %rdi
callq 0x4270
leaq 0x380(%rsp), %rdi
callq 0x4270
leaq 0x3a0(%rsp), %rdi
callq 0x4270
jmp 0x5b59e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
jmp 0x5b28a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x180(%rsp), %rdi
callq 0x45d0
leaq 0x160(%rsp), %rdi
callq 0x4270
jmp 0x5b59e
movq 0x790(%rsp), %rdi
addq $0xf70, %rdi            # imm = 0xF70
leaq 0x15e0(%rip), %rsi      # 0x5c892
callq 0x4430
jmp 0x5b2b9
movl $0x0, 0x158(%rsp)
movl 0x158(%rsp), %eax
movl %eax, 0x5c(%rsp)
movq 0x790(%rsp), %rdi
addq $0x2c88, %rdi           # imm = 0x2C88
callq 0x16bb0
movq %rax, %rcx
movl 0x5c(%rsp), %eax
cmpl %ecx, %eax
jge 0x5b573
movq 0x790(%rsp), %rdi
movq %rdi, %rax
addq $0xf70, %rax            # imm = 0xF70
movq %rax, 0x48(%rsp)
addq $0x2c88, %rdi           # imm = 0x2C88
movslq 0x158(%rsp), %rsi
callq 0x4fe90
movq 0x48(%rsp), %rdi
movq %rax, %rsi
callq 0x43e0
movq %rax, 0x50(%rsp)
jmp 0x5b330
movq 0x50(%rsp), %rdi
leaq 0xeec(%rip), %rsi       # 0x5c228
callq 0x4430
movq %rax, 0x40(%rsp)
jmp 0x5b348
movq 0x790(%rsp), %rdi
addq $0x2ca0, %rdi           # imm = 0x2CA0
movslq 0x158(%rsp), %rsi
callq 0x8ba0
movq 0x40(%rsp), %rdi
movl (%rax), %esi
callq 0x4700
jmp 0x5b372
movl $0x0, 0x154(%rsp)
movl 0x154(%rsp), %eax
cmpl 0x788(%rsp), %eax
jge 0x5b53e
movl $0x100, %edi            # imm = 0x100
callq 0x4030
movq %rax, 0x38(%rsp)
jmp 0x5b3a2
movq 0x38(%rsp), %rax
movq %rax, 0x148(%rsp)
movq 0x148(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x790(%rsp), %rdi
addq $0x2dd0, %rdi           # imm = 0x2DD0
movslq 0x78c(%rsp), %rsi
callq 0x8ae0
movq %rax, %rdi
movslq 0x158(%rsp), %rsi
callq 0x8bc0
movq %rax, %rdi
movslq 0x154(%rsp), %rsi
callq 0x8c20
movsd (%rax), %xmm0
movsd 0x327c(%rip), %xmm1     # 0x5e680
mulsd %xmm1, %xmm0
callq 0x33950
movl %eax, 0x34(%rsp)
jmp 0x5b413
movq 0x28(%rsp), %rdi
movl 0x34(%rsp), %eax
cvtsi2sd %eax, %xmm0
movsd 0x3258(%rip), %xmm1     # 0x5e680
divsd %xmm1, %xmm0
leaq 0x35b0(%rip), %rsi      # 0x5e9e3
movb $0x1, %al
callq 0x40b0
movq 0x148(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x127(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x4740
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
leaq 0x128(%rsp), %rdi
callq 0x4580
jmp 0x5b472
leaq 0x127(%rsp), %rdi
callq 0x4490
movq 0x148(%rsp), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x5b49c
movq 0x10(%rsp), %rdi
callq 0x4530
movq 0x790(%rsp), %rdi
addq $0xf70, %rdi            # imm = 0xF70
leaq 0xd76(%rip), %rsi       # 0x5c228
callq 0x4430
movq %rax, 0x8(%rsp)
jmp 0x5b4be
movq 0x8(%rsp), %rdi
leaq 0x128(%rsp), %rsi
callq 0x43e0
jmp 0x5b4d2
leaq 0x128(%rsp), %rdi
callq 0x4270
movl 0x154(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x154(%rsp)
jmp 0x5b37d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x127(%rsp), %rdi
callq 0x4490
jmp 0x5b59e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x748(%rsp)
movl %eax, 0x744(%rsp)
leaq 0x128(%rsp), %rdi
callq 0x4270
jmp 0x5b59e
movq 0x790(%rsp), %rdi
addq $0xf70, %rdi            # imm = 0xF70
leaq 0x133e(%rip), %rsi      # 0x5c892
callq 0x4430
jmp 0x5b55b
jmp 0x5b55d
movl 0x158(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x158(%rsp)
jmp 0x5b2c4
movq 0x790(%rsp), %rdi
addq $0xf70, %rdi            # imm = 0xF70
callq 0x42b0
jmp 0x5b589
leaq 0x430(%rsp), %rdi
callq 0x4270
addq $0x798, %rsp            # imm = 0x798
retq
leaq 0x430(%rsp), %rdi
callq 0x4270
movq 0x748(%rsp), %rdi
callq 0x4730
nopl (%rax,%rax)