// File: /workspace/github_c_makefile_star2_O3/c-zhou[P]oatk/hmmannot.c
// Function: hmm_annot_db_sort
void hmm_annot_db_sort(hmm_annot_db_t *annot_db, hmm_annot_so_t so)
{
    if (so == annot_db->so) return;
    switch(so) {
        case ORDER_GNAME:
            qsort(annot_db->a, annot_db->n, sizeof(hmm_annot_t), hmm_annot_cmpfunc1);
            break;
        case ORDER_GID:
            qsort(annot_db->a, annot_db->n, sizeof(hmm_annot_t), hmm_annot_cmpfunc2);
            break;
        case ORDER_SNAME:
            qsort(annot_db->a, annot_db->n, sizeof(hmm_annot_t), hmm_annot_cmpfunc3);
            break;
        case ORDER_SID:
            qsort(annot_db->a, annot_db->n, sizeof(hmm_annot_t), hmm_annot_cmpfunc4);
            break;
        case ORDER_SID_OG:
            qsort(annot_db->a, annot_db->n, sizeof(hmm_annot_t), hmm_annot_cmpfunc5);
            break;
        case ORDER_SID_CO:
            qsort(annot_db->a, annot_db->n, sizeof(hmm_annot_t), hmm_annot_cmpfunc6);
            break;
        default:
            fprintf(stderr, "[E::%s] undefined sorting: %d\n", __func__, so);
            exit(EXIT_FAILURE);
    }
    annot_db->so = so;
    hmm_annot_db_sort_index(annot_db);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpl %esi, 0x40(%rdi)
je 0x4c4c
movl %esi, %r14d
leal -0x1(%r14), %eax
cmpl $0x6, %eax
jae 0x4c52
movq %rdi, %rbx
movl %eax, %eax
leaq 0x52a5(%rip), %rcx      # 0x9d90
movq (%rcx,%rax,8), %rcx
movq (%rdi), %rsi
movq 0x10(%rdi), %rdi
movl $0x50, %edx
callq 0x20d0
movl %r14d, 0x40(%rbx)
movq 0x48(%rbx), %rdi
testq %rdi, %rdi
je 0x4b16
callq 0x2050
movl 0x40(%rbx), %r14d
movq $0x0, 0x48(%rbx)
leal 0x1(%r14), %eax
cmpl $0x7, %eax
ja 0x4c5a
movl $0x17, %ecx
btl %eax, %ecx
jb 0x4c4c
movl $0xe0, %ecx
btl %eax, %ecx
jae 0x4bb5
movq 0x10(%rbx), %r15
movl 0x1c(%rbx), %r14d
movl $0x8, %esi
movq %r14, %rdi
callq 0x21f0
movl 0x4c(%r15), %edx
movq (%rbx), %rdi
cmpq $0x2, %rdi
jb 0x4c2c
xorl %esi, %esi
movl $0x1, %ecx
movl $0x1, %r9d
movl %edx, %r8d
leaq (%r9,%r9,4), %rdx
shlq $0x4, %rdx
movl 0x4c(%r15,%rdx), %edx
cmpl %edx, %r8d
jne 0x4b90
movl %r8d, %edx
jmp 0x4ba9
movl %ecx, %r9d
subl %esi, %r9d
shlq $0x20, %rsi
orq %rsi, %r9
movl %r8d, %esi
movq %r9, (%rax,%rsi,8)
movl %ecx, %esi
movl %edx, %r8d
incl %ecx
movq %rcx, %r9
cmpq %rcx, %rdi
ja 0x4b79
jmp 0x4c33
movq 0x10(%rbx), %r15
movl 0x18(%rbx), %r14d
movl $0x8, %esi
movq %r14, %rdi
callq 0x21f0
movl $0x1fffffff, %edi       # imm = 0x1FFFFFFF
movl 0x48(%r15), %edx
andl %edi, %edx
movq (%rbx), %r8
cmpq $0x2, %r8
jb 0x4c2c
xorl %esi, %esi
movl $0x1, %ecx
movl $0x1, %r10d
movl %edx, %r9d
leaq (%r10,%r10,4), %rdx
shlq $0x4, %rdx
movl 0x48(%r15,%rdx), %edx
andl %edi, %edx
cmpl %edx, %r9d
jne 0x4c07
movl %r9d, %edx
jmp 0x4c20
movl %ecx, %r10d
subl %esi, %r10d
shlq $0x20, %rsi
orq %rsi, %r10
movl %r9d, %esi
movq %r10, (%rax,%rsi,8)
movl %ecx, %esi
movl %edx, %r9d
incl %ecx
movq %rcx, %r10
cmpq %rcx, %r8
ja 0x4bee
jmp 0x4c33
movl $0x1, %ecx
xorl %esi, %esi
subl %esi, %ecx
shlq $0x20, %rsi
movl %ecx, %ecx
orq %rsi, %rcx
movl %edx, %edx
movq %rcx, (%rax,%rdx,8)
movq %rax, 0x48(%rbx)
movl %r14d, 0x44(%rbx)
popq %rbx
popq %r14
popq %r15
retq
movl %r14d, %edi
callq 0x263e
movl %r14d, %edi
callq 0x2668