// File: /workspace/github_c_makefile_star2_O1/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 $0x28, %rsp
movq %rdi, %rbx
testb $0x1, 0xbc(%rdi)
jne 0x3f06e
movq %rbx, %rdi
movl $0x1, %esi
callq 0x38e9d
movl 0x18(%rbx), %esi
shrl $0x10, %esi
cmpl %esi, 0xa8(%rbx)
jge 0x3f0a5
movq 0xa0(%rbx), %rdi
shll $0x3, %esi
callq 0x4860
testq %rax, %rax
je 0x3f4a6
movq %rax, 0xa0(%rbx)
movzwl 0x1a(%rbx), %eax
movl %eax, 0xa8(%rbx)
movl $0x0, 0xac(%rbx)
movq 0xa0(%rbx), %r14
movq $0x0, (%r14)
movzwl 0x1a(%rbx), %eax
testl $0xfffe, %eax           # imm = 0xFFFE
je 0x3f495
movq 0x88(%rbx), %r15
movq (%r15), %r8
leaq 0x1(%r8), %r9
movl $0x1, %ebp
movq %rbx, 0x20(%rsp)
movq %r15, (%rsp)
movq %r8, 0x18(%rsp)
movq %r9, 0x10(%rsp)
movq %r14, 0x8(%rsp)
movq (%r15,%rbp,8), %r13
movzbl (%r13), %eax
cmpl $0x2a, %eax
jne 0x3f10c
cmpb $0x0, 0x1(%r13)
je 0x3f139
cmpb $0x0, (%r9)
jne 0x3f11d
cmpb $0x0, 0x1(%r13)
je 0x3f211
cmpl $0x3c, %eax
je 0x3f146
cmpl $0x5b, %eax
je 0x3f12c
cmpl $0x5d, %eax
jne 0x3f196
movl $0x10, (%r14,%rbp,8)
jmp 0x3f315
movq $0x20, (%r14,%rbp,8)
jmp 0x3f315
movzbl 0x1(%r13), %eax
cmpl $0x2a, %eax
je 0x3f164
cmpl $0x58, %eax
jne 0x3f16f
cmpb $0x3e, 0x2(%r13)
je 0x3f224
cmpb $0x2a, %al
jne 0x3f16f
cmpb $0x3e, 0x2(%r13)
je 0x3f224
incq %r13
leaq 0x70f82(%rip), %rdi     # 0xb00fb
movq %r13, %rsi
callq 0x46e0
testl %eax, %eax
je 0x3f2e9
movl $0x8, (%r14,%rbp,8)
jmp 0x3f2f1
movzbl (%r8), %r14d
testq %r14, %r14
sete %r12b
je 0x3f231
movzbl (%r13), %ebx
testq %rbx, %rbx
je 0x3f239
callq 0x4090
movq 0x10(%rsp), %r9
movq 0x18(%rsp), %r8
movq (%rax), %rax
movb (%rax,%r14,4), %cl
movq %r8, %r14
movq %r13, %r15
cmpb (%rax,%rbx,4), %cl
movq 0x20(%rsp), %rbx
jne 0x3f244
leaq 0x1(%r13), %rcx
movq %r9, %rdx
movq %rcx, %r15
movq %rdx, %r14
movzbl (%rdx), %ecx
testq %rcx, %rcx
sete %r12b
je 0x3f244
movzbl (%r15), %esi
testq %rsi, %rsi
je 0x3f244
movb (%rax,%rcx,4), %dil
leaq 0x1(%r15), %rcx
leaq 0x1(%r14), %rdx
cmpb (%rax,%rsi,4), %dil
je 0x3f1e2
jmp 0x3f244
cmpl $0x2e, %eax
je 0x3f224
cmpb %al, (%r8)
je 0x3f224
cmpl $0x58, %eax
jne 0x3f45a
movq $0x0, (%r14,%rbp,8)
jmp 0x3f315
movq %r8, %r14
movq %r13, %r15
jmp 0x3f244
movq %r8, %r14
movq %r13, %r15
movq 0x20(%rsp), %rbx
movb (%r15), %al
testb %r12b, %r12b
je 0x3f28e
testb %al, %al
je 0x3f28e
addl %r13d, %r14d
notl %r14d
addl %r8d, %r14d
addl %r15d, %r14d
incl %r14d
cmpb $0x0, (%r15)
leaq 0x1(%r15), %r15
jne 0x3f25c
movzbl -0x2(%r15), %eax
cmpl $0x5d, %eax
je 0x3f27c
cmpl $0x5b, %eax
jne 0x3f2fd
movq 0x8(%rsp), %r14
movl $0x10, (%r14,%rbp,8)
jmp 0x3f311
testb %al, %al
setne %cl
orb %r12b, %cl
je 0x3f2b9
testb %al, %al
jne 0x3f334
xorb $0x1, %r12b
jne 0x3f334
movq 0x8(%rsp), %r14
movq $0x0, (%r14,%rbp,8)
jmp 0x3f311
xorl %eax, %eax
cmpb $0x0, (%r14,%rax)
leaq 0x1(%rax), %rax
jne 0x3f2bb
addl %r8d, %r15d
addl %r13d, %r14d
subl %r14d, %r15d
subl %eax, %r15d
incl %r15d
movq 0x8(%rsp), %r14
movl %r15d, 0x4(%r14,%rbp,8)
movl $0x84, (%r14,%rbp,8)
jmp 0x3f311
movq $0x0, (%r14,%rbp,8)
movq 0x18(%rsp), %r8
movq 0x10(%rsp), %r9
jmp 0x3f315
movq 0x8(%rsp), %rax
movl %r14d, 0x4(%rax,%rbp,8)
movq %rax, %r14
movl $0x44, (%rax,%rbp,8)
movq (%rsp), %r15
movl (%r14,%rbp,8), %eax
orl %eax, 0xac(%rbx)
incq %rbp
movzwl 0x1a(%rbx), %eax
cmpq %rax, %rbp
jb 0x3f0f7
jmp 0x3f495
leaq -0x1(%r14), %r12
cmpb $0x0, 0x2(%r12)
leaq 0x1(%r12), %r12
jne 0x3f338
leaq -0x1(%r15), %r13
cmpb $0x0, 0x2(%r13)
leaq 0x1(%r13), %r13
jne 0x3f349
movzbl (%r13), %eax
cmpl $0x5b, %eax
je 0x3f27c
cmpl $0x5d, %eax
je 0x3f27c
cmpq %r14, %r12
jbe 0x3f3a9
cmpq %r15, %r13
jbe 0x3f3a9
callq 0x4090
movq 0x10(%rsp), %r9
movq 0x18(%rsp), %r8
movq (%rax), %rax
movzbl (%r12), %ecx
movb (%rax,%rcx,4), %cl
movzbl (%r13), %edx
cmpb (%rax,%rdx,4), %cl
jne 0x3f3a9
decq %r12
decq %r13
cmpq %r14, %r12
jbe 0x3f3a9
cmpq %r15, %r13
ja 0x3f387
movq %r13, %rcx
subq %r15, %rcx
je 0x3f3e4
movq %r12, %rax
subq %r14, %rax
je 0x3f421
leal 0x1(%rcx), %edx
cmpq %rcx, %rax
movl $0x8, %ecx
movl $0x2, %esi
cmovel %esi, %ecx
movq 0x8(%rsp), %r14
movl %ecx, (%r14,%rbp,8)
notl %eax
cmovlel %edx, %eax
movl %eax, 0x4(%r14,%rbp,8)
jmp 0x3f311
cmpq %r14, %r12
movq (%rsp), %r15
je 0x3f455
subl %r12d, %r14d
movq 0x8(%rsp), %rax
movl %r14d, 0x4(%rax,%rbp,8)
movq %rax, %r14
movzbl (%r12), %ebx
callq 0x4090
movq (%rax), %rax
movb (%rax,%rbx,4), %cl
movzbl (%r13), %edx
cmpb (%rax,%rdx,4), %cl
jne 0x3f46d
movl $0x84, (%r14,%rbp,8)
jmp 0x3f475
movl %r13d, %eax
subl %r15d, %eax
movq 0x8(%rsp), %r14
movl %eax, 0x4(%r14,%rbp,8)
movzbl (%r12), %ebx
callq 0x4090
movq (%rax), %rax
movb (%rax,%rbx,4), %cl
movzbl (%r13), %edx
cmpb (%rax,%rdx,4), %cl
jne 0x3f47f
movl $0x44, (%r14,%rbp,8)
jmp 0x3f487
movq 0x8(%rsp), %r14
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, (%r14,%rbp,8)
jmp 0x3f315
movl $0x8, (%r14,%rbp,8)
movq 0x20(%rsp), %rbx
jmp 0x3f2f1
movl $0x8, (%r14,%rbp,8)
movq 0x20(%rsp), %rbx
movq (%rsp), %r15
jmp 0x3f2f1
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x3f497