// File: /workspace/github_cpp_makefile_star2_O1/millanek[P]Dsuite/Dsuite_utils.cpp
// Function: GeneralSetCountsWithSplits::getSplitCountsNew(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, std::map<unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> const&)
void GeneralSetCountsWithSplits::getSplitCountsNew(const std::vector<std::string>& genotypes, const std::map<size_t, string>& posToSpeciesMap) {
    
    getBasicCountsWithSplitsNew(genotypes, posToSpeciesMap);
    
    // If at least one of the outgroup individuals has non-missing data
    // Find out what is the "ancestral allele" - i.e. the one more common in the outgroup
    try {
        if (setAlleleCounts.at("Outgroup") > 0) {
            if ((double)vector_sum(setGenotypes.at("Outgroup"))/setGenotypes.at("Outgroup").size() < 0.5) { AAint = AncestralAlleleRef; }
            else { AAint = AncestralAlleleAlt; } 
        }
    } catch (std::out_of_range& e) { AAint = -1; }
    
    // Now fill in the allele frequencies
    double totalAAF = 0; int numNonZeroCounts = 0;
    for(std::map<string,std::vector<int>>::iterator it = setGenotypes.begin(); it != setGenotypes.end(); ++it) {
        if (it->first == "") {
            std::cerr << "it->first " << it->first << "\t"; print_vector(it->second, std::cerr); std::cerr << std::endl;
        }
        std::vector<int> thisSetGenotypes = setGenotypes.at(it->first);
        std::vector<double> thisSetIndividualAFs = setIndividualAFs.at(it->first);
        
        if (thisSetGenotypes.size() > 0) {
            numNonZeroCounts++;
            double thisAAF = (double)vector_sum(thisSetGenotypes)/thisSetGenotypes.size();
           // print_vector(thisSetGenotypes, std::cerr);
           // std::cerr << "thisAAF: " << thisAAF << std::endl;
            setAAFs[it->first] = thisAAF; totalAAF += thisAAF;
            
            // Take care of the splits by random sampling with replacement:
            std::random_device rd;     // only used once to initialise (seed) engine
            std::mt19937 rng(rd());    // random-number engine used (Mersenne-Twister in this case)
            std::uniform_int_distribution<int> uni(0,((int)thisSetGenotypes.size() - 1)); // guaranteed unbiased
            std::uniform_int_distribution<int> uniAFs(0,((int)thisSetIndividualAFs.size() - 1)); // guaranteed unbiased
            
         /*   std::vector<int> thisSetGenotypesSampledSplit1; std::vector<int> thisSetGenotypesSampledSplit2;
            for (int i = 0; i < thisSetGenotypes.size(); i++) {
                int random_pos_s1 = uni(rng);
                int random_pos_s2 = uni(rng);
                thisSetGenotypesSampledSplit1.push_back(thisSetGenotypes[random_pos_s1]);
                thisSetGenotypesSampledSplit2.push_back(thisSetGenotypes[random_pos_s2]);
            }
          */
            
            std::vector<double> thisSetIndividualAFsSampledSplit1; std::vector<double> thisSetIndividualAFsSampledSplit2;
            for (int i = 0; i < thisSetIndividualAFs.size(); i++) {
                int random_pos_s1 = uniAFs(rng);
                int random_pos_s2 = uniAFs(rng);
                thisSetIndividualAFsSampledSplit1.push_back(thisSetIndividualAFs[random_pos_s1]);
                thisSetIndividualAFsSampledSplit2.push_back(thisSetIndividualAFs[random_pos_s2]);
            }
            
          //  double thisAAFsplit1 = vector_average(thisSetGenotypesSampledSplit1);
          //  double thisAAFsplit2 = vector_average(thisSetGenotypesSampledSplit2);
            double thisAAFsplit1 = vector_average(thisSetIndividualAFsSampledSplit1);
            double thisAAFsplit2 = vector_average(thisSetIndividualAFsSampledSplit2);
            setAAFsplit1[it->first] = thisAAFsplit1; setAAFsplit2[it->first] = thisAAFsplit2;
            
            // Count correction as in admixtools
         //   double ya = vector_sum(thisSetGenotypes); double yb = thisSetGenotypes.size() - vector_sum(thisSetGenotypes);
         //   double yt = (double)thisSetGenotypes.size();
         //   double h = ya * yb / (yt * (yt - 1.0));
            //std::cerr << "it->first: " << it->first << std::endl;
            //std::cerr << "ya: " << ya << " ; yb: " << yb << " ; yt: " << yt << std::endl;
            //std::cerr << "h: " << h << " ; h / yt: " << h / yt << std::endl;
            
          //  setCorrectionFactors[it->first] = h / yt;
            
           // std::cerr << "it->first " << it->first << std::endl;
            try {
            if (AAint == AncestralAlleleRef) { // Ancestral allele seems to be the ref, so derived is alt
                setDAFs[it->first] = thisAAF;
                setDAFsplit1[it->first] = thisAAFsplit1; setDAFsplit2[it->first] = thisAAFsplit2;
            } else if (AAint == AncestralAlleleAlt) { // Ancestral allele seems to be alt, so derived is ref
                setDAFs[it->first] = (1 - thisAAF);
                setDAFsplit1[it->first] = 1 - thisAAFsplit1;
                setDAFsplit2[it->first] = 1 - thisAAFsplit2;
            }
                } catch (std::out_of_range& e) { std::cerr << "The trouble was here" << it->first << std::endl; }
        }
    }
    averageAAF = totalAAF/numNonZeroCounts;
    if (AAint == AncestralAlleleRef) averageDAF = averageAAF;
    else if (AAint == AncestralAlleleAlt) averageDAF = (1 - averageAAF);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28c8, %rsp           # imm = 0x28C8
movq %rdi, %r12
callq 0xb776
leaq 0x1c8(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x34ffa(%rip), %rsi     # 0x40a9a
leaq 0x34ffb(%rip), %rdx     # 0x40aa2
leaq 0x1b8(%rsp), %rdi
callq 0x88ba
leaq 0xc8(%r12), %rdi
leaq 0x1b8(%rsp), %rsi
callq 0xd180
movl (%rax), %ebx
movq 0x1b8(%rsp), %rdi
cmpq %r14, %rdi
je 0xbae8
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x7420
testl %ebx, %ebx
jle 0xbc8c
leaq 0x1b8(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x34f98(%rip), %rsi     # 0x40a9a
leaq 0x34f99(%rip), %rdx     # 0x40aa2
callq 0x88ba
leaq 0x8(%r12), %rbx
leaq 0x1b8(%rsp), %rsi
movq %rbx, %rdi
callq 0xd754
leaq 0xe8(%rsp), %rdi
movq %rax, %rsi
callq 0xd7a8
movq 0xe8(%rsp), %rax
movq 0xf0(%rsp), %rcx
subq %rax, %rcx
je 0xbb70
sarq $0x2, %rcx
cmpq $0x1, %rcx
adcq $0x0, %rcx
xorpd %xmm1, %xmm1
xorl %edx, %edx
xorps %xmm0, %xmm0
cvtsi2sdl (%rax,%rdx,4), %xmm0
addsd %xmm0, %xmm1
incq %rdx
cmpq %rdx, %rcx
jne 0xbb5a
jmp 0xbb74
xorpd %xmm1, %xmm1
movsd %xmm1, 0x8(%rsp)
leaq 0x1550(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x34f0d(%rip), %rsi     # 0x40a9a
leaq 0x34f0e(%rip), %rdx     # 0x40aa2
leaq 0x1540(%rsp), %rdi
callq 0x88ba
leaq 0x1540(%rsp), %rsi
movq %rbx, %rdi
callq 0xd754
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x2, %rcx
movq %rcx, %xmm0
punpckldq 0x34907(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x3490f(%rip), %xmm0    # 0x404e0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
movq 0x1540(%rsp), %rdi
cmpq %r15, %rdi
je 0xbc0e
movq 0x1550(%rsp), %rsi
incq %rsi
movapd %xmm1, 0x30(%rsp)
movapd %xmm0, 0x20(%rsp)
callq 0x7420
movapd 0x20(%rsp), %xmm0
movapd 0x30(%rsp), %xmm1
addsd %xmm0, %xmm1
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0xbc3b
movq 0xf8(%rsp), %rsi
subq %rdi, %rsi
movapd %xmm1, 0x30(%rsp)
callq 0x7420
movapd 0x30(%rsp), %xmm1
movsd 0x8(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x1b8(%rsp), %rdi
cmpq %r14, %rdi
je 0xbc68
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x7420
movsd 0x34808(%rip), %xmm0    # 0x40478
ucomisd 0x8(%rsp), %xmm0
jbe 0xbc83
movl $0x0, 0x4(%r12)
jmp 0xbc8c
movl $0x1, 0x4(%r12)
movq 0x20(%r12), %rax
leaq 0x10(%r12), %rcx
movq %rcx, 0x128(%rsp)
cmpq %rcx, %rax
je 0xc428
leaq 0x8(%r12), %rcx
movq %rcx, 0x120(%rsp)
leaq 0x38(%r12), %rcx
movq %rcx, 0x118(%rsp)
leaq 0x1e8(%r12), %rcx
movq %rcx, 0x110(%rsp)
leaq 0x3a8(%r12), %rcx
movq %rcx, 0x108(%rsp)
leaq 0x3d8(%r12), %rcx
movq %rcx, 0x100(%rsp)
leaq 0x220(%r12), %rcx
movq %rcx, 0xd0(%rsp)
leaq 0x408(%r12), %rcx
movq %rcx, 0xc8(%rsp)
movq %r12, 0xd8(%rsp)
leaq 0x438(%r12), %rcx
movq %rcx, 0xc0(%rsp)
xorpd %xmm0, %xmm0
movsd %xmm0, 0x48(%rsp)
leaq 0x1540(%rsp), %r15
leaq 0xe0(%rsp), %r12
movl $0x0, 0x14(%rsp)
movq %rax, 0x30(%rsp)
leaq 0x20(%rax), %rbp
movq %rbp, %rdi
leaq 0x37253(%rip), %rsi     # 0x42fb1
callq 0x70f0
testl %eax, %eax
jne 0xbe23
movl $0xa, %edx
movq 0x4b271(%rip), %r14     # 0x56fe8
movq %r14, %rdi
leaq 0x34929(%rip), %rsi     # 0x406aa
callq 0x74b0
movq 0x30(%rsp), %rbx
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq %r14, %rdi
callq 0x74b0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x37206(%rip), %rsi     # 0x42fb0
callq 0x74b0
leaq 0x40(%rbx), %rsi
leaq 0x130(%rsp), %rbx
movq %rbx, %rdi
callq 0xd7a8
movq %rbx, %rdi
movq %r14, %rsi
movl $0x9, %edx
movl $0x1, %ecx
callq 0xd828
movq 0x130(%rsp), %rdi
testq %rdi, %rdi
je 0xbdf5
movq 0x140(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
movq 0x4b1ec(%rip), %rbx     # 0x56fe8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x73f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x7040
movq %rax, %rdi
callq 0x72e0
movq 0x120(%rsp), %rdi
movq %rbp, %rsi
callq 0xd754
leaq 0xa8(%rsp), %rdi
movq %rax, %rsi
callq 0xd7a8
movq 0x118(%rsp), %rdi
movq %rbp, %rsi
callq 0xd8da
leaq 0x90(%rsp), %rdi
movq %rax, %rsi
callq 0xd4a2
movq 0xb0(%rsp), %rax
cmpq 0xa8(%rsp), %rax
je 0xc360
leaq 0x178(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xd7a8
movq 0x178(%rsp), %rdi
movq 0x180(%rsp), %rax
subq %rdi, %rax
je 0xbecb
sarq $0x2, %rax
cmpq $0x1, %rax
adcq $0x0, %rax
xorpd %xmm1, %xmm1
xorl %ecx, %ecx
xorps %xmm0, %xmm0
cvtsi2sdl (%rdi,%rcx,4), %xmm0
addsd %xmm0, %xmm1
incq %rcx
cmpq %rcx, %rax
jne 0xbeb5
jmp 0xbecf
xorpd %xmm1, %xmm1
movsd %xmm1, 0x8(%rsp)
movq 0xb0(%rsp), %rax
subq 0xa8(%rsp), %rax
sarq $0x2, %rax
movq %rax, %xmm0
punpckldq 0x345da(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x345e2(%rip), %xmm0    # 0x404e0
movapd %xmm0, 0x20(%rsp)
testq %rdi, %rdi
je 0xbf19
movq 0x188(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
movq 0x110(%rsp), %rdi
movq %rbp, %rsi
callq 0xd1d4
movapd 0x20(%rsp), %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd %xmm1, (%rax)
leaq 0x1b8(%rsp), %rbx
movq %rbx, %rdi
callq 0xd522
movq %rbx, %rdi
callq 0x75a0
incl 0x14(%rsp)
movsd 0x48(%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
movl %eax, %eax
movq %rax, 0x1540(%rsp)
movl $0x1, %ecx
movq %rax, %rdx
shrq $0x1e, %rdx
xorl %eax, %edx
imull $0x6c078965, %edx, %eax # imm = 0x6C078965
addl %ecx, %eax
movq %rax, 0x1540(%rsp,%rcx,8)
incq %rcx
cmpq $0x270, %rcx            # imm = 0x270
jne 0xbf8c
movq 0x98(%rsp), %rax
movq 0x90(%rsp), %rcx
movq %rax, %rdx
subq %rcx, %rdx
shrq $0x3, %rdx
decl %edx
movq $0x270, 0x28c0(%rsp) # imm = 0x270
movl $0x0, 0xe0(%rsp)
movl %edx, 0xe4(%rsp)
xorl %edx, %edx
movq %rdx, 0x80(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x70(%rsp)
movq %rdx, 0x60(%rsp)
movapd %xmm0, 0x50(%rsp)
cmpq %rcx, %rax
je 0xc0ca
xorl %r14d, %r14d
movq %r12, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xf3ae
movl %eax, %r13d
movq %r12, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xf3ae
movl %eax, %ebx
movslq %r13d, %rdx
shlq $0x3, %rdx
addq 0x90(%rsp), %rdx
movq 0x78(%rsp), %rsi
cmpq 0x80(%rsp), %rsi
je 0xc068
movsd (%rdx), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x78(%rsp)
jmp 0xc072
leaq 0x70(%rsp), %rdi
callq 0xf2ce
movslq %ebx, %rdx
shlq $0x3, %rdx
addq 0x90(%rsp), %rdx
movq 0x58(%rsp), %rsi
cmpq 0x60(%rsp), %rsi
je 0xc0a0
movsd (%rdx), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x58(%rsp)
jmp 0xc0aa
leaq 0x50(%rsp), %rdi
callq 0xf2ce
incq %r14
movq 0x98(%rsp), %rax
subq 0x90(%rsp), %rax
sarq $0x3, %rax
cmpq %r14, %rax
ja 0xc016
leaq 0x160(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0xd4a2
movq 0x160(%rsp), %rdi
movq 0x168(%rsp), %rcx
movq %rcx, %rax
subq %rdi, %rax
sarq $0x3, %rax
cmpq %rdi, %rcx
je 0xc11b
cmpq $0x1, %rax
movq %rax, %rcx
adcq $0x0, %rcx
xorpd %xmm0, %xmm0
xorl %edx, %edx
addsd (%rdi,%rdx,8), %xmm0
incq %rdx
cmpq %rdx, %rcx
jne 0xc10c
jmp 0xc11f
xorpd %xmm0, %xmm0
movsd %xmm0, 0x20(%rsp)
movq %rax, %xmm0
punpckldq 0x3439e(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x343a6(%rip), %xmm0    # 0x404e0
movapd %xmm0, 0x1a0(%rsp)
testq %rdi, %rdi
je 0xc158
movq 0x170(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
leaq 0x148(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0xd4a2
movq 0x148(%rsp), %rdi
movq 0x150(%rsp), %rcx
movq %rcx, %rax
subq %rdi, %rax
sarq $0x3, %rax
cmpq %rdi, %rcx
je 0xc1a9
cmpq $0x1, %rax
movq %rax, %rcx
adcq $0x0, %rcx
xorpd %xmm0, %xmm0
xorl %edx, %edx
addsd (%rdi,%rdx,8), %xmm0
incq %rdx
cmpq %rdx, %rcx
jne 0xc19a
jmp 0xc1ad
xorpd %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
movq %rax, %xmm0
punpckldq 0x34310(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x34318(%rip), %xmm0    # 0x404e0
movapd %xmm0, 0x190(%rsp)
testq %rdi, %rdi
je 0xc1e6
movq 0x158(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
movq 0x108(%rsp), %rdi
movq %rbp, %rsi
callq 0xd1d4
movapd 0x1a0(%rsp), %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movsd 0x20(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x20(%rsp)
movsd %xmm1, (%rax)
movq 0x100(%rsp), %rdi
movq %rbp, %rsi
callq 0xd1d4
movapd 0x190(%rsp), %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movsd 0x18(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x18(%rsp)
movsd %xmm1, (%rax)
movq 0xd8(%rsp), %rax
movl 0x4(%rax), %eax
cmpl $0x1, %eax
je 0xc2bc
testl %eax, %eax
jne 0xc322
movq 0xd0(%rsp), %rdi
movq %rbp, %rsi
callq 0xd1d4
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0xc8(%rsp), %rdi
movq %rbp, %rsi
callq 0xd1d4
movsd 0x20(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0xc0(%rsp), %rdi
movq %rbp, %rsi
callq 0xd1d4
movsd 0x18(%rsp), %xmm0
jmp 0xc31e
movq 0xd0(%rsp), %rdi
movq %rbp, %rsi
callq 0xd1d4
movsd 0x3419c(%rip), %xmm0    # 0x40470
subsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0xc8(%rsp), %rdi
movq %rbp, %rsi
callq 0xd1d4
movsd 0x3417a(%rip), %xmm0    # 0x40470
subsd 0x20(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0xc0(%rsp), %rdi
movq %rbp, %rsi
callq 0xd1d4
movsd 0x34158(%rip), %xmm0    # 0x40470
subsd 0x18(%rsp), %xmm0
movsd %xmm0, (%rax)
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0xc339
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0xc353
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
leaq 0x1b8(%rsp), %rdi
callq 0x73d0
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0xc37d
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0xc39a
movq 0xb8(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
movq 0x30(%rsp), %rdi
callq 0x72f0
cmpq 0x128(%rsp), %rax
jne 0xbd4b
jmp 0xc40b
movq %rax, %rbp
cmpl $0x1, %edx
jne 0xc56e
movq %rbp, %rdi
callq 0x7170
movl $0x14, %edx
movq 0x4ac14(%rip), %rdi     # 0x56fe8
leaq 0x342da(%rip), %rsi     # 0x406b5
callq 0x74b0
movq 0x30(%rsp), %rax
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
movq 0x4abf4(%rip), %rdi     # 0x56fe8
callq 0x74b0
movq %rax, %rdi
callq 0x71b0
callq 0x76a0
jmp 0xc322
xorps %xmm0, %xmm0
cvtsi2sdl 0x14(%rsp), %xmm0
movsd 0x48(%rsp), %xmm2
divsd %xmm0, %xmm2
movq 0xd8(%rsp), %r12
jmp 0xc430
movsd 0x34068(%rip), %xmm2    # 0x40498
movapd %xmm2, %xmm1
movsd %xmm2, 0x218(%r12)
movl 0x4(%r12), %eax
testl %eax, %eax
je 0xc45a
cmpl $0x1, %eax
jne 0xc468
movsd 0x3401c(%rip), %xmm0    # 0x40470
subsd %xmm1, %xmm0
jmp 0xc45e
movapd %xmm1, %xmm0
movsd %xmm0, 0x250(%r12)
addq $0x28c8, %rsp           # imm = 0x28C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc56b
movq %rax, %rbp
callq 0x76a0
jmp 0xc56e
jmp 0xc5ee
movq %rdx, %rbx
movq %rax, %rbp
movq 0x1540(%rsp), %rdi
cmpq %r15, %rdi
je 0xc4bc
movq 0x1550(%rsp), %rsi
incq %rsi
callq 0x7420
jmp 0xc4bc
movq %rdx, %rbx
movq %rax, %rbp
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0xc4ed
movq 0xf8(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
jmp 0xc4ed
jmp 0xc4df
jmp 0xc4e7
movq %rdx, %rbx
movq %rax, %rbp
jmp 0xc50a
movq %rdx, %rbx
movq %rax, %rbp
movq 0x1b8(%rsp), %rdi
cmpq %r14, %rdi
je 0xc50a
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x7420
cmpl $0x1, %ebx
jne 0xc5e6
movq %rbp, %rdi
callq 0x7170
movl $0xffffffff, 0x4(%r12)  # imm = 0xFFFFFFFF
callq 0x76a0
jmp 0xbc8c
movq %rax, %rbp
movq 0x130(%rsp), %rdi
testq %rdi, %rdi
je 0xc5e6
movq 0x140(%rsp), %rsi
jmp 0xc5de
jmp 0xc5ee
jmp 0xc56b
jmp 0xc55d
movq %rax, %rbp
jmp 0xc59f
movq %rax, %rbp
jmp 0xc5ac
jmp 0xc56b
movq %rax, %rbp
jmp 0xc5c9
jmp 0xc56b
movq %rax, %rbp
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0xc585
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0xc59f
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
leaq 0x1b8(%rsp), %rdi
callq 0x73d0
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0xc5c9
movq 0xa0(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0xc5e6
movq 0xb8(%rsp), %rsi
subq %rdi, %rsi
callq 0x7420
movq %rbp, %rdi
callq 0x7740
movq %rax, %rdi
callq 0xd650