LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
movq %rdi, %rbx
movl $0x18, %edi
callq 0x4700
testq %rax, %rax
je 0x40e21
cmpq $0x401, %rbx            # imm = 0x401
movl $0x400, %ecx            # imm = 0x400
cmovaeq %rbx, %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq %rcx, (%rax)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
je 0x40e52
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x4610
incq %r15
addq $0x10, %r14
cmpq 0x8(%rbx), %r15
jb 0x40e38
movq 0x10(%rbx), %rdi
callq 0x4610
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x4610
// File: /workspace/github_cpp_makefile_star2_O3/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:
testq %rsi, %rsi
je 0x40f03
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rcx
movq 0x8(%rdi), %rsi
testq %rsi, %rsi
je 0x40eb2
movq 0x10(%r14), %rdx
movq %rsi, %r8
shlq $0x4, %r8
movq -0x8(%rdx,%r8), %rax
leaq (%rax,%rbx), %rdi
cmpq %rcx, %rdi
jae 0x40eb2
addq %r8, %rdx
addq -0x10(%rdx), %rax
movq %rdi, -0x8(%rdx)
jmp 0x40f08
cmpq %rbx, %rcx
jae 0x40eba
movq %rbx, (%r14)
movq 0x10(%r14), %rdi
shlq $0x4, %rsi
addq $0x10, %rsi
callq 0x48d0
testq %rax, %rax
je 0x40f06
movq %rax, %r15
movq %rax, 0x10(%r14)
movq (%r14), %rdi
movq 0x8(%r14), %r12
movq %r12, %r13
shlq $0x4, %r13
callq 0x4700
movq %rax, (%r15,%r13)
testq %rax, %rax
je 0x40f06
addq %r13, %r15
incq %r12
movq %r12, 0x8(%r14)
movq %rbx, 0x8(%r15)
jmp 0x40f08
xorl %eax, %eax
retq
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/string_alloc.c
// Function: string_ndup
char *string_ndup(string_alloc_t *a_str, char *instr, size_t len) {
    char *str = string_alloc(a_str, len + 1);
    
    if (NULL == str) return NULL;
    
    strncpy(str, instr, len);
    str[len] = 0;
    
    return str;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x1(%rdx), %rsi
callq 0x40e68
movq %rax, %r15
testq %rax, %rax
je 0x40f68
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x42b0
movb $0x0, (%r15,%rbx)
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/thread_pool.c
// Function: t_pool_next_result
t_pool_result *t_pool_next_result(t_results_queue *q) {
    t_pool_result *r;

#ifdef DEBUG
    fprintf(stderr, "Requesting next result on queue %p\n", q);
#endif

    pthread_mutex_lock(&q->result_m);
    r = t_pool_next_result_locked(q);
    pthread_mutex_unlock(&q->result_m);

#ifdef DEBUG
    fprintf(stderr, "(q=%p) Found %p\n", q, r);
#endif

    return r;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x20(%rdi), %r14
movq %r14, %rdi
callq 0x47a0
movq %rbx, %rdi
callq 0x40fa5
movq %rax, %rbx
movq %r14, %rdi
callq 0x43f0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/thread_pool.c
// Function: t_pool_next_result_locked
static t_pool_result *t_pool_next_result_locked(t_results_queue *q) {
    t_pool_result *r, *last;

    for (last = NULL, r = q->result_head; r; last = r, r = r->next) {
	if (r->serial == q->next_serial)
	    break;
    }

    if (r) {
	if (q->result_head == r)
	    q->result_head = r->next;
	else
	    last->next = r->next;

	if (q->result_tail == r)
	    q->result_tail = last;

	if (!q->result_head)
	    q->result_tail = NULL;

	q->next_serial++;
	q->queue_len--;
    }

    return r;
}

// Assembly:
xorl %esi, %esi
movq %rdi, %rax
movq (%rax), %rax
testq %rax, %rax
je 0x40ff0
movq %rsi, %rdx
movl 0x8(%rax), %ecx
movq %rax, %rsi
cmpl 0x10(%rdi), %ecx
jne 0x40faa
cmpq %rax, (%rdi)
movq %rdx, %rsi
cmoveq %rdi, %rsi
movq (%rax), %r8
movq %r8, (%rsi)
cmpq %rax, 0x8(%rdi)
jne 0x40fda
movq %rdx, 0x8(%rdi)
cmpq $0x0, (%rdi)
jne 0x40fe8
movq $0x0, 0x8(%rdi)
incl %ecx
movl %ecx, 0x10(%rdi)
decl 0x18(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/thread_pool.c
// Function: t_pool_next_result_wait
t_pool_result *t_pool_next_result_wait(t_results_queue *q) {
    t_pool_result *r;

#ifdef DEBUG
    fprintf(stderr, "Waiting for result %d...\n", q->next_serial);
#endif

    pthread_mutex_lock(&q->result_m);
    while (!(r = t_pool_next_result_locked(q))) {
	/* Possible race here now avoided via _locked() call, but incase... */
	struct timeval now;
	struct timespec timeout;

	gettimeofday(&now, NULL);
	timeout.tv_sec = now.tv_sec + 10;
	timeout.tv_nsec = now.tv_usec * 1000;

	pthread_cond_timedwait(&q->result_avail_c, &q->result_m, &timeout);
    }
    pthread_mutex_unlock(&q->result_m);

    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
leaq 0x20(%rdi), %rbx
movq %rbx, %rdi
callq 0x47a0
movq %r14, %rdi
callq 0x40fa5
testq %rax, %rax
jne 0x4106a
leaq 0x48(%r14), %r15
leaq 0x18(%rsp), %r12
leaq 0x8(%rsp), %r13
movq %r12, %rdi
xorl %esi, %esi
callq 0x48b0
movq 0x18(%rsp), %rax
addq $0xa, %rax
movq %rax, 0x8(%rsp)
imulq $0x3e8, 0x20(%rsp), %rax # imm = 0x3E8
movq %rax, 0x10(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x47e0
movq %r14, %rdi
callq 0x40fa5
testq %rax, %rax
je 0x41029
movq %rax, %rbp
movq %rbx, %rdi
callq 0x43f0
movq %rbp, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/thread_pool.c
// Function: t_pool_results_queue_empty
int t_pool_results_queue_empty(t_results_queue *q) {
    int empty;

    pthread_mutex_lock(&q->result_m);
    empty = q->queue_len == 0 && q->pending == 0;
    pthread_mutex_unlock(&q->result_m);

    return empty;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0x20(%rdi), %rbx
movq %rbx, %rdi
callq 0x47a0
xorl %ebp, %ebp
cmpl $0x0, 0x18(%r14)
jne 0x410ae
xorl %ebp, %ebp
cmpl $0x0, 0x1c(%r14)
sete %bpl
movq %rbx, %rdi
callq 0x43f0
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/thread_pool.c
// Function: t_pool_delete_result
void t_pool_delete_result(t_pool_result *r, int free_data) {
    if (!r)
	return;

    if (free_data && r->data)
	free(r->data);

    free(r);
}

// Assembly:
testq %rdi, %rdi
je 0x41131
pushq %rbx
movq %rdi, %rbx
testl %esi, %esi
je 0x41128
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x41128
callq 0x4610
movq %rbx, %rdi
popq %rbx
jmp 0x4610
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/thread_pool.c
// Function: t_pool_init
t_pool *t_pool_init(int qsize, int tsize) {
    int i;
    t_pool *p = malloc(sizeof(*p));
    p->qsize = qsize;
    p->tsize = tsize;
    p->njobs = 0;
    p->nwaiting = 0;
    p->shutdown = 0;
    p->head = p->tail = NULL;
    p->t_stack = NULL;
#ifdef DEBUG_TIME
    p->total_time = p->wait_time = 0;
#endif

    p->t = malloc(tsize * sizeof(p->t[0]));

    pthread_mutex_init(&p->pool_m, NULL);
    pthread_cond_init(&p->empty_c, NULL);
    pthread_cond_init(&p->full_c, NULL);

    pthread_mutex_lock(&p->pool_m);

#ifdef IN_ORDER
    if (!(p->t_stack = malloc(tsize * sizeof(*p->t_stack))))
	return NULL;
    p->t_stack_top = -1;

    for (i = 0; i < tsize; i++) {
	t_pool_worker_t *w = &p->t[i];
	p->t_stack[i] = 0;
	w->p = p;
	w->idx = i;
	w->wait_time = 0;
	pthread_cond_init(&w->pending_c, NULL);
	if (0 != pthread_create(&w->tid, NULL, t_pool_worker, w))
	    return NULL;
    }
#else
    pthread_cond_init(&p->pending_c, NULL);

    for (i = 0; i < tsize; i++) {
	t_pool_worker_t *w = &p->t[i];
	w->p = p;
	w->idx = i;
	pthread_cond_init(&w->pending_c, NULL);
	if (0 != pthread_create(&w->tid, NULL, t_pool_worker, w))
	    return NULL;
    }
#endif

    pthread_mutex_unlock(&p->pool_m);

    return p;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movl %edi, %r14d
movl $0x108, %edi            # imm = 0x108
callq 0x4700
movq %rax, %rbx
movl %r14d, (%rax)
movl %ebp, 0x20(%rax)
movq $0x0, 0xe8(%rax)
movslq %ebp, %r12
movq %r12, %rax
shlq $0x4, %rax
leaq (%rax,%rax,4), %rdi
callq 0x4700
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rbx)
movups %xmm0, 0x10(%rbx)
movq %rax, 0x28(%rbx)
leaq 0x30(%rbx), %r14
movq $0x0, 0x8(%rsp)
movq %r14, %rdi
xorl %esi, %esi
callq 0x47c0
leaq 0x58(%rbx), %rdi
xorl %esi, %esi
callq 0x4620
leaq 0xb8(%rbx), %rdi
xorl %esi, %esi
callq 0x4620
movq %r14, 0x10(%rsp)
movq %r14, %rdi
callq 0x47a0
shlq $0x2, %r12
movq %r12, %rdi
callq 0x4700
movq %rax, 0xe8(%rbx)
testq %rax, %rax
je 0x412ca
movl $0xffffffff, 0xf0(%rbx) # imm = 0xFFFFFFFF
testl %ebp, %ebp
jle 0x412bb
movl %ebp, %ebp
movl $0x48, %r15d
movq $0x0, 0x8(%rsp)
xorl %r14d, %r14d
movq 0x28(%rbx), %r12
movq 0xe8(%rbx), %rax
leaq (%r12,%r15), %r13
addq $-0x48, %r13
movl $0x0, (%rax,%r14,4)
movq %rbx, (%r13)
movl %r14d, 0x8(%r13)
movq $0x0, 0x48(%r13)
leaq (%r12,%r15), %rdi
addq $-0x30, %rdi
xorl %esi, %esi
callq 0x4620
leaq (%r12,%r15), %rdi
addq $-0x38, %rdi
xorl %esi, %esi
leaq 0x3b(%rip), %rdx        # 0x412de
movq %r13, %rcx
callq 0x49b0
testl %eax, %eax
jne 0x412ca
incq %r14
addq $0x50, %r15
cmpq %r14, %rbp
jne 0x41258
movq 0x10(%rsp), %rdi
callq 0x43f0
movq %rbx, 0x8(%rsp)
movq 0x8(%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/thread_pool.c
// Function: t_pool_flush
int t_pool_flush(t_pool *p) {
    int i;

#ifdef DEBUG
    fprintf(stderr, "Flushing pool %p\n", p);
#endif

    // Drains the queue
    pthread_mutex_lock(&p->pool_m);

    // Wake up everything for the final sprint!
    for (i = 0; i < p->tsize; i++)
	if (p->t_stack[i])
	    pthread_cond_signal(&p->t[i].pending_c);

    while (p->njobs || p->nwaiting != p->tsize)
	pthread_cond_wait(&p->empty_c, &p->pool_m);

    pthread_mutex_unlock(&p->pool_m);

#ifdef DEBUG
    fprintf(stderr, "Flushed complete for pool %p, njobs=%d, nwaiting=%d\n",
	    p, p->njobs, p->nwaiting);
#endif

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x30(%rdi), %rbx
movq %rbx, %rdi
callq 0x47a0
movl 0x20(%r14), %eax
testl %eax, %eax
jle 0x41699
movl $0x18, %r15d
xorl %r12d, %r12d
movq 0xe8(%r14), %rcx
cmpl $0x0, (%rcx,%r12,4)
je 0x4168a
movq 0x28(%r14), %rdi
addq %r15, %rdi
callq 0x4040
movl 0x20(%r14), %eax
incq %r12
movslq %eax, %rcx
addq $0x50, %r15
cmpq %rcx, %r12
jl 0x4166c
leaq 0x58(%r14), %r15
cmpl $0x0, 0x4(%r14)
jne 0x416ae
movl 0x8(%r14), %eax
cmpl 0x20(%r14), %eax
je 0x416bb
movq %r15, %rdi
movq %rbx, %rsi
callq 0x47f0
jmp 0x4169d
movq %rbx, %rdi
callq 0x43f0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/thread_pool.c
// Function: t_pool_destroy
void t_pool_destroy(t_pool *p, int kill) {
    int i;
    
#ifdef DEBUG
    fprintf(stderr, "Destroying pool %p, kill=%d\n", p, kill);
#endif

    /* Send shutdown message to worker threads */
    if (!kill) {
	pthread_mutex_lock(&p->pool_m);
	p->shutdown = 1;

#ifdef DEBUG
	fprintf(stderr, "Sending shutdown request\n");
#endif

#ifdef IN_ORDER
	for (i = 0; i < p->tsize; i++)
	    pthread_cond_signal(&p->t[i].pending_c);
#else
	pthread_cond_broadcast(&p->pending_c);
#endif
	pthread_mutex_unlock(&p->pool_m);

#ifdef DEBUG
	fprintf(stderr, "Shutdown complete\n");
#endif
	for (i = 0; i < p->tsize; i++)
	    pthread_join(p->t[i].tid, NULL);
    } else {
	for (i = 0; i < p->tsize; i++)
	    pthread_kill(p->t[i].tid, SIGINT);
    }

    pthread_mutex_destroy(&p->pool_m);
    pthread_cond_destroy(&p->empty_c);
    pthread_cond_destroy(&p->full_c);
#ifdef IN_ORDER
    for (i = 0; i < p->tsize; i++)
	pthread_cond_destroy(&p->t[i].pending_c);
#else
    pthread_cond_destroy(&p->pending_c);
#endif

#ifdef DEBUG_TIME
    fprintf(stderr, "Total time=%f\n", p->total_time / 1000000.0);
    fprintf(stderr, "Wait  time=%f\n", p->wait_time  / 1000000.0);
    fprintf(stderr, "%d%% utilisation\n",
	    (int)(100 - ((100.0 * p->wait_time) / p->total_time + 0.5)));
    for (i = 0; i < p->tsize; i++)
	fprintf(stderr, "%d: Wait time=%f\n", i,
		p->t[i].wait_time / 1000000.0);
#endif

    if (p->t_stack)
	free(p->t_stack);

    free(p->t);
    free(p);

#ifdef DEBUG
    fprintf(stderr, "Destroyed pool %p\n", p);
#endif
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
je 0x41717
cmpl $0x0, 0x20(%rbx)
jle 0x4178b
movl $0x10, %r14d
xorl %r15d, %r15d
movq 0x28(%rbx), %rax
movq (%rax,%r14), %rdi
movl $0x2, %esi
callq 0x46d0
incq %r15
movslq 0x20(%rbx), %rax
addq $0x50, %r14
cmpq %rax, %r15
jl 0x416f3
jmp 0x4178b
leaq 0x30(%rbx), %r14
movq %r14, %rdi
callq 0x47a0
movl $0x1, 0xc(%rbx)
cmpl $0x0, 0x20(%rbx)
jle 0x41755
movl $0x18, %r15d
xorl %r12d, %r12d
movq 0x28(%rbx), %rdi
addq %r15, %rdi
callq 0x4040
incq %r12
movslq 0x20(%rbx), %rax
addq $0x50, %r15
cmpq %rax, %r12
jl 0x41739
movq %r14, %rdi
callq 0x43f0
cmpl $0x0, 0x20(%rbx)
jle 0x4178b
movl $0x10, %r14d
xorl %r15d, %r15d
movq 0x28(%rbx), %rax
movq (%rax,%r14), %rdi
xorl %esi, %esi
callq 0x4490
incq %r15
movslq 0x20(%rbx), %rax
addq $0x50, %r14
cmpq %rax, %r15
jl 0x4176c
leaq 0x30(%rbx), %rdi
callq 0x45e0
leaq 0x58(%rbx), %rdi
callq 0x4a20
leaq 0xb8(%rbx), %rdi
callq 0x4a20
cmpl $0x0, 0x20(%rbx)
jle 0x417d4
movl $0x18, %r14d
xorl %r15d, %r15d
movq 0x28(%rbx), %rdi
addq %r14, %rdi
callq 0x4a20
incq %r15
movslq 0x20(%rbx), %rax
addq $0x50, %r14
cmpq %rax, %r15
jl 0x417b8
movq 0xe8(%rbx), %rdi
testq %rdi, %rdi
je 0x417e5
callq 0x4610
movq 0x28(%rbx), %rdi
callq 0x4610
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4610
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/zfio.c
// Function: zfgets
char *zfgets(char *line, int size, zfp *zf) {
    if (zf->fp)
	return fgets(line, size, zf->fp);
    else
	return gzgets(zf->gz, line, size);
}

// Assembly:
movl %esi, %eax
movq %rdi, %rsi
movq (%rdx), %rcx
testq %rcx, %rcx
je 0x41c1c
movq %rsi, %rdi
movl %eax, %esi
movq %rcx, %rdx
jmp 0x4860
movq 0x8(%rdx), %rdi
movl %eax, %edx
jmp 0x4940
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/zfio.c
// Function: zfputs
int zfputs(char *line, zfp *zf) {
    if (zf->fp)
	return fputs(line, zf->fp);
    else
	return gzputs(zf->gz, line) ? 0 : EOF;
}

// Assembly:
movq %rdi, %rax
movq (%rsi), %rcx
testq %rcx, %rcx
je 0x41c3d
movq %rax, %rdi
movq %rcx, %rsi
jmp 0x45c0
pushq %rax
movq 0x8(%rsi), %rdi
movq %rax, %rsi
callq 0x4a00
xorl %ecx, %ecx
cmpl $0x1, %eax
sbbl %ecx, %ecx
movl %ecx, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/zfio.c
// Function: zfpeek
int zfpeek(zfp *zf) {
    int c;

    if (zf->fp) {
	c = getc(zf->fp);
	if (c != EOF)
	    ungetc(c, zf->fp);
    } else {
	c = gzgetc(zf->gz);
	if (c != EOF)
	    gzungetc(c, zf->gz);
    }

    return c;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x41c7c
callq 0x4170
cmpl $-0x1, %eax
je 0x41cbb
movl %eax, %ebx
movq (%r14), %rsi
movl %eax, %edi
callq 0x40e0
jmp 0x41cc0
movq 0x8(%r14), %rsi
movl (%rsi), %eax
testl %eax, %eax
je 0x41c9f
decl %eax
movl %eax, (%rsi)
incq 0x10(%rsi)
movq 0x8(%rsi), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rsi)
movzbl (%rax), %ebx
jmp 0x41cb2
movq %rsi, %rdi
callq 0x4950
cmpl $-0x1, %eax
je 0x41cbb
movl %eax, %ebx
movq 0x8(%r14), %rsi
movl %ebx, %edi
callq 0x44f0
jmp 0x41cc0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/cram/zfio.c
// Function: zfopen
zfp *zfopen(const char *path, const char *mode) {
    char path2[1024];
    zfp *zf;

    if (!(zf = (zfp *)malloc(sizeof(*zf))))
	return NULL;
    zf->fp = NULL;
    zf->gz = NULL;

    /* Try normal fopen */
    if (mode[0] != 'z' && mode[1] != 'z' &&
	NULL != (zf->fp = fopen(path, mode))) {
	unsigned char magic[2];
	if (2 != fread(magic, 1, 2, zf->fp)) {
	    free(zf);
	    return NULL;
	}
	if (!(magic[0] == 0x1f &&
	      magic[1] == 0x8b)) {
	    fseeko(zf->fp, 0, SEEK_SET);
	    return zf;
	}

	fclose(zf->fp);
	zf->fp = NULL;
    }

    if ((zf->gz = gzopen(path, mode)))
	return zf;

    if (!strchr(mode, 'w')) {
	sprintf(path2, "%.*s.gz", 1020, path);
	if ((zf->gz = gzopen(path2, mode)))
	    return zf;
    }

    free(zf);
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rsi, %r14
movq %rdi, %r15
movl $0x1, %edi
movl $0x10, %esi
callq 0x4360
testq %rax, %rax
je 0x41da2
movq %rax, %rbx
cmpb $0x7a, (%r14)
je 0x41d74
cmpb $0x7a, 0x1(%r14)
je 0x41d74
movq %r15, %rdi
movq %r14, %rsi
callq 0x4600
movq %rax, (%rbx)
testq %rax, %rax
je 0x41d74
movq %rax, %r12
movq %rsp, %rdi
movl $0x1, %esi
movl $0x2, %edx
movq %rax, %rcx
callq 0x47d0
cmpq $0x2, %rax
jne 0x41d9a
cmpb $0x1f, (%rsp)
jne 0x41de8
cmpb $-0x75, 0x1(%rsp)
jne 0x41de8
movq %r12, %rdi
callq 0x4530
movq $0x0, (%rbx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x47b0
movq %rax, 0x8(%rbx)
testq %rax, %rax
jne 0x41da4
movq %r14, %rdi
movl $0x77, %esi
callq 0x4200
testq %rax, %rax
je 0x41db6
movq %rbx, %rdi
callq 0x4610
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x11d9b(%rip), %rsi     # 0x53b58
movq %rsp, %r12
movq %r12, %rdi
movl $0x3fc, %edx            # imm = 0x3FC
movq %r15, %rcx
xorl %eax, %eax
callq 0x4110
movq %r12, %rdi
movq %r14, %rsi
callq 0x47b0
movq %rax, 0x8(%rbx)
testq %rax, %rax
jne 0x41da4
jmp 0x41d9a
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4300
jmp 0x41da4
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/kstring.c
// Function: kvsprintf
int kvsprintf(kstring_t *s, const char *fmt, va_list ap)
{
	va_list args;
	int l;
	va_copy(args, ap);
	l = vsnprintf(s->s + s->l, s->m - s->l, fmt, args); // This line does not work with glibc 2.0. See `man snprintf'.
	va_end(args);
	if (l + 1 > s->m - s->l) {
		if (ks_resize(s, s->l + l + 2) < 0)
			return -1;
		va_copy(args, ap);
		l = vsnprintf(s->s + s->l, s->m - s->l, fmt, args);
		va_end(args);
	}
	s->l += l;
	return l;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rdx), %rax
movq %rsp, %rcx
movq %rax, 0x10(%rcx)
movups (%rdx), %xmm0
movaps %xmm0, (%rcx)
movq (%rdi), %rax
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rdi
addq %rax, %rdi
subq %rax, %rsi
movq %r14, %rdx
callq 0x4340
leal 0x1(%rax), %ecx
movslq %ecx, %rsi
movq (%rbx), %rcx
movq 0x8(%rbx), %rdx
movq %rdx, %rdi
subq %rcx, %rdi
cmpq %rsi, %rdi
jae 0x41f1c
cltq
leaq (%rcx,%rax), %rsi
addq $0x2, %rsi
cmpq %rsi, %rdx
jae 0x41eee
addq %rax, %rcx
incq %rcx
movq %rcx, %rax
shrq %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x10, %rax
orq %rcx, %rax
movq %rax, %r12
shrq $0x20, %r12
orq %rax, %r12
incq %r12
movq 0x10(%rbx), %rdi
movq %r12, %rsi
callq 0x48d0
testq %rax, %rax
je 0x41f31
movq %rax, 0x10(%rbx)
movq %r12, 0x8(%rbx)
movq 0x10(%r15), %rax
movq %rsp, %rcx
movq %rax, 0x10(%rcx)
movups (%r15), %xmm0
movaps %xmm0, (%rcx)
movq (%rbx), %rax
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdi
addq %rax, %rdi
subq %rax, %rsi
movq %r14, %rdx
callq 0x4340
movq (%rbx), %rcx
movslq %eax, %rdx
addq %rcx, %rdx
movq %rdx, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x41f25
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/kstring.c
// Function: kstrtok
char *kstrtok(const char *str, const char *sep, ks_tokaux_t *aux)
{
	const char *p, *start;
	if (sep) { // set up the table
		if (str == 0 && (aux->tab[0]&1)) return 0; // no need to set up if we have finished
		aux->finished = 0;
		if (sep[1]) {
			aux->sep = -1;
			aux->tab[0] = aux->tab[1] = aux->tab[2] = aux->tab[3] = 0;
			for (p = sep; *p; ++p) aux->tab[*p>>6] |= 1ull<<(*p&0x3f);
		} else aux->sep = sep[0];
	}
	if (aux->finished) return 0;
	else if (str) aux->p = str - 1, aux->finished = 0;
	if (aux->sep < 0) {
		for (p = start = aux->p + 1; *p; ++p)
			if (aux->tab[*p>>6]>>(*p&0x3f)&1) break;
	} else {
		for (p = start = aux->p + 1; *p; ++p)
			if (*p == aux->sep) break;
	}
	aux->p = p; // end of token
	if (*p == 0) aux->finished = 1; // no more tokens
	return (char*)start;
}

// Assembly:
testq %rsi, %rsi
je 0x42012
testq %rdi, %rdi
jne 0x41fcb
testb $0x1, (%rdx)
jne 0x42018
movl $0x0, 0x24(%rdx)
cmpb $0x0, 0x1(%rsi)
je 0x4201b
movl $0xffffffff, 0x20(%rdx) # imm = 0xFFFFFFFF
xorps %xmm0, %xmm0
movups %xmm0, (%rdx)
movups %xmm0, 0x10(%rdx)
movb (%rsi), %al
testb %al, %al
je 0x42021
incq %rsi
movsbl %al, %ecx
movl $0x1, %eax
shlq %cl, %rax
sarl $0x6, %ecx
movslq %ecx, %rcx
orq %rax, (%rdx,%rcx,8)
movb (%rsi), %al
incq %rsi
testb %al, %al
jne 0x41ff2
jmp 0x42021
cmpl $0x0, 0x24(%rdx)
je 0x42021
xorl %eax, %eax
retq
movsbl (%rsi), %eax
movl %eax, 0x20(%rdx)
testq %rdi, %rdi
je 0x42034
decq %rdi
movq %rdi, 0x28(%rdx)
movl $0x0, 0x24(%rdx)
movl 0x20(%rdx), %esi
movq 0x28(%rdx), %rcx
leaq 0x1(%rcx), %rax
testl %esi, %esi
js 0x42054
movsbl 0x1(%rcx), %edi
incq %rcx
testl %edi, %edi
je 0x42086
cmpl %edi, %esi
jne 0x42043
jmp 0x42086
movb (%rax), %sil
movq %rax, %rcx
testb %sil, %sil
je 0x42086
movq %rax, %rcx
movsbl %sil, %esi
movzbl %sil, %edi
sarl $0x6, %esi
movslq %esi, %rsi
movq (%rdx,%rsi,8), %rsi
btq %rdi, %rsi
jb 0x42086
movb 0x1(%rcx), %sil
incq %rcx
testb %sil, %sil
jne 0x42062
movq %rcx, 0x28(%rdx)
cmpb $0x0, (%rcx)
je 0x42090
retq
movl $0x1, 0x24(%rdx)
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/kstring.c
// Function: kgetline
int kgetline(kstring_t *s, kgets_func *fgets_fn, void *fp)
{
	size_t l0 = s->l;

	while (s->l == l0 || s->s[s->l-1] != '\n') {
		if (s->m - s->l < 200) {
			if (ks_resize(s, s->m + 200) < 0)
				return EOF;
		}
		if (fgets_fn(s->s + s->l, s->m - s->l, fp) == NULL) break;
		s->l += strlen(s->s + s->l);
	}

	if (s->l == l0) return EOF;

	if (s->l > l0 && s->s[s->l-1] == '\n') {
		s->l--;
		if (s->l > l0 && s->s[s->l-1] == '\r') s->l--;
	}
	s->s[s->l] = '\0';
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %rbp
movq 0x10(%rdi), %r12
movq %rbp, %rdi
cmpq %rbp, %rdi
je 0x42295
cmpb $0xa, -0x1(%r12,%rdi)
je 0x42347
movq 0x8(%rbx), %rax
movq %rax, %r13
subq %rdi, %r13
cmpq $-0xc9, %rax
ja 0x42315
cmpq $0xc7, %r13
ja 0x42315
addq $0xc7, %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
movq %rcx, %r13
shrq $0x20, %r13
orq %rcx, %r13
incq %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x48d0
testq %rax, %rax
je 0x42383
movq %rax, %r12
movq %rax, 0x10(%rbx)
movq %r13, 0x8(%rbx)
movq (%rbx), %rdi
subq %rdi, %r13
addq %r12, %rdi
movl %r13d, %esi
movq %r14, %rdx
callq *%r15
movq (%rbx), %r13
testq %rax, %rax
je 0x42344
movq 0x10(%rbx), %r12
leaq (%r12,%r13), %rdi
callq 0x4230
movq %rax, %rdi
addq %r13, %rdi
movq %rdi, (%rbx)
jmp 0x42284
movq %r13, %rdi
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rbp, %rdi
je 0x42388
movq 0x10(%rbx), %rax
jbe 0x42378
cmpb $0xa, -0x1(%rax,%rdi)
jne 0x42378
leaq -0x1(%rdi), %rcx
movq %rcx, (%rbx)
cmpq %rbp, %rcx
jbe 0x4237b
cmpb $0xd, -0x2(%rax,%rdi)
jne 0x4237b
addq $-0x2, %rdi
movq %rdi, (%rbx)
movq %rdi, %rcx
movb $0x0, (%rax,%rcx)
xorl %eax, %eax
jmp 0x42388
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/bgzf.c
// Function: bgzf_open
BGZF *bgzf_open(const char *path, const char *mode)
{
    BGZF *fp = 0;
    assert(compressBound(BGZF_BLOCK_SIZE) < BGZF_MAX_BLOCK_SIZE);
    if (strchr(mode, 'r')) {
        hFILE *fpr;
        if ((fpr = hopen(path, mode)) == 0) return 0;
        fp = bgzf_read_init(fpr);
        if (fp == 0) { hclose_abruptly(fpr); return NULL; }
        fp->fp = fpr;
    } else if (strchr(mode, 'w') || strchr(mode, 'a')) {
        hFILE *fpw;
        if ((fpw = hopen(path, mode)) == 0) return 0;
        fp = bgzf_write_init(mode);
        if (fp == NULL) return NULL;
        fp->fp = fpw;
    }
    else { errno = EINVAL; return 0; }

    fp->is_be = ed_is_big();
    return fp;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0xff00, %edi           # imm = 0xFF00
callq 0x4880
cmpq $0x10000, %rax          # imm = 0x10000
jae 0x42827
movq %rbx, %rdi
movl $0x72, %esi
callq 0x4200
testq %rax, %rax
je 0x427c4
movq %r14, %rdi
movq %rbx, %rsi
callq 0x477e9
testq %rax, %rax
je 0x4281d
movq %rax, %r14
movq %rax, %rdi
callq 0x42846
testq %rax, %rax
jne 0x42808
movq %r14, %rdi
callq 0x474b5
jmp 0x4281d
movq %rbx, %rdi
movl $0x77, %esi
callq 0x4200
testq %rax, %rax
jne 0x427e8
movq %rbx, %rdi
movl $0x61, %esi
callq 0x4200
testq %rax, %rax
je 0x42812
movq %r14, %rdi
movq %rbx, %rsi
callq 0x477e9
testq %rax, %rax
je 0x4281d
movq %rax, %r14
movq %rbx, %rdi
callq 0x4291e
testq %rax, %rax
je 0x4281d
movq %r14, 0x38(%rax)
andb $-0xd, 0x2(%rax)
jmp 0x4281f
callq 0x4070
movl $0x16, (%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x113a2(%rip), %rdi     # 0x53bd0
leaq 0x113d0(%rip), %rsi     # 0x53c05
leaq 0x113d0(%rip), %rcx     # 0x53c0c
movl $0xed, %edx
callq 0x4350
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/bgzf.c
// Function: bgzf_read_init
static BGZF *bgzf_read_init(hFILE *hfpr)
{
    BGZF *fp;
    uint8_t magic[18];
    ssize_t n = hpeek(hfpr, magic, 18);
    if (n < 0) return NULL;

    fp = (BGZF*)calloc(1, sizeof(BGZF));
    if (fp == NULL) return NULL;

    fp->is_write = 0;
    fp->is_compressed = (n==2 && magic[0]==0x1f && magic[1]==0x8b);
    fp->uncompressed_block = malloc(BGZF_MAX_BLOCK_SIZE);
    fp->compressed_block = malloc(BGZF_MAX_BLOCK_SIZE);
    fp->is_compressed = (n==18 && magic[0]==0x1f && magic[1]==0x8b) ? 1 : 0;
    fp->is_gzip = ( !fp->is_compressed || ((magic[3]&4) && memcmp(&magic[12], "BC\2\0",4)==0) ) ? 0 : 1;
#ifdef BGZF_CACHE
    fp->cache = kh_init(cache);
#endif
    return fp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsp, %rsi
movl $0x12, %edx
callq 0x470eb
testq %rax, %rax
js 0x4290c
movq %rax, %r14
movl $0x1, %edi
movl $0x60, %esi
callq 0x4360
xorl %r15d, %r15d
testq %rax, %rax
je 0x4290c
movq %rax, %rbx
cmpb $0x1f, (%rsp)
setne %bpl
cmpb $-0x75, 0x1(%rsp)
setne %r12b
movl $0x10000, %edi          # imm = 0x10000
callq 0x4700
movq %rax, 0x20(%rbx)
movl $0x10000, %edi          # imm = 0x10000
callq 0x4700
movq %rax, 0x28(%rbx)
cmpq $0x12, %r14
setne %cl
orb %bpl, %cl
orb %r12b, %cl
movl %ecx, %eax
xorb $0x1, %al
movzbl %al, %eax
shll $0x1d, %eax
testb %cl, %cl
jne 0x428f1
movl $0x80000000, %r15d      # imm = 0x80000000
testb $0x4, 0x3(%rsp)
je 0x428f1
xorl %r15d, %r15d
cmpl $0x24342, 0xc(%rsp)     # imm = 0x24342
setne %r15b
shll $0x1f, %r15d
orl %eax, %r15d
movl %r15d, (%rbx)
movl $0x1, %edi
movl $0x28, %esi
callq 0x4360
movq %rax, 0x30(%rbx)
jmp 0x4290e
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/bgzf.c
// Function: bgzf_dopen
BGZF *bgzf_dopen(int fd, const char *mode)
{
    BGZF *fp = 0;
    assert(compressBound(BGZF_BLOCK_SIZE) < BGZF_MAX_BLOCK_SIZE);
    if (strchr(mode, 'r')) {
        hFILE *fpr;
        if ((fpr = hdopen(fd, mode)) == 0) return 0;
        fp = bgzf_read_init(fpr);
        if (fp == 0) { hclose_abruptly(fpr); return NULL; } // FIXME this closes fd
        fp->fp = fpr;
    } else if (strchr(mode, 'w') || strchr(mode, 'a')) {
        hFILE *fpw;
        if ((fpw = hdopen(fd, mode)) == 0) return 0;
        fp = bgzf_write_init(mode);
        if (fp == NULL) return NULL;
        fp->fp = fpw;
    }
    else { errno = EINVAL; return 0; }

    fp->is_be = ed_is_big();
    return fp;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
movl $0xff00, %edi           # imm = 0xFF00
callq 0x4880
cmpq $0x10000, %rax          # imm = 0x10000
jae 0x42b7c
movq %rbx, %rdi
movl $0x72, %esi
callq 0x4200
testq %rax, %rax
je 0x42b1d
movl %ebp, %edi
movq %rbx, %rsi
callq 0x474e0
testq %rax, %rax
je 0x42b75
movq %rax, %r14
movq %rax, %rdi
callq 0x42846
testq %rax, %rax
jne 0x42b60
movq %r14, %rdi
callq 0x474b5
jmp 0x42b75
movq %rbx, %rdi
movl $0x77, %esi
callq 0x4200
testq %rax, %rax
jne 0x42b41
movq %rbx, %rdi
movl $0x61, %esi
callq 0x4200
testq %rax, %rax
je 0x42b6a
movl %ebp, %edi
movq %rbx, %rsi
callq 0x474e0
testq %rax, %rax
je 0x42b75
movq %rax, %r14
movq %rbx, %rdi
callq 0x4291e
testq %rax, %rax
je 0x42b75
movq %r14, 0x38(%rax)
andb $-0xd, 0x2(%rax)
jmp 0x42b77
callq 0x4070
movl $0x16, (%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x1104d(%rip), %rdi     # 0x53bd0
leaq 0x1107b(%rip), %rsi     # 0x53c05
leaq 0x110a7(%rip), %rcx     # 0x53c38
movl $0x104, %edx            # imm = 0x104
callq 0x4350
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/bgzf.c
// Function: bgzf_hopen
BGZF *bgzf_hopen(hFILE *hfp, const char *mode)
{
    BGZF *fp = NULL;
    assert(compressBound(BGZF_BLOCK_SIZE) < BGZF_MAX_BLOCK_SIZE);
    if (strchr(mode, 'r')) {
        fp = bgzf_read_init(hfp);
        if (fp == NULL) return NULL;
    } else if (strchr(mode, 'w') || strchr(mode, 'a')) {
        fp = bgzf_write_init(mode);
        if (fp == NULL) return NULL;
    }
    else { errno = EINVAL; return 0; }

    fp->fp = hfp;
    fp->is_be = ed_is_big();
    return fp;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0xff00, %edi           # imm = 0xFF00
callq 0x4880
cmpq $0x10000, %rax          # imm = 0x10000
jae 0x42c23
movq %r14, %rdi
movl $0x72, %esi
callq 0x4200
testq %rax, %rax
je 0x42bd3
movq %rbx, %rdi
callq 0x42846
jmp 0x42bff
movq %r14, %rdi
movl $0x77, %esi
callq 0x4200
testq %rax, %rax
jne 0x42bf7
movq %r14, %rdi
movl $0x61, %esi
callq 0x4200
testq %rax, %rax
je 0x42c0e
movq %r14, %rdi
callq 0x4291e
testq %rax, %rax
je 0x42c19
movq %rbx, 0x38(%rax)
andb $-0xd, 0x2(%rax)
jmp 0x42c1b
callq 0x4070
movl $0x16, (%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x10fa6(%rip), %rdi     # 0x53bd0
leaq 0x10fd4(%rip), %rsi     # 0x53c05
leaq 0x11024(%rip), %rcx     # 0x53c5c
movl $0x11b, %edx            # imm = 0x11B
callq 0x4350
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/bgzf.c
// Function: bgzf_zerr
static const char *bgzf_zerr(int errnum, z_stream *zs)
{
    static char buffer[32];

    /* Return zs->msg if available.
       zlib doesn't set this very reliably.  Looking at the source suggests
       that it may get set to a useful message for deflateInit2, inflateInit2
       and inflate when it returns Z_DATA_ERROR. For inflate with other
       return codes, deflate, deflateEnd and inflateEnd it doesn't appear
       to be useful.  For the likely non-useful cases, the caller should
       pass NULL into zs. */

    if (zs && zs->msg) return zs->msg;

    // gzerror OF((gzFile file, int *errnum)
    switch (errnum) {
    case Z_ERRNO:
        return strerror(errno);
    case Z_STREAM_ERROR:
        return "invalid parameter/compression level, or inconsistent stream state";
    case Z_DATA_ERROR:
        return "invalid or incomplete IO";
    case Z_MEM_ERROR:
        return "out of memory";
    case Z_BUF_ERROR:
        return "progress temporarily not possible, or in() / out() returned an error";
    case Z_VERSION_ERROR:
        return "zlib version mismatch";
    case Z_OK: // 0: maybe gzgets error Z_NULL
    default:
        snprintf(buffer, sizeof(buffer), "[%d] unknown", errnum);
        return buffer;  // FIXME: Not thread-safe.
    }
}

// Assembly:
pushq %rbx
movl %edi, %ecx
testq %rsi, %rsi
je 0x42da6
movq 0x30(%rsi), %rbx
testq %rbx, %rbx
je 0x42da6
movq %rbx, %rax
popq %rbx
retq
leal 0x6(%rcx), %eax
cmpl $0x5, %eax
ja 0x42df8
leaq 0x10dab(%rip), %rcx     # 0x53b60
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x112d1(%rip), %rbx     # 0x54096
jmp 0x42da1
leaq 0x1121a(%rip), %rbx     # 0x53fe8
jmp 0x42da1
leaq 0x1126c(%rip), %rbx     # 0x54043
jmp 0x42da1
leaq 0x1124a(%rip), %rbx     # 0x5402a
jmp 0x42da1
leaq 0x11268(%rip), %rbx     # 0x54051
jmp 0x42da1
callq 0x4070
movl (%rax), %edi
popq %rbx
jmp 0x41b0
leaq 0x1f7a1(%rip), %rbx     # 0x625a0
leaq 0x112a6(%rip), %rdx     # 0x540ac
movl $0x20, %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4890
jmp 0x42da1
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/bgzf.c
// Function: inflate_block
static int inflate_block(BGZF* fp, int block_length)
{
    z_stream zs;
    zs.zalloc = NULL;
    zs.zfree = NULL;
    zs.msg = NULL;
    zs.next_in = (Bytef*)fp->compressed_block + 18;
    zs.avail_in = block_length - 16;
    zs.next_out = (Bytef*)fp->uncompressed_block;
    zs.avail_out = BGZF_MAX_BLOCK_SIZE;

    int ret = inflateInit2(&zs, -15);
    if (ret != Z_OK) {
        if (hts_verbose >= 1) {
            fprintf(stderr, "[E::%s] inflateInit2 failed: %s\n",
                    __func__, bgzf_zerr(ret, &zs));
        }
        fp->errcode |= BGZF_ERR_ZLIB;
        return -1;
    }
    if ((ret = inflate(&zs, Z_FINISH)) != Z_STREAM_END) {
        if (hts_verbose >= 1) {
            fprintf(stderr, "[E::%s] inflate failed: %s\n",
                    __func__, bgzf_zerr(ret, ret == Z_DATA_ERROR ? &zs : NULL));
        }
        if ((ret = inflateEnd(&zs)) != Z_OK) {
            if (hts_verbose >= 2) {
                fprintf(stderr, "[E::%s] inflateEnd failed: %s\n",
                        __func__, bgzf_zerr(ret, NULL));
            }
        }
        fp->errcode |= BGZF_ERR_ZLIB;
        return -1;
    }
    if ((ret = inflateEnd(&zs)) != Z_OK) {
        if (hts_verbose >= 1) {
            fprintf(stderr, "[E::%s] inflateEnd failed: %s\n",
                    __func__, bgzf_zerr(ret, NULL));
        }
        fp->errcode |= BGZF_ERR_ZLIB;
        return -1;
    }
    return zs.total_out;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
movq $0x0, 0x30(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rdi)
movq 0x28(%rbx), %rax
addq $0x12, %rax
movq %rax, (%rdi)
addl $-0x10, %esi
movl %esi, 0x8(%rdi)
movq 0x20(%rbx), %rax
movq %rax, 0x18(%rdi)
movl $0x10000, 0x20(%rdi)    # imm = 0x10000
leaq 0xdb6b(%rip), %rdx      # 0x51025
movl $0xfffffff1, %esi       # imm = 0xFFFFFFF1
movl $0x70, %ecx
callq 0x4460
testl %eax, %eax
je 0x434e9
leaq 0x1f07c(%rip), %rcx     # 0x62550
cmpl $0x0, (%rcx)
jg 0x43550
orb $0x1, (%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x78, %rsp
popq %rbx
popq %r14
retq
leaq 0x8(%rsp), %rdi
movl $0x4, %esi
callq 0x4410
cmpl $0x1, %eax
jne 0x43520
leaq 0x8(%rsp), %rdi
callq 0x4560
testl %eax, %eax
je 0x4354a
leaq 0x1f03e(%rip), %rcx     # 0x62550
cmpl $0x0, (%rcx)
jle 0x434d9
movl %eax, %edi
callq 0x5bdb
jmp 0x434d9
leaq 0x1f029(%rip), %r14     # 0x62550
cmpl $0x0, (%r14)
jg 0x43561
leaq 0x8(%rsp), %rdi
callq 0x4560
testl %eax, %eax
je 0x434d9
cmpl $0x2, (%r14)
jl 0x434d9
movl %eax, %edi
callq 0x5bac
jmp 0x434d9
movl 0x30(%rsp), %eax
jmp 0x434e1
leaq 0x8(%rsp), %rsi
movl %eax, %edi
callq 0x5b49
jmp 0x434d9
leaq 0x8(%rsp), %rsi
movl %eax, %edi
callq 0x5b76
jmp 0x4352d
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/bgzf.c
// Function: bgzf_index_add_block
int bgzf_index_add_block(BGZF *fp)
{
    fp->idx->noffs++;
    if ( fp->idx->noffs > fp->idx->moffs )
    {
        fp->idx->moffs = fp->idx->noffs;
        kroundup32(fp->idx->moffs);
        fp->idx->offs = (bgzidx1_t*) realloc(fp->idx->offs, fp->idx->moffs*sizeof(bgzidx1_t));
        if ( !fp->idx->offs ) return -1;
    }
    fp->idx->offs[ fp->idx->noffs-1 ].uaddr = fp->idx->ublock_addr;
    fp->idx->offs[ fp->idx->noffs-1 ].caddr = fp->block_address;
    return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x48(%rdi), %rcx
movl (%rcx), %eax
leal 0x1(%rax), %edx
movl %edx, (%rcx)
cmpl 0x4(%rcx), %eax
jge 0x43589
movq 0x8(%rcx), %rax
jmp 0x435d6
movl %eax, %edx
sarl %edx
orl %eax, %edx
movl %edx, %eax
sarl $0x2, %eax
orl %edx, %eax
movl %eax, %edx
sarl $0x4, %edx
orl %eax, %edx
movl %edx, %eax
sarl $0x8, %eax
orl %edx, %eax
movl %eax, %edx
sarl $0x10, %edx
orl %eax, %edx
movslq %edx, %rax
movq %rax, %rsi
shlq $0x4, %rsi
incl %eax
movl %eax, 0x4(%rcx)
movq 0x8(%rcx), %rdi
addq $0x10, %rsi
callq 0x48d0
movq 0x48(%rbx), %rcx
movq %rax, 0x8(%rcx)
testq %rax, %rax
je 0x435f3
movl (%rcx), %edx
movq 0x10(%rcx), %rcx
movslq %edx, %rdx
shlq $0x4, %rdx
movq %rcx, -0x10(%rax,%rdx)
movq 0x10(%rbx), %rcx
movq %rcx, -0x8(%rax,%rdx)
xorl %eax, %eax
popq %rbx
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x435f1
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/bgzf.c
// Function: bgzf_read
ssize_t bgzf_read(BGZF *fp, void *data, size_t length)
{
    ssize_t bytes_read = 0;
    uint8_t *output = (uint8_t*)data;
    if (length <= 0) return 0;
    assert(fp->is_write == 0);
    while (bytes_read < length) {
        int copy_length, available = fp->block_length - fp->block_offset;
        uint8_t *buffer;
        if (available <= 0) {
            int ret = bgzf_read_block(fp);
            if (ret != 0) {
                if (hts_verbose >= 2) {
                    fprintf(stderr, "[E::%s] bgzf_read_block error %d after %zd of %zu bytes\n", __func__, ret, bytes_read, length);
                }
                fp->errcode |= BGZF_ERR_ZLIB;
                return -1;
            }
            available = fp->block_length - fp->block_offset;
            if (available <= 0) break;
        }
        copy_length = length - bytes_read < available? length - bytes_read : available;
        buffer = (uint8_t*)fp->uncompressed_block;
        memcpy(output, buffer + fp->block_offset, copy_length);
        fp->block_offset += copy_length;
        output += copy_length;
        bytes_read += copy_length;
    }
    if (fp->block_offset == fp->block_length) {
        fp->block_address = htell(fp->fp);
        fp->block_offset = fp->block_length = 0;
    }
    fp->uncompressed_address += bytes_read;
    return bytes_read;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdx, %rdx
je 0x438fb
movq %rdi, %rbx
testb $0x3, 0x2(%rdi)
jne 0x4397e
movq %rdx, %r15
movq %rsi, %r12
movl 0xc(%rbx), %eax
xorl %r14d, %r14d
movq %r15, %rbp
movl 0x8(%rbx), %ecx
subq %r14, %rbp
jbe 0x43908
subl %eax, %ecx
jg 0x438c1
movq %rbx, %rdi
callq 0x42e17
testl %eax, %eax
jne 0x4392d
movl 0x8(%rbx), %ecx
movl 0xc(%rbx), %eax
subl %eax, %ecx
jle 0x438f4
movl %ecx, %r13d
cmpq %r13, %rbp
cmovbq %rbp, %r13
movslq %eax, %rsi
addq 0x20(%rbx), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x4420
movl 0xc(%rbx), %eax
addl %r13d, %eax
movl %eax, 0xc(%rbx)
addq %r13, %r12
addq %r13, %r14
xorl %ecx, %ecx
testl %ecx, %ecx
je 0x4389c
jmp 0x43900
movl $0x3, %ecx
jmp 0x438ee
xorl %r14d, %r14d
jmp 0x43943
cmpl $0x3, %ecx
jne 0x4393c
movl 0x8(%rbx), %ecx
cmpl %ecx, %eax
jne 0x43927
movq 0x38(%rbx), %rax
movq 0x28(%rax), %rcx
addq 0x8(%rax), %rcx
subq (%rax), %rcx
movq %rcx, 0x10(%rbx)
movq $0x0, 0x8(%rbx)
addq %r14, 0x18(%rbx)
jmp 0x43943
leaq 0x1ec1c(%rip), %rcx     # 0x62550
cmpl $0x2, (%rcx)
jge 0x43955
orb $0x1, (%rbx)
movq $-0x1, %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1e66c(%rip), %rcx     # 0x61fc8
movq (%rcx), %rdi
leaq 0x10414(%rip), %rsi     # 0x53d7a
leaq 0x10446(%rip), %rdx     # 0x53db3
movl %eax, %ecx
movq %r14, %r8
movq %r15, %r9
xorl %eax, %eax
callq 0x4770
jmp 0x43939
leaq 0x103b9(%rip), %rdi     # 0x53d3e
leaq 0x10279(%rip), %rsi     # 0x53c05
leaq 0x103bd(%rip), %rcx     # 0x53d50
movl $0x2b2, %edx            # imm = 0x2B2
callq 0x4350
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/bgzf.c
// Function: bgzf_flush
int bgzf_flush(BGZF *fp)
{
    if (!fp->is_write) return 0;
#ifdef BGZF_MT
    if (fp->mt) {
        if (fp->block_offset) mt_queue(fp); // guaranteed that assertion does not fail
        return mt_flush_queue(fp);
    }
#endif
    while (fp->block_offset > 0) {
        int block_length;
        if ( fp->idx_build_otf )
        {
            bgzf_index_add_block(fp);
            fp->idx->ublock_addr += fp->block_offset;
        }
        block_length = deflate_block(fp, fp->block_offset);
        if (block_length < 0) {
            if (hts_verbose >= 3) fprintf(stderr, "[E::%s] deflate_block error %d\n", __func__, block_length);
            return -1;
        }
        if (hwrite(fp->fp, fp->compressed_block, block_length) != block_length) {
            if (hts_verbose >= 1) fprintf(stderr, "[E::%s] hwrite error (wrong size)\n", __func__);
            fp->errcode |= BGZF_ERR_IO; // possibly truncated file
            return -1;
        }
        fp->block_address += block_length;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %edx, %edx
testb $0x3, 0x2(%rdi)
je 0x43cc1
movq %rdi, %r14
cmpq $0x0, 0x40(%rdi)
movl 0xc(%rdi), %esi
je 0x43c70
testl %esi, %esi
je 0x43bde
movq %r14, %rdi
callq 0x43cd9
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x43d43
cmpl $0x0, 0x50(%r14)
je 0x43c0f
movq %r14, %rdi
callq 0x4356f
movslq 0xc(%r14), %rsi
movq 0x48(%r14), %rax
addq %rsi, 0x10(%rax)
movq %r14, %rdi
callq 0x43f79
testl %eax, %eax
js 0x43c78
movq 0x28(%r14), %r13
movq 0x38(%r14), %rbp
movl %eax, %r15d
movq 0x8(%rbp), %rdi
movq 0x18(%rbp), %rbx
subq %rdi, %rbx
cmpq %r15, %rbx
movq %r15, %r12
cmovbq %rbx, %r12
movq %r13, %rsi
movq %r12, %rdx
callq 0x4420
addq %r12, 0x8(%rbp)
cmpq %r15, %rbx
jae 0x43c63
movq %rbp, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x47309
movq %rax, %r12
cmpq %r15, %r12
jne 0x43cac
addq %r15, 0x10(%r14)
movl 0xc(%r14), %esi
testl %esi, %esi
jg 0x43bf4
xorl %edx, %edx
jmp 0x43cc1
leaq 0x1e8d1(%rip), %rcx     # 0x62550
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rcx)
jl 0x43cc1
movq 0x1e338(%rip), %rcx     # 0x61fc8
movq (%rcx), %rdi
leaq 0x10123(%rip), %rsi     # 0x53dbd
leaq 0x1013c(%rip), %rdx     # 0x53ddd
movl %eax, %ecx
xorl %eax, %eax
callq 0x4770
jmp 0x43cbc
leaq 0x1e89d(%rip), %rax     # 0x62550
cmpl $0x0, (%rax)
jg 0x43cd2
orb $0x4, (%r14)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %edx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5c0a
jmp 0x43cb8
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/bgzf.c
// Function: mt_queue
static void mt_queue(BGZF *fp)
{
    mtaux_t *mt = fp->mt;
    assert(mt->curr < mt->n_blks); // guaranteed by the caller
    memcpy(mt->blk[mt->curr], fp->uncompressed_block, fp->block_offset);
    mt->len[mt->curr] = fp->block_offset;
    fp->block_offset = 0;
    ++mt->curr;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x40(%rdi), %r14
movslq 0x8(%r14), %rax
cmpl 0x4(%r14), %eax
jge 0x43d24
movq %rdi, %rbx
movq 0x18(%r14), %rcx
movq (%rcx,%rax,8), %rdi
movq 0x20(%rbx), %rsi
movslq 0xc(%rbx), %rdx
callq 0x4420
movl 0xc(%rbx), %eax
movq 0x20(%r14), %rcx
movslq 0x8(%r14), %rdx
movl %eax, (%rcx,%rdx,4)
movl $0x0, 0xc(%rbx)
incl 0x8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x1044e(%rip), %rdi     # 0x54179
leaq 0xfed3(%rip), %rsi      # 0x53c05
leaq 0x10456(%rip), %rcx     # 0x5418f
movl $0x341, %edx            # imm = 0x341
callq 0x4350
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/bgzf.c
// Function: deflate_block
static int deflate_block(BGZF *fp, int block_length)
{
    size_t comp_size = BGZF_MAX_BLOCK_SIZE;
    int ret;
    if ( !fp->is_gzip )
        ret = bgzf_compress(fp->compressed_block, &comp_size, fp->uncompressed_block, block_length, fp->compress_level);
    else
        ret = bgzf_gzip_compress(fp, fp->compressed_block, &comp_size, fp->uncompressed_block, block_length, fp->compress_level);

    if ( ret != 0 )
    {
        if (hts_verbose >= 3) {
            fprintf(stderr, "[E::%s] compression error %d\n", __func__, ret);
        }
        fp->errcode |= BGZF_ERR_ZLIB;
        return -1;
    }
    fp->block_offset = 0;
    return comp_size;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq $0x10000, (%rsp)        # imm = 0x10000
movl (%rdi), %r8d
movq 0x28(%rdi), %rdi
movq 0x20(%rbx), %rdx
testl %r8d, %r8d
js 0x43fc2
movslq %esi, %rcx
shll $0x3, %r8d
sarl $0x17, %r8d
movq %rsp, %rsi
callq 0x42c42
testl %eax, %eax
je 0x44008
leaq 0x1e59a(%rip), %rax     # 0x62550
cmpl $0x3, (%rax)
jl 0x43ffe
callq 0x5c4f
jmp 0x43ffe
movq 0x58(%rbx), %r14
xorl %eax, %eax
testl %esi, %esi
sete %al
shll $0x2, %eax
movq %rdx, (%r14)
movl %esi, 0x8(%r14)
movq %rdi, 0x18(%r14)
movl $0x10000, 0x20(%r14)    # imm = 0x10000
movq %r14, %rdi
movl %eax, %esi
callq 0x4260
cmpl $-0x2, %eax
jne 0x4400e
leaq 0x1e557(%rip), %rax     # 0x62550
cmpl $0x0, (%rax)
jg 0x44029
orb $0x1, (%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x44021
movq (%rsp), %rax
jmp 0x4401a
movl 0x20(%r14), %ecx
movl $0x10000, %eax          # imm = 0x10000
subq %rcx, %rax
movl $0x0, 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x5c29
jmp 0x43faf
// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/htslib/bgzf.c
// Function: lazy_flush
static int lazy_flush(BGZF *fp)
{
    if (fp->mt) {
        if (fp->block_offset) mt_queue(fp);
        return (fp->mt->curr < fp->mt->n_blks)? 0 : mt_flush_queue(fp);
    }
    else return bgzf_flush(fp);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x40(%rdi), %rax
testq %rax, %rax
je 0x44070
cmpl $0x0, 0xc(%rbx)
je 0x44064
movq %rbx, %rdi
callq 0x43cd9
movq 0x40(%rbx), %rax
movl 0x8(%rax), %ecx
cmpl 0x4(%rax), %ecx
jge 0x44079
xorl %eax, %eax
popq %rbx
retq
movq %rbx, %rdi
popq %rbx
jmp 0x43baa
movq %rbx, %rdi
popq %rbx
jmp 0x43d43