// File: /workspace/github_c_makefile_star2_O3/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 %rbx
movl 0xc(%rdi), %eax
cmpl $0x3, %eax
je 0x73490
cmpl $0x2, %eax
je 0x73412
cmpl $0x1, %eax
jne 0x73570
movl 0x4(%rdi), %r10d
testl %r10d, %r10d
jle 0x73503
imull 0x8(%rdi), %esi
movslq %esi, %r11
addq 0x10(%rdi), %r11
xorl %r8d, %r8d
xorl %esi, %esi
xorl %edi, %edi
xorl %r9d, %r9d
xorl %eax, %eax
movb (%r11,%r8), %bl
cmpb $-0x7f, %bl
je 0x7350f
cmpb $0x2, %bl
jb 0x73549
sarb %bl
cmpb $0x2, %bl
jl 0x733f6
movsbl %bl, %ebx
testl %r9d, %r9d
je 0x733fd
cmpl %ebx, %r9d
je 0x73405
movl %ebx, %eax
cmovgl %r9d, %eax
cmovgel %ebx, %r9d
movl $0x2, %edi
jmp 0x73405
movl $0x1, %esi
jmp 0x73405
movl $0x1, %edi
movl %ebx, %r9d
incq %r8
cmpq %r8, %r10
jne 0x733bb
jmp 0x734fe
movl 0x4(%rdi), %r10d
testl %r10d, %r10d
jle 0x73503
imull 0x8(%rdi), %esi
movslq %esi, %r11
addq 0x10(%rdi), %r11
xorl %r8d, %r8d
xorl %esi, %esi
xorl %edi, %edi
xorl %r9d, %r9d
xorl %eax, %eax
movzwl (%r11,%r8,2), %ebx
cmpl $0x8001, %ebx           # imm = 0x8001
je 0x7350f
cmpw $0x2, %bx
jb 0x73549
movswl %bx, %ebx
sarl %ebx
cmpw $0x2, %bx
jl 0x73477
testl %r9d, %r9d
je 0x7347e
cmpl %ebx, %r9d
je 0x73486
movl %ebx, %eax
cmovgl %r9d, %eax
cmovgel %ebx, %r9d
movl $0x2, %edi
jmp 0x73486
movl $0x1, %esi
jmp 0x73486
movl $0x1, %edi
movl %ebx, %r9d
incq %r8
cmpq %r8, %r10
jne 0x73436
jmp 0x734fe
movl 0x4(%rdi), %r10d
testl %r10d, %r10d
jle 0x73503
imull 0x8(%rdi), %esi
movslq %esi, %r11
addq 0x10(%rdi), %r11
xorl %r8d, %r8d
xorl %esi, %esi
xorl %edi, %edi
xorl %r9d, %r9d
xorl %eax, %eax
movl (%r11,%r8,4), %ebx
cmpl $0x80000001, %ebx       # imm = 0x80000001
je 0x7350f
cmpl $0x2, %ebx
jb 0x73549
sarl %ebx
cmpl $0x2, %ebx
jl 0x734e7
testl %r9d, %r9d
je 0x734ee
cmpl %r9d, %ebx
je 0x734f6
movl %r9d, %eax
cmovgl %ebx, %eax
cmovll %ebx, %r9d
movl $0x2, %edi
jmp 0x734f6
movl $0x1, %esi
jmp 0x734f6
movl $0x1, %edi
movl %ebx, %r9d
incq %r8
cmpq %r8, %r10
jne 0x734b0
movl %r10d, %r8d
jmp 0x7350f
xorl %eax, %eax
xorl %r9d, %r9d
xorl %edi, %edi
xorl %esi, %esi
xorl %r8d, %r8d
testq %rdx, %rdx
je 0x73524
xorl %r10d, %r10d
testl %r9d, %r9d
setg %r10b
subl %r10d, %r9d
movl %r9d, (%rdx)
testq %rcx, %rcx
je 0x73534
xorl %edx, %edx
testl %eax, %eax
setg %dl
subl %edx, %eax
movl %eax, (%rcx)
testl %r8d, %r8d
je 0x73549
cmpl $0x1, %r8d
jne 0x73550
xorl %eax, %eax
cmpl $0x1, %esi
adcl $0x4, %eax
jmp 0x7356e
movl $0x6, %eax
jmp 0x7356e
testl %esi, %esi
je 0x7355f
xorl %eax, %eax
testl %edi, %edi
setne %al
addl %eax, %eax
jmp 0x7356e
xorl %eax, %eax
cmpl $0x1, %edi
setne %al
leal 0x1(,%rax,2), %eax
popq %rbx
retq
leaq 0x5fb58(%rip), %rsi     # 0xd30cf
leaq 0x5e60b(%rip), %rdx     # 0xd1b89
movl $0x1, %edi
movl %eax, %ecx
xorl %eax, %eax
callq 0x157b0
movl $0x1, %edi
callq 0x14620