// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
movl $0x1, %edi
movl $0xf0, %esi
callq 0x42f0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x76f75
movq $0x0, -0x8(%rbp)
jmp 0x771b5
movl $0x1, %edi
movl $0x50, %esi
callq 0x42f0
movq -0x18(%rbp), %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x76f96
jmp 0x7719d
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x20(%rax)
movslq -0x10(%rbp), %rax
imulq $0x90, %rax, %rdi
callq 0x4650
movq -0x18(%rbp), %rcx
movq %rax, 0x30(%rcx)
cmpq $0x0, %rax
jne 0x76ff5
jmp 0x7719d
movq -0x18(%rbp), %rax
movl $0x400, 0x40(%rax)      # imm = 0x400
movq -0x18(%rbp), %rax
movl 0x40(%rax), %eax
movl %eax, %edi
shlq $0x2, %rdi
callq 0x4650
movq -0x18(%rbp), %rcx
movq %rax, 0x38(%rcx)
cmpq $0x0, %rax
jne 0x77025
jmp 0x7719d
movq -0x18(%rbp), %rax
movl $0x0, 0x44(%rax)
movl $0x4, %edi
xorl %esi, %esi
callq 0x6ede0
movq -0x18(%rbp), %rcx
movq %rax, 0x70(%rcx)
cmpq $0x0, %rax
jne 0x7704f
jmp 0x7719d
movl $0x4, %edi
movl $0xc, %esi
callq 0x6ede0
movq -0x18(%rbp), %rcx
movq %rax, 0x78(%rcx)
cmpq $0x0, %rax
jne 0x77071
jmp 0x7719d
movl $0x4, %edi
movl $0xb, %esi
callq 0x6ede0
movq -0x18(%rbp), %rcx
movq %rax, 0x68(%rcx)
cmpq $0x0, %rax
jne 0x77093
jmp 0x7719d
movl $0x4, %edi
movl $0x1, %esi
callq 0x6ede0
movq -0x18(%rbp), %rcx
movq %rax, 0x90(%rcx)
cmpq $0x0, %rax
jne 0x770b8
jmp 0x7719d
movl $0x4, %edi
movl $0xd, %esi
callq 0x6ede0
movq -0x18(%rbp), %rcx
movq %rax, 0x80(%rcx)
cmpq $0x0, %rax
jne 0x770dd
jmp 0x7719d
movl $0x4, %edi
movl $0xe, %esi
callq 0x6ede0
movq -0x18(%rbp), %rcx
movq %rax, 0x88(%rcx)
cmpq $0x0, %rax
jne 0x77102
jmp 0x7719d
movq -0x18(%rbp), %rax
movq $0x0, 0x48(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x54(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x50(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x58(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x64(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x60(%rax)
movl $0x2000, %edi           # imm = 0x2000
callq 0x82320
movq -0x18(%rbp), %rcx
movq %rax, 0x98(%rcx)
cmpq $0x0, %rax
jne 0x77163
jmp 0x7719d
callq 0x76e40
movq -0x18(%rbp), %rcx
movq %rax, 0xa0(%rcx)
cmpq $0x0, %rax
jne 0x7717b
jmp 0x7719d
callq 0x76e40
movq -0x18(%rbp), %rcx
movq %rax, 0xa8(%rcx)
cmpq $0x0, %rax
jne 0x77193
jmp 0x7719d
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x771b5
cmpq $0x0, -0x18(%rbp)
je 0x771ad
movq -0x18(%rbp), %rdi
callq 0x74f20
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop