LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_utils.cpp
// Function: locateSet(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>>>>&, 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::vector<size_t> locateSet(std::vector<std::string>& sample_names, const std::vector<std::string>& set) {
    std::vector<size_t> setLocs;
    for (std::vector<std::string>::size_type i = 0; i != set.size(); i++) {
        std::vector<std::string>::iterator it = std::find(sample_names.begin(), sample_names.end(), set[i]);
        if (it == sample_names.end()) {
            std::cerr << "Did not find the sample: \"" << set[i] << "\"" << std::endl;
            print_vector(sample_names, std::cerr,',');
        } else {
            size_t loc = std::distance(sample_names.begin(), it);
            setLocs.push_back(loc);
        }
    }
    return setLocs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
xorl %ebp, %ebp
leaq 0x10(%rsp), %r13
xorl %r12d, %r12d
movq (%r14), %rdx
movq 0x8(%r14), %rax
subq %rdx, %rax
sarq $0x5, %rax
cmpq %rax, %r12
je 0x4289c
movq (%r15), %rdi
movq 0x8(%r15), %rsi
addq %rbp, %rdx
callq 0x46356
cmpq 0x8(%r15), %rax
je 0x42830
subq (%r15), %rax
sarq $0x5, %rax
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
leaq 0x8(%rsp), %rsi
callq 0x43ce0
jmp 0x42890
movq 0x9a7b1(%rip), %rdi     # 0xdcfe8
leaq 0x5cad8(%rip), %rsi     # 0x9f316
callq 0x8480
movq (%r14), %rsi
addq %rbp, %rsi
movq %rax, %rdi
callq 0x8430
movq %rax, %rdi
leaq 0x5cad4(%rip), %rsi     # 0x9f32f
callq 0x8480
movq %rax, %rdi
callq 0x8230
movq %r13, %rdi
movq %r15, %rsi
callq 0x297dc
movq %r13, %rdi
movq 0x9a76b(%rip), %rsi     # 0xdcfe8
pushq $0x2c
popq %rdx
pushq $0x1
popq %rcx
callq 0x2ea24
movq %r13, %rdi
callq 0x28a08
incq %r12
addq $0x20, %rbp
jmp 0x427e9
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x28a08
jmp 0x428c2
jmp 0x428bf
movq %rax, %r14
movq %rbx, %rdi
callq 0x2f68c
movq %r14, %rdi
callq 0x8870
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_utils.cpp
// Function: complementIndices(unsigned long, std::vector<unsigned long, std::allocator<unsigned long>> const&)
std::vector<size_t> complementIndices(const size_t fullVectorSize, const std::vector<size_t>& originalIndices) {
    std::vector<size_t> indexComplement;
    std::vector<bool> isInOriginal(fullVectorSize, false);
    for (const size_t j : originalIndices) {
        isInOriginal[j] = true;
    }
    indexComplement.reserve(fullVectorSize - originalIndices.size());
    for (size_t i = 0; i < fullVectorSize; i++) {
        if (!isInOriginal[i])
        indexComplement.push_back(i);
    }
    return indexComplement;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
andq $0x0, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
leaq 0x8(%rsp), %rdx
movb $0x0, (%rdx)
leaq 0x10(%rsp), %rdi
leaq 0x7(%rsp), %rcx
callq 0x43d00
movq (%r15), %r13
movq 0x8(%r15), %rbp
leaq 0x10(%rsp), %r12
cmpq %rbp, %r13
je 0x42931
movq (%r13), %rsi
movq %r12, %rdi
callq 0x439c0
orq %rdx, (%rax)
addq $0x8, %r13
jmp 0x42917
movq 0x8(%r15), %rax
subq (%r15), %rax
sarq $0x3, %rax
movq %r14, %rsi
subq %rax, %rsi
movq %rbx, %rdi
callq 0x43d64
xorl %esi, %esi
leaq 0x10(%rsp), %r15
leaq 0x8(%rsp), %r12
movq %rsi, 0x8(%rsp)
cmpq %r14, %rsi
jae 0x42982
movq %r15, %rdi
callq 0x439c0
testq %rdx, (%rax)
jne 0x42978
movq %rbx, %rdi
movq %r12, %rsi
callq 0x43ce0
movq 0x8(%rsp), %rsi
incq %rsi
jmp 0x42956
leaq 0x10(%rsp), %rdi
callq 0x2aee2
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x429a9
movq %rax, %r14
jmp 0x429b6
jmp 0x429a9
jmp 0x429a9
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x2aee2
movq %rbx, %rdi
callq 0x2f68c
movq %r14, %rdi
callq 0x8870
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_utils.cpp
// Function: locateOneSample(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>>>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
size_t locateOneSample(std::vector<std::string>& sample_names, const std::string toFind) {
    size_t pos = 0;
    std::vector<std::string>::iterator it = std::find(sample_names.begin(), sample_names.end(), toFind);
    if (it == sample_names.end()) {
        std::cerr << "Did not find the sample: " << toFind << std::endl;
    } else {
        pos = std::distance(sample_names.begin(), it);
    }
    return pos;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
movq 0x8(%r14), %rsi
movq %rbx, %rdx
callq 0x46356
cmpq 0x8(%r14), %rax
je 0x429ee
subq (%r14), %rax
sarq $0x5, %rax
jmp 0x42a16
movq 0x9a5f3(%rip), %rdi     # 0xdcfe8
leaq 0x5c935(%rip), %rsi     # 0x9f331
callq 0x8480
movq %rax, %rdi
movq %rbx, %rsi
callq 0x8430
movq %rax, %rdi
callq 0x8230
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_utils.cpp
// Function: readMultiFastaToOneString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)
std::string readMultiFastaToOneString(const string& fileName, int bytes) {
    std::string fastaSeqs; fastaSeqs.reserve(bytes); fastaSeqs = "";
    string line;
    std::ifstream* fastaFile = new std::ifstream(fileName.c_str());
    getline(*fastaFile, line);
    string currentScaffold = line.substr(1,string::npos);
    while (getline(*fastaFile, line)) {
        if (line[0] != '>') {
            fastaSeqs.append(line);
        } else {
            continue;
        }
    }
    return fastaSeqs;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movq %rsi, %r15
movb $0x0, 0x10(%rdi)
movslq %edx, %rsi
callq 0x8700
leaq 0x57111(%rip), %rsi     # 0x99e1f
movq %rbx, %rdi
callq 0x88f0
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movl $0x208, %edi            # imm = 0x208
callq 0x8490
movq %rax, %r14
movq (%r15), %rsi
pushq $0x8
popq %rdx
movq %rax, %rdi
callq 0x8890
movq %rsp, %rsi
movq %r14, %rdi
callq 0x80a0
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
pushq $0x1
popq %rdx
pushq $-0x1
popq %rcx
callq 0x84b0
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x80a0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x42d92
movq (%rsp), %rax
cmpb $0x3e, (%rax)
je 0x42d63
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8920
jmp 0x42d63
leaq 0x20(%rsp), %rdi
callq 0x8978
movq %rsp, %rdi
callq 0x8978
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x42dc5
movq %rax, %r15
movl $0x208, %esi            # imm = 0x208
movq %r14, %rdi
callq 0x84a0
jmp 0x42ddc
movq %rax, %r15
jmp 0x42ddc
movq %rax, %r15
jmp 0x42de4
movq %rax, %r15
leaq 0x20(%rsp), %rdi
callq 0x8978
movq %rsp, %rdi
callq 0x8978
movq %rbx, %rdi
callq 0x8978
movq %r15, %rdi
callq 0x8870
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_utils.cpp
// Function: GeneralSetCounts::probabilitiesFromLikelihoods(std::vector<double, std::allocator<double>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::vector<double> GeneralSetCounts::probabilitiesFromLikelihoods(const std::vector<double>& thisLikelihoods, const string& species) {
    std::vector<double> thisProbabilities; thisProbabilities.assign(3, 0.0);
    double multiple0 = thisLikelihoods[0]*setHWEpriorsFromAAFfromGT[species][0];
    double multiple1 = thisLikelihoods[1]*setHWEpriorsFromAAFfromGT[species][1];
    double multiple2 = thisLikelihoods[2]*setHWEpriorsFromAAFfromGT[species][2];
    double sum = multiple0 + multiple1 + multiple2;
    
    thisProbabilities[0] = multiple0/sum;
    thisProbabilities[1] = multiple1/sum;
    thisProbabilities[2] = multiple2/sum;
    
    return thisProbabilities;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
leaq 0x50(%rsp), %rdx
andq $0x0, (%rdx)
pushq $0x3
popq %rsi
callq 0x44d40
movq (%r12), %rax
movsd (%rax), %xmm0
movaps %xmm0, 0x40(%rsp)
addq $0x1e0, %r15            # imm = 0x1E0
movq %r15, %rdi
movq %r14, %rsi
callq 0x43dfa
movq (%rax), %rax
movsd (%rax), %xmm0
movaps %xmm0, 0x30(%rsp)
movq (%r12), %rax
movsd 0x8(%rax), %xmm0
movaps %xmm0, 0x20(%rsp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x43dfa
movq (%rax), %rax
movsd 0x8(%rax), %xmm0
movaps %xmm0, 0x10(%rsp)
movq (%r12), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x43dfa
movapd 0x40(%rsp), %xmm0
unpcklpd 0x20(%rsp), %xmm0       # xmm0 = xmm0[0],mem[0]
movapd 0x30(%rsp), %xmm1
unpcklpd 0x10(%rsp), %xmm1       # xmm1 = xmm1[0],mem[0]
movq (%rax), %rax
movsd 0x8(%rsp), %xmm2
mulsd 0x10(%rax), %xmm2
mulpd %xmm0, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
addsd %xmm2, %xmm0
movq (%rbx), %rax
divsd %xmm0, %xmm2
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
divpd %xmm0, %xmm1
movupd %xmm1, (%rax)
movsd %xmm2, 0x10(%rax)
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x42fd9
jmp 0x42fd9
jmp 0x42fd9
movq %rax, %r14
movq %rbx, %rdi
callq 0x2b43c
movq %r14, %rdi
callq 0x8870
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_utils.cpp
// Function: GeneralSetCounts::setHWEpriorsFromAFfromGT()
void GeneralSetCounts::setHWEpriorsFromAFfromGT() {
    double AF;
    // Alternative allele frequencies
    for(std::map<string,double>::iterator it = setAAFs.begin(); it != setAAFs.end(); ++it) {
        if (it->second >= 0) AF = it->second; else AF = averageAAF; // This should be average of AFs across populations where it is known
        setHWEpriorsFromAAFfromGT[it->first][0] = pow((1-AF),2);
        setHWEpriorsFromAAFfromGT[it->first][1] = AF*(1-AF);
        setHWEpriorsFromAAFfromGT[it->first][2] = pow(AF,2);
    }
    // Derived allele frequencies
    for(std::map<string,double>::iterator it = setDAFs.begin(); it != setDAFs.end(); ++it) {
        if (it->second >= 0) AF = it->second; else AF = averageDAF; // This should be average of AFs across populations
        setHWEpriorsFromDAFfromGT[it->first][0] = pow((1-AF),2);
        setHWEpriorsFromDAFfromGT[it->first][1] = AF*(1-AF);
        setHWEpriorsFromDAFfromGT[it->first][2] = pow(AF,2);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movq 0xf8(%rdi), %r15
leaq 0xe8(%rdi), %r13
leaq 0x1e0(%rdi), %r14
cmpq %r13, %r15
je 0x430de
leaq 0x20(%r15), %r12
movsd 0x40(%r15), %xmm0
xorpd %xmm2, %xmm2
cmpnlesd %xmm0, %xmm2
movsd 0x110(%rbx), %xmm1
andpd %xmm2, %xmm1
andnpd %xmm0, %xmm2
orpd %xmm1, %xmm2
movapd %xmm2, 0x10(%rsp)
movsd 0x545a1(%rip), %xmm0    # 0x975f0
subsd %xmm2, %xmm0
movsd %xmm0, 0x8(%rsp)
mulsd %xmm0, %xmm0
movsd %xmm0, 0x28(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x43dfa
movq (%rax), %rax
movsd 0x28(%rsp), %xmm0
movsd %xmm0, (%rax)
movsd 0x8(%rsp), %xmm0
mulsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x43dfa
movq (%rax), %rax
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rax)
movapd 0x10(%rsp), %xmm0
mulsd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x43dfa
movq (%rax), %rax
movaps 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rax)
movq %r15, %rdi
callq 0x8340
movq %rax, %r15
jmp 0x43011
movq 0x130(%rbx), %r15
leaq 0x120(%rbx), %r13
leaq 0x210(%rbx), %r14
cmpq %r13, %r15
je 0x431c0
leaq 0x20(%r15), %r12
movsd 0x40(%r15), %xmm0
xorpd %xmm2, %xmm2
cmpnlesd %xmm0, %xmm2
movsd 0x148(%rbx), %xmm1
andpd %xmm2, %xmm1
andnpd %xmm0, %xmm2
orpd %xmm1, %xmm2
movapd %xmm2, 0x10(%rsp)
movsd 0x544bf(%rip), %xmm0    # 0x975f0
subsd %xmm2, %xmm0
movsd %xmm0, 0x8(%rsp)
mulsd %xmm0, %xmm0
movsd %xmm0, 0x28(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x43dfa
movq (%rax), %rax
movsd 0x28(%rsp), %xmm0
movsd %xmm0, (%rax)
movsd 0x8(%rsp), %xmm0
mulsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x43dfa
movq (%rax), %rax
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rax)
movapd 0x10(%rsp), %xmm0
mulsd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x43dfa
movq (%rax), %rax
movaps 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rax)
movq %r15, %rdi
callq 0x8340
movq %rax, %r15
jmp 0x430f3
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_utils.cpp
// Function: GeneralSetCounts::checkForGenotypeLikelihoodsOrProbabilities(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&)
int GeneralSetCounts::checkForGenotypeLikelihoodsOrProbabilities(const std::vector<std::string>& vcfLineFields) {
    std::vector<std::string> format = split(vcfLineFields[8], ':');
    if (format.size() == 1) return LikelihoodsProbabilitiesAbsent; // The GT tag must be present in the first place
    
    int likelihoodsOrProbabilitiesTagPosition = returnFormatTagPosition(format, "GP");
    if (likelihoodsOrProbabilitiesTagPosition != std::numeric_limits<int>::min()) { likelihoodsProbabilitiesType = LikelihoodsProbabilitiesGP; }
    else {
        likelihoodsOrProbabilitiesTagPosition = returnFormatTagPosition(format, "GL");
        if (likelihoodsOrProbabilitiesTagPosition != std::numeric_limits<int>::min()) { likelihoodsProbabilitiesType = LikelihoodsProbabilitiesGL; }
        else {
            likelihoodsOrProbabilitiesTagPosition = returnFormatTagPosition(format, "PL");
            if (likelihoodsOrProbabilitiesTagPosition != std::numeric_limits<int>::min()) { likelihoodsProbabilitiesType = LikelihoodsProbabilitiesPL; }
        }
    }
    return likelihoodsOrProbabilitiesTagPosition;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
movl $0x100, %eax            # imm = 0x100
addq (%rsi), %rax
leaq 0x28(%rsp), %r14
pushq $0x3a
popq %rdx
movq %r14, %rdi
movq %rax, %rsi
callq 0x40349
movq 0x8(%r14), %rax
subq (%r14), %rax
xorl %ebp, %ebp
cmpq $0x20, %rax
je 0x436a0
leaq 0x5bd6b(%rip), %rsi     # 0x9f351
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x21904
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x4357e
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
callq 0x8978
movl %ebp, %eax
negl %eax
jno 0x43693
leaq 0x5bd37(%rip), %rsi     # 0x9f354
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x21904
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x4357e
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
callq 0x8978
movl %ebp, %eax
negl %eax
jno 0x43697
leaq 0x5bd03(%rip), %rsi     # 0x9f357
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x21904
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x4357e
movl %eax, %r14d
leaq 0x8(%rsp), %rdi
callq 0x8978
movl $0x80000000, %ebp       # imm = 0x80000000
movl %r14d, %eax
negl %eax
jo 0x436a0
pushq $0x3
popq %rax
movl %r14d, %ebp
jmp 0x4369a
pushq $0x1
jmp 0x43699
pushq $0x2
popq %rax
movl %eax, 0x1d8(%rbx)
leaq 0x28(%rsp), %rdi
callq 0x28a08
movl %ebp, %eax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x436bd
jmp 0x436cc
jmp 0x436bd
jmp 0x436cc
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x8978
jmp 0x436cf
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x28a08
movq %rbx, %rdi
callq 0x8870
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_utils.cpp
// Function: finalize_diffs_Hets_vs_Homs_proportions(std::vector<std::vector<double, std::allocator<double>>, std::allocator<std::vector<double, std::allocator<double>>>>&)
void finalize_diffs_Hets_vs_Homs_proportions(std::vector<std::vector<double> >& diffs_Hets_vs_Homs){
    for (std::vector<std::vector<int> >::size_type i = 0; i < diffs_Hets_vs_Homs.size(); i++) {
        for (int j = 0; j < i; j++) {
            diffs_Hets_vs_Homs[i][j] = (diffs_Hets_vs_Homs[i][j]/diffs_Hets_vs_Homs[j][i]);
            diffs_Hets_vs_Homs[j][i] = 0;
        }    
    }
}

// Assembly:
movq (%rdi), %rcx
movq 0x8(%rdi), %rax
subq %rcx, %rax
pushq $0x18
popq %rsi
cqto
idivq %rsi
xorl %edx, %edx
cmpq %rax, %rdx
je 0x43737
imulq $0x18, %rdx, %rsi
addq %rcx, %rsi
movq %rcx, %rdi
xorl %r8d, %r8d
cmpq %r8, %rdx
je 0x43732
movq (%rsi), %r9
movsd (%r9,%r8,8), %xmm0
movq (%rdi), %r10
divsd (%r10,%rdx,8), %xmm0
movsd %xmm0, (%r9,%r8,8)
andq $0x0, (%r10,%rdx,8)
incq %r8
addq $0x18, %rdi
jmp 0x43707
incq %rdx
jmp 0x436f5
retq
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/./process_vcf_stats_utils.h
// Function: pearson_chi_sq_goodness_of_fit(std::vector<double, std::allocator<double>>, std::vector<double, std::allocator<double>>, int, bool)
inline double pearson_chi_sq_goodness_of_fit(std::vector<double> observed, std::vector<double> expected, int df, bool lowerTail = true) {
    assert(observed.size() == expected.size());
    double chi_sq = 0;
    // Sum:
    for (int i = 0; i < (int)observed.size(); i++) {
        chi_sq = chi_sq + (pow((observed[i]-expected[i]),2)/expected[i]);
    }
    
    double p = chisq_cdf(df, chi_sq);
    if (lowerTail)
        p = 1-p;
    
    return p;
}

// Assembly:
pushq %rbx
movl %ecx, %ebx
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
subq %rax, %rcx
movq (%rsi), %rdi
movq 0x8(%rsi), %rsi
subq %rdi, %rsi
cmpq %rsi, %rcx
jne 0x4399a
shrq $0x3, %rcx
xorl %esi, %esi
testl %ecx, %ecx
cmovlel %esi, %ecx
xorpd %xmm1, %xmm1
cmpq %rsi, %rcx
je 0x4397b
movsd (%rax,%rsi,8), %xmm0
movsd (%rdi,%rsi,8), %xmm2
subsd %xmm2, %xmm0
mulsd %xmm0, %xmm0
divsd %xmm2, %xmm0
addsd %xmm0, %xmm1
incq %rsi
jmp 0x43957
cvtsi2sd %edx, %xmm0
callq 0x43f6f
testb %bl, %bl
je 0x43998
movsd 0x53c60(%rip), %xmm1    # 0x975f0
subsd %xmm0, %xmm1
movapd %xmm1, %xmm0
popq %rbx
retq
leaq 0x5b9b9(%rip), %rdi     # 0x9f35a
leaq 0x5b9d5(%rip), %rsi     # 0x9f37d
leaq 0x5b9ea(%rip), %rcx     # 0x9f399
movl $0x99, %edx
callq 0x82f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_IUPAC.cpp
// Function: reverseComplementIUPAC(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::string reverseComplementIUPAC(const std::string& seq)
{
    std::string out(seq.length(), 'A');
    int last_pos = (int)seq.length() - 1;
    for(int i = last_pos; i >= 0; --i)
    {
        out[last_pos - i] = complementIUPAC(seq[i]);
    }
    return out;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rsi
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
pushq $0x41
popq %rdx
callq 0x8500
movl 0x8(%r14), %eax
decl %eax
movslq %eax, %r15
xorl %r12d, %r12d
testq %r15, %r15
js 0x4660a
movq (%r14), %rax
movsbl (%rax,%r15), %edi
callq 0x46619
movq (%rbx), %rcx
movb %al, (%rcx,%r12)
decq %r15
incq %r12
jmp 0x465e9
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_IUPAC.cpp
// Function: complementIUPAC(char)
char complementIUPAC(char c)
{
    char cmp = '\0';
    bool is_lc = std::islower(c);
    
    switch(std::toupper(c)) {
        case 'A': cmp = 'T'; break;
        case 'C': cmp = 'G'; break;
        case 'G': cmp = 'C'; break;
        case 'T': cmp = 'A'; break;
        case 'M': cmp = 'K'; break;
        case 'R': cmp = 'Y'; break;
        case 'W': cmp = 'W'; break;
        case 'S': cmp = 'S'; break;
        case 'Y': cmp = 'R'; break;
        case 'K': cmp = 'M'; break;
        case 'V': cmp = 'B'; break;
        case 'H': cmp = 'D'; break;
        case 'D': cmp = 'H'; break;
        case 'B': cmp = 'V'; break;
        case 'N': cmp = 'N'; break;
        default:
            assert(false);
    }
    
    if(is_lc)
        cmp = std::tolower(cmp);
    return cmp;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebp
callq 0x85a0
movl %eax, %ebx
movl %ebp, %edi
callq 0x88b0
addl $-0x41, %eax
cmpl $0x19, %eax
jae 0x4665d
movl $0x16e34cf, %ecx        # imm = 0x16E34CF
btl %eax, %ecx
jae 0x4665d
movl %eax, %eax
leaq 0x599c2(%rip), %rcx     # 0xa0009
movb (%rax,%rcx), %al
testl %ebx, %ebx
je 0x46656
movzbl %al, %edi
callq 0x8660
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x57a89(%rip), %rdi     # 0x9e0ed
leaq 0x5996b(%rip), %rsi     # 0x9ffd6
leaq 0x5997a(%rip), %rcx     # 0x9ffec
pushq $0x32
popq %rdx
callq 0x82f0
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_annotation_tools.cpp
// Function: getIndividualSequenceForThisRegion(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::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::string getIndividualSequenceForThisRegion(const std::vector<std::string>& thisRegionAnnotation, const std::string& strand, const std::string& currentIndividualWholeScaffoldSequence) {
    string geneSeq = "";
    for (std::vector<std::string>::size_type j = 0; j != thisRegionAnnotation.size(); j++) {
        std::vector<string> annotLineVec = split(thisRegionAnnotation[j], '\t');
        geneSeq = geneSeq + currentIndividualWholeScaffoldSequence.substr(atoi(annotLineVec[1].c_str())-1,atoi(annotLineVec[2].c_str())-atoi(annotLineVec[1].c_str()) + 1);
    }
    if (strand == "-")
        geneSeq = reverseComplementIUPAC(geneSeq);
    
    return geneSeq;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rcx, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdi, %r15
leaq 0x5351d(%rip), %rsi     # 0x99e1f
leaq 0x48(%rsp), %r12
movq %r12, %rdx
callq 0x21904
xorl %ecx, %ecx
leaq 0x30(%rsp), %rbp
leaq 0x68(%rsp), %rbx
xorl %edx, %edx
movq %r15, (%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %rax, %rdx
je 0x469df
movq %rdx, 0x20(%rsp)
movq %rcx, 0x28(%rsp)
addq %rcx, %rsi
movq %rbp, %r13
movq %rbp, %rdi
pushq $0x9
popq %rdx
callq 0x40349
movq 0x30(%rsp), %r14
movq 0x20(%r14), %rdi
callq 0x86f0
movl %eax, %r15d
leal -0x1(%r15), %eax
movslq %eax, %rbp
movq 0x40(%r14), %rdi
callq 0x86f0
subl %r15d, %eax
incl %eax
movslq %eax, %rcx
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
movq %rbp, %rdx
callq 0x84b0
movq %r12, %rdi
movq (%rsp), %r15
movq %r15, %rsi
movq %rbx, %rdx
callq 0x28aaf
movq %r13, %rbp
movq %r15, %rdi
movq %r12, %rsi
callq 0x8550
movq %r12, %rdi
callq 0x8978
movq %rbx, %rdi
callq 0x8978
movq %r13, %rdi
callq 0x28a08
movq 0x20(%rsp), %rdx
incq %rdx
movq 0x28(%rsp), %rcx
addq $0x20, %rcx
jmp 0x46921
leaq 0x5206a(%rip), %rsi     # 0x98a50
movq 0x8(%rsp), %rdi
callq 0x2193f
testb %al, %al
je 0x46a19
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
callq 0x465bc
leaq 0x48(%rsp), %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x8550
movq %r14, %rdi
callq 0x8978
movq %r15, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x46a30
movq %rax, %r14
jmp 0x46a51
movq %rax, %r14
jmp 0x46a47
movq %rax, %r14
leaq 0x68(%rsp), %rdi
callq 0x8978
leaq 0x30(%rsp), %rdi
callq 0x28a08
movq (%rsp), %rdi
callq 0x8978
movq %r14, %rdi
callq 0x8870
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_annotation_tools.cpp
// Function: getReferenceForThisRegion(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::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::string getReferenceForThisRegion(const std::vector<std::string>& thisRegionAnnotation, const std::string& strand, const std::string& currentScaffoldReference) {
    // std::cerr << "generating gene refseq" << std::endl;
    std::string refSeq = "";
    for (std::vector<std::string>::size_type j = 0; j != thisRegionAnnotation.size(); j++) {
        std::vector<string> annotLineVec = split(thisRegionAnnotation[j], '\t');
        refSeq = refSeq + currentScaffoldReference.substr(atoi(annotLineVec[1].c_str())-1,atoi(annotLineVec[2].c_str())-atoi(annotLineVec[1].c_str()) + 1);
    }
    if (strand == "-")
        refSeq = reverseComplementIUPAC(refSeq);
    // std::cerr << "Done" << std::endl;
    return refSeq;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rcx, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdi, %r15
leaq 0x53393(%rip), %rsi     # 0x99e1f
leaq 0x48(%rsp), %r12
movq %r12, %rdx
callq 0x21904
xorl %ecx, %ecx
leaq 0x30(%rsp), %rbp
leaq 0x68(%rsp), %rbx
xorl %edx, %edx
movq %r15, (%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rax
subq %rsi, %rax
sarq $0x5, %rax
cmpq %rax, %rdx
je 0x46b69
movq %rdx, 0x20(%rsp)
movq %rcx, 0x28(%rsp)
addq %rcx, %rsi
movq %rbp, %r13
movq %rbp, %rdi
pushq $0x9
popq %rdx
callq 0x40349
movq 0x30(%rsp), %r14
movq 0x20(%r14), %rdi
callq 0x86f0
movl %eax, %r15d
leal -0x1(%r15), %eax
movslq %eax, %rbp
movq 0x40(%r14), %rdi
callq 0x86f0
subl %r15d, %eax
incl %eax
movslq %eax, %rcx
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
movq %rbp, %rdx
callq 0x84b0
movq %r12, %rdi
movq (%rsp), %r15
movq %r15, %rsi
movq %rbx, %rdx
callq 0x28aaf
movq %r13, %rbp
movq %r15, %rdi
movq %r12, %rsi
callq 0x8550
movq %r12, %rdi
callq 0x8978
movq %rbx, %rdi
callq 0x8978
movq %r13, %rdi
callq 0x28a08
movq 0x20(%rsp), %rdx
incq %rdx
movq 0x28(%rsp), %rcx
addq $0x20, %rcx
jmp 0x46aab
leaq 0x51ee0(%rip), %rsi     # 0x98a50
movq 0x8(%rsp), %rdi
callq 0x2193f
testb %al, %al
je 0x46ba3
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
callq 0x465bc
leaq 0x48(%rsp), %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x8550
movq %r14, %rdi
callq 0x8978
movq %r15, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x46bba
movq %rax, %r14
jmp 0x46bdb
movq %rax, %r14
jmp 0x46bd1
movq %rax, %r14
leaq 0x68(%rsp), %rdi
callq 0x8978
leaq 0x30(%rsp), %rdi
callq 0x28a08
movq (%rsp), %rdi
callq 0x8978
movq %r14, %rdi
callq 0x8870
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_print_routines.cpp
// Function: print_doubleton_distribution(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, 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::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>&)
void print_doubleton_distribution(const string& fileRoot, const std::vector<std::string>& header, std::vector<std::vector<int> >& doubletons) {
    rearrange_doubletons(doubletons);
    std::ios_base::openmode mode_out = std::ios_base::out;
    string doubletonFileName = fileRoot + ".doubletons.txt";
    std::ofstream* pDoubletonOutFile = new std::ofstream(doubletonFileName.c_str(), mode_out);
    *pDoubletonOutFile << "# Doubleton distribution:" << fileRoot << ".vcf" << std::endl;
    *pDoubletonOutFile << "# Input file:" << fileRoot << ".vcf" << std::endl;
    
    // Print the doubletons matrix
    print_vector(header,*pDoubletonOutFile);
    print_matrix<std::vector<std::vector<int> >&>(doubletons, *pDoubletonOutFile);
    
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movq %rdx, %rdi
callq 0x421e7
leaq 0x58802(%rip), %rdx     # 0xa0031
leaq 0x18(%rsp), %rdi
movq %r12, %rsi
callq 0x28806
movl $0x200, %edi            # imm = 0x200
callq 0x8490
movq %rax, %r14
movq 0x18(%rsp), %rsi
pushq $0x10
popq %rdx
movq %rax, %rdi
callq 0x84e0
leaq 0x587e1(%rip), %rsi     # 0xa0041
movq %r14, %rdi
callq 0x8480
movq %rax, %rdi
movq %r12, %rsi
callq 0x8430
leaq 0x62a26(%rip), %rsi     # 0xaa2a0
movq %rax, %rdi
callq 0x8480
movq %rax, %rdi
callq 0x8230
leaq 0x587ca(%rip), %rsi     # 0xa005b
movq %r14, %rdi
callq 0x8480
movq %rax, %rdi
movq %r12, %rsi
callq 0x8430
leaq 0x629f5(%rip), %rsi     # 0xaa2a0
movq %rax, %rdi
callq 0x8480
movq %rax, %rdi
callq 0x8230
movq %rsp, %rdi
movq %r15, %rsi
callq 0x297dc
movq %rsp, %rdi
pushq $0x9
popq %rdx
pushq $0x1
popq %rcx
movq %r14, %rsi
callq 0x2ea24
movq %rsp, %rdi
callq 0x28a08
movq %rbx, %rdi
movq %r14, %rsi
callq 0x48828
leaq 0x18(%rsp), %rdi
callq 0x8978
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x28a08
jmp 0x47922
movq %rax, %rbx
movl $0x200, %esi            # imm = 0x200
movq %r14, %rdi
callq 0x84a0
jmp 0x47922
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x8978
movq %rbx, %rdi
callq 0x8870
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_stats_functions.cpp
// Function: het_analysis(std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&, FilterResult&)
void het_analysis(std::vector<int>& hetCounts, std::vector<int>& sharedHetCounts, FilterResult& result) {
    for (std::vector<int>::size_type i = 0; i < hetCounts.size(); i++) {
        if (result.counts.individualsWithVariant[i] == 1) {
            hetCounts[i]++;
            if (result.counts.overall > 1) {
                sharedHetCounts[i]++;
            }
        }
    }
}

// Assembly:
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
movq 0x78(%rdx), %rdi
movq (%rsi), %rsi
xorl %r8d, %r8d
cmpq %rcx, %r8
jae 0x4b9e3
cmpl $0x1, (%rdi,%r8,4)
jne 0x4b9de
incl (%rax,%r8,4)
cmpl $0x2, 0x8(%rdx)
jl 0x4b9de
incl (%rsi,%r8,4)
incq %r8
jmp 0x4b9c4
retq
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_stats_functions.cpp
// Function: initialisePopulationMap(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>>>>, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>&)
std::vector<string> initialisePopulationMap(const std::vector<std::string> populations, std::map<std::string,int>& fp_map) {
    std::vector<std::string> pop_unique = populations;
    std::sort(pop_unique.begin(), pop_unique.end());
    std::vector<std::string>::iterator it = std::unique(pop_unique.begin(), pop_unique.end());
    pop_unique.resize(std::distance(pop_unique.begin(), it));
    std::vector<std::string>::size_type n_pop = pop_unique.size();
    // Initialize fields to populations map
    for (int i = 0; i < n_pop; i++) {
        fp_map[pop_unique[i]] = i;
    }
    std::cerr << "Initialised the population map; there are " << n_pop << " populations" << std::endl;
    return pop_unique;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rdi, %rbx
callq 0x297dc
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
callq 0x4c811
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
callq 0x4cf50
subq (%rbx), %rax
sarq $0x5, %rax
movq %rbx, %rdi
movq %rax, %rsi
callq 0x34872
movq 0x8(%rbx), %r15
subq (%rbx), %r15
sarq $0x5, %r15
xorl %r12d, %r12d
xorl %r13d, %r13d
cmpq %r13, %r15
je 0x4ba52
movq (%rbx), %rsi
addq %r12, %rsi
movq %r14, %rdi
callq 0x32a8a
movl %r13d, (%rax)
incq %r13
addq $0x20, %r12
jmp 0x4ba33
movq 0x9158f(%rip), %rdi     # 0xdcfe8
leaq 0x55940(%rip), %rsi     # 0xa13a0
callq 0x8480
movq %rax, %rdi
movq %r15, %rsi
callq 0x8320
leaq 0x55954(%rip), %rsi     # 0xa13cb
movq %rax, %rdi
callq 0x8480
movq %rax, %rdi
callq 0x8230
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x4ba9a
jmp 0x4ba9a
jmp 0x4ba9a
movq %rax, %r14
movq %rbx, %rdi
callq 0x28a08
movq %r14, %rdi
callq 0x8870
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_stats_functions.cpp
// Function: initializeDoubletons(std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>&, 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>>>>)
void initializeDoubletons(std::vector<std::vector<int> >& d, const std::vector<std::string> populationsUnique) {
    std::vector<std::string>::size_type n_pop = populationsUnique.size();
    
    // Initialize doubletons
    for (int i = 0; i < n_pop; i++) { 
        std::vector<int> v(n_pop,0);
        d.push_back(v);
    }
#ifdef TESTING
    std::cerr << "Doubletons initialised with size: " << n_pop << std::endl;
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x8(%rsi), %r14
subq (%rsi), %r14
sarq $0x5, %r14
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
leaq 0xb(%rsp), %r13
movq %r14, %rbp
subq $0x1, %rbp
jb 0x4bc21
andl $0x0, 0xc(%rsp)
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x438a0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3b5c4
movq %r15, %rdi
callq 0x2aef2
jmp 0x4bbf0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2aef2
movq %rbx, %rdi
callq 0x8870
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_stats_functions.cpp
// Function: diffs_between_H1(std::vector<std::vector<double, std::allocator<double>>, std::allocator<std::vector<double, std::allocator<double>>>>&, FilterResult&)
void diffs_between_H1(std::vector<std::vector<double> >& H1diffs, FilterResult& result) {
    for (std::vector<std::vector<int> >::size_type i = 0; i < H1diffs.size(); i++) {
        for (int j = 0; j < i; j++) {
            const int ind_i = result.counts.haplotypesWithVariant[2*i];
            const int ind_j = result.counts.haplotypesWithVariant[2*j];
            
            if ((ind_i == 1 && ind_j == 0) || (ind_i == 0 && ind_j == 1)) {
                H1diffs[i][j]++;
            } else if ((ind_i == 0 && ind_j == 0) || (ind_i == 1 && ind_j == 1)) { // one is hom for reference allele the other is hom for alternative allele
                
            } else {
                std::cerr << "result.counts.haplotypesWithVariant[" << 2*i << "]=" << result.counts.haplotypesWithVariant[2*i] << std::endl;
                std::cerr << "result.counts.haplotypesWithVariant[" << 2*j << "]=" << result.counts.haplotypesWithVariant[2*j] << std::endl;
                exit(EXIT_FAILURE);
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq (%rdi), %rcx
movq 0x8(%rdi), %rax
subq %rcx, %rax
pushq $0x18
popq %rsi
cqto
idivq %rsi
xorl %edx, %edx
movsd 0x4b046(%rip), %xmm0    # 0x975f0
cmpq %rax, %rdx
je 0x4c629
leaq (%rdx,%rdx), %r15
movq 0xc0(%rbx), %rsi
imulq $0x18, %rdx, %rdi
addq %rcx, %rdi
xorl %r14d, %r14d
movq %rdx, %r8
subq $0x1, %r8
jb 0x4c624
movl (%rsi,%r15,4), %r9d
movl (%rsi,%r14,4), %r10d
cmpl $0x1, %r9d
jne 0x4c5e0
testl %r10d, %r10d
je 0x4c5eb
testl %r9d, %r9d
jne 0x4c604
cmpl $0x1, %r10d
jne 0x4c604
movq (%rdi), %r9
movsd (%r9,%r14,4), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%r9,%r14,4)
addq $0x2, %r14
jmp 0x4c5c7
movl %r10d, %r11d
xorl $0x1, %r11d
movl %r9d, %ebp
xorl $0x1, %ebp
orl %r11d, %ebp
sete %r11b
orl %r10d, %r9d
je 0x4c5fe
testb %r11b, %r11b
jne 0x4c5fe
jmp 0x4c638
incq %rdx
jmp 0x4c5aa
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x909a9(%rip), %r12     # 0xdcfe8
leaq 0x54e79(%rip), %r13     # 0xa14bf
movq %r12, %rdi
movq %r13, %rsi
callq 0x8480
movq %rax, %rdi
movq %r15, %rsi
callq 0x8120
leaq 0x54e81(%rip), %rbp     # 0xa14e4
movq %rax, %rdi
movq %rbp, %rsi
callq 0x8480
movq 0xc0(%rbx), %rcx
movl (%rcx,%r15,4), %esi
movq %rax, %rdi
callq 0x8840
movq %rax, %rdi
callq 0x8230
movq %r12, %rdi
movq %r13, %rsi
callq 0x8480
movq %rax, %rdi
movl %r14d, %esi
callq 0x8840
movq %rax, %rdi
movq %rbp, %rsi
callq 0x8480
movq 0xc0(%rbx), %rcx
movl (%rcx,%r14,4), %esi
movq %rax, %rdi
callq 0x8840
movq %rax, %rdi
callq 0x8230
pushq $0x1
popq %rdi
callq 0x8540
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_stats_functions.cpp
// Function: diffs_between_AllH(std::vector<std::vector<double, std::allocator<double>>, std::allocator<std::vector<double, std::allocator<double>>>>&, FilterResult&)
void diffs_between_AllH(std::vector<std::vector<double> >& AllHdiffs, FilterResult& result) {
    for (std::vector<std::vector<int> >::size_type i = 0; i < AllHdiffs.size(); i++) {
        for (int j = 0; j < i; j++) {
            const int ind_i = result.counts.haplotypesWithVariant[i];
            const int ind_j = result.counts.haplotypesWithVariant[j];
            
            if ((ind_i == 1 && ind_j == 0) || (ind_i == 0 && ind_j == 1)) {
                AllHdiffs[i][j]++;
            } else if ((ind_i == 0 && ind_j == 0) || (ind_i == 1 && ind_j == 1)) { // one is hom for reference allele the other is hom for alternative allele
                
            } else {
                std::cerr << "result.counts.haplotypesWithVariant[" << i << "]=" << result.counts.haplotypesWithVariant[i] << std::endl;
                std::cerr << "result.counts.haplotypesWithVariant[" << j << "]=" << result.counts.haplotypesWithVariant[j] << std::endl;
                exit(EXIT_FAILURE);
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq (%rdi), %rcx
movq 0x8(%rdi), %rax
subq %rcx, %rax
pushq $0x18
popq %rsi
cqto
idivq %rsi
xorl %r15d, %r15d
movsd 0x4aef8(%rip), %xmm0    # 0x975f0
cmpq %rax, %r15
je 0x4c76d
movq 0xc0(%rbx), %rdx
imulq $0x18, %r15, %rsi
addq %rcx, %rsi
xorl %r14d, %r14d
cmpq %r14, %r15
je 0x4c768
movl (%rdx,%r15,4), %edi
movl (%rdx,%r14,4), %r8d
cmpl $0x1, %edi
jne 0x4c725
testl %r8d, %r8d
je 0x4c72f
testl %edi, %edi
jne 0x4c747
cmpl $0x1, %r8d
jne 0x4c747
movq (%rsi), %rdi
movsd (%rdi,%r14,8), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rdi,%r14,8)
incq %r14
jmp 0x4c70e
movl %r8d, %r9d
xorl $0x1, %r9d
movl %edi, %r10d
xorl $0x1, %r10d
orl %r9d, %r10d
sete %r9b
orl %r8d, %edi
je 0x4c742
testb %r9b, %r9b
jne 0x4c742
jmp 0x4c77c
incq %r15
jmp 0x4c6f8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x90865(%rip), %r12     # 0xdcfe8
leaq 0x54d35(%rip), %r13     # 0xa14bf
movq %r12, %rdi
movq %r13, %rsi
callq 0x8480
movq %rax, %rdi
movq %r15, %rsi
callq 0x8120
leaq 0x54d3d(%rip), %rbp     # 0xa14e4
movq %rax, %rdi
movq %rbp, %rsi
callq 0x8480
movq 0xc0(%rbx), %rcx
movl (%rcx,%r15,4), %esi
movq %rax, %rdi
callq 0x8840
movq %rax, %rdi
callq 0x8230
movq %r12, %rdi
movq %r13, %rsi
callq 0x8480
movq %rax, %rdi
movl %r14d, %esi
callq 0x8840
movq %rax, %rdi
movq %rbp, %rsi
callq 0x8480
movq 0xc0(%rbx), %rcx
movl (%rcx,%r14,4), %esi
movq %rax, %rdi
callq 0x8840
movq %rax, %rdi
callq 0x8230
pushq $0x1
popq %rdi
callq 0x8540
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/./process_vcf_utils.h
// Function: MassokoMalawiResult::init(unsigned long)
void init(std::vector<int>::size_type size) {
        absentWithBlue.assign(size, 0);
        hetsWithBlue.assign(size, 0);
        homsWithBlue.assign(size, 0);
        absentWithYellow.assign(size, 0);
        hetsWithYellow.assign(size, 0);
        homsWithYellow.assign(size, 0);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xc(%rsp), %r15
andl $0x0, (%r15)
movq %r15, %rdx
callq 0x44dfe
leaq 0x18(%r14), %rdi
andl $0x0, (%r15)
leaq 0xc(%rsp), %r15
movq %rbx, %rsi
movq %r15, %rdx
callq 0x44dfe
leaq 0x30(%r14), %rdi
andl $0x0, (%r15)
leaq 0xc(%rsp), %r15
movq %rbx, %rsi
movq %r15, %rdx
callq 0x44dfe
leaq 0x48(%r14), %rdi
andl $0x0, (%r15)
leaq 0xc(%rsp), %r15
movq %rbx, %rsi
movq %r15, %rdx
callq 0x44dfe
leaq 0x60(%r14), %rdi
andl $0x0, (%r15)
leaq 0xc(%rsp), %r15
movq %rbx, %rsi
movq %r15, %rdx
callq 0x44dfe
addq $0x78, %r14
andl $0x0, (%r15)
leaq 0xc(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x44dfe
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_massoko.cpp
// Function: initializeCountsBlue(std::map<int, std::vector<int, std::allocator<int>>, std::less<int>, std::allocator<std::pair<int const, std::vector<int, std::allocator<int>>>>>&, int)
void initializeCountsBlue(std::map<int, std::vector<int> >& countsBlue, int numChr) {
    for (int i = opt::min_copies; i <= numChr - opt::min_copies; i++) {
        std::vector<int> v(i+1);
        for (int j = 0; j <= i; j++) { v[j] = 0; }
        countsBlue[i] = v;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %esi, %ebx
movq %rdi, %r14
movl 0x8d6f0(%rip), %ecx     # 0xdd588
leaq 0x8(%rsp), %r15
leaq 0x7(%rsp), %r12
movq %rsp, %r13
movl %ecx, %eax
movl %eax, (%rsp)
movl %ebx, %edx
subl %ecx, %edx
cmpl %edx, %eax
jg 0x4ff06
incl %eax
movslq %eax, %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x50aa4
movq 0x8(%rsp), %rax
xorl %ecx, %ecx
movslq (%rsp), %rdx
cmpq %rdx, %rcx
jg 0x4fedb
andl $0x0, (%rax,%rcx,4)
incq %rcx
jmp 0x4fec9
movq %r14, %rdi
movq %r13, %rsi
callq 0x50af6
movq %rax, %rdi
movq %r15, %rsi
callq 0x2ab5a
movq %r15, %rdi
callq 0x2aef2
movl (%rsp), %eax
incl %eax
movl 0x8d684(%rip), %ecx     # 0xdd588
jmp 0x4fea7
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2aef2
movq %rbx, %rdi
callq 0x8870
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/process_vcf_massoko.cpp
// Function: getNumHets(MassokoFilterResult&)
int getNumHets(MassokoFilterResult& result) {
    int num_hets = 0;
    for (std::vector<std::vector<int> >::size_type i = 0; i < result.counts.individualsWithVariant.size(); i++) {
        if (result.counts.individualsWithVariant[i] == 1)
            num_hets++;
    }
    return num_hets;
}

// Assembly:
movq 0x78(%rdi), %rcx
movq 0x80(%rdi), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
xorl %eax, %eax
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x4ff55
xorl %edi, %edi
cmpl $0x1, (%rcx,%rsi,4)
sete %dil
addl %edi, %eax
incq %rsi
jmp 0x4ff3f
retq
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/./process_vcf_annotation_tools.h
// Function: AccessibleGenome::getAccessibleSeqForScaffold(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string getAccessibleSeqForScaffold(const string& scaffold, const string& fullString) {
        std::vector<std::vector<int> > aGThisSc = BedFeatureMap[scaffold];
        
        string accessibleString; accessibleString.reserve(fullString.length()); accessibleString = "";
        for (std::vector<int>::size_type i = 0; i < aGThisSc[0].size(); i++) {
            accessibleString.append(fullString.substr(aGThisSc[0][i],aGThisSc[1][i]- aGThisSc[0][i]));
        }
        return accessibleString;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %r14
movq %rdi, %rbx
leaq 0x8(%rsi), %rdi
movq %rdx, %rsi
callq 0x3b5f0
movq %rsp, %rdi
movq %rax, %rsi
callq 0x3c304
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x8700
leaq 0x44f2c(%rip), %rsi     # 0x99e1f
movq %rbx, %rdi
callq 0x88f0
xorl %r12d, %r12d
leaq 0x18(%rsp), %r15
movq (%rsp), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq %rdx, %r12
jae 0x54f4c
movslq (%rcx,%r12,4), %rdx
movq 0x18(%rax), %rax
movslq (%rax,%r12,4), %rcx
subq %rdx, %rcx
movq %r15, %rdi
movq %r14, %rsi
callq 0x84b0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8920
movq %r15, %rdi
callq 0x8978
incq %r12
jmp 0x54f03
movq %rsp, %rdi
callq 0x3b73c
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x54f74
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x8978
jmp 0x54f77
movq %rax, %r14
movq %rbx, %rdi
callq 0x8978
movq %rsp, %rdi
callq 0x3b73c
movq %r14, %rdi
callq 0x8870
nop
// File: /workspace/github_cpp_makefile_star2_O2/millanek[P]evo/./process_vcf_seq_utils.h
// Function: appendGenotypeBaseToString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<char, std::allocator<char>> const&, char)
inline void appendGenotypeBaseToString(std::string& toExtend, const std::string& ref, const std::string& alt, const std::vector<char>& genotype, char hetTreatment) {
    if (genotype[0] == '0' && genotype[1] == '0')
        toExtend.append(ref);
    else if (genotype[0] == '1' && genotype[1] == '1')
        toExtend.append(alt);
    else {
        if (hetTreatment == 'r') {
            double rn = ((double) rand() / RAND_MAX);
            if (rn <= 0.5) {
                toExtend.append(ref);
            } else {
                toExtend.append(alt);
            }
        } else if(hetTreatment == 'p') {
            if (genotype[0] == '0')
                toExtend.append(ref);
            if (genotype[0] == '1')
                toExtend.append(alt);
        } else if (hetTreatment == 'i') {
            std::string ambiguityBase = getAmbiguityCode(ref, alt);
            toExtend.append(ambiguityBase);
        } else if (hetTreatment == 'b') {
            if (genotype[1] == '0')
                toExtend.append(ref);
            if (genotype[1] == '1')
                toExtend.append(alt);
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rcx), %rcx
movb (%rcx), %al
cmpb $0x30, %al
jne 0x55397
cmpb $0x30, 0x1(%rcx)
jne 0x553a5
movq %rbx, %rdi
movq %r15, %rsi
jmp 0x5548b
cmpb $0x31, %al
jne 0x553a5
cmpb $0x31, 0x1(%rcx)
je 0x55485
movsbl %r8b, %edx
cmpl $0x62, %edx
je 0x55468
cmpl $0x69, %edx
je 0x553ed
cmpl $0x70, %edx
je 0x55451
cmpl $0x72, %edx
jne 0x5549b
callq 0x8160
cvtsi2sd %eax, %xmm0
divsd 0x3cd46(%rip), %xmm0    # 0x92120
movsd 0x4221e(%rip), %xmm1    # 0x97600
ucomisd %xmm0, %xmm1
jae 0x5538c
jmp 0x55485
leaq 0x28(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x8600
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x8600
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %r12
leaq 0x8(%rsp), %rdx
movq %r12, %rsi
callq 0x4667a
leaq 0x8(%rsp), %rdi
callq 0x8978
leaq 0x28(%rsp), %rdi
callq 0x8978
leaq 0x48(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x8920
leaq 0x48(%rsp), %rdi
callq 0x8978
jmp 0x5549b
cmpb $0x30, %al
jne 0x55481
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8920
movq (%r12), %rax
movb (%rax), %al
jmp 0x55481
movb 0x1(%rcx), %al
cmpb $0x30, %al
jne 0x55481
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8920
movq (%r12), %rax
movb 0x1(%rax), %al
cmpb $0x31, %al
jne 0x5549b
movq %rbx, %rdi
movq %r14, %rsi
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x8920
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x554b8
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x8978
jmp 0x554bb
movq %rax, %rbx
movq %r12, %rdi
callq 0x8978
movq %rbx, %rdi
callq 0x8870