// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_io.c
// Function: cram_free_slice
void cram_free_slice(cram_slice *s) {
    if (!s)
        return;

    if (s->hdr_block)
        cram_free_block(s->hdr_block);

    if (s->block) {
        int i;

        if (s->hdr) {
            for (i = 0; i < s->hdr->num_blocks; i++) {
                if (i > 0 && s->block[i] == s->block[0])
                    continue;
                cram_free_block(s->block[i]);
            }
        }
        free(s->block);
    }

    {
        // Normally already copied into s->block[], but potentially still
        // here if we error part way through cram_encode_slice.
        int i;
        for (i = 0; i < s->naux_block; i++)
            cram_free_block(s->aux_block[i]);
    }

    if (s->block_by_id)
        free(s->block_by_id);

    if (s->hdr)
        cram_free_slice_header(s->hdr);

    if (s->seqs_blk)
        cram_free_block(s->seqs_blk);

    if (s->qual_blk)
        cram_free_block(s->qual_blk);

    if (s->name_blk)
        cram_free_block(s->name_blk);

    if (s->aux_blk)
        cram_free_block(s->aux_blk);

    if (s->base_blk)
        cram_free_block(s->base_blk);

    if (s->soft_blk)
        cram_free_block(s->soft_blk);

    if (s->cigar)
        free(s->cigar);

    if (s->crecs)
        free(s->crecs);

    if (s->features)
        free(s->features);

    if (s->TN)
        free(s->TN);

    if (s->pair_keys)
        string_pool_destroy(s->pair_keys);

    if (s->pair[0])
        kh_destroy(m_s2i, s->pair[0]);
    if (s->pair[1])
        kh_destroy(m_s2i, s->pair[1]);

    if (s->aux_block)
        free(s->aux_block);

    free(s);
}

// Assembly:
testq %rdi, %rdi
je 0x502fd
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x50145
callq 0x4ceb6
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x50193
movq (%rbx), %rax
testq %rax, %rax
je 0x5018e
cmpl $0x0, 0x28(%rax)
jle 0x5018e
xorl %r14d, %r14d
movq 0x10(%rbx), %rcx
testq %r14, %r14
je 0x50173
movq (%rcx,%r14,8), %rdi
cmpq (%rcx), %rdi
jne 0x50176
jmp 0x5017e
movq (%rcx), %rdi
callq 0x4ceb6
movq (%rbx), %rax
incq %r14
movslq 0x28(%rax), %rcx
cmpq %rcx, %r14
jl 0x5015f
movq 0x10(%rbx), %rdi
callq 0x45c0
cmpl $0x0, 0xcc(%rbx)
jle 0x501be
xorl %r14d, %r14d
movq 0xd0(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x4ceb6
incq %r14
movslq 0xcc(%rbx), %rax
cmpq %rax, %r14
jl 0x5019f
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x501cc
callq 0x45c0
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x501d9
callq 0x51337
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
je 0x501e7
callq 0x4ceb6
movq 0x78(%rbx), %rdi
testq %rdi, %rdi
je 0x501f5
callq 0x4ceb6
movq 0x68(%rbx), %rdi
testq %rdi, %rdi
je 0x50203
callq 0x4ceb6
movq 0x90(%rbx), %rdi
testq %rdi, %rdi
je 0x50214
callq 0x4ceb6
movq 0x80(%rbx), %rdi
testq %rdi, %rdi
je 0x50225
callq 0x4ceb6
movq 0x88(%rbx), %rdi
testq %rdi, %rdi
je 0x50236
callq 0x4ceb6
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x50244
callq 0x45c0
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x50252
callq 0x45c0
movq 0x48(%rbx), %rdi
testq %rdi, %rdi
je 0x50260
callq 0x45c0
movq 0x58(%rbx), %rdi
testq %rdi, %rdi
je 0x5026e
callq 0x45c0
movq 0x98(%rbx), %rdi
testq %rdi, %rdi
je 0x5027f
callq 0x57ec7
movq 0xa0(%rbx), %r14
testq %r14, %r14
je 0x502ae
movq 0x18(%r14), %rdi
callq 0x45c0
movq 0x10(%r14), %rdi
callq 0x45c0
movq 0x20(%r14), %rdi
callq 0x45c0
movq %r14, %rdi
callq 0x45c0
movq 0xa8(%rbx), %r14
testq %r14, %r14
je 0x502dd
movq 0x18(%r14), %rdi
callq 0x45c0
movq 0x10(%r14), %rdi
callq 0x45c0
movq 0x20(%r14), %rdi
callq 0x45c0
movq %r14, %rdi
callq 0x45c0
movq 0xd0(%rbx), %rdi
testq %rdi, %rdi
je 0x502ee
callq 0x45c0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x45c0
retq