// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/bcf_sr_sort.c
// Function: bcf_sr_sort_destroy
void bcf_sr_sort_destroy(sr_sort_t *srt)
{
    free(srt->active);
    if ( srt->var_str2int ) khash_str2int_destroy_free(srt->var_str2int);
    if ( srt->grp_str2int ) khash_str2int_destroy_free(srt->grp_str2int);
    int i;
    for (i=0; i<srt->nsr; i++) free(srt->vcf_buf[i].rec);
    free(srt->vcf_buf);
    for (i=0; i<srt->mvar; i++)
    {
        free(srt->var[i].str);
        free(srt->var[i].vcf);
        free(srt->var[i].rec);
        kbs_destroy(srt->var[i].mask);
    }
    free(srt->var);
    for (i=0; i<srt->mgrp; i++)
        free(srt->grp[i].var);
    free(srt->grp);
    for (i=0; i<srt->mvset; i++)
    {
        kbs_destroy(srt->vset[i].mask);
        free(srt->vset[i].var);
    }
    free(srt->vset);
    free(srt->str.s);
    free(srt->off);
    free(srt->charp);
    free(srt->cnt);
    free(srt->pmat);
    memset(srt,0,sizeof(*srt));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x1d0(%rdi), %rdi
callq 0x45d0
movq 0x168(%rbx), %r14
testq %r14, %r14
je 0x922c9
movl (%r14), %eax
testl %eax, %eax
je 0x922a6
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x10(%r14), %rcx
movq %r12, %rdx
shrq $0x4, %rdx
movl (%rcx,%rdx,4), %edx
movl %r15d, %ecx
andb $0x1e, %cl
shrl %cl, %edx
testb $0x3, %dl
jne 0x92298
movq 0x18(%r14), %rax
movq (%rax,%r12,8), %rdi
callq 0x45d0
movl (%r14), %eax
incq %r12
movl %eax, %ecx
addl $0x2, %r15d
cmpq %rcx, %r12
jb 0x9226d
movq 0x18(%r14), %rdi
callq 0x45d0
movq 0x10(%r14), %rdi
callq 0x45d0
movq 0x20(%r14), %rdi
callq 0x45d0
movq %r14, %rdi
callq 0x45d0
movq 0x160(%rbx), %r14
testq %r14, %r14
je 0x9233e
movl (%r14), %eax
testl %eax, %eax
je 0x9231b
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x10(%r14), %rcx
movq %r12, %rdx
shrq $0x4, %rdx
movl (%rcx,%rdx,4), %edx
movl %r15d, %ecx
andb $0x1e, %cl
shrl %cl, %edx
testb $0x3, %dl
jne 0x9230d
movq 0x18(%r14), %rax
movq (%rax,%r12,8), %rdi
callq 0x45d0
movl (%r14), %eax
incq %r12
movl %eax, %ecx
addl $0x2, %r15d
cmpq %rcx, %r12
jb 0x922e2
movq 0x18(%r14), %rdi
callq 0x45d0
movq 0x10(%r14), %rdi
callq 0x45d0
movq 0x20(%r14), %rdi
callq 0x45d0
movq %r14, %rdi
callq 0x45d0
cmpl $0x0, 0x1b8(%rbx)
jle 0x92373
movl $0x8, %r14d
xorl %r15d, %r15d
movq 0x150(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x45d0
incq %r15
movslq 0x1b8(%rbx), %rax
addq $0x10, %r14
cmpq %rax, %r15
jl 0x92350
movq 0x150(%rbx), %rdi
callq 0x45d0
cmpl $0x0, 0x104(%rbx)
jle 0x923e4
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x108(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x45d0
movq 0x108(%rbx), %rax
movq 0x18(%rax,%r14), %rdi
callq 0x45d0
movq 0x108(%rbx), %rax
movq 0x20(%rax,%r14), %rdi
callq 0x45d0
movq 0x108(%rbx), %rax
movq 0x28(%rax,%r14), %rdi
callq 0x45d0
incq %r15
movslq 0x104(%rbx), %rax
addq $0x30, %r14
cmpq %rax, %r15
jl 0x9238e
movq 0x108(%rbx), %rdi
callq 0x45d0
cmpl $0x0, 0x12c(%rbx)
jle 0x92425
movl $0x10, %r14d
xorl %r15d, %r15d
movq 0x140(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x45d0
incq %r15
movslq 0x12c(%rbx), %rax
addq $0x20, %r14
cmpq %rax, %r15
jl 0x92402
movq 0x140(%rbx), %rdi
callq 0x45d0
cmpl $0x0, 0x114(%rbx)
jle 0x92475
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x148(%rbx), %rax
movq 0x18(%rax,%r14), %rdi
callq 0x45d0
movq 0x148(%rbx), %rax
movq 0x8(%rax,%r14), %rdi
callq 0x45d0
incq %r15
movslq 0x114(%rbx), %rax
addq $0x20, %r14
cmpq %rax, %r15
jl 0x92440
movq 0x148(%rbx), %rdi
callq 0x45d0
movq 0x180(%rbx), %rdi
callq 0x45d0
movq 0x190(%rbx), %rdi
callq 0x45d0
movq 0x1a0(%rbx), %rdi
callq 0x45d0
movq 0x138(%rbx), %rdi
callq 0x45d0
movq 0x120(%rbx), %rdi
callq 0x45d0
movl $0x1d8, %edx            # imm = 0x1D8
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4250