// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/cram/cram_io.c
// Function: cram_free_container
void cram_free_container(cram_container *c) {
    enum cram_DS_ID id;
    int i;

    if (!c)
        return;

    if (c->refs_used)
        free(c->refs_used);

    if (c->landmark)
        free(c->landmark);

    if (c->comp_hdr)
        cram_free_compression_header(c->comp_hdr);

    if (c->comp_hdr_block)
        cram_free_block(c->comp_hdr_block);

    // Free the slices; filled out by encoder only
    if (c->slices) {
        for (i = 0; i < c->max_slice; i++) {
            if (c->slices[i])
                cram_free_slice(c->slices[i]);
            if (c->slices[i] == c->slice)
                c->slice = NULL;
        }
        free(c->slices);
    }

    // Free the current slice; set by both encoder & decoder
    if (c->slice) {
        cram_free_slice(c->slice);
        c->slice = NULL;
    }

    for (id = DS_RN; id < DS_TN; id++)
        if (c->stats[id]) cram_stats_free(c->stats[id]);

    //if (c->aux_B_stats) cram_stats_free(c->aux_B_stats);

    if (c->tags_used) {
        khint_t k;

        for (k = kh_begin(c->tags_used); k != kh_end(c->tags_used); k++) {
            if (!kh_exist(c->tags_used, k))
                continue;

            cram_tag_map *tm = (cram_tag_map *)kh_val(c->tags_used, k);
            if (tm) {
                cram_codec *c = tm->codec;

                if (c) c->free(c);

                // If tm->blk or tm->blk2 is set, then we haven't yet got to
                // cram_encode_container which copies the blocks to s->aux_block
                // and NULLifies tm->blk*.  In this case we failed to complete
                // the container construction, so we have to free up our partially
                // converted CRAM.
                cram_free_block(tm->blk);
                cram_free_block(tm->blk2);
                free(tm);
            }
        }

        kh_destroy(m_tagmap, c->tags_used);
    }

    if (c->ref_free)
        free(c->ref);

    if (c->bams)
        free_bam_list(c->bams, c->max_c_rec);

    free(c);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x74a88
jmp 0x74d26
movq -0x8(%rbp), %rax
cmpq $0x0, 0x278(%rax)
je 0x74aa6
movq -0x8(%rbp), %rax
movq 0x278(%rax), %rdi
callq 0x45a0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x74abe
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x45a0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x74ad6
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x74d30
movq -0x8(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0x74aee
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x6f940
movq -0x8(%rbp), %rax
cmpq $0x0, 0x88(%rax)
je 0x74b8d
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x58(%rcx), %eax
jge 0x74b7d
movq -0x8(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0x10(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x74b41
movq -0x8(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x74f20
movq -0x8(%rbp), %rax
movq 0x88(%rax), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x8(%rbp), %rcx
cmpq 0x90(%rcx), %rax
jne 0x74b70
movq -0x8(%rbp), %rax
movq $0x0, 0x90(%rax)
jmp 0x74b72
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x74b07
movq -0x8(%rbp), %rax
movq 0x88(%rax), %rdi
callq 0x45a0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x90(%rax)
je 0x74bba
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rdi
callq 0x74f20
movq -0x8(%rbp), %rax
movq $0x0, 0x90(%rax)
movl $0xb, -0xc(%rbp)
cmpl $0x27, -0xc(%rbp)
jae 0x74bfa
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
cmpq $0x0, 0xf8(%rax,%rcx,8)
je 0x74bed
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
movq 0xf8(%rax,%rcx,8), %rdi
callq 0x7f820
jmp 0x74bef
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x74bc1
movq -0x8(%rbp), %rax
cmpq $0x0, 0x270(%rax)
je 0x74cdb
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x270(%rcx), %rcx
cmpl (%rcx), %eax
je 0x74ccb
movq -0x8(%rbp), %rax
movq 0x270(%rax), %rax
movq 0x10(%rax), %rax
movl -0x14(%rbp), %ecx
shrl $0x4, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl -0x14(%rbp), %ecx
andl $0xf, %ecx
shll %ecx
shrl %cl, %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x74c57
jmp 0x74cbd
movq -0x8(%rbp), %rax
movq 0x270(%rax), %rax
movq 0x20(%rax), %rax
movl -0x14(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x74cbb
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x74c98
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x28(%rbp), %rdi
callq *%rax
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x6f940
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x6f940
movq -0x20(%rbp), %rdi
callq 0x45a0
jmp 0x74cbd
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x74c13
movq -0x8(%rbp), %rax
movq 0x270(%rax), %rdi
callq 0x751c0
movq -0x8(%rbp), %rax
cmpl $0x0, 0x29c(%rax)
je 0x74cf8
movq -0x8(%rbp), %rax
movq 0xe0(%rax), %rdi
callq 0x45a0
movq -0x8(%rbp), %rax
cmpq $0x0, 0xf0(%rax)
je 0x74d1d
movq -0x8(%rbp), %rax
movq 0xf0(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x6c(%rax), %esi
callq 0x75210
movq -0x8(%rbp), %rdi
callq 0x45a0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)