LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: karel-brinda[P]ococo/ext/htslib/cram/cram_io.c
// Function: bgzf_open_ref
static BGZF *bgzf_open_ref(char *fn, char *mode, int is_md5) {
    BGZF *fp;

    if (!is_md5) {
	char fai_file[PATH_MAX];

	snprintf(fai_file, PATH_MAX, "%s.fai", fn);
	if (access(fai_file, R_OK) != 0)
	    if (fai_build(fn) != 0)
		return NULL;
    }

    if (!(fp = bgzf_open(fn, mode))) {
	perror(fn);
	return NULL;
    }

    if (fp->is_compressed == 1 && bgzf_index_load(fp, fn, ".gzi") < 0) {
	fprintf(stderr, "Unable to load .gzi index '%s.gzi'\n", fn);
	bgzf_close(fp);
	return NULL;
    }

    return fp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1030, %rsp           # imm = 0x1030
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x4941f
leaq -0x1030(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl $0x1000, %esi           # imm = 0x1000
leaq 0x33de5(%rip), %rdx     # 0x7d1c8
movb $0x0, %al
callq 0x4950
leaq -0x1030(%rbp), %rdi
movl $0x4, %esi
callq 0x49d0
cmpl $0x0, %eax
je 0x4941d
movq -0x10(%rbp), %rdi
callq 0x68800
cmpl $0x0, %eax
je 0x4941b
movq $0x0, -0x8(%rbp)
jmp 0x494aa
jmp 0x4941d
jmp 0x4941f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x62d50
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x49449
movq -0x10(%rbp), %rdi
callq 0x4480
movq $0x0, -0x8(%rbp)
jmp 0x494aa
movq -0x28(%rbp), %rax
movl (%rax), %eax
shrl $0x1d, %eax
andl $0x3, %eax
cmpl $0x1, %eax
jne 0x494a2
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq 0x33d66(%rip), %rdx     # 0x7d1cf
callq 0x66830
cmpl $0x0, %eax
jge 0x494a2
movq 0x40b56(%rip), %rax     # 0x89fd0
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x33d4c(%rip), %rsi     # 0x7d1d4
movb $0x0, %al
callq 0x4830
movq -0x28(%rbp), %rdi
callq 0x65880
movq $0x0, -0x8(%rbp)
jmp 0x494aa
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x1030, %rsp           # imm = 0x1030
popq %rbp
retq
nopw (%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/cram_io.c
// Function: cram_load_reference
int cram_load_reference(cram_fd *fd, char *fn) {
    int ret = 0;

    if (fn) {
	fd->refs = refs_load_fai(fd->refs, fn,
				 !(fd->embed_ref && fd->mode == 'r'));
	fn = fd->refs ? fd->refs->fn : NULL;
	if (!fn)
	    ret = -1;
	sanitise_SQ_lines(fd);
    }
    fd->ref_fn = fn;

    if ((!fd->refs || (fd->refs->nref == 0 && !fn)) && fd->header) {
	if (fd->refs)
	    refs_free(fd->refs);
	if (!(fd->refs = refs_create()))
	    return -1;
	if (-1 == refs_from_header(fd->refs, fd, fd->header))
	    return -1;
    }

    if (fd->header)
	if (-1 == refs2id(fd->refs, fd->header))
	    return -1;

    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x4a82c
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0x208(%rcx)
movb %al, -0x1d(%rbp)
je 0x4a7c6
movq -0x10(%rbp), %rax
cmpl $0x72, 0x8(%rax)
sete %al
movb %al, -0x1d(%rbp)
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdi
movb -0x1d(%rbp), %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %edx
callq 0x4a910
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x4a805
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x20(%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0x4a80d
xorl %eax, %eax
movq %rax, -0x38(%rbp)
jmp 0x4a80d
movq -0x38(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x4a823
movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rdi
callq 0x4b070
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x4a858
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
cmpl $0x0, 0x18(%rax)
jne 0x4a8c6
cmpq $0x0, -0x18(%rbp)
jne 0x4a8c6
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x4a8c6
movq -0x10(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x4a87b
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x48510
callq 0x4b240
movq -0x10(%rbp), %rcx
movq %rax, 0x48(%rcx)
cmpq $0x0, %rax
jne 0x4a897
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4a902
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdx
callq 0x489e0
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
jne 0x4a8c4
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4a902
jmp 0x4a8c6
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x4a8fc
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x48700
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
jne 0x4a8fa
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4a902
jmp 0x4a8fc
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/cram_io.c
// Function: refs_create
static refs_t *refs_create(void) {
    refs_t *r = calloc(1, sizeof(*r));

    RP("refs_create()\n");

    if (!r)
	return NULL;

    if (!(r->pool = string_pool_create(8192)))
	goto err;

    r->ref_id = NULL; // see refs2id() to populate.
    r->count = 1;
    r->last = NULL;
    r->last_id = -1;

    if (!(r->h_meta = kh_init(refs)))
	goto err;

    pthread_mutex_init(&r->lock, NULL);

    return r;

 err:
    refs_free(r);
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x1, %edi
movl $0x70, %esi
callq 0x4370
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x4b26f
movq $0x0, -0x8(%rbp)
jmp 0x4b2f7
movl $0x2000, %edi           # imm = 0x2000
callq 0x5fed0
movq -0x10(%rbp), %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x4b288
jmp 0x4b2e6
movq -0x10(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0x30(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x60(%rax)
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x68(%rax) # imm = 0xFFFFFFFF
callq 0x54580
movq -0x10(%rbp), %rcx
movq %rax, 0x8(%rcx)
cmpq $0x0, %rax
jne 0x4b2cb
jmp 0x4b2e6
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x48a0
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x4b2f7
movq -0x10(%rbp), %rdi
callq 0x48510
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: karel-brinda[P]ococo/ext/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->max_slice = nslice;
    c->curr_slice = 0;

    c->pos_sorted = 1;
    c->max_apos   = 0;
    c->multi_seq  = 0;

    c->bams = NULL;

    if (!(c->slices = (cram_slice **)calloc(nslice, 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(s_i2i)))
	goto err;
    c->refs_used = 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 $0x250, %esi            # imm = 0x250
callq 0x4370
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x4b345
movq $0x0, -0x8(%rbp)
jmp 0x4b4c1
movq -0x18(%rbp), %rax
movl $0xfffffffe, 0x6c(%rax) # imm = 0xFFFFFFFE
movl -0xc(%rbp), %ecx
imull -0x10(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x60(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x64(%rax)
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x58(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x18(%rax)
movl -0x10(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x50(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x54(%rax)
movq -0x18(%rbp), %rax
movl $0x1, 0x88(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x8c(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x94(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0xb8(%rax)
movslq -0x10(%rbp), %rdi
movl $0x8, %esi
callq 0x4370
movq -0x18(%rbp), %rcx
movq %rax, 0x78(%rcx)
cmpq $0x0, %rax
jne 0x4b3fa
jmp 0x4b491
movq -0x18(%rbp), %rax
movq $0x0, 0x80(%rax)
callq 0x4b4d0
movq -0x18(%rbp), %rcx
movq %rax, 0x40(%rcx)
cmpq $0x0, %rax
jne 0x4b41e
jmp 0x4b491
movq -0x18(%rbp), %rax
movq $0x0, 0x48(%rax)
movl $0xb, -0x1c(%rbp)
cmpl $0x27, -0x1c(%rbp)
jae 0x4b460
callq 0x54c10
movq -0x18(%rbp), %rcx
movl -0x1c(%rbp), %edx
movq %rax, 0xc0(%rcx,%rdx,8)
cmpq $0x0, %rax
jne 0x4b453
jmp 0x4b491
jmp 0x4b455
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x4b431
callq 0x4b5c0
movq -0x18(%rbp), %rcx
movq %rax, 0x238(%rcx)
cmpq $0x0, %rax
jne 0x4b478
jmp 0x4b491
movq -0x18(%rbp), %rax
movq $0x0, 0x240(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x4b4c1
cmpq $0x0, -0x18(%rbp)
je 0x4b4b9
movq -0x18(%rbp), %rax
cmpq $0x0, 0x78(%rax)
je 0x4b4b0
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rdi
callq 0x46a0
movq -0x18(%rbp), %rdi
callq 0x46a0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/cram_io.c
// Function: cram_new_compression_header
cram_block_compression_hdr *cram_new_compression_header(void) {
    cram_block_compression_hdr *hdr = calloc(1, sizeof(*hdr));
    if (!hdr)
	return NULL;

    if (!(hdr->TD_blk = cram_new_block(CORE, 0))) {
	free(hdr);
	return NULL;
    }

    if (!(hdr->TD_hash = kh_init(m_s2i))) {
	cram_free_block(hdr->TD_blk);
	free(hdr);
	return NULL;
    }

    if (!(hdr->TD_keys = string_pool_create(8192))) {
	kh_destroy(m_s2i, hdr->TD_hash);
	cram_free_block(hdr->TD_blk);
	free(hdr);
	return NULL;
    }

    return hdr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x1, %edi
movl $0x418, %esi            # imm = 0x418
callq 0x4370
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x4b4ff
movq $0x0, -0x8(%rbp)
jmp 0x4b5af
movl $0x5, %edi
xorl %esi, %esi
callq 0x45b10
movq -0x10(%rbp), %rcx
movq %rax, 0x50(%rcx)
cmpq $0x0, %rax
jne 0x4b52f
movq -0x10(%rbp), %rdi
callq 0x46a0
movq $0x0, -0x8(%rbp)
jmp 0x4b5af
callq 0x4f5c0
movq -0x10(%rbp), %rcx
movq %rax, 0x68(%rcx)
cmpq $0x0, %rax
jne 0x4b562
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x470c0
movq -0x10(%rbp), %rdi
callq 0x46a0
movq $0x0, -0x8(%rbp)
jmp 0x4b5af
movl $0x2000, %edi           # imm = 0x2000
callq 0x5fed0
movq -0x10(%rbp), %rcx
movq %rax, 0x70(%rcx)
cmpq $0x0, %rax
jne 0x4b5a7
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0x4f5e0
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x470c0
movq -0x10(%rbp), %rdi
callq 0x46a0
movq $0x0, -0x8(%rbp)
jmp 0x4b5af
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/cram_io.c
// Function: cram_free_container
void cram_free_container(cram_container *c) {
    enum cram_DS_ID id;
    int i;

    if (!c)
	return;

    if (c->refs_used)
	free(c->refs_used);

    if (c->landmark)
	free(c->landmark);

    if (c->comp_hdr)
	cram_free_compression_header(c->comp_hdr);

    if (c->comp_hdr_block)
	cram_free_block(c->comp_hdr_block);

    if (c->slices) {
	for (i = 0; i < c->max_slice; i++)
	    if (c->slices[i])
		cram_free_slice(c->slices[i]);
	free(c->slices);
    }

    for (id = DS_RN; id < DS_TN; id++)
	if (c->stats[id]) cram_stats_free(c->stats[id]);

    //if (c->aux_B_stats) cram_stats_free(c->aux_B_stats);
    
    if (c->tags_used) kh_destroy(s_i2i, c->tags_used);

    free(c);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x4b5f8
jmp 0x4b725
movq -0x8(%rbp), %rax
cmpq $0x0, 0x240(%rax)
je 0x4b616
movq -0x8(%rbp), %rax
movq 0x240(%rax), %rdi
callq 0x46a0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x4b62e
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x46a0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x40(%rax)
je 0x4b646
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x4b730
movq -0x8(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x4b65e
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x470c0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x78(%rax)
je 0x4b6be
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x50(%rcx), %eax
jge 0x4b6b1
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x10(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x4b6a4
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x4b920
jmp 0x4b6a6
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x4b670
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rdi
callq 0x46a0
movl $0xb, -0xc(%rbp)
cmpl $0x27, -0xc(%rbp)
jae 0x4b6fe
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
cmpq $0x0, 0xc0(%rax,%rcx,8)
je 0x4b6f1
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
movq 0xc0(%rax,%rcx,8), %rdi
callq 0x557f0
jmp 0x4b6f3
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x4b6c5
movq -0x8(%rbp), %rax
cmpq $0x0, 0x238(%rax)
je 0x4b71c
movq -0x8(%rbp), %rax
movq 0x238(%rax), %rdi
callq 0x4bc00
movq -0x8(%rbp), %rdi
callq 0x46a0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/cram_io.c
// Function: cram_flush_container
int cram_flush_container(cram_fd *fd, cram_container *c) {
    /* Encode the container blocks and generate compression header */
    if (0 != cram_encode_container(fd, c))
	return -1;

    return cram_flush_container2(fd, c);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x34f50
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x4f1fe
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4f20e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4f220
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/cram_io.c
// Function: cram_flush_container2
static int cram_flush_container2(cram_fd *fd, cram_container *c) {
    int i, j;

    if (c->curr_slice > 0 && !c->slices)
	return -1;

    //fprintf(stderr, "Writing container %d, sum %u\n", c->record_counter, sum);

    /* Write the container struct itself */
    if (0 != cram_write_container(fd, c))
	return -1;

    /* And the compression header */
    if (0 != cram_write_block(fd, c->comp_hdr_block))
	return -1;

    /* Followed by the slice blocks */
    for (i = 0; i < c->curr_slice; i++) {
	cram_slice *s = c->slices[i];

	if (0 != cram_write_block(fd, s->hdr_block))
	    return -1;

	for (j = 0; j < s->hdr->num_blocks; j++) {
	    if (0 != cram_write_block(fd, s->block[j]))
		return -1;
	}
    }

    return hflush(fd->fp) == 0 ? 0 : -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x54(%rax)
jle 0x4f251
movq -0x18(%rbp), %rax
cmpq $0x0, 0x78(%rax)
jne 0x4f251
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4f35f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4d8d0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x4f272
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4f35f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rsi
callq 0x46670
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x4f297
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4f35f
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x54(%rcx), %eax
jge 0x4f341
movq -0x18(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x46670
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x4f2e4
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4f35f
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x28(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x20(%rcx), %eax
jge 0x4f331
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x46670
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x4f324
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4f35f
jmp 0x4f326
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x4f2eb
jmp 0x4f333
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x4f29e
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x6a8e0
movl %eax, %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/cram_io.c
// Function: cram_flush_thread
void *cram_flush_thread(void *arg) {
    cram_job *j = (cram_job *)arg;

    /* Encode the container blocks and generate compression header */
    if (0 != cram_encode_container(j->fd, j->c)) {
	fprintf(stderr, "cram_encode_container failed\n");
	return NULL;
    }

    return arg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x34f50
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x4f3c2
movq 0x3ac29(%rip), %rax     # 0x89fd0
movq (%rax), %rdi
leaq 0x2dc32(%rip), %rsi     # 0x7cfe3
movb $0x0, %al
callq 0x4830
movq $0x0, -0x8(%rbp)
jmp 0x4f3ca
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/cram_io.c
// Function: cram_flush_container_mt
int cram_flush_container_mt(cram_fd *fd, cram_container *c) {
    cram_job *j;

    if (!fd->pool)
	return cram_flush_container(fd, c);

    if (!(j = malloc(sizeof(*j))))
	return -1;
    j->fd = fd;
    j->c = c;
    
    t_pool_dispatch(fd->pool, fd->rqueue, cram_flush_thread, j);

    return cram_flush_result(fd);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8860(%rax)
jne 0x4f410
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4f1d0
movl %eax, -0x4(%rbp)
jmp 0x4f476
movl $0x10, %edi
callq 0x47a0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x4f42d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4f476
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x8860(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8868(%rax), %rsi
movq -0x20(%rbp), %rcx
leaq -0xf5(%rip), %rdx       # 0x4f370
callq 0x60a00
movq -0x10(%rbp), %rdi
callq 0x4f480
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: karel-brinda[P]ococo/ext/htslib/cram/cram_io.c
// Function: cram_flush_result
static int cram_flush_result(cram_fd *fd) {
    int i, ret = 0;
    t_pool_result *r;

    while ((r = t_pool_next_result(fd->rqueue))) {
	cram_job *j = (cram_job *)r->data;
	cram_container *c;

	if (!j) {
	    t_pool_delete_result(r, 0);
	    return -1;
	}

	fd = j->fd;
	c = j->c;

	if (0 != cram_flush_container2(fd, c))
	    return -1;

	/* Free the container */
	for (i = 0; i < c->max_slice; i++) {
	    cram_free_slice(c->slices[i]);
	    c->slices[i] = NULL;
	}

	c->slice = NULL;
	c->curr_slice = 0;

	cram_free_container(c);

	ret |= hflush(fd->fp) == 0 ? 0 : -1;

	t_pool_delete_result(r, 1);
    }

    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8868(%rax), %rdi
callq 0x60220
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x4f5b1
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x4f4db
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x604a0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4f5b7
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x4f220
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x4f513
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4f5b7
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x30(%rbp), %rcx
cmpl 0x50(%rcx), %eax
jge 0x4f55a
movq -0x30(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x4b920
movq -0x30(%rbp), %rax
movq 0x78(%rax), %rax
movslq -0x14(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x4f51a
movq -0x30(%rbp), %rax
movq $0x0, 0x80(%rax)
movq -0x30(%rbp), %rax
movl $0x0, 0x54(%rax)
movq -0x30(%rbp), %rdi
callq 0x4b5e0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x6a8e0
movl %eax, %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
orl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x604a0
jmp 0x4f493
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
// File: karel-brinda[P]ococo/ext/htslib/cram/cram_io.c
// Function: cram_free_slice_header
void cram_free_slice_header(cram_block_slice_hdr *hdr) {
    if (!hdr)
	return;

    if (hdr->block_content_ids)
	free(hdr->block_content_ids);

    free(hdr);

    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x4f695
jmp 0x4f6b6
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x4f6ad
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x46a0
movq -0x8(%rbp), %rdi
callq 0x46a0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/cram_io.c
// Function: cram_read_file_def
cram_file_def *cram_read_file_def(cram_fd *fd) {
    cram_file_def *def = malloc(sizeof(*def));
    if (!def)
	return NULL;

    if (26 != hread(fd->fp, &def->magic[0], 26)) {
	free(def);
	return NULL;
    }

    if (memcmp(def->magic, "CRAM", 4) != 0) {
	free(def);
	return NULL;
    }

    if (def->major_version > 3) {
	fprintf(stderr, "CRAM version number mismatch\n"
		"Expected 1.x, 2.x or 3.x, got %d.%d\n",
		def->major_version, def->minor_version);
	free(def);
	return NULL;
    }

    fd->first_container += 26;
    fd->last_slice = 0;

    return def;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x1a, %edi
callq 0x47a0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x4fd1e
movq $0x0, -0x8(%rbp)
jmp 0x4fdf3
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
movl $0x1a, %edx
callq 0x45540
movq %rax, %rcx
movl $0x1a, %eax
cmpq %rcx, %rax
je 0x4fd56
movq -0x18(%rbp), %rdi
callq 0x46a0
movq $0x0, -0x8(%rbp)
jmp 0x4fdf3
movq -0x18(%rbp), %rax
movl (%rax), %eax
subl $0x4d415243, %eax       # imm = 0x4D415243
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x4fd7f
movq -0x18(%rbp), %rdi
callq 0x46a0
movq $0x0, -0x8(%rbp)
jmp 0x4fdf3
movq -0x18(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x3, %eax
jle 0x4fdc7
movq 0x3a23d(%rip), %rax     # 0x89fd0
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movzbl 0x4(%rax), %edx
movq -0x18(%rbp), %rax
movzbl 0x5(%rax), %ecx
leaq 0x2d29a(%rip), %rsi     # 0x7d047
movb $0x0, %al
callq 0x4830
movq -0x18(%rbp), %rdi
callq 0x46a0
movq $0x0, -0x8(%rbp)
jmp 0x4fdf3
movq -0x10(%rbp), %rax
movq 0x8840(%rax), %rcx
addq $0x1a, %rcx
movq %rcx, 0x8840(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x884c(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/cram_io.c
// Function: full_path
static void full_path(char *out, char *in) {
    if (*in == '/') {
	strncpy(out, in, PATH_MAX);
	out[PATH_MAX-1] = 0;
    } else {
	int len;

	// unable to get dir or out+in is too long
	if (!getcwd(out, PATH_MAX) ||
	    (len = strlen(out))+1+strlen(in) >= PATH_MAX) {
	    strncpy(out, in, PATH_MAX);
	    out[PATH_MAX-1] = 0;
	    return;
	}

	sprintf(out+len, "/%.*s", PATH_MAX - len, in);

	// FIXME: cope with `pwd`/../../../foo.fa ?
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x518ae
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x42c0
movq -0x8(%rbp), %rax
movb $0x0, 0xfff(%rax)
jmp 0x51936
movq -0x8(%rbp), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0x42b0
cmpq $0x0, %rax
je 0x518f2
movq -0x8(%rbp), %rdi
callq 0x4230
movl %eax, -0x14(%rbp)
addl $0x1, %eax
cltq
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4230
movq %rax, %rcx
movq -0x20(%rbp), %rax
addq %rcx, %rax
cmpq $0x1000, %rax           # imm = 0x1000
jb 0x51911
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x42c0
movq -0x8(%rbp), %rax
movb $0x0, 0xfff(%rax)
jmp 0x51936
movq -0x8(%rbp), %rdi
movslq -0x14(%rbp), %rax
addq %rax, %rdi
movl $0x1000, %edx           # imm = 0x1000
subl -0x14(%rbp), %edx
movq -0x10(%rbp), %rcx
leaq 0x2bb7c(%rip), %rsi     # 0x7d4ab
movb $0x0, %al
callq 0x4100
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/cram_io.c
// Function: cram_open
cram_fd *cram_open(const char *filename, const char *mode) {
    hFILE *fp;
    cram_fd *fd;
    char fmode[3]= { mode[0], '\0', '\0' };

    if (strlen(mode) > 1 && (mode[1] == 'b' || mode[1] == 'c')) {
	fmode[1] = 'b';
    }

    fp = hopen(filename, fmode);
    if (!fp)
	return NULL;

    fd = cram_dopen(fp, filename, mode);
    if (!fd)
	hclose_abruptly(fp);

    return fd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movb (%rax), %al
movb %al, -0x2b(%rbp)
movb $0x0, -0x2a(%rbp)
movb $0x0, -0x29(%rbp)
movq -0x18(%rbp), %rdi
callq 0x4230
cmpq $0x1, %rax
jbe 0x5198e
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x62, %eax
je 0x5198a
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x63, %eax
jne 0x5198e
movb $0x62, -0x2a(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x2b(%rbp), %rsi
callq 0x6b3f0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x519b0
movq $0x0, -0x8(%rbp)
jmp 0x519dd
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x519f0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x519d5
movq -0x20(%rbp), %rdi
callq 0x6ae00
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/cram_io.c
// Function: cram_seek
int cram_seek(cram_fd *fd, off_t offset, int whence) {
    char buf[65536];

    fd->ooc = 0;

    if (hseek(fd->fp, offset, whence) >= 0)
	return 0;

    if (!(whence == SEEK_CUR && offset >= 0))
	return -1;

    /* Couldn't fseek, but we're in SEEK_CUR mode so read instead */
    while (offset > 0) {
	int len = MIN(65536, offset);
	if (len != hread(fd->fp, buf, len))
	    return -1;
	offset -= len;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10040, %rsp          # imm = 0x10040
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl $0x0, 0x88f8(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0x6abd0
cmpq $0x0, %rax
jl 0x52529
movl $0x0, -0x4(%rbp)
jmp 0x525de
cmpl $0x1, -0x1c(%rbp)
jne 0x52536
cmpq $0x0, -0x18(%rbp)
jge 0x52542
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x525de
jmp 0x52544
cmpq $0x0, -0x18(%rbp)
jle 0x525d7
movl $0x10000, %eax          # imm = 0x10000
cmpq -0x18(%rbp), %rax
jge 0x52568
movl $0x10000, %eax          # imm = 0x10000
movq %rax, -0x10030(%rbp)
jmp 0x52573
movq -0x18(%rbp), %rax
movq %rax, -0x10030(%rbp)
movq -0x10030(%rbp), %rax
movl %eax, -0x10024(%rbp)
movslq -0x10024(%rbp), %rax
movq %rax, -0x10038(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq -0x10020(%rbp), %rsi
movslq -0x10024(%rbp), %rdx
callq 0x45540
movq %rax, %rcx
movq -0x10038(%rbp), %rax
cmpq %rcx, %rax
je 0x525c0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x525de
movslq -0x10024(%rbp), %rcx
movq -0x18(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x18(%rbp)
jmp 0x52544
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10040, %rsp          # imm = 0x10040
popq %rbp
retq
nopw (%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/cram_io.c
// Function: cram_flush
int cram_flush(cram_fd *fd) {
    if (!fd)
	return -1;

    if (fd->mode == 'w' && fd->ctr) {
	if(fd->ctr->slice)
	    cram_update_curr_slice(fd->ctr);

	if (-1 == cram_flush_container_mt(fd, fd->ctr))
	    return -1;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x5260c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5266e
movq -0x10(%rbp), %rax
cmpl $0x77, 0x8(%rax)
jne 0x52667
movq -0x10(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x52667
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
cmpq $0x0, 0x80(%rax)
je 0x52640
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x39a00
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x4f3e0
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
jne 0x52665
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5266e
jmp 0x52667
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/cram_io.c
// Function: cram_set_option
int cram_set_option(cram_fd *fd, enum hts_fmt_option opt, ...) {
    int r;
    va_list args;

    va_start(args, opt);
    r = cram_set_voption(fd, opt, args);
    va_end(args);

    return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
testb %al, %al
je 0x52a58
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
movq %r9, -0xb8(%rbp)
movq %r8, -0xc0(%rbp)
movq %rcx, -0xc8(%rbp)
movq %rdx, -0xd0(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
leaq -0xe0(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x30, -0x2c(%rbp)
movl $0x10, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x30(%rbp), %rdx
callq 0x52ac0
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
addq $0xe0, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/cram_io.c
// Function: get_cache_basedir
static const char *get_cache_basedir(const char **extra) {
    char *base;

    *extra = "";

    base = getenv("XDG_CACHE_HOME");
    if (base && *base) return base;

    base = getenv("HOME");
    if (base && *base) { *extra = "/.cache"; return base; }

    base = getenv("TMPDIR");
    if (base && *base) return base;

    base = getenv("TEMP");
    if (base && *base) return base;

    return "/tmp";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x280c5(%rip), %rcx     # 0x7c4cc
movq %rcx, (%rax)
leaq 0x28fdf(%rip), %rdi     # 0x7d3f0
callq 0x46e0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x5443a
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x5443a
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x544da
leaq 0x28fb9(%rip), %rdi     # 0x7d3fa
callq 0x46e0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x54475
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x54475
movq -0x10(%rbp), %rax
leaq 0x28f97(%rip), %rcx     # 0x7d3ff
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x544da
leaq 0x28f8b(%rip), %rdi     # 0x7d407
callq 0x46e0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x544a2
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x544a2
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x544da
leaq 0x28f65(%rip), %rdi     # 0x7d40e
callq 0x46e0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x544cf
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x544cf
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x544da
leaq 0x28f3d(%rip), %rax     # 0x7d413
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/cram_io.c
// Function: get_int_threadid
static unsigned get_int_threadid() {
    pthread_t pt = pthread_self();
    unsigned char *s = (unsigned char *) &pt;
    size_t i;
    unsigned h = 0;
    for (i = 0; i < sizeof(pthread_t); i++)
	h = (h << 5) - h + s[i];
    return h;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
callq 0x44d0
movq %rax, -0x8(%rbp)
leaq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x1c(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x8, -0x18(%rbp)
jae 0x54547
movl -0x1c(%rbp), %eax
shll $0x5, %eax
subl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
addl %ecx, %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x54518
movl -0x1c(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
// File: karel-brinda[P]ococo/ext/htslib/cram/cram_samtools.c
// Function: cram_header_to_bam
bam_hdr_t *cram_header_to_bam(SAM_hdr *h) {
    int i;
    bam_hdr_t *header = bam_hdr_init();

    header->l_text = ks_len(&h->text);
    header->text = malloc(header->l_text+1);
    memcpy(header->text, ks_str(&h->text), header->l_text);
    header->text[header->l_text] = 0;

    header->n_targets = h->nref;
    header->target_name = (char **)calloc(header->n_targets,
					  sizeof(char *));
    header->target_len = (uint32_t *)calloc(header->n_targets, 4);

    for (i = 0; i < h->nref; i++) {
	header->target_name[i] = strdup(h->ref[i].name);
	header->target_len[i] = h->ref[i].len;
    }

    return header;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
callq 0x1aa30
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x54ba0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edi
callq 0x47a0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x54bc0
movq -0x20(%rbp), %rdi
movq %rax, %rsi
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, %edx
callq 0x4460
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x18(%rbp), %rcx
movl 0x8(%rcx), %ecx
movb $0x0, (%rax,%rcx)
movq -0x8(%rbp), %rax
movl 0x38(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movslq (%rax), %rdi
movl $0x8, %esi
callq 0x4370
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
movslq (%rax), %rdi
movl $0x4, %esi
callq 0x4370
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jge 0x54b88
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x4aa0
movq %rax, %rdx
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0xc(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x8(%rax), %edx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x54b1e
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/cram_stats.c
// Function: cram_stats_add
void cram_stats_add(cram_stats *st, int32_t val) {
    st->nsamp++;

    //assert(val >= 0);

    if (val < MAX_STAT_VAL && val >= 0) {
	st->freqs[val]++;
    } else {
	khint_t k;
	int r;

	if (!st->h) {
	    st->h = kh_init(m_i2i);
	}

	k = kh_put(m_i2i, st->h, val, &r);
	if (r == 0)
	    kh_val(st->h, k)++;
	else if (r != -1)
	    kh_val(st->h, k) = 1;
	else
	    ; // FIXME: handle error
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl 0x1008(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x1008(%rax)
cmpl $0x400, -0xc(%rbp)      # imm = 0x400
jge 0x54c77
cmpl $0x0, -0xc(%rbp)
jl 0x54c77
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
jmp 0x54cfc
movq -0x8(%rbp), %rax
cmpq $0x0, 0x1000(%rax)
jne 0x54c98
callq 0x54d10
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x1000(%rax)
movq -0x8(%rbp), %rax
movq 0x1000(%rax), %rdi
movl -0xc(%rbp), %esi
leaq -0x14(%rbp), %rdx
callq 0x54d30
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x54cd5
movq -0x8(%rbp), %rax
movq 0x1000(%rax), %rax
movq 0x20(%rax), %rax
movl -0x10(%rbp), %ecx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
jmp 0x54cfa
cmpl $-0x1, -0x14(%rbp)
je 0x54cf6
movq -0x8(%rbp), %rax
movq 0x1000(%rax), %rax
movq 0x20(%rax), %rax
movl -0x10(%rbp), %ecx
movl $0x1, (%rax,%rcx,4)
jmp 0x54cf8
jmp 0x54cf8
jmp 0x54cfa
jmp 0x54cfc
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/cram_stats.c
// Function: cram_stats_del
void cram_stats_del(cram_stats *st, int32_t val) {
    st->nsamp--;

    //assert(val >= 0);

    if (val < MAX_STAT_VAL && val >= 0) {
	st->freqs[val]--;
	assert(st->freqs[val] >= 0);
    } else if (st->h) {
	khint_t k = kh_get(m_i2i, st->h, val);

	if (k != kh_end(st->h)) {
	    if (--kh_val(st->h, k) == 0)
		kh_del(m_i2i, st->h, k);
	} else {
	    fprintf(stderr, "Failed to remove val %d from cram_stats\n", val);
	    st->nsamp++;
	}
    } else {
	fprintf(stderr, "Failed to remove val %d from cram_stats\n", val);
	st->nsamp++;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl 0x1008(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x1008(%rax)
cmpl $0x400, -0xc(%rbp)      # imm = 0x400
jge 0x550f6
cmpl $0x0, -0xc(%rbp)
jl 0x550f6
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jl 0x550d2
jmp 0x550f1
leaq 0x284e7(%rip), %rdi     # 0x7d5c0
leaq 0x284f4(%rip), %rsi     # 0x7d5d4
movl $0x52, %edx
leaq 0x284fa(%rip), %rcx     # 0x7d5e6
callq 0x4360
jmp 0x551c7
movq -0x8(%rbp), %rax
cmpq $0x0, 0x1000(%rax)
je 0x55197
movq -0x8(%rbp), %rax
movq 0x1000(%rax), %rdi
movl -0xc(%rbp), %esi
callq 0x551d0
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x1000(%rcx), %rcx
cmpl (%rcx), %eax
je 0x55167
movq -0x8(%rbp), %rax
movq 0x1000(%rax), %rax
movq 0x20(%rax), %rcx
movl -0x10(%rbp), %eax
movl %eax, %edx
movl (%rcx,%rdx,4), %eax
addl $-0x1, %eax
movl %eax, (%rcx,%rdx,4)
cmpl $0x0, %eax
jne 0x55165
movq -0x8(%rbp), %rax
movq 0x1000(%rax), %rdi
movl -0x10(%rbp), %esi
callq 0x55310
jmp 0x55195
movq 0x34e62(%rip), %rax     # 0x89fd0
movq (%rax), %rdi
movl -0xc(%rbp), %edx
leaq 0x28496(%rip), %rsi     # 0x7d611
movb $0x0, %al
callq 0x4830
movq -0x8(%rbp), %rax
movl 0x1008(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x1008(%rax)
jmp 0x551c5
movq 0x34e32(%rip), %rax     # 0x89fd0
movq (%rax), %rdi
movl -0xc(%rbp), %edx
leaq 0x28466(%rip), %rsi     # 0x7d611
movb $0x0, %al
callq 0x4830
movq -0x8(%rbp), %rax
movl 0x1008(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x1008(%rax)
jmp 0x551c7
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/cram_stats.c
// Function: cram_stats_dump
void cram_stats_dump(cram_stats *st) {
    int i;
    fprintf(stderr, "cram_stats:\n");
    for (i = 0; i < MAX_STAT_VAL; i++) {
	if (!st->freqs[i])
	    continue;
	fprintf(stderr, "\t%d\t%d\n", i, st->freqs[i]);
    }
    if (st->h) {
	khint_t k;
	for (k = kh_begin(st->h); k != kh_end(st->h); k++) {
	    if (!kh_exist(st->h, k))
		continue;

	    fprintf(stderr, "\t%d\t%d\n", kh_key(st->h, k), kh_val(st->h, k));
	}
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq 0x34c2d(%rip), %rax     # 0x89fd0
movq (%rax), %rdi
leaq 0x2828d(%rip), %rsi     # 0x7d63a
movb $0x0, %al
callq 0x4830
movl $0x0, -0xc(%rbp)
cmpl $0x400, -0xc(%rbp)      # imm = 0x400
jge 0x55405
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jne 0x553d4
jmp 0x553fa
movq 0x34bf5(%rip), %rax     # 0x89fd0
movq (%rax), %rdi
movl -0xc(%rbp), %edx
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
leaq 0x2754d(%rip), %rsi     # 0x7c940
movb $0x0, %al
callq 0x4830
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x553bb
movq -0x8(%rbp), %rax
cmpq $0x0, 0x1000(%rax)
je 0x554b0
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x1000(%rcx), %rcx
cmpl (%rcx), %eax
je 0x554ae
movq -0x8(%rbp), %rax
movq 0x1000(%rax), %rax
movq 0x10(%rax), %rax
movl -0x10(%rbp), %ecx
shrl $0x4, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl -0x10(%rbp), %ecx
andl $0xf, %ecx
shll %ecx
shrl %cl, %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x5545e
jmp 0x554a0
movq 0x34b6b(%rip), %rax     # 0x89fd0
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x1000(%rax), %rax
movq 0x18(%rax), %rax
movl -0x10(%rbp), %ecx
movl (%rax,%rcx,4), %edx
movq -0x8(%rbp), %rax
movq 0x1000(%rax), %rax
movq 0x20(%rax), %rax
movl -0x10(%rbp), %ecx
movl (%rax,%rcx,4), %ecx
leaq 0x274a7(%rip), %rsi     # 0x7c940
movb $0x0, %al
callq 0x4830
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x5541e
jmp 0x554b0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mstdin
mFILE *mstdin(void) {
    if (m_channel[0])
	return m_channel[0];

    m_channel[0] = mfcreate(NULL, 0);
    if (NULL == m_channel[0]) return NULL;
    m_channel[0]->fp = stdin;
    return m_channel[0];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
cmpq $0x0, 0x349d0(%rip)     # 0x8a830
je 0x55e6f
movq 0x349c7(%rip), %rax     # 0x8a830
movq %rax, -0x8(%rbp)
jmp 0x55eb5
xorl %eax, %eax
movl %eax, %edi
xorl %esi, %esi
callq 0x55ec0
movq %rax, 0x349af(%rip)     # 0x8a830
xorl %eax, %eax
cmpq 0x349a6(%rip), %rax     # 0x8a830
jne 0x55e96
movq $0x0, -0x8(%rbp)
jmp 0x55eb5
movq 0x3412b(%rip), %rax     # 0x89fc8
movq (%rax), %rcx
movq 0x34989(%rip), %rax     # 0x8a830
movq %rcx, (%rax)
movq 0x3497f(%rip), %rax     # 0x8a830
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfcreate
mFILE *mfcreate(char *data, int size) {
    mFILE *mf = (mFILE *)malloc(sizeof(*mf));
    if (NULL == mf) return NULL;
    mf->fp = NULL;
    mf->data = data;
    mf->alloced = size;
    mf->size = size;
    mf->eof = 0;
    mf->offset = 0;
    mf->flush_pos = 0;
    mf->mode = MF_READ | MF_WRITE;
    return mf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl $0x38, %edi
callq 0x47a0
movq %rax, -0x20(%rbp)
xorl %eax, %eax
cmpq -0x20(%rbp), %rax
jne 0x55eef
movq $0x0, -0x8(%rbp)
jmp 0x55f54
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movslq -0x14(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movslq -0x14(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x18(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x30(%rax)
movq -0x20(%rbp), %rax
movl $0x3, 0x1c(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mstdout
mFILE *mstdout(void) {
    if (m_channel[1])
	return m_channel[1];

    m_channel[1] = mfcreate(NULL, 0);
    if (NULL == m_channel[1]) return NULL;
    m_channel[1]->fp = stdout;
    m_channel[1]->mode = MF_WRITE;
    return m_channel[1];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
cmpq $0x0, 0x348c8(%rip)     # 0x8a838
je 0x55f7f
movq 0x348bf(%rip), %rax     # 0x8a838
movq %rax, -0x8(%rbp)
jmp 0x55fd3
xorl %eax, %eax
movl %eax, %edi
xorl %esi, %esi
callq 0x55ec0
movq %rax, 0x348a7(%rip)     # 0x8a838
xorl %eax, %eax
cmpq 0x3489e(%rip), %rax     # 0x8a838
jne 0x55fa6
movq $0x0, -0x8(%rbp)
jmp 0x55fd3
movq 0x33feb(%rip), %rax     # 0x89f98
movq (%rax), %rcx
movq 0x34881(%rip), %rax     # 0x8a838
movq %rcx, (%rax)
movq 0x34877(%rip), %rax     # 0x8a838
movl $0x2, 0x1c(%rax)
movq 0x34869(%rip), %rax     # 0x8a838
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mstderr
mFILE *mstderr(void) {
    if (m_channel[2])
	return m_channel[2];

    m_channel[2] = mfcreate(NULL, 0);
    if (NULL == m_channel[2]) return NULL;
    m_channel[2]->fp = stderr;
    m_channel[2]->mode = MF_WRITE;
    return m_channel[2];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
cmpq $0x0, 0x34850(%rip)     # 0x8a840
je 0x55fff
movq 0x34847(%rip), %rax     # 0x8a840
movq %rax, -0x8(%rbp)
jmp 0x56053
xorl %eax, %eax
movl %eax, %edi
xorl %esi, %esi
callq 0x55ec0
movq %rax, 0x3482f(%rip)     # 0x8a840
xorl %eax, %eax
cmpq 0x34826(%rip), %rax     # 0x8a840
jne 0x56026
movq $0x0, -0x8(%rbp)
jmp 0x56053
movq 0x33fa3(%rip), %rax     # 0x89fd0
movq (%rax), %rcx
movq 0x34809(%rip), %rax     # 0x8a840
movq %rcx, (%rax)
movq 0x347ff(%rip), %rax     # 0x8a840
movl $0x2, 0x1c(%rax)
movq 0x347f1(%rip), %rax     # 0x8a840
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfrecreate
void mfrecreate(mFILE *mf, char *data, int size) {
    if (mf->data)
	free(mf->data);
    mf->data = data;
    mf->size = size;
    mf->alloced = size;
    mf->eof = 0;
    mf->offset = 0;
    mf->flush_pos = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x5608b
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x46a0
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movslq -0x14(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movslq -0x14(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x18(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x30(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfcreate_from
mFILE *mfcreate_from(const char *path, const char *mode_str, FILE *fp) {
   mFILE *mf; 

    /* Open using mfreopen() */
    if (NULL == (mf = mfreopen(path, mode_str, fp)))
	return NULL;
    
    /* Disassociate from the input stream */
    mf->fp = NULL;

    return mf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x56140
movq %rax, %rcx
movq %rcx, -0x28(%rbp)
xorl %eax, %eax
cmpq %rcx, %rax
jne 0x5611d
movq $0x0, -0x8(%rbp)
jmp 0x56130
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)