// File: 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 %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movb %al, -0x21(%rbp)
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xae8a0
movsbl (%rax), %eax
cmpl $0x30, %eax
jne 0xae33e
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0xae8a0
movsbl (%rax), %eax
cmpl $0x30, %eax
jne 0xae33e
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xac20
jmp 0xae54c
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xae8a0
movsbl (%rax), %eax
cmpl $0x31, %eax
jne 0xae37b
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0xae8a0
movsbl (%rax), %eax
cmpl $0x31, %eax
jne 0xae37b
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xac20
jmp 0xae54a
movsbl -0x21(%rbp), %eax
cmpl $0x72, %eax
jne 0xae3ce
callq 0xa180
cvtsi2sd %eax, %xmm0
movsd 0x8cd93(%rip), %xmm1    # 0x13b128
divsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd 0x7fd62(%rip), %xmm0    # 0x12e108
ucomisd -0x30(%rbp), %xmm0
jb 0xae3bc
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xac20
jmp 0xae3c9
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xac20
jmp 0xae548
movsbl -0x21(%rbp), %eax
cmpl $0x70, %eax
jne 0xae420
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xae8a0
movsbl (%rax), %eax
cmpl $0x30, %eax
jne 0xae3f9
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xac20
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xae8a0
movsbl (%rax), %eax
cmpl $0x31, %eax
jne 0xae41b
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xac20
jmp 0xae546
movsbl -0x21(%rbp), %eax
cmpl $0x69, %eax
jne 0xae4f1
movq -0x10(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0xa250
movq -0x18(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0xa250
jmp 0xae44c
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0x90(%rbp), %rdx
callq 0x8e990
jmp 0xae462
leaq -0x90(%rbp), %rdi
callq 0xac88
leaq -0x70(%rbp), %rdi
callq 0xac88
movq -0x8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xac20
jmp 0xae486
leaq -0x50(%rbp), %rdi
callq 0xac88
jmp 0xae544
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0xae4c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0xac88
leaq -0x70(%rbp), %rdi
callq 0xac88
jmp 0xae555
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xac88
jmp 0xae555
movsbl -0x21(%rbp), %eax
cmpl $0x62, %eax
jne 0xae542
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0xae8a0
movsbl (%rax), %eax
cmpl $0x30, %eax
jne 0xae51d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xac20
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0xae8a0
movsbl (%rax), %eax
cmpl $0x31, %eax
jne 0xae540
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xac20
jmp 0xae542
jmp 0xae544
jmp 0xae546
jmp 0xae548
jmp 0xae54a
jmp 0xae54c
addq $0xa0, %rsp
popq %rbp
retq
movq -0x98(%rbp), %rdi
callq 0xab50
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)