// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/vcf.c
// Function: bcf_set_variant_types
static int bcf_set_variant_types(bcf1_t *b)
{
    if ( !(b->unpacked & BCF_UN_STR) ) bcf_unpack(b, BCF_UN_STR);
    bcf_dec_t *d = &b->d;
    if ( d->n_var < b->n_allele )
    {
        bcf_variant_t *new_var = realloc(d->var, sizeof(bcf_variant_t)*b->n_allele);
        if (!new_var)
            return -1;
        d->var = new_var;
        d->n_var = b->n_allele;
    }
    int i;
    b->d.var_type = 0;
    d->var[0].type = VCF_REF;
    d->var[0].n    = 0;
    for (i=1; i<b->n_allele; i++)
    {
        bcf_set_variant_type(d->allele[0],d->allele[i], &d->var[i]);
        b->d.var_type |= d->var[i].type;
        //fprintf(stderr,"[set_variant_type] %d   %s %s -> %d %d .. %d\n", b->pos+1,d->allele[0],d->allele[i],d->var[i].type,d->var[i].n, b->d.var_type);
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
testb $0x1, 0xbc(%rdi)
jne 0x2e463
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2b198
movl 0x18(%rbx), %esi
shrl $0x10, %esi
movq 0xa0(%rbx), %r12
cmpl %esi, 0xa8(%rbx)
jge 0x2e4a0
shll $0x3, %esi
movq %r12, %rdi
callq 0x4860
testq %rax, %rax
je 0x2e881
movq %rax, %r12
movq %rax, 0xa0(%rbx)
movzwl 0x1a(%rbx), %eax
movl %eax, 0xa8(%rbx)
andl $0x0, 0xac(%rbx)
andq $0x0, (%r12)
pushq $0x1
popq %r13
pushq $0x10
popq %r15
xorl %ebp, %ebp
movq %rbx, 0x8(%rsp)
movq %r12, 0x18(%rsp)
movzwl 0x1a(%rbx), %eax
cmpq %rax, %r13
jae 0x2e870
movq 0x88(%rbx), %rax
movq (%rax), %rcx
movq (%rax,%r13,8), %r14
movzbl (%r14), %eax
cmpl $0x2a, %eax
jne 0x2e4eb
cmpb $0x0, 0x1(%r14)
je 0x2e51b
cmpb $0x0, 0x1(%rcx)
jne 0x2e4fc
cmpb $0x0, 0x1(%r14)
je 0x2e5d4
cmpl $0x3c, %eax
je 0x2e527
cmpl $0x5b, %eax
je 0x2e50b
cmpl $0x5d, %eax
jne 0x2e56b
movl $0x10, (%r12,%r13,8)
movl %r15d, %eax
jmp 0x2e7a1
movq $0x20, (%r12,%r13,8)
pushq $0x20
jmp 0x2e565
movzbl 0x1(%r14), %eax
cmpl $0x2a, %eax
je 0x2e536
cmpl $0x58, %eax
jne 0x2e541
cmpb $0x3e, 0x2(%r14)
je 0x2e5e6
incq %r14
leaq 0x598bc(%rip), %rdi     # 0x87e07
movq %r14, %rsi
callq 0x46e0
testl %eax, %eax
je 0x2e5e6
movl $0x8, (%r12,%r13,8)
pushq $0x8
popq %rax
jmp 0x2e7a1
movq %r13, 0x10(%rsp)
movl %ebp, (%rsp)
leaq -0x1(%rcx), %r15
leaq -0x1(%r14), %rbx
xorl %edx, %edx
xorl %r13d, %r13d
movb (%rcx), %al
movb (%r14,%rdx), %r12b
testb %al, %al
je 0x2e5f2
testb %r12b, %r12b
je 0x2e621
movq %rdx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
movsbl %al, %edi
callq 0x31729
movl %eax, %ebp
movsbl %r12b, %edi
callq 0x31729
cmpb %al, %bpl
jne 0x2e653
movq 0x20(%rsp), %rcx
incq %rcx
decq %r13
movq 0x28(%rsp), %rdx
incq %rdx
incq %r15
incq %rbx
jmp 0x2e580
cmpl $0x2e, %eax
je 0x2e5e6
cmpb %al, (%rcx)
je 0x2e5e6
cmpl $0x58, %eax
jne 0x2e777
andq $0x0, (%r12,%r13,8)
xorl %eax, %eax
jmp 0x2e7a1
testb %r12b, %r12b
je 0x2e758
movb $0x1, %cl
xorl %eax, %eax
movq 0x18(%rsp), %r12
pushq $0x10
popq %r15
movl (%rsp), %ebp
movq 0x10(%rsp), %r13
testb %cl, %cl
je 0x2e73d
movb 0x2(%rbx,%rax), %cl
incq %rax
jmp 0x2e610
xorl %eax, %eax
cmpb $0x0, (%rcx,%rax)
leaq 0x1(%rax), %rax
jne 0x2e623
pushq $0x1
popq %rcx
subl %eax, %ecx
movq 0x18(%rsp), %r12
movq 0x10(%rsp), %r13
movl %ecx, 0x4(%r12,%r13,8)
movl $0x84, (%r12,%r13,8)
movl $0x84, %eax
jmp 0x2e769
movq %r14, %rcx
movq %r14, %rax
subq %r13, %rax
movq %rax, 0x30(%rsp)
xorl %eax, %eax
movq %rax, %rbp
cmpb $0x0, 0x2(%r15)
leaq 0x1(%r15), %r15
leaq -0x1(%rax), %rax
jne 0x2e663
pushq $0x1
popq %rax
movq 0x18(%rsp), %r12
movq %rax, %r13
cmpb $0x0, 0x2(%rbx)
leaq 0x1(%rbx), %rbx
leaq 0x1(%rax), %rax
jne 0x2e67d
movzbl (%rbx), %eax
cmpl $0x5b, %eax
je 0x2e69b
cmpl $0x5d, %eax
jne 0x2e6c5
movq 0x10(%rsp), %r13
movl $0x10, (%r12,%r13,8)
pushq $0x10
popq %r15
movl %r15d, %eax
movq 0x8(%rsp), %rbx
jmp 0x2e772
decq %r15
decq %rbx
incq %rbp
decq %r13
cmpq 0x20(%rsp), %r15
jbe 0x2e6f1
cmpq 0x30(%rsp), %rbx
jbe 0x2e6f1
movsbl (%r15), %edi
callq 0x31729
movb %al, 0x7(%rsp)
movsbl (%rbx), %edi
callq 0x31729
movq %r14, %rcx
cmpb %al, 0x7(%rsp)
je 0x2e6b9
cmpq $0x1, %r13
je 0x2e7b1
testq %rbp, %rbp
pushq $0x10
popq %r15
je 0x2e7f9
movq %rbp, %rcx
negq %rcx
leaq -0x1(%r13), %rdx
cmpq %rcx, %rdx
pushq $0x8
popq %rax
pushq $0x2
popq %rsi
cmovel %esi, %eax
movq 0x10(%rsp), %rsi
movl %eax, (%r12,%rsi,8)
decl %ebp
cmpq %rdx, %rcx
cmovgl %ebp, %r13d
movl %r13d, 0x4(%r12,%rsi,8)
movq %rsi, %r13
jmp 0x2e6af
movzbl (%rbx,%rax), %ecx
cmpl $0x5d, %ecx
je 0x2e74b
cmpl $0x5b, %ecx
jne 0x2e78c
movl $0x10, (%r12,%r13,8)
movl %r15d, %eax
jmp 0x2e79c
movq 0x18(%rsp), %r12
movq 0x10(%rsp), %r13
andq $0x0, (%r12,%r13,8)
xorl %eax, %eax
movq 0x8(%rsp), %rbx
pushq $0x10
popq %r15
movl (%rsp), %ebp
jmp 0x2e7a1
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, (%r12,%r13,8)
pushq $0x1
jmp 0x2e565
movl %eax, 0x4(%r12,%r13,8)
movl $0x44, (%r12,%r13,8)
pushq $0x44
popq %rax
movq 0x8(%rsp), %rbx
orl %eax, %ebp
movl %ebp, 0xac(%rbx)
incq %r13
jmp 0x2e4c0
testq %rbp, %rbp
movq 0x8(%rsp), %rbx
je 0x2e831
movq 0x10(%rsp), %r13
movl %ebp, 0x4(%r12,%r13,8)
movsbl (%r15), %edi
movq %rcx, %r14
callq 0x31729
movl %eax, %ebp
movq 0x28(%rsp), %rax
movsbl (%r14,%rax), %edi
callq 0x31729
cmpb %al, %bpl
movl (%rsp), %ebp
jne 0x2e84c
movl $0x84, (%r12,%r13,8)
movl $0x84, %eax
jmp 0x2e857
decl %r13d
movq 0x10(%rsp), %rax
movl %r13d, 0x4(%r12,%rax,8)
movq %rax, %r13
movq 0x20(%rsp), %rax
movsbl (%rax), %edi
callq 0x31729
movl %eax, %ebp
movsbl (%rbx), %edi
callq 0x31729
cmpb %al, %bpl
jne 0x2e860
movl $0x44, (%r12,%r13,8)
pushq $0x44
jmp 0x2e86a
movabsq $0x100000001, %rax      # imm = 0x100000001
movq 0x10(%rsp), %r13
movq %rax, (%r12,%r13,8)
pushq $0x1
popq %rax
jmp 0x2e76e
movl $0x8, (%r12,%r13,8)
pushq $0x8
popq %rax
pushq $0x10
popq %r15
jmp 0x2e7a1
movl $0x8, (%r12,%r13,8)
pushq $0x8
popq %rax
jmp 0x2e6af
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x1
popq %rax
jmp 0x2e872