// File: /workspace/github_cpp_makefile_star2_O3/millanek[P]evo/process_vcf_utils.cpp
// Function: MultiallelicCounts::getMultiallelicCounts(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&)
void MultiallelicCounts::getMultiallelicCounts(const std::vector<std::string>& genotypes) {
    
  /*  std::cerr << "genotypes.size(): " << genotypes.size() << std::endl;
    std::cerr << "missingIndividualsDot.size(): " << missingIndividualsDot.size() << std::endl;
    std::cerr << "missingIndividualsAny.size(): " << missingIndividualsAny.size() << std::endl;
    std::cerr << "missingHaplotypesDot.size(): " << missingHaplotypesDot.size() << std::endl;
    std::cerr << "starpos: " << starPos << std::endl;
   */
    
    for (std::vector<std::string>::size_type i = 0; i != genotypes.size(); i++) {
     //   std::cerr << "genotypes[i]: " << genotypes[i] << std::endl;
        
        
        if (genotypes[i][0] == '.' || genotypes[i][2] == '.') { missingIndividualsDot[i] = 1; missingIndividualsAny[i] = 1; }
     //   std::cerr << "Missing individuals assigned: " << std::endl;
        if (genotypes[i][0] == starPos || genotypes[i][2] == starPos) missingIndividualsAny[i] = 1;
          
        if (genotypes[i][0] == '.') { missingHaplotypesDot[2*i] = 1;}
        else if (genotypes[i][0] == starPos) { missingHaplotypesStar[2*i] = 1; }
        else haplotypeVariants[2*i] = genotypes[i][0];
        
        if (genotypes[i][1] == '.')  { missingHaplotypesDot[(2*i)+1] = 1;}
        else if (genotypes[i][1] == starPos) { missingHaplotypesStar[(2*i)+1] = 1; }
        else haplotypeVariants[(2*i)+1] = genotypes[i][2];
        
        if (missingIndividualsAny[i] == 0 && genotypes[i][0] != genotypes[i][2]) {
            individualsHets[i] = 1;
        }
        
        if (missingIndividualsAny[i] == 0 && genotypes[i][0] == genotypes[i][2]) {
            individualsHets[i] = 0;
        }
        
    }
}

// Assembly:
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
subq %rax, %rcx
je 0x4df05
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
sarq $0x5, %rcx
movq 0x50(%rdi), %rdx
movq 0x68(%rdi), %rsi
movq 0x20(%rdi), %r8
movq 0x38(%rdi), %r9
movq 0x98(%rdi), %r10
movq 0x80(%rdi), %r11
xorl %ebx, %ebx
movl $0x1, %ebp
movq (%rax,%rbx,8), %r14
movb (%r14), %r15b
cmpb $0x2e, %r15b
je 0x4de41
cmpb $0x2e, 0x2(%r14)
jne 0x4de4a
movl %ebp, (%rdx,%rbx)
movl %ebp, (%rsi,%rbx)
movb (%r14), %r15b
movsbl %r15b, %r13d
movl (%rdi), %r12d
cmpl %r13d, %r12d
je 0x4de60
movsbl 0x2(%r14), %r13d
cmpl %r13d, %r12d
jne 0x4de6a
movl $0x1, (%rsi,%rbx)
movb (%r14), %r15b
cmpb $0x2e, %r15b
jne 0x4de7a
movl $0x1, (%r11,%rbx,2)
jmp 0x4de91
movsbl %r15b, %r15d
cmpl %r15d, (%rdi)
jne 0x4de8d
movl $0x1, (%r10,%rbx,2)
jmp 0x4de91
movl %r15d, (%r9,%rbx,2)
movsbl 0x1(%r14), %r13d
movl $0x1, %r15d
cmpl $0x2e, %r13d
jne 0x4dea7
movq %r11, %r12
jmp 0x4deb7
movq %r10, %r12
cmpl %r13d, (%rdi)
je 0x4deb7
movsbl 0x2(%r14), %r15d
movq %r9, %r12
movl %r15d, 0x4(%r12,%rbx,2)
cmpl $0x0, (%rsi,%rbx)
je 0x4ded1
addq $0x4, %rbx
decq %rcx
jne 0x4de2d
jmp 0x4defb
movb (%r14), %r15b
cmpb 0x2(%r14), %r15b
je 0x4dee8
movl $0x1, (%r8,%rbx)
cmpl $0x0, (%rsi,%rbx)
jne 0x4dec2
movb (%r14), %r15b
cmpb 0x2(%r14), %r15b
jne 0x4dec2
movl $0x0, (%r8,%rbx)
jmp 0x4dec2
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq