// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/vcfutils.c
// Function: bcf_gt_type
int bcf_gt_type(bcf_fmt_t *fmt_ptr, int isample, int *_ial, int *_jal)
{
    int i, nals = 0, has_ref = 0, has_alt = 0, ial = 0, jal = 0;
    #define BRANCH_INT(type_t, convert, vector_end) { \
        uint8_t *p = fmt_ptr->p + isample*fmt_ptr->size; \
        for (i=0; i<fmt_ptr->n; i++) \
        { \
            int32_t val = convert(&p[i * sizeof(type_t)]); \
            if ( val == vector_end ) break; /* smaller ploidy */ \
            if ( bcf_gt_is_missing(val) ) return GT_UNKN; /* missing allele */ \
            int tmp = val>>1; \
            if ( tmp>1 ) \
            { \
                if ( !ial ) { ial = tmp; has_alt = 1; } \
                else if ( tmp!=ial ) \
                { \
                    if ( tmp<ial ) \
                    { \
                        jal = ial; \
                        ial = tmp; \
                    } \
                    else \
                    { \
                        jal = tmp; \
                    } \
                    has_alt = 2; \
                } \
            } \
            else has_ref = 1; \
            nals++; \
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl 0xc(%rdi), %eax
cmpl $0x3, %eax
je 0x748a9
cmpl $0x2, %eax
je 0x747fa
cmpl $0x1, %eax
jne 0x749e8
movslq 0x4(%rdi), %rax
movb $0x1, %r11b
testq %rax, %rax
jle 0x7494b
imull 0x8(%rdi), %esi
movslq %esi, %rbx
addq 0x10(%rdi), %rbx
xorl %r14d, %r14d
xorl %esi, %esi
xorl %r8d, %r8d
xorl %r9d, %r9d
xorl %r10d, %r10d
xorl %edi, %edi
movb (%rbx,%r14), %bpl
cmpb $-0x7f, %bpl
jne 0x74789
movl $0x3, %r12d
jmp 0x74795
cmpb $0x2, %bpl
jae 0x74799
movl $0x1, %r12d
xorl %ebp, %ebp
jmp 0x747e4
sarb %bpl
cmpb $0x2, %bpl
jl 0x747b5
movsbl %bpl, %r15d
testl %r10d, %r10d
je 0x747c0
cmpl %r15d, %r10d
jne 0x747c8
movl %r10d, %r15d
jmp 0x747d9
movl %r10d, %r15d
movl $0x1, %r8d
jmp 0x747d9
movl $0x1, %r9d
jmp 0x747d9
movl %r15d, %edi
cmovgl %r10d, %edi
cmovll %r10d, %r15d
movl $0x2, %r9d
incl %esi
xorl %r12d, %r12d
movb $0x1, %bpl
movl %r15d, %r10d
testl %r12d, %r12d
jne 0x7496d
incq %r14
cmpq %r14, %rax
jne 0x74777
jmp 0x74976
movslq 0x4(%rdi), %rax
movb $0x1, %r11b
testq %rax, %rax
jle 0x7494b
imull 0x8(%rdi), %esi
movslq %esi, %rbx
addq 0x10(%rdi), %rbx
xorl %r14d, %r14d
xorl %esi, %esi
xorl %r8d, %r8d
xorl %r9d, %r9d
xorl %r10d, %r10d
xorl %edi, %edi
movzwl (%rbx,%r14,2), %ebp
cmpl $0x8001, %ebp           # imm = 0x8001
jne 0x7483a
movl $0x6, %r12d
jmp 0x74846
cmpw $0x2, %bp
jae 0x7484b
movl $0x1, %r12d
xorl %r15d, %r15d
jmp 0x74893
movswl %bp, %ebp
sarl %ebp
cmpw $0x2, %bp
jl 0x74865
testl %r10d, %r10d
je 0x74870
cmpl %ebp, %r10d
jne 0x74878
movl %r10d, %ebp
jmp 0x74888
movl %r10d, %ebp
movl $0x1, %r8d
jmp 0x74888
movl $0x1, %r9d
jmp 0x74888
movl %ebp, %edi
cmovgl %r10d, %edi
cmovll %r10d, %ebp
movl $0x2, %r9d
incl %esi
xorl %r12d, %r12d
movb $0x1, %r15b
movl %ebp, %r10d
testl %r12d, %r12d
jne 0x7495a
incq %r14
cmpq %r14, %rax
jne 0x74825
jmp 0x74976
movslq 0x4(%rdi), %rax
movb $0x1, %r11b
testq %rax, %rax
jle 0x7494b
imull 0x8(%rdi), %esi
movslq %esi, %rbx
addq 0x10(%rdi), %rbx
xorl %r14d, %r14d
xorl %esi, %esi
xorl %r8d, %r8d
xorl %r9d, %r9d
xorl %r10d, %r10d
xorl %edi, %edi
movl (%rbx,%r14,4), %ebp
cmpl $0x80000001, %ebp       # imm = 0x80000001
jne 0x748e8
movl $0x9, %r12d
jmp 0x748f3
cmpl $0x2, %ebp
jae 0x748f8
movl $0x1, %r12d
xorl %r15d, %r15d
jmp 0x7493c
sarl %ebp
cmpl $0x2, %ebp
jl 0x7490e
testl %r10d, %r10d
je 0x74919
cmpl %r10d, %ebp
jne 0x74921
movl %r10d, %ebp
jmp 0x74931
movl %r10d, %ebp
movl $0x1, %r8d
jmp 0x74931
movl $0x1, %r9d
jmp 0x74931
movl %r10d, %edi
cmovgl %ebp, %edi
cmovgel %r10d, %ebp
movl $0x2, %r9d
incl %esi
xorl %r12d, %r12d
movb $0x1, %r15b
movl %ebp, %r10d
testl %r12d, %r12d
jne 0x74962
incq %r14
cmpq %r14, %rax
jne 0x748d4
jmp 0x74976
xorl %edi, %edi
xorl %r10d, %r10d
xorl %r9d, %r9d
xorl %r8d, %r8d
xorl %esi, %esi
jmp 0x74976
cmpl $0x6, %r12d
jne 0x74968
jmp 0x74976
cmpl $0x9, %r12d
je 0x74976
movl %r15d, %r11d
jmp 0x74976
cmpl $0x3, %r12d
je 0x74976
movl %ebp, %r11d
movl $0x6, %eax
testb %r11b, %r11b
je 0x749df
testq %rdx, %rdx
je 0x74993
xorl %eax, %eax
testl %r10d, %r10d
setg %al
subl %eax, %r10d
movl %r10d, (%rdx)
testq %rcx, %rcx
je 0x749a3
xorl %eax, %eax
testl %edi, %edi
setg %al
subl %eax, %edi
movl %edi, (%rcx)
testl %esi, %esi
je 0x749b7
cmpl $0x1, %esi
jne 0x749be
xorl %eax, %eax
cmpl $0x1, %r8d
adcl $0x4, %eax
jmp 0x749df
movl $0x6, %eax
jmp 0x749df
testl %r8d, %r8d
je 0x749cf
xorl %eax, %eax
testl %r9d, %r9d
setne %al
addl %eax, %eax
jmp 0x749df
xorl %eax, %eax
cmpl $0x1, %r9d
setne %al
leal 0x1(,%rax,2), %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x606b0(%rip), %rsi     # 0xd509f
leaq 0x5f163(%rip), %rdx     # 0xd3b59
movl $0x1, %edi
movl %eax, %ecx
xorl %eax, %eax
callq 0x157b0
movl $0x1, %edi
callq 0x14620