// File: /workspace/github_cpp_makefile_star2_O1/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 0x379aa
movq %rax, %rbx
movl $0x1, %edi
movl $0x48, %esi
callq 0x4360
movq %rax, (%rbx)
testq %rax, %rax
je 0x379a2
movl %r14d, (%rax)
movslq %ebp, %rax
imulq $0x70, %rax, %rdi
callq 0x4700
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movups %xmm0, 0x14(%rbx)
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0x379a2
movl $0x40, %edi
callq 0x4700
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rbx)
testq %rax, %rax
je 0x377f0
movaps 0x1d04d(%rip), %xmm0    # 0x54820
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)
jmp 0x377f2
xorl %eax, %eax
movq %rax, 0x68(%rbx)
testq %rax, %rax
je 0x379a2
movl $0x40, %edi
callq 0x4700
testq %rax, %rax
je 0x37832
movaps 0x1d01b(%rip), %xmm0    # 0x54830
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)
jmp 0x37834
xorl %eax, %eax
movq %rax, 0x70(%rbx)
testq %rax, %rax
je 0x379a2
movl $0x40, %edi
callq 0x4700
testq %rax, %rax
je 0x37874
movaps 0x1cfe9(%rip), %xmm0    # 0x54840
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)
jmp 0x37876
xorl %eax, %eax
movq %rax, 0x60(%rbx)
testq %rax, %rax
je 0x379a2
movl $0x40, %edi
callq 0x4700
testq %rax, %rax
je 0x378b6
movaps 0x1cfb7(%rip), %xmm0    # 0x54850
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)
jmp 0x378b8
xorl %eax, %eax
movq %rax, 0x88(%rbx)
testq %rax, %rax
je 0x379a2
movl $0x40, %edi
callq 0x4700
testq %rax, %rax
je 0x378fb
movaps 0x1cf82(%rip), %xmm0    # 0x54860
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)
jmp 0x378fd
xorl %eax, %eax
movq %rax, 0x78(%rbx)
testq %rax, %rax
je 0x379a2
movl $0x40, %edi
callq 0x4700
testq %rax, %rax
je 0x3793d
movaps 0x1cf50(%rip), %xmm0    # 0x54870
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)
jmp 0x3793f
xorl %eax, %eax
movq %rax, 0x80(%rbx)
testq %rax, %rax
je 0x379a2
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rbx)
movups %xmm0, 0x40(%rbx)
movl $0x2000, %edi           # imm = 0x2000
callq 0x41dfc
movq %rax, 0xd0(%rbx)
testq %rax, %rax
je 0x379a2
movl $0x1, %edi
movl $0x28, %esi
callq 0x4360
movq %rax, 0xd8(%rbx)
testq %rax, %rax
je 0x379a2
movl $0x1, %edi
movl $0x28, %esi
callq 0x4360
movq %rax, 0xe0(%rbx)
testq %rax, %rax
jne 0x379ac
movq %rbx, %rdi
callq 0x35ef7
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq