// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl $0x0, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x74(%rbp)
subl $0x1, %eax
je 0x984ed
jmp 0x984ce
movl -0x74(%rbp), %eax
subl $0x2, %eax
je 0x985e1
jmp 0x984dc
movl -0x74(%rbp), %eax
subl $0x3, %eax
je 0x986d5
jmp 0x987c6
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rdx
imull 0x8(%rdx), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x985dc
movq -0x48(%rbp), %rdi
movslq -0x2c(%rbp), %rax
shlq $0x0, %rax
addq %rax, %rdi
callq 0x98390
movsbl %al, %eax
movl %eax, -0x4c(%rbp)
cmpl $-0x7f, -0x4c(%rbp)
jne 0x98546
jmp 0x985dc
movl -0x4c(%rbp), %eax
sarl %eax
cmpl $0x0, %eax
je 0x98558
xorl %eax, %eax
testb $0x1, %al
jne 0x98560
jmp 0x9856c
movb $0x1, %al
testb $0x1, %al
jne 0x98560
jmp 0x9856c
movl $0x6, -0x4(%rbp)
jmp 0x988a0
movl -0x4c(%rbp), %eax
sarl %eax
movl %eax, -0x50(%rbp)
cmpl $0x1, -0x50(%rbp)
jle 0x985be
cmpl $0x0, -0x3c(%rbp)
jne 0x9858f
movl -0x50(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl $0x1, -0x38(%rbp)
jmp 0x985bc
movl -0x50(%rbp), %eax
cmpl -0x3c(%rbp), %eax
je 0x985ba
movl -0x50(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x985ad
movl -0x3c(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0x985b3
movl -0x50(%rbp), %eax
movl %eax, -0x40(%rbp)
movl $0x2, -0x38(%rbp)
jmp 0x985bc
jmp 0x985c5
movl $0x1, -0x34(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x98511
jmp 0x987f1
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rdx
imull 0x8(%rdx), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x986d0
movq -0x58(%rbp), %rdi
movslq -0x2c(%rbp), %rax
shlq %rax
addq %rax, %rdi
callq 0x983e0
cwtl
movl %eax, -0x5c(%rbp)
cmpl $0xffff8001, -0x5c(%rbp) # imm = 0xFFFF8001
jne 0x9863a
jmp 0x986d0
movl -0x5c(%rbp), %eax
sarl %eax
cmpl $0x0, %eax
je 0x9864c
xorl %eax, %eax
testb $0x1, %al
jne 0x98654
jmp 0x98660
movb $0x1, %al
testb $0x1, %al
jne 0x98654
jmp 0x98660
movl $0x6, -0x4(%rbp)
jmp 0x988a0
movl -0x5c(%rbp), %eax
sarl %eax
movl %eax, -0x60(%rbp)
cmpl $0x1, -0x60(%rbp)
jle 0x986b2
cmpl $0x0, -0x3c(%rbp)
jne 0x98683
movl -0x60(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl $0x1, -0x38(%rbp)
jmp 0x986b0
movl -0x60(%rbp), %eax
cmpl -0x3c(%rbp), %eax
je 0x986ae
movl -0x60(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x986a1
movl -0x3c(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x60(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0x986a7
movl -0x60(%rbp), %eax
movl %eax, -0x40(%rbp)
movl $0x2, -0x38(%rbp)
jmp 0x986b0
jmp 0x986b9
movl $0x1, -0x34(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x98605
jmp 0x987f1
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rdx
imull 0x8(%rdx), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x987c4
movq -0x68(%rbp), %rdi
movslq -0x2c(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdi
callq 0x98430
movl %eax, -0x6c(%rbp)
cmpl $0x80000001, -0x6c(%rbp) # imm = 0x80000001
jne 0x9872e
jmp 0x987c4
movl -0x6c(%rbp), %eax
sarl %eax
cmpl $0x0, %eax
je 0x98740
xorl %eax, %eax
testb $0x1, %al
jne 0x98748
jmp 0x98754
movb $0x1, %al
testb $0x1, %al
jne 0x98748
jmp 0x98754
movl $0x6, -0x4(%rbp)
jmp 0x988a0
movl -0x6c(%rbp), %eax
sarl %eax
movl %eax, -0x70(%rbp)
cmpl $0x1, -0x70(%rbp)
jle 0x987a6
cmpl $0x0, -0x3c(%rbp)
jne 0x98777
movl -0x70(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl $0x1, -0x38(%rbp)
jmp 0x987a4
movl -0x70(%rbp), %eax
cmpl -0x3c(%rbp), %eax
je 0x987a2
movl -0x70(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x98795
movl -0x3c(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x70(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0x9879b
movl -0x70(%rbp), %eax
movl %eax, -0x40(%rbp)
movl $0x2, -0x38(%rbp)
jmp 0x987a4
jmp 0x987ad
movl $0x1, -0x34(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x986f9
jmp 0x987f1
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
movl $0x1, %edi
leaq 0xa0a86(%rip), %rsi     # 0x13925f
leaq 0x9f536(%rip), %rdx     # 0x137d16
movb $0x0, %al
callq 0x15920
movl $0x1, %edi
callq 0x146e0
cmpq $0x0, -0x20(%rbp)
je 0x98818
cmpl $0x0, -0x3c(%rbp)
jle 0x98809
movl -0x3c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x9880f
movl -0x3c(%rbp), %eax
movl %eax, -0x78(%rbp)
movl -0x78(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
cmpq $0x0, -0x28(%rbp)
je 0x9883f
cmpl $0x0, -0x40(%rbp)
jle 0x98830
movl -0x40(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x98836
movl -0x40(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
cmpl $0x0, -0x30(%rbp)
jne 0x9884e
movl $0x6, -0x4(%rbp)
jmp 0x988a0
cmpl $0x1, -0x30(%rbp)
jne 0x9886c
movl -0x34(%rbp), %edx
movl $0x5, %eax
movl $0x4, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x988a0
cmpl $0x0, -0x34(%rbp)
jne 0x9888a
movl -0x38(%rbp), %edx
movl $0x3, %eax
movl $0x1, %ecx
cmpl $0x1, %edx
cmovel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x988a0
cmpl $0x0, -0x38(%rbp)
jne 0x98899
movl $0x0, -0x4(%rbp)
jmp 0x988a0
movl $0x2, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)