// File: /workspace/github_c_makefile_star2_O3/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 $0x48, %rsp
movq %rdi, %rbx
testb $0x1, 0xbc(%rdi)
jne 0x3e2a1
movq %rbx, %rdi
movl $0x1, %esi
callq 0x38183
movl 0x18(%rbx), %esi
shrl $0x10, %esi
movq 0xa0(%rbx), %r15
cmpl %esi, 0xa8(%rbx)
jge 0x3e2de
shll $0x3, %esi
movq %r15, %rdi
callq 0x4860
testq %rax, %rax
je 0x3e6ea
movq %rax, %r15
movq %rax, 0xa0(%rbx)
movzwl 0x1a(%rbx), %eax
movl %eax, 0xa8(%rbx)
movl $0x0, 0xac(%rbx)
movq $0x0, (%r15)
movzwl 0x1a(%rbx), %eax
testl $0xfffe, %eax           # imm = 0xFFFE
je 0x3e6d9
movq 0x88(%rbx), %r14
movq (%r14), %rax
movq %rax, %rcx
negq %rcx
movq %rcx, 0x30(%rsp)
leaq -0x1(%rax), %rcx
movq %rcx, 0x40(%rsp)
movq %rax, 0x10(%rsp)
incq %rax
movq %rax, 0x38(%rsp)
movl $0x1, %r13d
xorl %ebp, %ebp
movq %rbx, 0x8(%rsp)
movq %r15, 0x28(%rsp)
movq %r14, 0x18(%rsp)
movq (%r14,%r13,8), %r12
movzbl (%r12), %eax
cmpl $0x2a, %eax
jne 0x3e356
cmpb $0x0, 0x1(%r12)
je 0x3e38e
movq 0x10(%rsp), %rcx
cmpb $0x0, 0x1(%rcx)
jne 0x3e36d
cmpb $0x0, 0x1(%r12)
je 0x3e4b0
cmpl $0x3c, %eax
je 0x3e3a0
cmpl $0x5b, %eax
je 0x3e37c
cmpl $0x5d, %eax
jne 0x3e3e8
movl $0x10, (%r15,%r13,8)
movl $0x10, %eax
jmp 0x3e603
movq $0x20, (%r15,%r13,8)
movl $0x20, %eax
jmp 0x3e603
movzbl 0x1(%r12), %eax
cmpl $0x2a, %eax
je 0x3e3b0
cmpl $0x58, %eax
jne 0x3e3bc
cmpb $0x3e, 0x2(%r12)
je 0x3e4c5
incq %r12
leaq 0x6ece5(%rip), %rdi     # 0xad0ab
movq %r12, %rsi
callq 0x46e0
testl %eax, %eax
je 0x3e4c5
movl $0x8, (%r15,%r13,8)
movl $0x8, %eax
jmp 0x3e603
movq %rbp, (%rsp)
movq %r13, 0x20(%rsp)
movq 0x10(%rsp), %rbp
movb (%rbp), %r13b
movq %r12, %rcx
testb %r13b, %r13b
je 0x3e469
leaq -0x1(%r12), %r14
movq 0x40(%rsp), %rbx
xorl %ebp, %ebp
movzbl (%r12,%rbp), %r15d
testq %r15, %r15
je 0x3e4e8
callq 0x4090
movq (%rax), %rax
movzbl %r13b, %ecx
movb (%rax,%rcx,4), %cl
cmpb (%rax,%r15,4), %cl
jne 0x3e51c
movq 0x10(%rsp), %rax
movb 0x1(%rax,%rbp), %r13b
incq %rbp
incq %rbx
incq %r14
testb %r13b, %r13b
jne 0x3e40e
leaq (%r12,%rbp), %rcx
movb (%r12,%rbp), %al
addq 0x10(%rsp), %rbp
movq 0x8(%rsp), %rbx
movq 0x28(%rsp), %r15
movq 0x18(%rsp), %r14
testb %al, %al
je 0x3e4d4
leaq 0x1(%rcx), %rax
addl 0x38(%rsp), %ecx
addl %r12d, %ebp
notl %ebp
addl %ecx, %ebp
movq 0x20(%rsp), %r13
incl %ebp
cmpb $0x0, (%rax)
leaq 0x1(%rax), %rax
jne 0x3e481
movzbl -0x2(%rax), %eax
cmpl $0x5d, %eax
je 0x3e49e
cmpl $0x5b, %eax
jne 0x3e5ed
movl $0x10, (%r15,%r13,8)
movl $0x10, %eax
jmp 0x3e5ff
cmpb $0x2e, %al
je 0x3e4c5
movq 0x10(%rsp), %rcx
cmpb %al, (%rcx)
je 0x3e4c5
cmpb $0x58, %al
jne 0x3e620
movq $0x0, (%r15,%r13,8)
xorl %eax, %eax
jmp 0x3e603
movq 0x20(%rsp), %r13
movq $0x0, (%r15,%r13,8)
xorl %eax, %eax
jmp 0x3e5ff
addq 0x10(%rsp), %rbp
movl $0x1, %eax
decl %eax
cmpb $0x0, (%rbp)
leaq 0x1(%rbp), %rbp
jne 0x3e4f2
movq 0x28(%rsp), %r15
movq 0x20(%rsp), %r13
movl %eax, 0x4(%r15,%r13,8)
movl $0x84, (%r15,%r13,8)
movl $0x84, %eax
jmp 0x3e562
leaq (%r12,%rbp), %rcx
movq 0x10(%rsp), %rdx
addq %rbp, %rdx
cmpb $0x0, 0x2(%rbx)
leaq 0x1(%rbx), %rbx
jne 0x3e528
movq 0x28(%rsp), %r15
movq 0x20(%rsp), %r13
cmpb $0x0, 0x2(%r14)
leaq 0x1(%r14), %r14
jne 0x3e53c
movzbl (%r14), %esi
cmpl $0x5b, %esi
je 0x3e555
cmpl $0x5d, %esi
jne 0x3e577
movl $0x10, (%r15,%r13,8)
movl $0x10, %eax
movq 0x8(%rsp), %rbx
movq 0x18(%rsp), %r14
jmp 0x3e5ff
decq %rbx
decq %r14
cmpq %rdx, %rbx
jbe 0x3e592
cmpq %rcx, %r14
jbe 0x3e592
movzbl (%rbx), %esi
movb (%rax,%rsi,4), %sil
movzbl (%r14), %edi
cmpb (%rax,%rdi,4), %sil
je 0x3e571
cmpq %r14, %rcx
je 0x3e635
cmpq %rbx, %rdx
je 0x3e66a
movq 0x30(%rsp), %rax
addq %rbx, %rax
movq %rax, %rcx
subq %rbp, %rcx
subq %r12, %r14
movq %r14, %rdx
subq %rbp, %rdx
cmpq %r14, %rax
movl $0x8, %eax
movl $0x2, %esi
cmovel %esi, %eax
movl %eax, (%r15,%r13,8)
movq 0x10(%rsp), %rsi
subl %ebx, %esi
leal 0x1(%rdx), %edi
cmpq %rdx, %rcx
leal -0x1(%rsi,%rbp), %ecx
cmovlel %edi, %ecx
movl %ecx, 0x4(%r15,%r13,8)
jmp 0x3e562
movl %ebp, 0x4(%r15,%r13,8)
movl $0x44, (%r15,%r13,8)
movl $0x44, %eax
movq (%rsp), %rbp
orl %eax, %ebp
movl %ebp, 0xac(%rbx)
incq %r13
movzwl 0x1a(%rbx), %eax
cmpq %rax, %r13
jb 0x3e340
jmp 0x3e6d9
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, (%r15,%r13,8)
movl $0x1, %eax
jmp 0x3e603
cmpq %rbx, %rdx
je 0x3e698
movq 0x10(%rsp), %rdx
subl %ebx, %edx
addl %edx, %ebp
movl %ebp, 0x4(%r15,%r13,8)
movzbl (%rbx), %edx
movb (%rax,%rdx,4), %dl
movzbl (%rcx), %ecx
cmpb (%rax,%rcx,4), %dl
movq 0x18(%rsp), %r14
jne 0x3e6b0
movl $0x84, (%r15,%r13,8)
movl $0x84, %eax
jmp 0x3e6bd
movl %r14d, %ecx
subl %r12d, %ecx
subl %ebp, %ecx
movl %ecx, 0x4(%r15,%r13,8)
movzbl (%rdx), %ecx
movb (%rax,%rcx,4), %cl
movzbl (%r14), %edx
cmpb (%rax,%rdx,4), %cl
jne 0x3e6c7
movl $0x44, (%r15,%r13,8)
movl $0x44, %eax
jmp 0x3e562
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, (%r15,%r13,8)
movl $0x1, %eax
jmp 0x3e562
movl $0x8, (%r15,%r13,8)
movl $0x8, %eax
movq 0x8(%rsp), %rbx
jmp 0x3e5ff
movl $0x8, (%r15,%r13,8)
movl $0x8, %eax
jmp 0x3e562
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x3e6db