LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_add_PG
int sam_hdr_add_PG(SAM_hdr *sh, const char *name, ...) {
    va_list args;

    if (sh->npg_end) {
	/* Copy ends array to avoid us looping while modifying it */
	int *end = malloc(sh->npg_end * sizeof(int));
	int i, nends = sh->npg_end;

	if (!end)
	    return -1;

	memcpy(end, sh->pg_end, nends * sizeof(*end));

	for (i = 0; i < nends; i++) {
	    va_start(args, name);
	    if (-1 == sam_hdr_vadd(sh, "PG", args,
				   "ID", sam_hdr_PG_ID(sh, name),
				   "PN", name,
				   "PP", sh->pg[end[i]].name,
				   NULL)) {
		free(end);
		return  -1;
	    }
	    va_end(args);
	}

	free(end);
    } else {
	va_start(args, name);
	if (-1 == sam_hdr_vadd(sh, "PG", args,
			       "ID", sam_hdr_PG_ID(sh, name),
			       "PN", name,
			       NULL))
	    return -1;
	va_end(args);
    }

    //sam_hdr_dump(sh);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x41482
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movslq 0x6c(%rdi), %r13
testq %r13, %r13
je 0x41562
leaq (,%r13,4), %r12
movq %r12, %rdi
callq 0x4700
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x415d4
movq %rax, %r15
movq 0x88(%r14), %rsi
movq %rax, %rdi
movq %r12, %rdx
callq 0x4420
testl %r13d, %r13d
jle 0x41556
movq %rsp, %r12
xorl %ebp, %ebp
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x411cf
movq 0x78(%r14), %r10
movslq (%r15,%rbp,4), %rcx
leaq (%rcx,%rcx,4), %r11
movq %r14, %rdi
leaq 0x14280(%rip), %rsi     # 0x55796
movq %r12, %rdx
leaq 0x1377e(%rip), %rcx     # 0x54c9e
movq %rax, %r8
leaq 0x1426f(%rip), %r9      # 0x55799
xorl %eax, %eax
pushq $0x0
pushq (%r10,%r11,8)
leaq 0x14263(%rip), %r10     # 0x5579c
pushq %r10
pushq %rbx
callq 0x3edba
addq $0x20, %rsp
cmpl $-0x1, %eax
je 0x415c7
incq %rbp
cmpq %rbp, %r13
jne 0x414d0
movq %r15, %rdi
callq 0x4610
xorl %ebp, %ebp
jmp 0x415d4
leaq 0x20(%rsp), %rax
movq %rsp, %r15
movq %rax, 0x10(%r15)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%r15)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%r15)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x411cf
leaq 0x141fd(%rip), %rsi     # 0x55796
leaq 0x136fe(%rip), %rcx     # 0x54c9e
leaq 0x141f2(%rip), %r9      # 0x55799
xorl %ebp, %ebp
movq %r14, %rdi
movq %r15, %rdx
movq %rax, %r8
xorl %eax, %eax
pushq $0x0
pushq %rbx
callq 0x3edba
addq $0x10, %rsp
cmpl $-0x1, %eax
jne 0x415d4
jmp 0x415cf
movq %r15, %rdi
callq 0x4610
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
movl %edi, %r15d
movl $0x1, %r14d
testl %edi, %edi
jle 0x4161c
xorl %r12d, %r12d
movq (%rbx,%r12,8), %rdi
callq 0x4230
addq %rax, %r14
incq %r14
incq %r12
cmpq %r12, %r15
jne 0x41605
movq %r14, %rdi
callq 0x4700
testq %rax, %rax
je 0x41678
movq %rax, %rcx
testl %ebp, %ebp
jle 0x41673
xorl %edx, %edx
movq %rax, %rdi
movq %rdi, %rcx
movl $0x1, %esi
movq (%rbx,%rdx,8), %rdi
movzbl -0x1(%rdi,%rsi), %edi
movb $0x20, %r8b
cmpl $0x9, %edi
je 0x41655
testl %edi, %edi
je 0x4165f
movl %edi, %r8d
movb %r8b, -0x1(%rcx,%rsi)
incq %rsi
jmp 0x4163d
leaq (%rcx,%rsi), %rdi
movb $0x20, -0x1(%rcx,%rsi)
incq %rdx
cmpq %r15, %rdx
jne 0x41635
addq %rsi, %rcx
movb $0x0, (%rcx)
jmp 0x4167a
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x41e2b
cmpq $0x401, %rbx            # imm = 0x401
movl $0x400, %ecx            # imm = 0x400
cmovaeq %rbx, %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq %rcx, (%rax)
jmp 0x41e2d
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x41e5e
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 0x41e44
movq 0x10(%rbx), %rdi
callq 0x4610
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x4610
// File: /workspace/github_cpp_makefile_star2_O1/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 0x41f10
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rdi), %rsi
testq %rsi, %rsi
je 0x41ebb
movq 0x10(%r14), %rcx
movq %rsi, %rdi
shlq $0x4, %rdi
movq -0x8(%rcx,%rdi), %rax
leaq (%rax,%rbx), %rdx
cmpq (%r14), %rdx
jae 0x41ebb
addq %rdi, %rcx
addq -0x10(%rcx), %rax
movq %rdx, -0x8(%rcx)
jmp 0x41f26
cmpq %rbx, (%r14)
jae 0x41ec3
movq %rbx, (%r14)
movq 0x10(%r14), %rdi
shlq $0x4, %rsi
addq $0x10, %rsi
callq 0x48d0
testq %rax, %rax
je 0x41f13
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 0x41f13
addq %r13, %r15
movq $0x0, 0x8(%r15)
incq %r12
movq %r12, 0x8(%r14)
jmp 0x41f16
xorl %eax, %eax
retq
xorl %r15d, %r15d
testq %r15, %r15
je 0x41f24
movq %rbx, 0x8(%r15)
movq (%r15), %rax
jmp 0x41f26
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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, %r15
leaq 0x1(%rdx), %rsi
callq 0x41e74
testq %rax, %rax
je 0x41f88
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x42b0
movb $0x0, (%r14,%rbx)
jmp 0x41f8b
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x41fc5
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_O1/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 0x42010
movq %rsi, %rdx
movl 0x10(%rdi), %ecx
movq %rax, %rsi
cmpl %ecx, 0x8(%rax)
jne 0x41fca
cmpq %rax, (%rdi)
movq %rdx, %rsi
cmoveq %rdi, %rsi
movq (%rax), %r8
movq %r8, (%rsi)
cmpq %rax, 0x8(%rdi)
jne 0x41ffa
movq %rdx, 0x8(%rdi)
cmpq $0x0, (%rdi)
jne 0x42008
movq $0x0, 0x8(%rdi)
incl %ecx
movl %ecx, 0x10(%rdi)
decl 0x18(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x41fc5
testq %rax, %rax
jne 0x4208a
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 0x41fc5
testq %rax, %rax
je 0x42049
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_O1/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 0x420ce
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_O1/karel-brinda[P]ococo/ext/htslib/cram/thread_pool.c
// Function: t_pool_results_queue_len
int t_pool_results_queue_len(t_results_queue *q) {
    int len;

    pthread_mutex_lock(&q->result_m);
    len = q->queue_len;
    pthread_mutex_unlock(&q->result_m);

    return len;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x20(%rdi), %r14
movq %r14, %rdi
callq 0x47a0
movl 0x18(%rbx), %ebx
movq %r14, %rdi
callq 0x43f0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/thread_pool.c
// Function: t_pool_results_queue_sz
int t_pool_results_queue_sz(t_results_queue *q) {
    int len;

    pthread_mutex_lock(&q->result_m);
    len = q->queue_len + q->pending;
    pthread_mutex_unlock(&q->result_m);

    return len;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x20(%rdi), %r14
movq %r14, %rdi
callq 0x47a0
movl 0x1c(%rbx), %ebp
addl 0x18(%rbx), %ebp
movq %r14, %rdi
callq 0x43f0
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x42151
pushq %rbx
movq %rdi, %rbx
testl %esi, %esi
je 0x42148
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x42148
callq 0x4610
movq %rbx, %rdi
popq %rbx
jmp 0x4610
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/thread_pool.c
// Function: t_results_queue_init
t_results_queue *t_results_queue_init(void) {
    t_results_queue *q = malloc(sizeof(*q));

    pthread_mutex_init(&q->result_m, NULL);
    pthread_cond_init(&q->result_avail_c, NULL);

    q->result_head = NULL;
    q->result_tail = NULL;
    q->next_serial = 0;
    q->curr_serial = 0;
    q->queue_len   = 0;
    q->pending     = 0;

    return q;
}

// Assembly:
pushq %rbx
movl $0x78, %edi
callq 0x4700
movq %rax, %rbx
leaq 0x20(%rax), %rdi
xorl %esi, %esi
callq 0x47c0
leaq 0x48(%rbx), %rdi
xorl %esi, %esi
callq 0x4620
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movups %xmm0, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/karel-brinda[P]ococo/ext/htslib/cram/thread_pool.c
// Function: t_results_queue_destroy
void t_results_queue_destroy(t_results_queue *q) {
#ifdef DEBUG
    fprintf(stderr, "Destroying results queue %p\n", q);
#endif

    if (!q)
	return;

    pthread_mutex_destroy(&q->result_m);
    pthread_cond_destroy(&q->result_avail_c);

    memset(q, 0xbb, sizeof(*q));
    free(q);

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

// Assembly:
testq %rdi, %rdi
je 0x421d9
pushq %rbx
movq %rdi, %rbx
addq $0x20, %rdi
callq 0x45e0
leaq 0x48(%rbx), %rdi
callq 0x4a20
movaps 0x13669(%rip), %xmm0    # 0x55810
movups %xmm0, (%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x40(%rbx)
movups %xmm0, 0x50(%rbx)
movups %xmm0, 0x60(%rbx)
movabsq $-0x4444444444444445, %rax # imm = 0xBBBBBBBBBBBBBBBB
movq %rax, 0x70(%rbx)
movq %rbx, %rdi
popq %rbx
jmp 0x4610
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4231a
movl $0xffffffff, 0xf0(%rbx) # imm = 0xFFFFFFFF
testl %ebp, %ebp
jle 0x4230b
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        # 0x4232e
movq %r13, %rcx
callq 0x49b0
testl %eax, %eax
jne 0x4231a
incq %r14
addq $0x50, %r15
cmpq %r14, %rbp
jne 0x422a8
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_O1/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
cmpl $0x0, 0x20(%r14)
jle 0x426cc
movl $0x18, %r15d
xorl %r12d, %r12d
movq 0xe8(%r14), %rax
cmpl $0x0, (%rax,%r12,4)
je 0x426bc
movq 0x28(%r14), %rdi
addq %r15, %rdi
callq 0x4040
incq %r12
movslq 0x20(%r14), %rax
addq $0x50, %r15
cmpq %rax, %r12
jl 0x426a2
leaq 0x58(%r14), %r15
cmpl $0x0, 0x4(%r14)
jne 0x426e1
movl 0x8(%r14), %eax
cmpl 0x20(%r14), %eax
je 0x426ee
movq %r15, %rdi
movq %rbx, %rsi
callq 0x47f0
jmp 0x426d0
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_O1/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 0x4274a
cmpl $0x0, 0x20(%rbx)
jle 0x427be
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 0x42726
jmp 0x427be
leaq 0x30(%rbx), %r14
movq %r14, %rdi
callq 0x47a0
movl $0x1, 0xc(%rbx)
cmpl $0x0, 0x20(%rbx)
jle 0x42788
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 0x4276c
movq %r14, %rdi
callq 0x43f0
cmpl $0x0, 0x20(%rbx)
jle 0x427be
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 0x4279f
leaq 0x30(%rbx), %rdi
callq 0x45e0
leaq 0x58(%rbx), %rdi
callq 0x4a20
leaq 0xb8(%rbx), %rdi
callq 0x4a20
cmpl $0x0, 0x20(%rbx)
jle 0x42807
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 0x427eb
movq 0xe8(%rbx), %rdi
testq %rdi, %rdi
je 0x42818
callq 0x4610
movq 0x28(%rbx), %rdi
callq 0x4610
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4610
// File: /workspace/github_cpp_makefile_star2_O1/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 0x42c64
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_O1/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 0x42c85
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_O1/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 %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x42cc3
callq 0x4170
cmpl $-0x1, %eax
je 0x42cff
movl %eax, %ebp
movq (%rbx), %rsi
movl %eax, %edi
callq 0x40e0
jmp 0x42d04
movq 0x8(%rbx), %rdi
movl (%rdi), %eax
testl %eax, %eax
je 0x42ce6
decl %eax
movl %eax, (%rdi)
incq 0x10(%rdi)
movq 0x8(%rdi), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rdi)
movzbl (%rax), %ebp
jmp 0x42ced
callq 0x4950
movl %eax, %ebp
cmpl $-0x1, %ebp
je 0x42cff
movq 0x8(%rbx), %rsi
movl %ebp, %edi
callq 0x44f0
jmp 0x42d04
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rsi, %r14
movq %rdi, %r15
movl $0x10, %edi
callq 0x4700
testq %rax, %rax
je 0x42e10
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
cmpb $0x7a, (%r14)
je 0x42ddd
cmpb $0x7a, 0x1(%r14)
je 0x42ddd
movq %r15, %rdi
movq %r14, %rsi
callq 0x4600
movq %rax, (%rbx)
testq %rax, %rax
je 0x42ddd
movq %rax, %r12
movq %rsp, %rdi
movl $0x1, %esi
movl $0x2, %edx
movq %rax, %rcx
callq 0x47d0
cmpq $0x2, %rax
jne 0x42db7
cmpb $0x1f, (%rsp)
jne 0x42dc6
cmpb $-0x75, 0x1(%rsp)
jne 0x42dc6
movq %r12, %rdi
callq 0x4530
movq $0x0, (%rbx)
movb $0x1, %r13b
jmp 0x42dd8
movq %rbx, %rdi
callq 0x4610
xorl %eax, %eax
xorl %r13d, %r13d
jmp 0x42dd8
xorl %r13d, %r13d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4300
movq %rbx, %rax
testb %r13b, %r13b
je 0x42e12
movq %r15, %rdi
movq %r14, %rsi
callq 0x47b0
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x42df6
movq %rbx, %rax
jmp 0x42e12
movq %r14, %rdi
movl $0x77, %esi
callq 0x4200
testq %rax, %rax
je 0x42e23
movq %rbx, %rdi
callq 0x4610
xorl %eax, %eax
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x12a6e(%rip), %rsi     # 0x55898
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 0x42df1
jmp 0x42e08
// File: /workspace/github_cpp_makefile_star2_O1/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 0x42f79
cltq
leaq (%rcx,%rax), %rsi
addq $0x2, %rsi
cmpq %rsi, %rdx
jae 0x42f4e
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 0x42f8b
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
movslq %eax, %rcx
addq %rcx, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x42f7f
// File: /workspace/github_cpp_makefile_star2_O1/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 0x43072
testq %rdi, %rdi
jne 0x43025
testb $0x1, (%rdx)
jne 0x43078
movl $0x0, 0x24(%rdx)
cmpb $0x0, 0x1(%rsi)
je 0x4306c
movl $0xffffffff, 0x20(%rdx) # imm = 0xFFFFFFFF
xorps %xmm0, %xmm0
movups %xmm0, (%rdx)
movups %xmm0, 0x10(%rdx)
movb (%rsi), %al
testb %al, %al
je 0x43072
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 0x4304c
jmp 0x43072
movsbl (%rsi), %eax
movl %eax, 0x20(%rdx)
cmpl $0x0, 0x24(%rdx)
je 0x4307b
xorl %eax, %eax
retq
testq %rdi, %rdi
je 0x4308e
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 0x430ae
movsbl 0x1(%rcx), %edi
incq %rcx
testl %edi, %edi
je 0x430e0
cmpl %edi, %esi
jne 0x4309d
jmp 0x430e0
movb (%rax), %sil
movq %rax, %rcx
testb %sil, %sil
je 0x430e0
movq %rax, %rcx
movsbl %sil, %esi
movzbl %sil, %edi
sarl $0x6, %esi
movslq %esi, %rsi
movq (%rdx,%rsi,8), %rsi
btq %rdi, %rsi
jb 0x430e0
movb 0x1(%rcx), %sil
incq %rcx
testb %sil, %sil
jne 0x430bc
movq %rcx, 0x28(%rdx)
cmpb $0x0, (%rcx)
je 0x430ea
retq
movl $0x1, 0x24(%rdx)
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdi), %r13
movq (%rbx), %rcx
cmpq %r13, %rcx
je 0x4333e
movq 0x10(%rbx), %rax
cmpb $0xa, -0x1(%rax,%rcx)
je 0x433f0
movq 0x8(%rbx), %rax
movq %rax, %rdx
subq %rcx, %rdx
cmpq $0xc8, %rdx
setae %cl
cmpq $-0xc8, %rax
setae %dl
orb %cl, %dl
jne 0x433bc
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, %r12
shrq $0x20, %r12
orq %rcx, %r12
incq %r12
movq 0x10(%rbx), %rdi
movq %r12, %rsi
callq 0x48d0
testq %rax, %rax
je 0x43433
movq %rax, 0x10(%rbx)
movq %r12, 0x8(%rbx)
movq (%rbx), %rax
movq 0x10(%rbx), %rdi
addq %rax, %rdi
movl 0x8(%rbx), %esi
subl %eax, %esi
movq %r14, %rdx
callq *%r15
testq %rax, %rax
je 0x433f0
movq (%rbx), %r12
movq 0x10(%rbx), %rdi
addq %r12, %rdi
callq 0x4230
addq %r12, %rax
movq %rax, (%rbx)
jmp 0x43327
movq (%rbx), %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %r13, %rcx
je 0x43438
jbe 0x43424
movq 0x10(%rbx), %rax
cmpb $0xa, -0x1(%rax,%rcx)
jne 0x43424
leaq -0x1(%rcx), %rdx
movq %rdx, (%rbx)
cmpq %r13, %rdx
jbe 0x43424
cmpb $0xd, -0x2(%rax,%rcx)
jne 0x43424
addq $-0x2, %rcx
movq %rcx, (%rbx)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
movb $0x0, (%rcx,%rax)
xorl %eax, %eax
jmp 0x43438
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x437bf
movq %rbx, %rdi
movl $0x72, %esi
callq 0x4200
testq %rax, %rax
je 0x43748
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4883b
testq %rax, %rax
je 0x4379c
movq %rax, %rbx
movq %rax, %rdi
callq 0x437de
testq %rax, %rax
je 0x43794
movq %rbx, 0x38(%rax)
jmp 0x43790
movq %rbx, %rdi
movl $0x77, %esi
callq 0x4200
testq %rax, %rax
jne 0x4376c
movq %rbx, %rdi
movl $0x61, %esi
callq 0x4200
testq %rax, %rax
je 0x437aa
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4883b
testq %rax, %rax
je 0x4379c
movq %rax, %r14
movq %rbx, %rdi
callq 0x438db
testq %rax, %rax
je 0x4379c
movq %r14, 0x38(%rax)
movb $0x1, %cl
jmp 0x437a0
movq %rbx, %rdi
callq 0x4850c
xorl %eax, %eax
xorl %ecx, %ecx
testb %cl, %cl
je 0x437b5
andb $-0xd, 0x2(%rax)
jmp 0x437b7
callq 0x4070
movl $0x16, (%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x1214a(%rip), %rdi     # 0x55910
leaq 0x12178(%rip), %rsi     # 0x55945
leaq 0x12178(%rip), %rcx     # 0x5594c
movl $0xed, %edx
callq 0x4350
// File: /workspace/github_cpp_makefile_star2_O1/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 0x48107
testq %rax, %rax
js 0x438c9
movq %rax, %r14
movl $0x1, %edi
movl $0x60, %esi
callq 0x4360
xorl %r15d, %r15d
testq %rax, %rax
je 0x438c9
movq %rax, %rbx
movl (%rax), %ebp
movl %ebp, %eax
andl $0xfffcffff, %eax       # imm = 0xFFFCFFFF
xorl %r12d, %r12d
cmpb $-0x75, 0x1(%rsp)
sete %r12b
shll $0x1d, %r12d
cmpb $0x1f, (%rsp)
cmovnel %r15d, %r12d
cmpq $0x2, %r14
movl $0x0, %ecx
cmovel %r12d, %ecx
movl %eax, (%rbx)
andl $0x9ffcffff, %ebp       # imm = 0x9FFCFFFF
orl %ebp, %ecx
movl %ecx, (%rbx)
movl $0x10000, %edi          # imm = 0x10000
callq 0x4700
movq %rax, 0x20(%rbx)
movl $0x10000, %edi          # imm = 0x10000
callq 0x4700
cmpq $0x12, %r14
cmovnel %r15d, %r12d
movq %rax, 0x28(%rbx)
orl %r12d, %ebp
movl %ebp, (%rbx)
testl %r12d, %r12d
je 0x438a9
movl $0x80000000, %r15d      # imm = 0x80000000
testb $0x4, 0x3(%rsp)
je 0x438a9
xorl %r15d, %r15d
cmpl $0x24342, 0xc(%rsp)     # imm = 0x24342
setne %r15b
shll $0x1f, %r15d
andl $0x3ffcffff, %ebp       # imm = 0x3FFCFFFF
orl %r15d, %ebp
movl %ebp, (%rbx)
movl $0x1, %edi
movl $0x28, %esi
callq 0x4360
movq %rax, 0x30(%rbx)
jmp 0x438cb
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_O1/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 0x43b87
movq %rbx, %rdi
movl $0x72, %esi
callq 0x4200
testq %rax, %rax
je 0x43b14
movl %ebp, %edi
movq %rbx, %rsi
callq 0x48537
testq %rax, %rax
je 0x43b67
movq %rax, %rbx
movq %rax, %rdi
callq 0x437de
testq %rax, %rax
je 0x43b5f
movq %rbx, 0x38(%rax)
jmp 0x43b5b
movq %rbx, %rdi
movl $0x77, %esi
callq 0x4200
testq %rax, %rax
jne 0x43b38
movq %rbx, %rdi
movl $0x61, %esi
callq 0x4200
testq %rax, %rax
je 0x43b75
movl %ebp, %edi
movq %rbx, %rsi
callq 0x48537
testq %rax, %rax
je 0x43b67
movq %rax, %r14
movq %rbx, %rdi
callq 0x438db
testq %rax, %rax
je 0x43b67
movq %r14, 0x38(%rax)
movb $0x1, %cl
jmp 0x43b6b
movq %rbx, %rdi
callq 0x4850c
xorl %eax, %eax
xorl %ecx, %ecx
testb %cl, %cl
je 0x43b80
andb $-0xd, 0x2(%rax)
jmp 0x43b82
callq 0x4070
movl $0x16, (%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x11d82(%rip), %rdi     # 0x55910
leaq 0x11db0(%rip), %rsi     # 0x55945
leaq 0x11ddc(%rip), %rcx     # 0x55978
movl $0x104, %edx            # imm = 0x104
callq 0x4350
// File: /workspace/github_cpp_makefile_star2_O1/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 0x43c2e
movq %r14, %rdi
movl $0x72, %esi
callq 0x4200
testq %rax, %rax
je 0x43bde
movq %rbx, %rdi
callq 0x437de
jmp 0x43c0a
movq %r14, %rdi
movl $0x77, %esi
callq 0x4200
testq %rax, %rax
jne 0x43c02
movq %r14, %rdi
movl $0x61, %esi
callq 0x4200
testq %rax, %rax
je 0x43c19
movq %r14, %rdi
callq 0x438db
testq %rax, %rax
je 0x43c24
movq %rbx, 0x38(%rax)
andb $-0xd, 0x2(%rax)
jmp 0x43c26
callq 0x4070
movl $0x16, (%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x11cdb(%rip), %rdi     # 0x55910
leaq 0x11d09(%rip), %rsi     # 0x55945
leaq 0x11d59(%rip), %rcx     # 0x5599c
movl $0x11b, %edx            # imm = 0x11B
callq 0x4350
// File: /workspace/github_cpp_makefile_star2_O1/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 0x43db1
movq 0x30(%rsi), %rbx
testq %rbx, %rbx
je 0x43db1
movq %rbx, %rax
popq %rbx
retq
leal 0x6(%rcx), %eax
cmpl $0x5, %eax
ja 0x43e03
leaq 0x11ae0(%rip), %rcx     # 0x558a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x12006(%rip), %rbx     # 0x55dd6
jmp 0x43dac
leaq 0x11f4f(%rip), %rbx     # 0x55d28
jmp 0x43dac
leaq 0x11fa1(%rip), %rbx     # 0x55d83
jmp 0x43dac
leaq 0x11f7f(%rip), %rbx     # 0x55d6a
jmp 0x43dac
leaq 0x11f9d(%rip), %rbx     # 0x55d91
jmp 0x43dac
callq 0x4070
movl (%rax), %edi
popq %rbx
jmp 0x41b0
leaq 0x20796(%rip), %rbx     # 0x645a0
leaq 0x11fdb(%rip), %rdx     # 0x55dec
movl $0x20, %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4890
jmp 0x43dac
// File: /workspace/github_cpp_makefile_star2_O1/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 0xeb1f(%rip), %rdx      # 0x52ff3
movl $0xfffffff1, %esi       # imm = 0xFFFFFFF1
movl $0x70, %ecx
callq 0x4460
testl %eax, %eax
je 0x44503
leaq 0x20062(%rip), %rcx     # 0x64550
cmpl $0x0, (%rcx)
jg 0x4456a
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 0x4453a
leaq 0x8(%rsp), %rdi
callq 0x4560
testl %eax, %eax
je 0x44564
leaq 0x20024(%rip), %rcx     # 0x64550
cmpl $0x0, (%rcx)
jle 0x444f3
movl %eax, %edi
callq 0x5c7d
jmp 0x444f3
leaq 0x2000f(%rip), %r14     # 0x64550
cmpl $0x0, (%r14)
jg 0x4457b
leaq 0x8(%rsp), %rdi
callq 0x4560
testl %eax, %eax
je 0x444f3
cmpl $0x2, (%r14)
jl 0x444f3
movl %eax, %edi
callq 0x5c4e
jmp 0x444f3
movl 0x30(%rsp), %eax
jmp 0x444fb
leaq 0x8(%rsp), %rsi
movl %eax, %edi
callq 0x5beb
jmp 0x444f3
leaq 0x8(%rsp), %rsi
movl %eax, %edi
callq 0x5c18
jmp 0x44547
// File: /workspace/github_cpp_makefile_star2_O1/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), %rax
movl (%rax), %ecx
leal 0x1(%rcx), %edx
movl %edx, (%rax)
cmpl 0x4(%rax), %ecx
jl 0x445e8
movl %ecx, %edx
sarl %edx
orl %ecx, %edx
movl %edx, %ecx
sarl $0x2, %ecx
orl %edx, %ecx
movl %ecx, %edx
sarl $0x4, %edx
orl %ecx, %edx
movl %edx, %ecx
sarl $0x8, %ecx
orl %edx, %ecx
movl %ecx, %edx
sarl $0x10, %edx
orl %ecx, %edx
movslq %edx, %rcx
movq %rcx, %rsi
shlq $0x4, %rsi
incl %ecx
movl %ecx, 0x4(%rax)
movq 0x8(%rax), %rdi
addq $0x10, %rsi
callq 0x48d0
movq 0x48(%rbx), %rcx
movq %rax, 0x8(%rcx)
testq %rax, %rax
je 0x4460d
movq 0x48(%rbx), %rax
movq 0x8(%rax), %rcx
movq 0x10(%rax), %rdx
movslq (%rax), %rax
shlq $0x4, %rax
movq %rdx, -0x10(%rcx,%rax)
movq 0x10(%rbx), %rdx
movq %rdx, -0x8(%rcx,%rax)
xorl %eax, %eax
popq %rbx
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4460b