// File: 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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3ffd0
movq %rax, %rcx
movq -0x28(%rbp), %rax
cmpq %rcx, %rax
je 0x7cab7
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x52960
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa670
movsbl (%rax), %eax
cmpl $0x2e, %eax
je 0x7c7a4
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x52960
movq %rax, %rdi
movl $0x2, %esi
callq 0xa670
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x7c7d2
movq -0x20(%rbp), %rdi
addq $0x50, %rdi
movq -0x18(%rbp), %rsi
callq 0x4d100
movq -0x20(%rbp), %rdi
movl $0x1, (%rax)
addq $0x68, %rdi
movq -0x18(%rbp), %rsi
callq 0x4d100
movl $0x1, (%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x52960
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa670
movq -0x20(%rbp), %rcx
movsbl (%rax), %eax
cmpl (%rcx), %eax
je 0x7c81b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x52960
movq %rax, %rdi
movl $0x2, %esi
callq 0xa670
movq -0x20(%rbp), %rcx
movsbl (%rax), %eax
cmpl (%rcx), %eax
jne 0x7c832
movq -0x20(%rbp), %rdi
addq $0x68, %rdi
movq -0x18(%rbp), %rsi
callq 0x4d100
movl $0x1, (%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x52960
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa670
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x7c872
movq -0x20(%rbp), %rdi
addq $0x80, %rdi
movq -0x18(%rbp), %rsi
shlq %rsi
callq 0x4d100
movl $0x1, (%rax)
jmp 0x7c8ef
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x52960
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa670
movq -0x20(%rbp), %rcx
movsbl (%rax), %eax
cmpl (%rcx), %eax
jne 0x7c8b5
movq -0x20(%rbp), %rdi
addq $0x98, %rdi
movq -0x18(%rbp), %rsi
shlq %rsi
callq 0x4d100
movl $0x1, (%rax)
jmp 0x7c8ed
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x52960
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa670
movq -0x20(%rbp), %rdi
movsbl (%rax), %eax
movl %eax, -0x2c(%rbp)
addq $0x38, %rdi
movq -0x18(%rbp), %rsi
shlq %rsi
callq 0x4d100
movl -0x2c(%rbp), %ecx
movl %ecx, (%rax)
jmp 0x7c8ef
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x52960
movq %rax, %rdi
movl $0x1, %esi
callq 0xa670
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x7c937
movq -0x20(%rbp), %rdi
addq $0x80, %rdi
movq -0x18(%rbp), %rsi
shlq %rsi
addq $0x1, %rsi
callq 0x4d100
movl $0x1, (%rax)
jmp 0x7c9be
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x52960
movq %rax, %rdi
movl $0x1, %esi
callq 0xa670
movq -0x20(%rbp), %rcx
movsbl (%rax), %eax
cmpl (%rcx), %eax
jne 0x7c97f
movq -0x20(%rbp), %rdi
addq $0x98, %rdi
movq -0x18(%rbp), %rsi
shlq %rsi
addq $0x1, %rsi
callq 0x4d100
movl $0x1, (%rax)
jmp 0x7c9bc
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x52960
movq %rax, %rdi
movl $0x2, %esi
callq 0xa670
movq -0x20(%rbp), %rdi
movsbl (%rax), %eax
movl %eax, -0x30(%rbp)
addq $0x38, %rdi
movq -0x18(%rbp), %rsi
shlq %rsi
addq $0x1, %rsi
callq 0x4d100
movl -0x30(%rbp), %ecx
movl %ecx, (%rax)
jmp 0x7c9be
movq -0x20(%rbp), %rdi
addq $0x68, %rdi
movq -0x18(%rbp), %rsi
callq 0x4d100
cmpl $0x0, (%rax)
jne 0x7ca31
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x52960
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa670
movsbl (%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x52960
movq %rax, %rdi
movl $0x2, %esi
callq 0xa670
movq %rax, %rcx
movl -0x34(%rbp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x7ca31
movq -0x20(%rbp), %rdi
addq $0x20, %rdi
movq -0x18(%rbp), %rsi
callq 0x4d100
movl $0x1, (%rax)
movq -0x20(%rbp), %rdi
addq $0x68, %rdi
movq -0x18(%rbp), %rsi
callq 0x4d100
cmpl $0x0, (%rax)
jne 0x7caa4
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x52960
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa670
movsbl (%rax), %eax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x52960
movq %rax, %rdi
movl $0x2, %esi
callq 0xa670
movq %rax, %rcx
movl -0x38(%rbp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x7caa4
movq -0x20(%rbp), %rdi
addq $0x20, %rdi
movq -0x18(%rbp), %rsi
callq 0x4d100
movl $0x0, (%rax)
jmp 0x7caa6
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x7c740
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)