// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/cram/cram_io.c
// Function: cram_new_container
cram_container *cram_new_container(int nrec, int nslice) {
    cram_container *c = calloc(1, sizeof(*c));
    enum cram_DS_ID id;

    if (!c)
        return NULL;

    c->curr_ref = -2;

    c->max_c_rec = nrec * nslice;
    c->curr_c_rec = 0;

    c->max_rec = nrec;
    c->record_counter = 0;
    c->num_bases = 0;
    c->s_num_bases = 0;

    c->max_slice = nslice;
    c->curr_slice = 0;

    c->pos_sorted = 1;
    c->max_apos   = 0;
    c->multi_seq  = 0;
    c->qs_seq_orient = 1;
    c->no_ref = 0;
    c->embed_ref = -1; // automatic selection

    c->bams = NULL;

    if (!(c->slices = calloc(nslice != 0 ? nslice : 1, sizeof(cram_slice *))))
        goto err;
    c->slice = NULL;

    if (!(c->comp_hdr = cram_new_compression_header()))
        goto err;
    c->comp_hdr_block = NULL;

    for (id = DS_RN; id < DS_TN; id++)
        if (!(c->stats[id] = cram_stats_create())) goto err;

    //c->aux_B_stats = cram_stats_create();

    if (!(c->tags_used = kh_init(m_tagmap)))
        goto err;
    c->refs_used = 0;
    c->ref_free = 0;

    return c;

 err:
    if (c) {
        if (c->slices)
            free(c->slices);
        free(c);
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
movl $0x1, %edi
movl $0x2a0, %esi            # imm = 0x2A0
callq 0x42f0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x74765
movq $0x0, -0x8(%rbp)
jmp 0x7494f
movq -0x18(%rbp), %rax
movl $0xfffffffe, 0x78(%rax) # imm = 0xFFFFFFFE
movl -0xc(%rbp), %ecx
imull -0x10(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x6c(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x70(%rax)
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x64(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x288(%rax)
movl -0x10(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x58(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x5c(%rax)
movq -0x18(%rbp), %rax
movl $0x1, 0x98(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0xa0(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0xac(%rax)
movq -0x18(%rbp), %rax
movl $0x1, 0xb4(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0xec(%rax)
movq -0x18(%rbp), %rax
movl $0xffffffff, 0xe8(%rax) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rax
movq $0x0, 0xf0(%rax)
cmpl $0x0, -0x10(%rbp)
je 0x74841
movl -0x10(%rbp), %eax
movl %eax, -0x20(%rbp)
jmp 0x7484b
movl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x7484b
movl -0x20(%rbp), %eax
movslq %eax, %rdi
movl $0x8, %esi
callq 0x42f0
movq -0x18(%rbp), %rcx
movq %rax, 0x88(%rcx)
cmpq $0x0, %rax
jne 0x74871
jmp 0x74919
movq -0x18(%rbp), %rax
movq $0x0, 0x90(%rax)
callq 0x74960
movq -0x18(%rbp), %rcx
movq %rax, 0x48(%rcx)
cmpq $0x0, %rax
jne 0x74898
jmp 0x74919
movq -0x18(%rbp), %rax
movq $0x0, 0x50(%rax)
movl $0xb, -0x1c(%rbp)
cmpl $0x27, -0x1c(%rbp)
jae 0x748da
callq 0x7ec10
movq -0x18(%rbp), %rcx
movl -0x1c(%rbp), %edx
movq %rax, 0xf8(%rcx,%rdx,8)
cmpq $0x0, %rax
jne 0x748cd
jmp 0x74919
jmp 0x748cf
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x748ab
callq 0x74a50
movq -0x18(%rbp), %rcx
movq %rax, 0x270(%rcx)
cmpq $0x0, %rax
jne 0x748f2
jmp 0x74919
movq -0x18(%rbp), %rax
movq $0x0, 0x278(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x29c(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x7494f
cmpq $0x0, -0x18(%rbp)
je 0x74947
movq -0x18(%rbp), %rax
cmpq $0x0, 0x88(%rax)
je 0x7493e
movq -0x18(%rbp), %rax
movq 0x88(%rax), %rdi
callq 0x45a0
movq -0x18(%rbp), %rdi
callq 0x45a0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)