LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfload
static char *mfload(FILE *fp, const char *fn, size_t *size, int binary) {
    struct stat sb;
    char *data = NULL;
    size_t allocated = 0, used = 0;
    int bufsize = 8192;

#ifdef _WIN32
    if (binary)
	_setmode(_fileno(fp), _O_BINARY);
    else 
	_setmode(_fileno(fp), _O_TEXT);
#endif

    if (fn && -1 != stat(fn, &sb)) {
	data = malloc(allocated = sb.st_size);
	bufsize = sb.st_size;
    } else {
	fn = NULL;
    }

    do {
	size_t len;
	if (used + bufsize > allocated) {
	    allocated += bufsize;
	    data = realloc(data, allocated);
	}
	len = fread(data + used, 1, allocated - used, fp);
	if (len > 0)
	    used += len;
    } while (!feof(fp) && (fn == NULL || used < sb.st_size));

    *size = used;

    return data;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq $0x0, -0xb8(%rbp)
movq $0x0, -0xc0(%rbp)
movq $0x0, -0xc8(%rbp)
movl $0x2000, -0xcc(%rbp)    # imm = 0x2000
cmpq $0x0, -0x10(%rbp)
je 0x5643a
movq -0x10(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x44f0
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
je 0x5643a
movq -0x80(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x47a0
movq %rax, -0xb8(%rbp)
movq -0x80(%rbp), %rax
movl %eax, -0xcc(%rbp)
jmp 0x56442
movq $0x0, -0x10(%rbp)
jmp 0x56444
movq -0xc8(%rbp), %rax
movslq -0xcc(%rbp), %rcx
addq %rcx, %rax
cmpq -0xc0(%rbp), %rax
jbe 0x5648d
movslq -0xcc(%rbp), %rax
addq -0xc0(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0xb8(%rbp), %rdi
movq -0xc0(%rbp), %rsi
callq 0x4990
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rdi
addq -0xc8(%rbp), %rdi
movq -0xc0(%rbp), %rdx
subq -0xc8(%rbp), %rdx
movq -0x8(%rbp), %rcx
movl $0x1, %esi
callq 0x48b0
movq %rax, -0xd8(%rbp)
cmpq $0x0, -0xd8(%rbp)
jbe 0x564dd
movq -0xd8(%rbp), %rax
addq -0xc8(%rbp), %rax
movq %rax, -0xc8(%rbp)
jmp 0x564df
movq -0x8(%rbp), %rdi
callq 0x4900
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xd9(%rbp)
jne 0x56526
movb $0x1, %al
cmpq $0x0, -0x10(%rbp)
movb %al, -0xda(%rbp)
je 0x5651a
movq -0xc8(%rbp), %rax
cmpq -0x80(%rbp), %rax
setb %al
movb %al, -0xda(%rbp)
movb -0xda(%rbp), %al
movb %al, -0xd9(%rbp)
movb -0xd9(%rbp), %al
testb $0x1, %al
jne 0x56444
movq -0xc8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0xb8(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfopen
mFILE *mfopen(const char *path, const char *mode) {
    FILE *fp;

    if (NULL == (fp = fopen(path, mode)))
	return NULL;
    return mfreopen(path, mode, fp);
}

// 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 0x4690
movq %rax, %rcx
movq %rcx, -0x20(%rbp)
xorl %eax, %eax
cmpq %rcx, %rax
jne 0x56595
movq $0x0, -0x8(%rbp)
jmp 0x565aa
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x56140
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/mFILE.c
// Function: mfclose
int mfclose(mFILE *mf) {
    if (!mf)
	return -1;

    mfflush(mf);

#ifdef HAVE_MMAP
    if ((mf->mode & MF_MMAP) && mf->data) {
	/* Mmaped */
	munmap(mf->data, mf->size);
	mf->data = NULL;
    }
#endif

    if (mf->fp)
	fclose(mf->fp);

    mfdestroy(mf);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x565dc
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5660b
movq -0x10(%rbp), %rdi
callq 0x56620
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x565fb
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x4590
movq -0x10(%rbp), %rdi
callq 0x56820
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfdestroy
int mfdestroy(mFILE *mf) {
    if (!mf)
	return -1;

    if (mf->data)
	free(mf->data);
    free(mf);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x5683c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x56864
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x56854
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x46a0
movq -0x10(%rbp), %rdi
callq 0x46a0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfdetach
int mfdetach(mFILE *mf) {
    if (!mf)
	return -1;

    mfflush(mf);
    if (mf->mode & MF_MMAP)
	return -1;

    if (mf->fp) {
	fclose(mf->fp);
	mf->fp = NULL;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x5688c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x568d5
movq -0x10(%rbp), %rdi
callq 0x56620
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x568ad
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x568d5
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x568ce
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x4590
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfsteal
void *mfsteal(mFILE *mf, size_t *size_out) {
    void *data;

    if (!mf) return NULL;

    data = mf->data;
    
    if (NULL != size_out) *size_out = mf->size;

    if (mfdetach(mf) != 0)
	return NULL;

    mf->data = NULL;
    mfdestroy(mf);

    return data;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x56901
movq $0x0, -0x8(%rbp)
jmp 0x56959
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
xorl %eax, %eax
cmpq -0x18(%rbp), %rax
je 0x56924
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
callq 0x56870
cmpl $0x0, %eax
je 0x5693c
movq $0x0, -0x8(%rbp)
jmp 0x56959
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rdi
callq 0x56820
movq -0x20(%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/mFILE.c
// Function: mfseek
int mfseek(mFILE *mf, long offset, int whence) {
    switch (whence) {
    case SEEK_SET:
	mf->offset = offset;
	break;
    case SEEK_CUR:
	mf->offset += offset;
	break;
    case SEEK_END:
	mf->offset = mf->size + offset;
	break;
    default:
	errno = EINVAL;
	return -1;
    }

    mf->eof = 0;
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x20(%rbp)
testl %eax, %eax
je 0x569a3
jmp 0x5698f
movl -0x20(%rbp), %eax
subl $0x1, %eax
je 0x569b1
jmp 0x56999
movl -0x20(%rbp), %eax
subl $0x2, %eax
je 0x569c3
jmp 0x569d9
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
jmp 0x569ed
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
addq 0x28(%rax), %rcx
movq %rcx, 0x28(%rax)
jmp 0x569ed
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rcx
addq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
jmp 0x569ed
callq 0x4070
movl $0x16, (%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x569ff
movq -0x10(%rbp), %rax
movl $0x0, 0x18(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfread
size_t mfread(void *ptr, size_t size, size_t nmemb, mFILE *mf) {
    size_t len;
    char *cptr = (char *)ptr;
    
    if (mf == m_channel[0]) init_mstdin();

    if (mf->size <= mf->offset)
	return 0;

    len = size * nmemb <= mf->size - mf->offset
	? size * nmemb
	: mf->size - mf->offset;
    if (!size)
	return 0;

    memcpy(cptr, &mf->data[mf->offset], len);
    mf->offset += len;
    
    if (len != size * nmemb) {
	mf->eof = 1;
    }

    return len / size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
cmpq 0x33d25(%rip), %rax     # 0x8a830
jne 0x56b12
callq 0x56bf0
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x28(%rcx), %rax
ja 0x56b31
movq $0x0, -0x8(%rbp)
jmp 0x56be5
movq -0x18(%rbp), %rax
imulq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x20(%rcx), %rcx
movq -0x28(%rbp), %rdx
subq 0x28(%rdx), %rcx
cmpq %rcx, %rax
ja 0x56b5e
movq -0x18(%rbp), %rax
imulq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x56b72
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x28(%rbp), %rcx
subq 0x28(%rcx), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x56b8b
movq $0x0, -0x8(%rbp)
jmp 0x56be5
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x28(%rbp), %rax
addq 0x28(%rax), %rsi
movq -0x30(%rbp), %rdx
callq 0x4460
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
addq 0x28(%rax), %rcx
movq %rcx, 0x28(%rax)
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
imulq -0x20(%rbp), %rcx
cmpq %rcx, %rax
je 0x56bd5
movq -0x28(%rbp), %rax
movl $0x1, 0x18(%rax)
movq -0x30(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0x18(%rbp)
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: init_mstdin
static void init_mstdin(void) {
    static int done_stdin = 0;
    if (done_stdin)
	return;

    m_channel[0]->data = mfload(stdin, NULL, &m_channel[0]->size, 1);
    m_channel[0]->mode = MF_READ;
    done_stdin = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x0, 0x33c4d(%rip)     # 0x8a848
je 0x56bff
jmp 0x56c48
movq 0x333c2(%rip), %rax     # 0x89fc8
movq (%rax), %rdi
movq 0x33c20(%rip), %rdx     # 0x8a830
addq $0x20, %rdx
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %ecx
callq 0x563b0
movq %rax, %rcx
movq 0x33c04(%rip), %rax     # 0x8a830
movq %rcx, 0x8(%rax)
movq 0x33bf9(%rip), %rax     # 0x8a830
movl $0x1, 0x1c(%rax)
movl $0x1, 0x33c00(%rip)     # 0x8a848
popq %rbp
retq
nopw (%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfwrite
size_t mfwrite(void *ptr, size_t size, size_t nmemb, mFILE *mf) {
    if (!(mf->mode & MF_WRITE))
	return 0;

    /* Append mode => forced all writes to end of file */
    if (mf->mode & MF_APPEND)
	mf->offset = mf->size;

    /* Make sure we have enough room */
    while (size * nmemb + mf->offset > mf->alloced) {
	size_t new_alloced = mf->alloced ? mf->alloced * 2 : 1024;
	void * new_data = realloc(mf->data, new_alloced);
	if (NULL == new_data) return 0;
	mf->alloced = new_alloced;
	mf->data    = new_data;
    }

    /* Record where we need to reflush from */
    if (mf->offset < mf->flush_pos)
	mf->flush_pos = mf->offset;

    /* Copy the data over */
    memcpy(&mf->data[mf->offset], ptr, size * nmemb);
    mf->offset += size * nmemb;
    if (mf->size < mf->offset)
	mf->size = mf->offset;

    return nmemb;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl 0x1c(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x56c84
movq $0x0, -0x8(%rbp)
jmp 0x56db9
movq -0x28(%rbp), %rax
movl 0x1c(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x56ca3
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x28(%rax)
jmp 0x56ca5
movq -0x18(%rbp), %rax
imulq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
addq 0x28(%rcx), %rax
movq -0x28(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jbe 0x56d36
movq -0x28(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x56cdc
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
shlq %rax
movq %rax, -0x40(%rbp)
jmp 0x56ce7
movl $0x400, %eax            # imm = 0x400
movq %rax, -0x40(%rbp)
jmp 0x56ce7
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x30(%rbp), %rsi
callq 0x4990
movq %rax, -0x38(%rbp)
xorl %eax, %eax
cmpq -0x38(%rbp), %rax
jne 0x56d19
movq $0x0, -0x8(%rbp)
jmp 0x56db9
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x56ca5
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x30(%rcx), %rax
jae 0x56d58
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rax
addq 0x28(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
imulq -0x20(%rbp), %rdx
callq 0x4460
movq -0x18(%rbp), %rcx
imulq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
addq 0x28(%rax), %rcx
movq %rcx, 0x28(%rax)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x28(%rcx), %rax
jae 0x56db1
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfgetc
int mfgetc(mFILE *mf) {
    if (mf == m_channel[0]) init_mstdin();
    if (mf->offset < mf->size) {
	return (unsigned char)mf->data[mf->offset++];
    }

    mf->eof = 1;
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq 0x33a49(%rip), %rax     # 0x8a830
jne 0x56dee
callq 0x56bf0
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x56e24
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rdx
movq 0x28(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x28(%rdx)
movzbl (%rax,%rcx), %eax
movl %eax, -0x4(%rbp)
jmp 0x56e36
movq -0x10(%rbp), %rax
movl $0x1, 0x18(%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mungetc
int mungetc(int c, mFILE *mf) {
    if (mf->offset > 0) {
	mf->data[--mf->offset] = c;
	return c;
    }
    
    mf->eof = 1;
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jbe 0x56e82
movl -0x8(%rbp), %eax
movb %al, %dl
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rsi
movq 0x28(%rsi), %rcx
movq %rcx, %rdi
addq $-0x1, %rdi
movq %rdi, 0x28(%rsi)
movb %dl, -0x1(%rax,%rcx)
movl -0x8(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x56e94
movq -0x10(%rbp), %rax
movl $0x1, 0x18(%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfgets
char *mfgets(char *s, int size, mFILE *mf) {
    int i;

    if (mf == m_channel[0]) init_mstdin();
    *s = 0;
    for (i = 0; i < size-1;) {
	if (mf->offset < mf->size) {
	    s[i] = mf->data[mf->offset++];
	    if (s[i++] == '\n')
		break;
	} else {
	    mf->eof = 1;
	    break;
	}
    }

    s[i] = 0;
    return i ? s : NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq 0x33972(%rip), %rax     # 0x8a830
jne 0x56ec5
callq 0x56bf0
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x56f49
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x18(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x56f3a
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rdx
movq 0x28(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x28(%rdx)
movb (%rax,%rcx), %dl
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0xa, %eax
jne 0x56f38
jmp 0x56f49
jmp 0x56f47
movq -0x18(%rbp), %rax
movl $0x1, 0x18(%rax)
jmp 0x56f49
jmp 0x56ed3
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movb $0x0, (%rax,%rcx)
cmpl $0x0, -0x1c(%rbp)
je 0x56f65
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x56f6d
xorl %eax, %eax
movq %rax, -0x28(%rbp)
jmp 0x56f6d
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/mFILE.c
// Function: mfascii
void mfascii(mFILE *mf) {
    size_t p1, p2;

    for (p1 = p2 = 1; p1 < mf->size; p1++, p2++) {
	if (mf->data[p1] == '\n' && mf->data[p1-1] == '\r') {
	    p2--; /* delete the \r */
	}
	mf->data[p2] = mf->data[p1];
    }
    mf->size = p2;

    mf->offset = mf->flush_pos = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq $0x1, -0x18(%rbp)
movq $0x1, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x57218
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0xa, %eax
jne 0x571e0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
subq $0x1, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0xd, %eax
jne 0x571e0
movq -0x18(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x57198
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x30(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x28(%rax)
popq %rbp
retq
nop
// File: karel-brinda[P]ococo/ext/htslib/cram/open_trace_file.c
// Function: find_file_dir
static mFILE *find_file_dir(char *file, char *dirname) {
    char *path;
    mFILE *mf = NULL;

    path = expand_path(file, dirname);

    if (is_file(path))
	mf = mfopen(path, "rbm");

    free(path);
    return mf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x57d40
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x55d70
cmpl $0x0, %eax
je 0x57bcb
movq -0x18(%rbp), %rdi
leaq 0x25b2c(%rip), %rsi     # 0x7d6ee
callq 0x56560
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x46a0
movq -0x20(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: karel-brinda[P]ococo/ext/htslib/cram/open_trace_file.c
// Function: find_path
char *find_path(char *file, char *path) {
    char *newsearch;
    char *ele;
    char *outpath = NULL;

    /* Use path first */
    if (!path)
	path = getenv("RAWDATA");
    if (NULL == (newsearch = tokenise_search_path(path)))
	return NULL;
    
    for (ele = newsearch; *ele; ele += strlen(ele)+1) {
	char *ele2 = (*ele == '|') ? ele+1 : ele;

	if (!strncmp(ele2, "URL=", 4) ||
	    !strncmp(ele2, "http:", 5) ||
	    !strncmp(ele2, "ftp:", 4)) {
	    continue;
	} else {
	    outpath = expand_path(file, ele2);
	    if (is_file(outpath)) {
		free(newsearch);
		return outpath;
	    } else {
		free(outpath);
	    }
	} 
    }

    free(newsearch);

    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x30(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x57c0f
leaq 0x25adb(%rip), %rdi     # 0x7d6e1
callq 0x46e0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x57240
movq %rax, %rcx
movq %rcx, -0x20(%rbp)
xorl %eax, %eax
cmpq %rcx, %rax
jne 0x57c33
movq $0x0, -0x8(%rbp)
jmp 0x57d2c
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpb $0x0, (%rax)
je 0x57d1b
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x7c, %eax
jne 0x57c62
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x57c6a
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
leaq 0x25a6c(%rip), %rsi     # 0x7d6e9
movl $0x4, %edx
callq 0x4290
cmpl $0x0, %eax
je 0x57cc0
movq -0x38(%rbp), %rdi
leaq 0x25a3b(%rip), %rsi     # 0x7d6d2
movl $0x5, %edx
callq 0x4290
cmpl $0x0, %eax
je 0x57cc0
movq -0x38(%rbp), %rdi
leaq 0x25a2b(%rip), %rsi     # 0x7d6dc
movl $0x4, %edx
callq 0x4290
cmpl $0x0, %eax
jne 0x57cc2
jmp 0x57d01
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x57d40
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x55d70
cmpl $0x0, %eax
je 0x57cf4
movq -0x20(%rbp), %rdi
callq 0x46a0
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x57d2c
movq -0x30(%rbp), %rdi
callq 0x46a0
jmp 0x57cff
jmp 0x57d01
movq -0x28(%rbp), %rdi
callq 0x4230
addq $0x1, %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x57c3b
movq -0x20(%rbp), %rdi
callq 0x46a0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/./cram/rANS_byte.h
// Function: RansEncPutSymbol
static inline void RansEncPutSymbol(RansState* r, uint8_t** pptr, RansEncSymbol const* sym)
{
    RansAssert(sym->x_max != 0); // can't encode symbol with freq=0

    // renormalize
    uint32_t x = *r;
    uint32_t x_max = sym->x_max;

    if (x >= x_max) {
	uint8_t* ptr = *pptr;
	do {
	    *--ptr = (uint8_t) (x & 0xff);
	    x >>= 8;
	} while (x >= x_max);
	*pptr = ptr;
    }

    // x = C(s,x)
    // NOTE: written this way so we get a 32-bit "multiply high" when
    // available. If you're on a 64-bit platform with cheap multiplies
    // (e.g. x64), just bake the +32 into rcp_shift.
    //uint32_t q = (uint32_t) (((uint64_t)x * sym->rcp_freq) >> 32) >> sym->rcp_shift;

    // The extra >>32 has already been added to RansEncSymbolInit
    uint32_t q = (uint32_t) (((uint64_t)x * sym->rcp_freq) >> sym->rcp_shift);
    *r = x + sym->bias + q * sym->cmpl_freq;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x58b4f
jmp 0x58b6e
leaq 0x24e0b(%rip), %rdi     # 0x7d961
leaq 0x24d6c(%rip), %rsi     # 0x7d8c9
movl $0x10f, %edx            # imm = 0x10F
leaq 0x24e08(%rip), %rcx     # 0x7d971
callq 0x4360
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jb 0x58bcb
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movl -0x1c(%rbp), %eax
andl $0xff, %eax
movb %al, %cl
movq -0x28(%rbp), %rax
movq %rax, %rdx
addq $-0x1, %rdx
movq %rdx, -0x28(%rbp)
movb %cl, -0x1(%rax)
movl -0x1c(%rbp), %eax
shrl $0x8, %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jae 0x58b93
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl -0x1c(%rbp), %eax
movq -0x18(%rbp), %rcx
movl 0x4(%rcx), %ecx
imulq %rcx, %rax
movq -0x18(%rbp), %rcx
movzwl 0xe(%rcx), %ecx
movl %ecx, %ecx
shrq %cl, %rax
movl %eax, -0x2c(%rbp)
movl -0x1c(%rbp), %ecx
movq -0x18(%rbp), %rax
addl 0x8(%rax), %ecx
movl -0x2c(%rbp), %eax
movq -0x18(%rbp), %rdx
movzwl 0xc(%rdx), %edx
imull %edx, %eax
addl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nop
// File: karel-brinda[P]ococo/ext/htslib/./cram/rANS_byte.h
// Function: RansEncFlush
static inline void RansEncFlush(RansState* r, uint8_t** pptr)
{
    uint32_t x = *r;
    uint8_t* ptr = *pptr;

    ptr -= 4;
    ptr[0] = (uint8_t) (x >> 0);
    ptr[1] = (uint8_t) (x >> 8);
    ptr[2] = (uint8_t) (x >> 16);
    ptr[3] = (uint8_t) (x >> 24);

    *pptr = ptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $-0x4, %rax
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %eax
shrl $0x0, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, (%rax)
movl -0x14(%rbp), %eax
shrl $0x8, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x1(%rax)
movl -0x14(%rbp), %eax
shrl $0x10, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x2(%rax)
movl -0x14(%rbp), %eax
shrl $0x18, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, 0x3(%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/./cram/rANS_byte.h
// Function: RansDecSymbolInit
static inline void RansDecSymbolInit(RansDecSymbol* s, uint32_t start, uint32_t freq)
{
    RansAssert(start <= (1 << 16));
    RansAssert(freq <= (1 << 16) - start);
    s->start = (uint16_t) start;
    s->freq = (uint16_t) freq;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
cmpl $0x10000, -0xc(%rbp)    # imm = 0x10000
ja 0x595cd
jmp 0x595ec
leaq 0x243e3(%rip), %rdi     # 0x7d9b7
leaq 0x242ee(%rip), %rsi     # 0x7d8c9
movl $0x103, %edx            # imm = 0x103
leaq 0x243e3(%rip), %rcx     # 0x7d9ca
callq 0x4360
movl -0x10(%rbp), %eax
movl $0x10000, %ecx          # imm = 0x10000
subl -0xc(%rbp), %ecx
cmpl %ecx, %eax
ja 0x595fd
jmp 0x5961c
leaq 0x24402(%rip), %rdi     # 0x7da06
leaq 0x242be(%rip), %rsi     # 0x7d8c9
movl $0x104, %edx            # imm = 0x104
leaq 0x243b3(%rip), %rcx     # 0x7d9ca
callq 0x4360
movl -0xc(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, (%rax)
movl -0x10(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x2(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: karel-brinda[P]ococo/ext/htslib/./cram/rANS_byte.h
// Function: RansDecInit
static inline void RansDecInit(RansState* r, uint8_t** pptr)
{
    uint32_t x;
    uint8_t* ptr = *pptr;

    x  = ptr[0] << 0;
    x |= ptr[1] << 8;
    x |= ptr[2] << 16;
    x |= ptr[3] << 24;
    ptr += 4;

    *pptr = ptr;
    *r = x;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
shll $0x0, %eax
movl %eax, -0x14(%rbp)
movq -0x20(%rbp), %rax
movzbl 0x1(%rax), %eax
shll $0x8, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x20(%rbp), %rax
movzbl 0x2(%rax), %eax
shll $0x10, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x20(%rbp), %rax
movzbl 0x3(%rax), %eax
shll $0x18, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x20(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
popq %rbp
retq
nopl (%rax)
// File: karel-brinda[P]ococo/ext/htslib/./cram/rANS_byte.h
// Function: RansDecRenorm
static inline void RansDecRenorm(RansState* r, uint8_t** pptr)
{
    // renormalize
    uint32_t x = *r;

    if (x < RANS_BYTE_L) {
        uint8_t* ptr = *pptr;
        do x = (x << 8) | *ptr++; while (x < RANS_BYTE_L);
        *pptr = ptr;
    }

    *r = x;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
cmpl $0x800000, -0x14(%rbp)  # imm = 0x800000
jae 0x5971a
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %eax
shll $0x8, %eax
movq -0x20(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movzbl (%rcx), %ecx
orl %ecx, %eax
movl %eax, -0x14(%rbp)
cmpl $0x800000, -0x14(%rbp)  # imm = 0x800000
jb 0x596e9
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/rANS_static.c
// Function: rans_uncompress
unsigned char *rans_uncompress(unsigned char *in, unsigned int in_size,
			       unsigned int *out_size) {
    /* Both rans_uncompress functions need to be able to read at least 9
       bytes. */
    if (in_size < 9)
        return NULL;
    return in[0]
	? rans_uncompress_O1(in, in_size, out_size)
	: rans_uncompress_O0(in, in_size, out_size);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
cmpl $0x9, -0x14(%rbp)
jae 0x5af13
movq $0x0, -0x8(%rbp)
jmp 0x5af51
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
je 0x5af35
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0x5a430
movq %rax, -0x28(%rbp)
jmp 0x5af49
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0x58c90
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/./cram/rANS_byte.h
// Function: RansDecAdvance
static inline void RansDecAdvance(RansState* r, uint8_t** pptr, uint32_t start, uint32_t freq, uint32_t scale_bits)
{
    uint32_t mask = (1u << scale_bits) - 1;

    // s, x = D(x)
    uint32_t x = *r;
    x = freq * (x >> scale_bits) + (x & mask) - start;

    // renormalize
    if (x < RANS_BYTE_L) {
        uint8_t* ptr = *pptr;
        do x = (x << 8) | *ptr++; while (x < RANS_BYTE_L);
        *pptr = ptr;
    }

    *r = x;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movl -0x1c(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movl -0x18(%rbp), %eax
movl -0x24(%rbp), %edx
movl -0x1c(%rbp), %ecx
shrl %cl, %edx
movl %edx, %ecx
imull %ecx, %eax
movl -0x24(%rbp), %ecx
andl -0x20(%rbp), %ecx
addl %ecx, %eax
subl -0x14(%rbp), %eax
movl %eax, -0x24(%rbp)
cmpl $0x800000, -0x24(%rbp)  # imm = 0x800000
jae 0x5aff2
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movl -0x24(%rbp), %eax
shll $0x8, %eax
movq -0x30(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x30(%rbp)
movzbl (%rcx), %ecx
orl %ecx, %eax
movl %eax, -0x24(%rbp)
cmpl $0x800000, -0x24(%rbp)  # imm = 0x800000
jb 0x5afc1
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl -0x24(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
popq %rbp
retq
nopl (%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_find_line
char *sam_hdr_find_line(SAM_hdr *hdr, char *type,
			char *ID_key, char *ID_value) {
    SAM_hdr_type *ty = sam_hdr_find(hdr, type, ID_key, ID_value);
    kstring_t ks = KS_INITIALIZER;
    SAM_hdr_tag *tag;
    int r = 0;

    if (!ty)
	return NULL;

    // Paste together the line from the hashed copy
    r |= (kputc_('@', &ks) == EOF);
    r |= (kputs(type, &ks) == EOF);
    for (tag = ty->tag; tag; tag = tag->next) {
	r |= (kputc_('\t', &ks) == EOF);
	r |= (kputsn(tag->str, tag->len, &ks) == EOF);
    }

    if (r) {
	KS_FREE(&ks);
	return NULL;
    }

    return ks_str(&ks);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x5d1a0
movq %rax, -0x30(%rbp)
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x42d0
movl $0x0, -0x54(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x5d82c
movq $0x0, -0x8(%rbp)
jmp 0x5d902
movl $0x40, %edi
leaq -0x48(%rbp), %rsi
callq 0x5d070
cmpl $-0x1, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
orl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x5d0e0
cmpl $-0x1, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
orl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x5d8d1
movl $0x9, %edi
leaq -0x48(%rbp), %rsi
callq 0x5d070
cmpl $-0x1, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
orl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x50(%rbp), %rax
movl 0x10(%rax), %esi
leaq -0x48(%rbp), %rdx
callq 0x5b950
cmpl $-0x1, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
orl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movq -0x50(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x5d875
cmpl $0x0, -0x54(%rbp)
je 0x5d8f5
jmp 0x5d8d9
cmpq $0x0, -0x38(%rbp)
je 0x5d8e9
movq -0x38(%rbp), %rdi
callq 0x46a0
jmp 0x5d8eb
movq $0x0, -0x8(%rbp)
jmp 0x5d902
leaq -0x48(%rbp), %rdi
callq 0x5b9e0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_find_key
SAM_hdr_tag *sam_hdr_find_key(SAM_hdr *sh,
			      SAM_hdr_type *type,
			      char *key,
			      SAM_hdr_tag **prev) {
    SAM_hdr_tag *tag, *p = NULL;

    for (tag = type->tag; tag; p = tag, tag = tag->next) {
	if (tag->str[0] == key[0] && tag->str[1] == key[1]) {
	    if (prev)
		*prev = p;
	    return tag;
	}
    }

    if (prev)
	*prev = p;

    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x5d9a0
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
movq -0x20(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x5d989
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movsbl 0x1(%rax), %eax
movq -0x20(%rbp), %rcx
movsbl 0x1(%rcx), %ecx
cmpl %ecx, %eax
jne 0x5d989
cmpq $0x0, -0x28(%rbp)
je 0x5d97f
movq -0x38(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x5d9ba
jmp 0x5d98b
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x5d938
cmpq $0x0, -0x28(%rbp)
je 0x5d9b2
movq -0x38(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
// File: karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_parse_
SAM_hdr *sam_hdr_parse_(const char *hdr, int len) {
    /* Make an empty SAM_hdr */
    SAM_hdr *sh;
    
    sh = sam_hdr_new();
    if (NULL == sh) return NULL;

    if (NULL == hdr) return sh; // empty header is permitted

    /* Parse the header, line by line */
    if (-1 == sam_hdr_add_lines(sh, hdr, len)) {
	sam_hdr_free(sh);
	return NULL;
    }

    /* Obtain sort order */
    sh->sort_order = sam_hdr_parse_sort_order(sh);

    //sam_hdr_dump(sh);
    //sam_hdr_add(sh, "RG", "ID", "foo", "SM", "bar", NULL);
    //sam_hdr_rebuild(sh);
    //printf(">>%s<<", ks_str(sh->text));

    //parse_references(sh);
    //parse_read_groups(sh);

    sam_hdr_link_pg(sh);
    //sam_hdr_dump(sh);

    return sh;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
callq 0x5e050
movq %rax, -0x20(%rbp)
xorl %eax, %eax
cmpq -0x20(%rbp), %rax
jne 0x5e32a
movq $0x0, -0x8(%rbp)
jmp 0x5e390
xorl %eax, %eax
cmpq -0x10(%rbp), %rax
jne 0x5e33c
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x5e390
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x5b270
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %eax
jne 0x5e36a
movq -0x20(%rbp), %rdi
callq 0x5e3a0
movq $0x0, -0x8(%rbp)
jmp 0x5e390
movq -0x20(%rbp), %rdi
callq 0x5e630
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x90(%rax)
movq -0x20(%rbp), %rdi
callq 0x5e7b0
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_parse_sort_order
static enum sam_sort_order sam_hdr_parse_sort_order(SAM_hdr *hdr) {
    khint_t k;
    enum sam_sort_order so;

    so = ORDER_UNKNOWN;
    k = kh_get(sam_hdr, hdr->h, K("HD"));
    if (k != kh_end(hdr->h)) {
	SAM_hdr_type *ty = kh_val(hdr->h, k);
	SAM_hdr_tag *tag;
        for (tag = ty->tag; tag; tag = tag->next) {
	    if (tag->str[0] == 'S' && tag->str[1] == 'O') {
		if (strcmp(tag->str+3, "unsorted") == 0)
		    so = ORDER_UNSORTED;
		else if (strcmp(tag->str+3, "queryname") == 0)
		    so = ORDER_NAME;
		else if (strcmp(tag->str+3, "coordinate") == 0)
		    so = ORDER_COORD;
		else if (strcmp(tag->str+3, "unknown") != 0)
		    fprintf(stderr, "Unknown sort order field: %s\n",
			    tag->str+3);
	    }
	}
    }

    return so;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0xffffffff, -0x10(%rbp) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movsbl 0x1f551(%rip), %esi     # 0x7dba3
shll $0x8, %esi
movsbl 0x1f548(%rip), %eax     # 0x7dba4
orl %eax, %esi
callq 0x5d690
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpl (%rcx), %eax
je 0x5e7a2
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movl -0xc(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x5e7a0
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x53, %eax
jne 0x5e78e
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movsbl 0x1(%rax), %eax
cmpl $0x4f, %eax
jne 0x5e78e
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x3, %rdi
leaq 0x1f4ee(%rip), %rsi     # 0x7dbd1
callq 0x4810
cmpl $0x0, %eax
jne 0x5e6f9
movl $0x0, -0x10(%rbp)
jmp 0x5e78c
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x3, %rdi
leaq 0x1f4ce(%rip), %rsi     # 0x7dbda
callq 0x4810
cmpl $0x0, %eax
jne 0x5e71f
movl $0x1, -0x10(%rbp)
jmp 0x5e78a
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x3, %rdi
leaq 0x1f4b2(%rip), %rsi     # 0x7dbe4
callq 0x4810
cmpl $0x0, %eax
jne 0x5e745
movl $0x2, -0x10(%rbp)
jmp 0x5e788
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x3, %rdi
leaq 0x1fb69(%rip), %rsi     # 0x7e2c1
callq 0x4810
cmpl $0x0, %eax
je 0x5e786
movq 0x2b867(%rip), %rax     # 0x89fd0
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdx
addq $0x3, %rdx
leaq 0x1f470(%rip), %rsi     # 0x7dbef
movb $0x0, %al
callq 0x4830
jmp 0x5e788
jmp 0x5e78a
jmp 0x5e78c
jmp 0x5e78e
jmp 0x5e790
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x5e69c
jmp 0x5e7a2
movl -0x10(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_find_rg
SAM_RG *sam_hdr_find_rg(SAM_hdr *hdr, const char *rg) {
    khint_t k = kh_get(m_s2i, hdr->rg_hash, rg);
    return k == kh_end(hdr->rg_hash)
	? NULL
	: &hdr->rg[kh_val(hdr->rg_hash, k)];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x5d540
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x60(%rcx), %rcx
cmpl (%rcx), %eax
jne 0x5ebfb
xorl %eax, %eax
movq %rax, -0x20(%rbp)
jmp 0x5ec21
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x60(%rcx), %rcx
movq 0x20(%rcx), %rcx
movl -0x14(%rbp), %edx
movslq (%rcx,%rdx,4), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_PG_ID
const char *sam_hdr_PG_ID(SAM_hdr *sh, const char *name) {
    khint_t k = kh_get(m_s2i, sh->pg_hash, name);
    if (k == kh_end(sh->pg_hash))
	return name;

    do {
	sprintf(sh->ID_buf, "%.1000s.%d", name, sh->ID_cnt++);
	k = kh_get(m_s2i, sh->pg_hash, sh->ID_buf);
    } while (k != kh_end(sh->pg_hash));

    return sh->ID_buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x5d540
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x80(%rcx), %rcx
cmpl (%rcx), %eax
jne 0x5ec73
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x5ece5
jmp 0x5ec75
movq -0x10(%rbp), %rdi
addq $0x94, %rdi
movq -0x18(%rbp), %rdx
movq -0x10(%rbp), %rax
movl 0x494(%rax), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x494(%rax)
leaq 0x1ef06(%rip), %rsi     # 0x7dba6
movb $0x0, %al
callq 0x4100
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x94, %rsi
callq 0x5d540
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x80(%rcx), %rcx
cmpl (%rcx), %eax
jne 0x5ec75
movq -0x10(%rbp), %rax
addq $0x94, %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: stringify_argv
char *stringify_argv(int argc, char *argv[]) {
    char *str, *cp;
    size_t nbytes = 1;
    int i, j;

    /* Allocate */
    for (i = 0; i < argc; i++) {
	nbytes += strlen(argv[i]) + 1;
    }
    if (!(str = malloc(nbytes)))
	return NULL;

    /* Copy */
    cp = str;
    for (i = 0; i < argc; i++) {
	j = 0;
	while (argv[i][j]) {
	    if (argv[i][j] == '\t')
		*cp++ = ' ';
	    else
		*cp++ = argv[i][j];
	    j++;
	}
	*cp++ = ' ';
    }
    *cp++ = 0;

    return str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x1, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x5efbe
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x4230
addq $0x1, %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x5ef8e
movq -0x30(%rbp), %rdi
callq 0x47a0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x5efde
movq $0x0, -0x8(%rbp)
jmp 0x5f0ac
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x5f092
movl $0x0, -0x38(%rbp)
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x38(%rbp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x5f072
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x9, %eax
jne 0x5f043
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movb $0x20, (%rax)
jmp 0x5f067
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x38(%rbp), %rcx
movb (%rax,%rcx), %cl
movq -0x28(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x28(%rbp)
movb %cl, (%rax)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x5f000
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movb $0x20, (%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x5efed
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movb $0x0, (%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/string_alloc.c
// Function: string_pool_create
string_alloc_t *string_pool_create(size_t max_length) {
    string_alloc_t *a_str;
    
    if (NULL == (a_str = (string_alloc_t *)malloc(sizeof(*a_str)))) {
    	return NULL;
    }
    
    if (max_length < MIN_STR_SIZE) max_length = MIN_STR_SIZE;
    
    a_str->nstrings    = 0;
    a_str->max_length  = max_length;
    a_str->strings     = NULL;
    
    return a_str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x18, %edi
callq 0x47a0
movq %rax, %rcx
movq %rcx, -0x18(%rbp)
xorl %eax, %eax
cmpq %rcx, %rax
jne 0x5fefe
movq $0x0, -0x8(%rbp)
jmp 0x5ff3b
cmpq $0x400, -0x10(%rbp)     # imm = 0x400
jae 0x5ff10
movq $0x400, -0x10(%rbp)     # imm = 0x400
movq -0x18(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x18(%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/string_alloc.c
// Function: string_pool_destroy
void string_pool_destroy(string_alloc_t *a_str) {
    size_t i;
    
    for (i = 0; i < a_str->nstrings; i++) {
    	free(a_str->strings[i].str);
    }
    
    free(a_str->strings);
    free(a_str);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x5ff9b
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x46a0
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x5ff64
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x46a0
movq -0x8(%rbp), %rdi
callq 0x46a0
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: karel-brinda[P]ococo/ext/htslib/cram/string_alloc.c
// Function: string_alloc
char *string_alloc(string_alloc_t *a_str, size_t length) {
    string_t *str;
    char *ret;
    
    if (length <= 0) return NULL;
    
    // add to last string pool if we have space
    if (a_str->nstrings) {
    	str = &a_str->strings[a_str->nstrings - 1];
	
	if (str->used + length < a_str->max_length) {
	    ret = str->str + str->used;
	    str->used += length;
	    return ret;
	}
    }
    
    // increase the max length if needs be
    if (length > a_str->max_length) a_str->max_length = length;
	
    // need a new string pool 
    str = new_string_pool(a_str);
    
    if (NULL == str) return NULL;
    
    str->used = length;
    return str->str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
ja 0x5ffe4
movq $0x0, -0x8(%rbp)
jmp 0x600a0
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x60052
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
subq $0x1, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
addq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x60050
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
addq 0x8(%rcx), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x600a0
jmp 0x60052
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jbe 0x6006a
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
callq 0x600b0
movq %rax, -0x20(%rbp)
xorl %eax, %eax
cmpq -0x20(%rbp), %rax
jne 0x60089
movq $0x0, -0x8(%rbp)
jmp 0x600a0
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq (%rax), %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/string_alloc.c
// Function: new_string_pool
static string_t *new_string_pool(string_alloc_t *a_str) {
    string_t *str;
    
    str = realloc(a_str->strings, (a_str->nstrings + 1) * sizeof(*a_str->strings));
    
    if (NULL == str) return NULL;
    
    a_str->strings = str;
    str = &a_str->strings[a_str->nstrings];
    
    str->str = malloc(a_str->max_length);;
    
    if (NULL == str->str) return NULL;
    
    str->used = 0;
    a_str->nstrings++;
    
    return str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
addq $0x1, %rsi
shlq $0x4, %rsi
callq 0x4990
movq %rax, -0x18(%rbp)
xorl %eax, %eax
cmpq -0x18(%rbp), %rax
jne 0x600ef
movq $0x0, -0x8(%rbp)
jmp 0x60165
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x47a0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
xorl %eax, %eax
cmpq (%rcx), %rax
jne 0x60141
movq $0x0, -0x8(%rbp)
jmp 0x60165
movq -0x18(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop