// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bcf_sr_sort.c
// Function: bcf_sr_init_scores
static void bcf_sr_init_scores(sr_sort_t *srt)
{
    int i,jbit,kbit;

    // lower number = lower priority, zero means forbidden

    if ( srt->pair & BCF_SR_PAIR_ANY ) srt->pair |= (BCF_SR_PAIR_SNPS | BCF_SR_PAIR_INDELS | BCF_SR_PAIR_SNP_REF | BCF_SR_PAIR_INDEL_REF);
    if ( srt->pair & BCF_SR_PAIR_SNPS ) SR_SCORE(srt,SR_SNP,SR_SNP) = 3;
    if ( srt->pair & BCF_SR_PAIR_INDELS ) SR_SCORE(srt,SR_INDEL,SR_INDEL) = 3;
    if ( srt->pair & BCF_SR_PAIR_SNP_REF )
    {
        SR_SCORE(srt,SR_SNP,SR_REF) = 2;
        SR_SCORE(srt,SR_REF,SR_SNP) = 2;
    }
    if ( srt->pair & BCF_SR_PAIR_INDEL_REF )
    {
        SR_SCORE(srt,SR_INDEL,SR_REF) = 2;
        SR_SCORE(srt,SR_REF,SR_INDEL) = 2;
    }
    if ( srt->pair & BCF_SR_PAIR_ANY )
    {
        for (i=0; i<256; i++)
            if ( !srt->score[i] ) srt->score[i] = 1;
    }

    // set all combinations
    for (i=0; i<256; i++)
    {
        if ( srt->score[i] ) continue;      // already set
        int max = 0;
        for (jbit=0; jbit<4; jbit++)        // high bits
        {
            int j = 1<<jbit;
            if ( !(i & (j<<4)) ) continue;
            for (kbit=0; kbit<4; kbit++)    // low bits
            {
                int k = 1<<kbit;
                if ( !(i & k) ) continue;
                if ( max < SR_SCORE(srt,j,k) ) max = SR_SCORE(srt,j,k);
            }
        }
        srt->score[i] = max;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl 0x1c0(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0xe154d
movq -0x8(%rbp), %rax
movl 0x1c0(%rax), %ecx
orl $0x33, %ecx
movl %ecx, 0x1c0(%rax)
movq -0x8(%rbp), %rax
movl 0x1c0(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xe1567
movq -0x8(%rbp), %rax
movb $0x3, 0x22(%rax)
movq -0x8(%rbp), %rax
movl 0x1c0(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xe1581
movq -0x8(%rbp), %rax
movb $0x3, 0x44(%rax)
movq -0x8(%rbp), %rax
movl 0x1c0(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0xe15a3
movq -0x8(%rbp), %rax
movb $0x2, 0x21(%rax)
movq -0x8(%rbp), %rax
movb $0x2, 0x12(%rax)
movq -0x8(%rbp), %rax
movl 0x1c0(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0xe15c5
movq -0x8(%rbp), %rax
movb $0x2, 0x41(%rax)
movq -0x8(%rbp), %rax
movb $0x2, 0x14(%rax)
movq -0x8(%rbp), %rax
movl 0x1c0(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0xe1610
movl $0x0, -0xc(%rbp)
cmpl $0x100, -0xc(%rbp)      # imm = 0x100
jge 0xe160e
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
cmpb $0x0, (%rax,%rcx)
jne 0xe1601
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movb $0x1, (%rax,%rcx)
jmp 0xe1603
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xe15de
jmp 0xe1610
movl $0x0, -0xc(%rbp)
cmpl $0x100, -0xc(%rbp)      # imm = 0x100
jge 0xe1702
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0xe1637
jmp 0xe16f4
movl $0x0, -0x18(%rbp)
movl $0x0, -0x10(%rbp)
cmpl $0x4, -0x10(%rbp)
jge 0xe16e4
movl -0x10(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x1c(%rbp)
movl -0xc(%rbp), %eax
movl -0x1c(%rbp), %ecx
shll $0x4, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
jne 0xe166e
jmp 0xe16d6
movl $0x0, -0x14(%rbp)
cmpl $0x4, -0x14(%rbp)
jge 0xe16d4
movl -0x14(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x20(%rbp)
movl -0xc(%rbp), %eax
andl -0x20(%rbp), %eax
cmpl $0x0, %eax
jne 0xe1695
jmp 0xe16c9
movl -0x18(%rbp), %eax
movq -0x8(%rbp), %rcx
movl -0x1c(%rbp), %edx
shll $0x4, %edx
orl -0x20(%rbp), %edx
movslq %edx, %rdx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jge 0xe16c7
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
shll $0x4, %ecx
orl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x18(%rbp)
jmp 0xe16c9
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xe1675
jmp 0xe16d6
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xe1645
movl -0x18(%rbp), %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xe1617
popq %rbp
retq
nopw %cs:(%rax,%rax)