// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
subq %rax, %rcx
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
subq $0x1, %rcx
jb 0x40966
movq (%rax,%rbx,8), %r14
movb (%r14), %r15b
cmpb $0x2e, %r15b
je 0x408b7
cmpb $0x2e, 0x2(%r14)
jne 0x408c0
movl %ebp, (%rdx,%rbx)
movl %ebp, (%rsi,%rbx)
movb (%r14), %r15b
movsbl %r15b, %r13d
movl (%rdi), %r12d
cmpl %r13d, %r12d
je 0x408d6
movsbl 0x2(%r14), %r13d
cmpl %r13d, %r12d
jne 0x408e0
movl $0x1, (%rsi,%rbx)
movb (%r14), %r15b
cmpb $0x2e, %r15b
jne 0x408f0
movl $0x1, (%r11,%rbx,2)
jmp 0x40907
movsbl %r15b, %r15d
cmpl %r15d, (%rdi)
jne 0x40903
movl $0x1, (%r10,%rbx,2)
jmp 0x40907
movl %r15d, (%r9,%rbx,2)
movsbl 0x1(%r14), %r13d
movq %r11, %r15
movl %ebp, %r12d
cmpl $0x2e, %r13d
je 0x4092b
movq %r10, %r15
movl %ebp, %r12d
cmpl %r13d, (%rdi)
je 0x4092b
movsbl 0x2(%r14), %r12d
movq %r9, %r15
movl %r12d, 0x4(%r15,%rbx,2)
cmpl $0x0, (%rsi,%rbx)
je 0x4093f
addq $0x4, %rbx
jmp 0x40899
movb (%r14), %r15b
cmpb 0x2(%r14), %r15b
je 0x40956
movl $0x1, (%r8,%rbx)
cmpl $0x0, (%rsi,%rbx)
jne 0x40936
movb (%r14), %r15b
cmpb 0x2(%r14), %r15b
jne 0x40936
andl $0x0, (%r8,%rbx)
jmp 0x40936
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop