// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/cram/cram_io.c
// Function: cram_new_slice
cram_slice *cram_new_slice(enum cram_content_type type, int nrecs) {
    cram_slice *s = calloc(1, sizeof(*s));
    if (!s)
        return NULL;

    if (!(s->hdr = (cram_block_slice_hdr *)calloc(1, sizeof(*s->hdr))))
        goto err;
    s->hdr->content_type = type;

    s->hdr_block = NULL;
    s->block = NULL;
    s->block_by_id = NULL;
    s->last_apos = 0;
    if (!(s->crecs = malloc(nrecs * sizeof(cram_record))))  goto err;
    s->cigar_alloc = 1024;
    if (!(s->cigar = malloc(s->cigar_alloc * sizeof(*s->cigar)))) goto err;
    s->ncigar = 0;

    if (!(s->seqs_blk = cram_new_block(EXTERNAL, 0)))       goto err;
    if (!(s->qual_blk = cram_new_block(EXTERNAL, DS_QS)))   goto err;
    if (!(s->name_blk = cram_new_block(EXTERNAL, DS_RN)))   goto err;
    if (!(s->aux_blk  = cram_new_block(EXTERNAL, DS_aux)))  goto err;
    if (!(s->base_blk = cram_new_block(EXTERNAL, DS_IN)))   goto err;
    if (!(s->soft_blk = cram_new_block(EXTERNAL, DS_SC)))   goto err;

    s->features = NULL;
    s->nfeatures = s->afeatures = 0;

#ifndef TN_external
    s->TN = NULL;
    s->nTN = s->aTN = 0;
#endif

    // Volatile keys as we do realloc in dstring
    if (!(s->pair_keys = string_pool_create(8192))) goto err;
    if (!(s->pair[0] = kh_init(m_s2i)))             goto err;
    if (!(s->pair[1] = kh_init(m_s2i)))             goto err;

#ifdef BA_external
    s->BA_len = 0;
#endif

    return s;

 err:
    if (s)
        cram_free_slice(s);

    return NULL;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movl %edi, %r14d
movl $0x1, %edi
movl $0xf0, %esi
callq 0x4300
testq %rax, %rax
je 0x54000
movq %rax, %rbx
movl $0x1, %edi
movl $0x50, %esi
callq 0x4300
movq %rax, (%rbx)
testq %rax, %rax
je 0x53ff8
movl %r14d, (%rax)
movslq %ebp, %rax
shlq $0x4, %rax
leaq (%rax,%rax,8), %rdi
callq 0x4680
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movups %xmm0, 0x18(%rbx)
movq %rax, 0x30(%rbx)
testq %rax, %rax
je 0x53ff8
movl $0x400, 0x40(%rbx)      # imm = 0x400
movl $0x1000, %edi           # imm = 0x1000
callq 0x4680
movq %rax, 0x38(%rbx)
testq %rax, %rax
je 0x53ff8
movl $0x0, 0x44(%rbx)
movl $0x4, %edi
xorl %esi, %esi
callq 0x4ee42
movq %rax, 0x70(%rbx)
testq %rax, %rax
je 0x53ff8
movl $0x4, %edi
movl $0xc, %esi
callq 0x4ee42
movq %rax, 0x78(%rbx)
testq %rax, %rax
je 0x53ff8
movl $0x4, %edi
movl $0xb, %esi
callq 0x4ee42
movq %rax, 0x68(%rbx)
testq %rax, %rax
je 0x53ff8
movl $0x4, %edi
movl $0x1, %esi
callq 0x4ee42
movq %rax, 0x90(%rbx)
testq %rax, %rax
je 0x53ff8
movl $0x4, %edi
movl $0xd, %esi
callq 0x4ee42
movq %rax, 0x80(%rbx)
testq %rax, %rax
je 0x53ff8
movl $0x4, %edi
movl $0xe, %esi
callq 0x4ee42
movq %rax, 0x88(%rbx)
testq %rax, %rax
je 0x53ff8
xorps %xmm0, %xmm0
movups %xmm0, 0x58(%rbx)
movups %xmm0, 0x48(%rbx)
movl $0x2000, %edi           # imm = 0x2000
callq 0x5a90c
movq %rax, 0x98(%rbx)
testq %rax, %rax
je 0x53ff8
movl $0x1, %edi
movl $0x28, %esi
callq 0x4300
movq %rax, 0xa0(%rbx)
testq %rax, %rax
je 0x53ff8
movl $0x1, %edi
movl $0x28, %esi
callq 0x4300
movq %rax, 0xa8(%rbx)
testq %rax, %rax
jne 0x54002
movq %rbx, %rdi
callq 0x52c5d
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq