// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/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 = NULL;
    s->cigar_alloc = 0;
    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 $0x100, %esi            # imm = 0x100
callq 0x4360
testq %rax, %rax
je 0x36b9b
movq %rax, %rbx
movl $0x1, %edi
movl $0x48, %esi
callq 0x4360
movq %rax, (%rbx)
testq %rax, %rax
je 0x36b93
movl %r14d, (%rax)
movslq %ebp, %rax
imulq $0x70, %rax, %rdi
callq 0x4700
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0x36b93
movl $0x40, %edi
callq 0x4700
testq %rax, %rax
je 0x36b93
movaps 0x1bfc7(%rip), %xmm0    # 0x529d0
movups %xmm0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movq %rcx, 0x30(%rax)
movl $0x7, 0x38(%rax)
movq %rax, 0x68(%rbx)
movl $0x40, %edi
callq 0x4700
testq %rax, %rax
je 0x36b93
movaps 0x1bf9e(%rip), %xmm0    # 0x529e0
movups %xmm0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movq %rcx, 0x30(%rax)
movl $0x7, 0x38(%rax)
movq %rax, 0x70(%rbx)
movl $0x40, %edi
callq 0x4700
testq %rax, %rax
je 0x36b93
movaps 0x1bf75(%rip), %xmm0    # 0x529f0
movups %xmm0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movq %rcx, 0x30(%rax)
movl $0x7, 0x38(%rax)
movq %rax, 0x60(%rbx)
movl $0x40, %edi
callq 0x4700
testq %rax, %rax
je 0x36b93
movaps 0x1bf4c(%rip), %xmm0    # 0x52a00
movups %xmm0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movq %rcx, 0x30(%rax)
movl $0x7, 0x38(%rax)
movq %rax, 0x88(%rbx)
movl $0x40, %edi
callq 0x4700
testq %rax, %rax
je 0x36b93
movaps 0x1bf20(%rip), %xmm0    # 0x52a10
movups %xmm0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movq %rcx, 0x30(%rax)
movl $0x7, 0x38(%rax)
movq %rax, 0x78(%rbx)
movl $0x40, %edi
callq 0x4700
testq %rax, %rax
je 0x36b93
movaps 0x1befb(%rip), %xmm0    # 0x52a20
movups %xmm0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movq %rcx, 0x30(%rax)
movl $0x7, 0x38(%rax)
movq %rax, 0x80(%rbx)
movl $0x2000, %edi           # imm = 0x2000
callq 0x40df4
movq %rax, 0xd0(%rbx)
testq %rax, %rax
je 0x36b93
movl $0x1, %edi
movl $0x28, %esi
callq 0x4360
movq %rax, 0xd8(%rbx)
testq %rax, %rax
je 0x36b93
movl $0x1, %edi
movl $0x28, %esi
callq 0x4360
movq %rax, 0xe0(%rbx)
testq %rax, %rax
jne 0x36b9d
movq %rbx, %rdi
callq 0x35120
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq