LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_dump
void sam_hdr_dump(SAM_hdr *hdr) {
    khint_t k;
    int i;

    printf("===DUMP===\n");
    for (k = kh_begin(hdr->h); k != kh_end(hdr->h); k++) {
	SAM_hdr_type *t1, *t2;
	char c[2];

	if (!kh_exist(hdr->h, k))
	    continue;

	t1 = t2 = kh_val(hdr->h, k);
	c[0] = kh_key(hdr->h, k)>>8;
	c[1] = kh_key(hdr->h, k)&0xff;
	printf("Type %.2s, count %d\n", c, t1->prev->order+1);

	do {
	    SAM_hdr_tag *tag;
	    printf(">>>%d ", t1->order);
	    for (tag = t1->tag; tag; tag=tag->next) {
		printf("\"%.2s\":\"%.*s\"\t",
		       tag->str, tag->len-3, tag->str+3);
	    }
	    putchar('\n');
	    t1 = t1->next;
	} while (t1 != t2);
    }

    /* Dump out PG chains */
    printf("\n@PG chains:\n");
    for (i = 0; i < hdr->npg_end; i++) {
	int j;
	printf("  %d:", i);
	for (j = hdr->pg_end[i]; j != -1; j = hdr->pg[j].prev_id) {
	    printf("%s%d(%.*s)", 
		   j == hdr->pg_end[i] ? " " : "->",
		   j, hdr->pg[j].name_len, hdr->pg[j].name);
	}
	printf("\n");
    }

    puts("===END DUMP===");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x148fe(%rip), %rdi     # 0x46812
callq 0x4810
pushq $0xa
popq %rbp
leaq 0x14738(%rip), %r13     # 0x4665b
xorl %esi, %esi
movq 0x18(%rbx), %rax
cmpl (%rax), %esi
je 0x31fe3
movq 0x10(%rax), %rcx
movl %esi, %edx
shrl $0x4, %edx
movl (%rcx,%rdx,4), %edx
movq %rsi, 0x10(%rsp)
leal (%rsi,%rsi), %ecx
shrl %cl, %edx
testb $0x3, %dl
jne 0x31fd7
movq 0x18(%rax), %rcx
movq 0x20(%rax), %rax
movl 0x10(%rsp), %edx
movq (%rax,%rdx,8), %r14
movzwl (%rcx,%rdx,4), %eax
rolw $0x8, %ax
movw %ax, 0xe(%rsp)
movq 0x8(%r14), %rax
movl 0x18(%rax), %edx
incl %edx
leaq 0x146c2(%rip), %rdi     # 0x4663f
leaq 0xe(%rsp), %rsi
xorl %eax, %eax
callq 0x4070
movq %r14, %r15
movl 0x18(%r15), %esi
leaq 0x146bd(%rip), %rdi     # 0x46654
xorl %eax, %eax
callq 0x4070
leaq 0x10(%r15), %r12
movq (%r12), %r12
testq %r12, %r12
je 0x31fc8
movq 0x8(%r12), %rsi
movl 0x10(%r12), %edx
addl $-0x3, %edx
leaq 0x3(%rsi), %rcx
movq %r13, %rdi
xorl %eax, %eax
callq 0x4070
jmp 0x31fa2
movl %ebp, %edi
callq 0x4740
movq (%r15), %r15
cmpq %r14, %r15
jne 0x31f8c
movq 0x10(%rsp), %rsi
incl %esi
jmp 0x31f25
leaq 0x14833(%rip), %rdi     # 0x4681d
callq 0x4810
leaq 0x10c73(%rip), %r13     # 0x42c69
leaq 0x1467e(%rip), %r14     # 0x4667b
leaq 0x1466c(%rip), %r15     # 0x46670
xorl %r12d, %r12d
movslq 0x6c(%rbx), %rax
cmpq %rax, %r12
jge 0x3207f
leaq 0x14653(%rip), %rdi     # 0x4666a
movl %r12d, %esi
xorl %eax, %eax
callq 0x4070
leaq (,%r12,4), %rax
addq 0x88(%rbx), %rax
movslq (%rax), %rdx
cmpq $-0x1, %rdx
je 0x32072
movq 0x88(%rbx), %rax
cmpl (%rax,%r12,4), %edx
movq %r14, %rsi
cmoveq %r13, %rsi
movq 0x78(%rbx), %rax
imulq $0x28, %rdx, %rbp
movl 0x18(%rax,%rbp), %ecx
movq (%rax,%rbp), %r8
movq %r15, %rdi
xorl %eax, %eax
callq 0x4070
movq 0x78(%rbx), %rax
addq %rbp, %rax
addq $0x20, %rax
jmp 0x32030
pushq $0xa
popq %rdi
callq 0x4740
incq %r12
jmp 0x32007
leaq 0x145f8(%rip), %rdi     # 0x4667e
callq 0x4810
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_find_line
char *sam_hdr_find_line(SAM_hdr *hdr, char *type,
			char *ID_key, char *ID_value) {
    SAM_hdr_type *ty = sam_hdr_find(hdr, type, ID_key, ID_value);
    kstring_t ks = KS_INITIALIZER;
    SAM_hdr_tag *tag;
    int r = 0;

    if (!ty)
	return NULL;

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

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

    return ks_str(&ks);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r15
callq 0x33011
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
testq %rax, %rax
je 0x33371
movq %rax, %rbx
pushq $0x40
popq %rdi
movq %rsp, %r14
movq %r14, %rsi
callq 0x32f79
cmpl $-0x1, %eax
sete %bpl
movq %r15, %rdi
movq %r14, %rsi
callq 0x32fb4
cmpl $-0x1, %eax
sete %al
orb %bpl, %al
movzbl %al, %r15d
addq $0x10, %rbx
pushq $0x9
popq %rbp
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x3335f
movl %ebp, %edi
movq %r14, %rsi
callq 0x32f79
cmpl $-0x1, %eax
sete %r12b
movq 0x8(%rbx), %rdi
movl 0x10(%rbx), %esi
movq %r14, %rdx
callq 0x3243d
cmpl $-0x1, %eax
sete %al
orb %r12b, %al
movzbl %al, %eax
orl %eax, %r15d
jmp 0x33326
movq 0x10(%rsp), %rax
testl %r15d, %r15d
je 0x33373
movq %rax, %rdi
callq 0x4600
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_find_key
SAM_hdr_tag *sam_hdr_find_key(SAM_hdr *sh,
			      SAM_hdr_type *type,
			      char *key,
			      SAM_hdr_tag **prev) {
    SAM_hdr_tag *tag, *p = NULL;

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

    if (prev)
	*prev = p;

    return NULL;
}

// Assembly:
movq %rsi, %rax
addq $0x10, %rax
xorl %edi, %edi
movq %rdi, %rsi
movq (%rax), %rax
testq %rax, %rax
je 0x333b0
movq 0x8(%rax), %r8
movb (%r8), %r9b
movq %rax, %rdi
cmpb (%rdx), %r9b
jne 0x33389
movb 0x1(%r8), %r8b
movq %rax, %rdi
cmpb 0x1(%rdx), %r8b
jne 0x33389
testq %rcx, %rcx
je 0x333b8
movq %rsi, (%rcx)
retq
// File: /workspace/github_cpp_makefile_star2_O2/karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_update
int sam_hdr_update(SAM_hdr *hdr, SAM_hdr_type *type, ...) {
    va_list ap;

    va_start(ap, type);
    
    for (;;) {
	char *k, *v;
	int idx;
	SAM_hdr_tag *tag, *prev;

	if (!(k = (char *)va_arg(ap, char *)))
	    break;
	v = va_arg(ap, char *);

	tag = sam_hdr_find_key(hdr, type, k, &prev);
	if (!tag) {
	    if (!(tag = pool_alloc(hdr->tag_pool)))
		return -1;
	    if (prev)
		prev->next = tag;
	    else
		type->tag = tag;

	    tag->next = NULL;
	}

	idx = ks_len(&hdr->text);
	if (ksprintf(&hdr->text, "%2.2s:%s", k, v) < 0)
	    return -1;
	tag->len = ks_len(&hdr->text) - idx;
	tag->str = string_ndup(hdr->str_pool,
			       ks_str(&hdr->text) + idx,
			       tag->len);
	if (!tag->str)
	    return -1;
    }

    va_end(ap);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x30(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x33423
movaps %xmm0, 0x60(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm2, 0x80(%rsp)
movaps %xmm3, 0x90(%rsp)
movaps %xmm4, 0xa0(%rsp)
movaps %xmm5, 0xb0(%rsp)
movaps %xmm6, 0xc0(%rsp)
movaps %xmm7, 0xd0(%rsp)
movq %rsi, 0x10(%rsp)
leaq 0x120(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
leaq 0x10(%rbx), %rax
movq %rax, 0x20(%rsp)
movl (%rsp), %eax
cmpq $0x28, %rax
ja 0x33465
movq %rax, %rcx
addq 0x10(%rsp), %rcx
addl $0x8, %eax
movl %eax, (%rsp)
jmp 0x33473
movq 0x8(%rsp), %rcx
leaq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsp)
movq (%rcx), %r13
testq %r13, %r13
je 0x3352f
cmpl $0x28, %eax
ja 0x33493
movl %eax, %ecx
addq 0x10(%rsp), %rcx
addl $0x8, %eax
movl %eax, (%rsp)
jmp 0x334a1
movq 0x8(%rsp), %rcx
leaq 0x8(%rcx), %rax
movq %rax, 0x8(%rsp)
movq (%rcx), %r12
movq %rbx, %rsi
movq %r13, %rdx
leaq 0x28(%rsp), %rcx
callq 0x33380
movq %rax, %rbp
testq %rax, %rax
jne 0x334e3
movq 0x30(%r14), %rdi
callq 0x3f4d4
testq %rax, %rax
je 0x3352a
movq %rax, %rbp
movq 0x28(%rsp), %rax
testq %rax, %rax
cmoveq 0x20(%rsp), %rax
movq %rbp, (%rax)
andq $0x0, (%rbp)
movq (%r14), %r15
movq %r14, %rdi
leaq 0x132ae(%rip), %rsi     # 0x4679e
movq %r13, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x35818
testl %eax, %eax
js 0x3352a
movq (%r14), %rax
movslq %r15d, %rsi
subq %r15, %rax
movl %eax, 0x10(%rbp)
movq 0x20(%r14), %rdi
addq 0x10(%r14), %rsi
movslq %eax, %rdx
callq 0x3489a
movq %rax, 0x8(%rbp)
testq %rax, %rax
jne 0x3344c
pushq $-0x1
popq %rax
jmp 0x33531
xorl %eax, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_new
SAM_hdr *sam_hdr_new() {
    SAM_hdr *sh = calloc(1, sizeof(*sh));

    if (!sh)
	return NULL;
    
    sh->h = kh_init(sam_hdr);
    if (!sh->h)
	goto err;

    sh->ID_cnt = 1;
    sh->ref_count = 1;

    sh->nref = 0;
    sh->ref  = NULL;
    if (!(sh->ref_hash = kh_init(m_s2i)))
	goto err;

    sh->nrg = 0;
    sh->rg  = NULL;
    if (!(sh->rg_hash = kh_init(m_s2i)))
	goto err;

    sh->npg = 0;
    sh->pg  = NULL;
    sh->npg_end = sh->npg_end_alloc = 0;
    sh->pg_end = NULL;
    if (!(sh->pg_hash = kh_init(m_s2i)))
	goto err;

    KS_INIT(&sh->text);

    if (!(sh->tag_pool = pool_create(sizeof(SAM_hdr_tag))))
	goto err;

    if (!(sh->type_pool = pool_create(sizeof(SAM_hdr_type))))
	goto err;

    if (!(sh->str_pool = string_pool_create(8192)))
	goto err;

    return sh;

 err:
    if (sh->h)
	kh_destroy(sam_hdr, sh->h);

    if (sh->tag_pool)
	pool_destroy(sh->tag_pool);

    if (sh->type_pool)
	pool_destroy(sh->type_pool);

    if (sh->str_pool)
	string_pool_destroy(sh->str_pool);

    free(sh);

    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
pushq $0x1
popq %rdi
movl $0x4a0, %esi            # imm = 0x4A0
callq 0x4370
testq %rax, %rax
je 0x33885
movq %rax, %rbx
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0x4370
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x3386f
movq %rax, %r14
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x494(%rbx)
callq 0x3389b
movq %rax, 0x48(%rbx)
testq %rax, %rax
je 0x33843
callq 0x3389b
movq %rax, 0x60(%rbx)
testq %rax, %rax
je 0x33843
callq 0x3389b
movq %rax, 0x80(%rbx)
testq %rax, %rax
je 0x33843
pushq $0x18
popq %rdi
callq 0x3f410
movq %rax, 0x30(%rbx)
testq %rax, %rax
je 0x33843
movq %rax, %r12
pushq $0x20
popq %rdi
callq 0x3f410
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0x33896
movq %rax, %r15
movl $0x2000, %edi           # imm = 0x2000
callq 0x34760
movq %rax, 0x20(%rbx)
testq %rax, %rax
jne 0x33887
jmp 0x33849
xorl %r15d, %r15d
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x338a6
testq %r12, %r12
je 0x33862
movq %r12, %rdi
callq 0x3f498
movq 0x28(%rbx), %r15
testq %r15, %r15
je 0x3386f
movq %r15, %rdi
callq 0x3f498
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x3387d
callq 0x3478d
movq %rbx, %rdi
callq 0x4600
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
xorl %r15d, %r15d
jmp 0x33849
// File: /workspace/github_cpp_makefile_star2_O2/karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_parse_
SAM_hdr *sam_hdr_parse_(const char *hdr, int len) {
    /* Make an empty SAM_hdr */
    SAM_hdr *sh;
    
    sh = sam_hdr_new();
    if (NULL == sh) return NULL;

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

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

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

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

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

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

    return sh;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %r14
callq 0x3378c
testq %rax, %rax
je 0x33935
movq %rax, %rbx
testq %r14, %r14
je 0x33937
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x3209a
cmpl $-0x1, %eax
je 0x3392d
movq 0x18(%rbx), %r14
movq %r14, %rdi
movl $0x4844, %esi           # imm = 0x4844
callq 0x33254
cmpl (%r14), %eax
jne 0x33949
pushq $-0x1
popq %r13
movl %r13d, 0x90(%rbx)
movq %rbx, %rdi
callq 0x33b43
jmp 0x33937
movq %rbx, %rdi
callq 0x33a02
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x20(%r14), %rcx
movl %eax, %eax
movq (%rcx,%rax,8), %r12
addq $0x10, %r12
pushq $-0x1
popq %r13
leaq 0x12e74(%rip), %r14     # 0x467d6
leaq 0x12e76(%rip), %r15     # 0x467df
movq (%r12), %r12
testq %r12, %r12
je 0x3391c
movq 0x8(%r12), %rbp
cmpb $0x53, (%rbp)
jne 0x33969
cmpb $0x4f, 0x1(%rbp)
jne 0x33969
addq $0x3, %rbp
movq %rbp, %rdi
movq %r14, %rsi
callq 0x4750
testl %eax, %eax
je 0x339e8
movq %rbp, %rdi
movq %r15, %rsi
callq 0x4750
testl %eax, %eax
je 0x339f0
movq %rbp, %rdi
leaq 0x12e3a(%rip), %rsi     # 0x467e9
callq 0x4750
testl %eax, %eax
je 0x339f9
movq %rbp, %rdi
leaq 0x1343f(%rip), %rsi     # 0x46e01
callq 0x4750
testl %eax, %eax
je 0x33969
movq 0x235fe(%rip), %rax     # 0x56fd0
movq (%rax), %rdi
leaq 0x12e18(%rip), %rsi     # 0x467f4
movq %rbp, %rdx
xorl %eax, %eax
callq 0x4770
jmp 0x33969
xorl %r13d, %r13d
jmp 0x33969
pushq $0x1
popq %r13
jmp 0x33969
pushq $0x2
popq %r13
jmp 0x33969
// File: /workspace/github_cpp_makefile_star2_O2/karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_free
void sam_hdr_free(SAM_hdr *hdr) {
    if (!hdr)
	return;

    if (--hdr->ref_count > 0)
	return;

    if (ks_str(&hdr->text))
	KS_FREE(&hdr->text);

    if (hdr->h)
	kh_destroy(sam_hdr, hdr->h);

    if (hdr->ref_hash)
	kh_destroy(m_s2i, hdr->ref_hash);

    if (hdr->ref) {
	int i;
	for (i = 0; i < hdr->nref; i++)
	    if (hdr->ref[i].name)
		free(hdr->ref[i].name);
	free(hdr->ref);
    }

    if (hdr->rg_hash)
	kh_destroy(m_s2i, hdr->rg_hash);

    if (hdr->rg) {
	int i;
	for (i = 0; i < hdr->nrg; i++)
	    if (hdr->rg[i].name)
		free(hdr->rg[i].name);
	free(hdr->rg);
    }

    if (hdr->pg_hash)
	kh_destroy(m_s2i, hdr->pg_hash);

    if (hdr->pg) {
	int i;
	for (i = 0; i < hdr->npg; i++)
	    if (hdr->pg[i].name)
		free(hdr->pg[i].name);
	free(hdr->pg);
    }

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

    if (hdr->type_pool)
	pool_destroy(hdr->type_pool);

    if (hdr->tag_pool)
	pool_destroy(hdr->tag_pool);

    if (hdr->str_pool)
	string_pool_destroy(hdr->str_pool);

    free(hdr);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x33a23
movq %rdi, %rbx
movl 0x498(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x498(%rdi)
cmpl $0x1, %eax
jle 0x33a29
popq %rbx
popq %r14
popq %r15
retq
movq 0x10(%rbx), %rdi
callq 0x4600
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x33a40
callq 0x338a6
movq 0x48(%rbx), %rdi
testq %rdi, %rdi
je 0x33a4e
callq 0x33cbd
cmpq $0x0, 0x40(%rbx)
je 0x33a7f
xorl %r14d, %r14d
xorl %r15d, %r15d
movslq 0x38(%rbx), %rax
movq 0x40(%rbx), %rdi
cmpq %rax, %r15
jge 0x33a7a
movq (%rdi,%r14), %rdi
callq 0x4600
incq %r15
addq $0x20, %r14
jmp 0x33a5b
callq 0x4600
movq 0x60(%rbx), %rdi
testq %rdi, %rdi
je 0x33a8d
callq 0x33cbd
cmpq $0x0, 0x58(%rbx)
je 0x33abe
xorl %r14d, %r14d
xorl %r15d, %r15d
movslq 0x50(%rbx), %rax
movq 0x58(%rbx), %rdi
cmpq %rax, %r15
jge 0x33ab9
movq (%rdi,%r14), %rdi
callq 0x4600
incq %r15
addq $0x20, %r14
jmp 0x33a9a
callq 0x4600
movq 0x80(%rbx), %rdi
testq %rdi, %rdi
je 0x33acf
callq 0x33cbd
cmpq $0x0, 0x78(%rbx)
je 0x33b00
xorl %r14d, %r14d
xorl %r15d, %r15d
movslq 0x68(%rbx), %rax
movq 0x78(%rbx), %rdi
cmpq %rax, %r15
jge 0x33afb
movq (%rdi,%r14), %rdi
callq 0x4600
incq %r15
addq $0x28, %r14
jmp 0x33adc
callq 0x4600
movq 0x88(%rbx), %rdi
callq 0x4600
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x33b1a
callq 0x3f498
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x33b28
callq 0x3f498
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x33b36
callq 0x3478d
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x4600
// File: /workspace/github_cpp_makefile_star2_O2/karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_link_pg
int sam_hdr_link_pg(SAM_hdr *hdr) {
    int i, j, ret = 0;

    hdr->npg_end_alloc = hdr->npg;
    hdr->pg_end = realloc(hdr->pg_end, hdr->npg * sizeof(*hdr->pg_end));
    if (!hdr->pg_end)
	return -1;

    for (i = 0; i < hdr->npg; i++)
	hdr->pg_end[i] = i;

    for (i = 0; i < hdr->npg; i++) {
	khint_t k;
	SAM_hdr_tag *tag;
	char tmp;

	for (tag = hdr->pg[i].tag; tag; tag = tag->next) {
	    if (tag->str[0] == 'P' && tag->str[1] == 'P')
		break;
	}
	if (!tag) {
	    /* Chain start points */
	    continue;
	}

	tmp = tag->str[tag->len]; tag->str[tag->len] = 0;
	k = kh_get(m_s2i, hdr->pg_hash, tag->str+3);
	tag->str[tag->len] = tmp;

	if (k == kh_end(hdr->pg_hash)) {
	    ret = -1;
	    continue;
	}

	hdr->pg[i].prev_id = hdr->pg[kh_val(hdr->pg_hash, k)].id;
	hdr->pg_end[kh_val(hdr->pg_hash, k)] = -1;
    }

    for (i = j = 0; i < hdr->npg; i++) {
	if (hdr->pg_end[i] != -1)
	    hdr->pg_end[j++] = hdr->pg_end[i];
    }
    hdr->npg_end = j;

    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0x68(%rdi), %rsi
movl %esi, 0x70(%rdi)
movq 0x88(%rdi), %rdi
shlq $0x2, %rsi
callq 0x48c0
movq %rax, 0x88(%rbx)
testq %rax, %rax
je 0x33c79
movl 0x68(%rbx), %ecx
xorl %edx, %edx
testl %ecx, %ecx
movl $0x0, %esi
cmovgl %ecx, %esi
cmpq %rdx, %rsi
je 0x33b94
movl %edx, (%rax,%rdx,4)
incq %rdx
jmp 0x33b87
xorl %r14d, %r14d
xorl %eax, %eax
movslq %ecx, %rdx
cmpq %rdx, %r14
jge 0x33c47
movq 0x78(%rbx), %rcx
imulq $0x28, %r14, %r12
leaq (%rcx,%r12), %r13
addq $0x10, %r13
movq (%r13), %r13
testq %r13, %r13
je 0x33c38
movq 0x8(%r13), %rdx
cmpb $0x50, (%rdx)
jne 0x33bb5
cmpb $0x50, 0x1(%rdx)
jne 0x33bb5
movl %eax, 0x4(%rsp)
movslq 0x10(%r13), %rcx
movb (%rdx,%rcx), %r15b
movb $0x0, (%rdx,%rcx)
movq 0x80(%rbx), %rdi
movq 0x8(%r13), %rbp
leaq 0x3(%rbp), %rsi
callq 0x33193
movslq 0x10(%r13), %rcx
movb %r15b, (%rbp,%rcx)
movq 0x80(%rbx), %rcx
pushq $-0x1
popq %rdx
cmpl (%rcx), %eax
je 0x33c3a
movq 0x78(%rbx), %rdx
movq 0x20(%rcx), %rcx
movl %eax, %eax
movslq (%rcx,%rax,4), %rsi
imulq $0x28, %rsi, %rsi
movl 0x1c(%rdx,%rsi), %esi
movl %esi, 0x20(%rdx,%r12)
movq 0x88(%rbx), %rdx
movslq (%rcx,%rax,4), %rax
orl $-0x1, (%rdx,%rax,4)
movl 0x4(%rsp), %edx
jmp 0x33c3a
movl %eax, %edx
incq %r14
movl 0x68(%rbx), %ecx
movl %edx, %eax
jmp 0x33b99
xorl %r8d, %r8d
xorl %edx, %edx
movslq %ecx, %rsi
cmpq %rsi, %r8
jge 0x33c74
movq 0x88(%rbx), %rsi
movl (%rsi,%r8,4), %edi
cmpl $-0x1, %edi
je 0x33c6f
movslq %edx, %rcx
incl %edx
movl %edi, (%rsi,%rcx,4)
movl 0x68(%rbx), %ecx
incq %r8
jmp 0x33c4c
movl %edx, 0x6c(%rbx)
jmp 0x33c7c
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_find_rg
SAM_RG *sam_hdr_find_rg(SAM_hdr *hdr, const char *rg) {
    khint_t k = kh_get(m_s2i, hdr->rg_hash, rg);
    return k == kh_end(hdr->rg_hash)
	? NULL
	: &hdr->rg[kh_val(hdr->rg_hash, k)];
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x60(%rdi), %r14
movq %r14, %rdi
callq 0x33193
cmpl (%r14), %eax
jne 0x33d22
xorl %eax, %eax
jmp 0x33d34
movq 0x20(%r14), %rcx
movl %eax, %eax
movslq (%rcx,%rax,4), %rax
shlq $0x5, %rax
addq 0x58(%rbx), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/karel-brinda[P]ococo/ext/htslib/cram/sam_header.c
// Function: sam_hdr_PG_ID
const char *sam_hdr_PG_ID(SAM_hdr *sh, const char *name) {
    khint_t k = kh_get(m_s2i, sh->pg_hash, name);
    if (k == kh_end(sh->pg_hash))
	return name;

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

    return sh->ID_buf;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x80(%rdi), %r15
movq %r15, %rdi
callq 0x33193
cmpl (%r15), %eax
je 0x33da9
leaq 0x94(%r14), %r15
leaq 0x12a3e(%rip), %r12     # 0x467ab
movl 0x494(%r14), %ecx
leal 0x1(%rcx), %eax
movl %eax, 0x494(%r14)
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x4100
movq 0x80(%r14), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x33193
cmpl (%r13), %eax
jne 0x33d6d
movq %r15, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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, %r14
movq %rdi, %rbx
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x33e1c
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 0x33ef8
leaq (,%r13,4), %r12
movq %r12, %rdi
callq 0x46f0
pushq $-0x1
popq %rbp
testq %rax, %rax
je 0x33f7d
movq %rax, %r15
movq 0x88(%rbx), %rsi
movq %rax, %rdi
movq %r12, %rdx
callq 0x4420
xorl %eax, %eax
testl %r13d, %r13d
cmovlel %eax, %r13d
movq %rsp, %r12
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0x33f66
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 %rbx, %rdi
movq %r14, %rsi
callq 0x33d3c
movq 0x78(%rbx), %r10
movslq (%r15,%rbp,4), %rcx
imulq $0x28, %rcx, %r11
movq %rbx, %rdi
leaq 0x128ff(%rip), %rsi     # 0x467b6
movq %r12, %rdx
leaq 0x11e00(%rip), %rcx     # 0x45cc1
movq %rax, %r8
leaq 0x128ee(%rip), %r9      # 0x467b9
xorl %eax, %eax
pushq $0x0
pushq (%r10,%r11)
leaq 0x128e2(%rip), %r10     # 0x467bc
pushq %r10
pushq %r14
callq 0x32b9d
addq $0x20, %rsp
cmpl $-0x1, %eax
je 0x33f72
incq %rbp
jmp 0x33e68
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 %rbx, %rdi
movq %r14, %rsi
callq 0x33d3c
subq $0x10, %rsp
andq $0x0, 0x8(%rsp)
movq %r14, (%rsp)
leaq 0x12879(%rip), %rsi     # 0x467b6
leaq 0x11d7d(%rip), %rcx     # 0x45cc1
leaq 0x1286e(%rip), %r9      # 0x467b9
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r15, %rdx
movq %rax, %r8
xorl %eax, %eax
callq 0x32b9d
popq %rcx
popq %rdx
cmpl $-0x1, %eax
jne 0x33f7d
jmp 0x33f7a
movq %r15, %rdi
callq 0x4600
xorl %ebp, %ebp
jmp 0x33f7d
movq %r15, %rdi
callq 0x4600
pushq $-0x1
popq %rbp
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_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
xorl %r12d, %r12d
testl %edi, %edi
cmovlel %r12d, %r14d
pushq $0x1
popq %r15
cmpq %r12, %r14
je 0x33fc5
movq (%rbx,%r12,8), %rdi
callq 0x4210
addq %rax, %r15
incq %r15
incq %r12
jmp 0x33fac
movq %r15, %rdi
callq 0x46f0
testq %rax, %rax
je 0x34017
xorl %ecx, %ecx
pushq $0x1
popq %rdx
movq %rax, %rsi
cmpq %r14, %rcx
je 0x34014
movq %rdx, %rdi
movq (%rbx,%rcx,8), %r8
movzbl -0x1(%r8,%rdi), %r8d
movb $0x20, %r9b
cmpl $0x9, %r8d
je 0x33ffd
testl %r8d, %r8d
je 0x34007
movl %r8d, %r9d
movb %r9b, -0x1(%rsi,%rdi)
incq %rdi
jmp 0x33fe2
movb $0x20, -0x1(%rsi,%rdi)
addq %rdi, %rsi
incq %rcx
jmp 0x33fda
movb $0x0, (%rsi)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x18
popq %rdi
callq 0x46f0
testq %rax, %rax
je 0x3478b
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_O2/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
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x10(%rbx), %rdi
cmpq 0x8(%rbx), %r15
jae 0x347b7
movq (%rdi,%r14), %rdi
callq 0x4600
incq %r15
addq $0x10, %r14
jmp 0x3479b
callq 0x4600
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x4600
// File: /workspace/github_cpp_makefile_star2_O2/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 0x34864
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 0x34813
movq 0x10(%r14), %rdx
movq %rsi, %r8
shlq $0x4, %r8
movq -0x8(%rdx,%r8), %rax
leaq (%rax,%rbx), %rdi
cmpq %rcx, %rdi
jae 0x34813
addq %r8, %rdx
addq -0x10(%rdx), %rax
movq %rdi, -0x8(%rdx)
jmp 0x34869
cmpq %rbx, %rcx
jae 0x3481b
movq %rbx, (%r14)
movq 0x10(%r14), %rdi
shlq $0x4, %rsi
addq $0x10, %rsi
callq 0x48c0
testq %rax, %rax
je 0x34867
movq %rax, %r15
movq %rax, 0x10(%r14)
movq (%r14), %rdi
movq 0x8(%r14), %r12
movq %r12, %r13
shlq $0x4, %r13
callq 0x46f0
movq %rax, (%r15,%r13)
testq %rax, %rax
je 0x34867
addq %r13, %r15
incq %r12
movq %r12, 0x8(%r14)
movq %rbx, 0x8(%r15)
jmp 0x34869
xorl %eax, %eax
retq
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x347c9
movq %rax, %r15
testq %rax, %rax
je 0x348c9
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x42c0
movb $0x0, (%r15,%rbx)
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x34905
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_O2/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 0x3494d
movq %rsi, %rdx
movl 0x8(%rax), %ecx
movq %rax, %rsi
cmpl 0x10(%rdi), %ecx
jne 0x3490a
cmpq %rax, (%rdi)
movq %rdx, %rsi
cmoveq %rdi, %rsi
movq (%rax), %r8
movq %r8, (%rsi)
cmpq %rax, 0x8(%rdi)
jne 0x3493a
movq %rdx, 0x8(%rdi)
cmpq $0x0, (%rdi)
jne 0x34945
andq $0x0, 0x8(%rdi)
incl %ecx
movl %ecx, 0x10(%rdi)
decl 0x18(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
leaq 0x48(%r14), %r15
leaq 0x18(%rsp), %r12
leaq 0x8(%rsp), %r13
movq %r14, %rdi
callq 0x34905
testq %rax, %rax
jne 0x349bc
movq %r12, %rdi
xorl %esi, %esi
callq 0x48a0
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
jmp 0x34979
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_O2/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 0x34a00
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_O2/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 0x34a7e
pushq %rbx
movq %rdi, %rbx
testl %esi, %esi
je 0x34a75
movq 0x10(%rbx), %rdi
callq 0x4600
movq %rbx, %rdi
popq %rbx
jmp 0x4600
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x78
popq %rdi
callq 0x46f0
movq %rax, %rbx
leaq 0x20(%rax), %rdi
xorl %esi, %esi
callq 0x47c0
leaq 0x48(%rbx), %rdi
xorl %esi, %esi
callq 0x4610
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movups %xmm0, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
movl $0x108, %edi            # imm = 0x108
callq 0x46f0
movq %rax, %r14
movl %ebp, (%rax)
movl %ebx, 0x20(%rax)
andq $0x0, 0xe8(%rax)
movslq %ebx, %r12
imulq $0x50, %r12, %rdi
callq 0x46f0
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%r14)
movups %xmm0, 0x10(%r14)
movq %rax, 0x28(%r14)
leaq 0x30(%r14), %r15
xorl %r13d, %r13d
movq %r15, %rdi
xorl %esi, %esi
callq 0x47c0
leaq 0x58(%r14), %rdi
xorl %esi, %esi
callq 0x4610
leaq 0xb8(%r14), %rdi
xorl %esi, %esi
callq 0x4610
movq %r15, (%rsp)
movq %r15, %rdi
callq 0x47a0
shlq $0x2, %r12
movq %r12, %rdi
callq 0x46f0
movq %rax, 0xe8(%r14)
testq %rax, %rax
je 0x34bed
orl $-0x1, 0xf0(%r14)
testl %ebx, %ebx
cmovlel %r13d, %ebx
xorl %ebp, %ebp
xorl %r15d, %r15d
cmpq %r15, %rbx
je 0x34be1
movq 0x28(%r14), %r12
movq 0xe8(%r14), %rax
andl $0x0, (%rax,%r15,4)
leaq (%r12,%rbp), %r13
leaq (%r12,%rbp), %rdi
addq $0x18, %rdi
movq %r14, -0x18(%rdi)
movl %r15d, -0x10(%rdi)
andq $0x0, 0x30(%rdi)
xorl %esi, %esi
callq 0x4610
leaq (%r12,%rbp), %rdi
addq $0x10, %rdi
xorl %esi, %esi
leaq 0x39(%rip), %rdx        # 0x34bff
movq %r13, %rcx
callq 0x4990
incq %r15
addq $0x50, %rbp
movl $0x0, %r13d
testl %eax, %eax
je 0x34b80
jmp 0x34bed
movq (%rsp), %rdi
callq 0x43f0
movq %r14, %r13
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x18
popq %r15
xorl %r12d, %r12d
movslq 0x20(%r14), %rax
cmpq %rax, %r12
jge 0x34f6b
movq 0xe8(%r14), %rax
cmpl $0x0, (%rax,%r12,4)
je 0x34f62
movq 0x28(%r14), %rdi
addq %r15, %rdi
callq 0x4040
incq %r12
addq $0x50, %r15
jmp 0x34f3f
leaq 0x58(%r14), %r15
cmpl $0x0, 0x4(%r14)
jne 0x34f80
movl 0x8(%r14), %eax
cmpl 0x20(%r14), %eax
je 0x34f8d
movq %r15, %rdi
movq %rbx, %rsi
callq 0x47f0
jmp 0x34f6f
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_O2/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
testl %esi, %esi
je 0x34fe1
pushq $0x10
popq %r14
xorl %r15d, %r15d
pushq $0x2
popq %rbp
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jge 0x35049
movq 0x28(%rbx), %rax
movq (%rax,%r14), %rdi
movl %ebp, %esi
callq 0x46c0
incq %r15
addq $0x50, %r14
jmp 0x34fbc
leaq 0x30(%rbx), %r14
movq %r14, %rdi
callq 0x47a0
movl $0x1, 0xc(%rbx)
pushq $0x18
popq %r15
xorl %r12d, %r12d
movslq 0x20(%rbx), %rax
cmpq %rax, %r12
jge 0x35019
movq 0x28(%rbx), %rdi
addq %r15, %rdi
callq 0x4040
incq %r12
addq $0x50, %r15
jmp 0x34ffb
movq %r14, %rdi
callq 0x43f0
pushq $0x10
popq %r14
xorl %r15d, %r15d
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jge 0x35049
movq 0x28(%rbx), %rax
movq (%rax,%r14), %rdi
xorl %esi, %esi
callq 0x4490
incq %r15
addq $0x50, %r14
jmp 0x35028
pushq $0x18
popq %r14
leaq 0x30(%rbx), %rdi
callq 0x45d0
leaq 0x58(%rbx), %rdi
callq 0x4a10
leaq 0xb8(%rbx), %rdi
callq 0x4a10
xorl %r15d, %r15d
movslq 0x20(%rbx), %rax
cmpq %rax, %r15
jge 0x3508c
movq 0x28(%rbx), %rdi
addq %r14, %rdi
callq 0x4a10
incq %r15
addq $0x50, %r14
jmp 0x3506e
movq 0xe8(%rbx), %rdi
callq 0x4600
movq 0x28(%rbx), %rdi
callq 0x4600
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4600
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/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 0x354fa
movq %rsi, %rdi
movl %eax, %esi
movq %rcx, %rdx
jmp 0x4850
movq 0x8(%rdx), %rdi
movl %eax, %edx
jmp 0x4920
// File: /workspace/github_cpp_makefile_star2_O2/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 0x3551b
movq %rax, %rdi
movq %rcx, %rsi
jmp 0x45c0
pushq %rax
movq 0x8(%rsi), %rdi
movq %rax, %rsi
callq 0x49e0
xorl %ecx, %ecx
cmpl $0x1, %eax
sbbl %ecx, %ecx
movl %ecx, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x3555a
callq 0x4160
cmpl $-0x1, %eax
je 0x35599
movl %eax, %ebx
movq (%r14), %rsi
movl %eax, %edi
callq 0x40d0
jmp 0x3559c
movq 0x8(%r14), %rsi
movl (%rsi), %eax
testl %eax, %eax
je 0x3557d
decl %eax
movl %eax, (%rsi)
incq 0x10(%rsi)
movq 0x8(%rsi), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rsi)
movzbl (%rax), %ebx
jmp 0x35590
movq %rsi, %rdi
callq 0x4930
cmpl $-0x1, %eax
je 0x35599
movl %eax, %ebx
movq 0x8(%r14), %rsi
movl %ebx, %edi
callq 0x44f0
jmp 0x3559c
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x1
popq %rdi
pushq $0x10
popq %rsi
callq 0x4370
testq %rax, %rax
je 0x3566d
movq %rax, %rbx
cmpb $0x7a, (%r14)
je 0x35641
cmpb $0x7a, 0x1(%r14)
je 0x35641
movq %r15, %rdi
movq %r14, %rsi
callq 0x45f0
movq %rax, (%rbx)
testq %rax, %rax
je 0x35641
movq %rax, %r12
movq %rsp, %rdi
pushq $0x1
popq %rsi
pushq $0x2
popq %rdx
movq %rax, %rcx
callq 0x47d0
cmpq $0x2, %rax
jne 0x35665
cmpb $0x1f, (%rsp)
jne 0x356b3
cmpb $-0x75, 0x1(%rsp)
jne 0x356b3
movq %r12, %rdi
callq 0x4530
andq $0x0, (%rbx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x47b0
movq %rax, 0x8(%rbx)
testq %rax, %rax
jne 0x3566f
pushq $0x77
popq %rsi
movq %r14, %rdi
callq 0x41e0
testq %rax, %rax
je 0x35681
movq %rbx, %rdi
callq 0x4600
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x11230(%rip), %rsi     # 0x468b8
movq %rsp, %r12
movq %r12, %rdi
movl $0x3fc, %edx            # imm = 0x3FC
movq %r15, %rcx
xorl %eax, %eax
callq 0x4100
movq %r12, %rdi
movq %r14, %rsi
callq 0x47b0
movq %rax, 0x8(%rbx)
testq %rax, %rax
jne 0x3566f
jmp 0x35665
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x4310
jmp 0x3566f
// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x20, %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 0x4350
leal 0x1(%rax), %ecx
movslq %ecx, %rdx
movq (%rbx), %rcx
movq 0x8(%rbx), %rsi
subq %rcx, %rsi
cmpq %rdx, %rsi
jae 0x35789
cltq
leaq (%rax,%rcx), %rsi
addq $0x2, %rsi
movq %rbx, %rdi
callq 0x357a1
testl %eax, %eax
js 0x3579c
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 0x4350
movq (%rbx), %rcx
movslq %eax, %rdx
addq %rcx, %rdx
movq %rdx, (%rbx)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
pushq $-0x1
popq %rax
jmp 0x35792
// File: /workspace/github_cpp_makefile_star2_O2/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 0x358e2
testq %rdi, %rdi
jne 0x358ab
testb $0x1, (%rdx)
jne 0x358e8
andl $0x0, 0x24(%rdx)
cmpb $0x0, 0x1(%rsi)
je 0x358eb
orl $-0x1, 0x20(%rdx)
xorps %xmm0, %xmm0
movups %xmm0, (%rdx)
movups %xmm0, 0x10(%rdx)
pushq $0x1
popq %rax
movsbl (%rsi), %ecx
testl %ecx, %ecx
je 0x358f1
movq %rax, %r8
shlq %cl, %r8
sarl $0x6, %ecx
movslq %ecx, %rcx
orq %r8, (%rdx,%rcx,8)
incq %rsi
jmp 0x358c6
cmpl $0x0, 0x24(%rdx)
je 0x358f1
xorl %eax, %eax
retq
movsbl (%rsi), %eax
movl %eax, 0x20(%rdx)
testq %rdi, %rdi
je 0x35901
decq %rdi
movq %rdi, 0x28(%rdx)
andl $0x0, 0x24(%rdx)
movl 0x20(%rdx), %esi
movq 0x28(%rdx), %rcx
leaq 0x1(%rcx), %rax
testl %esi, %esi
js 0x35929
movsbl 0x1(%rcx), %edi
incq %rcx
testl %edi, %edi
je 0x3591f
cmpl %edi, %esi
jne 0x35910
movq %rcx, 0x28(%rdx)
cmpb $0x0, (%rcx)
je 0x3594a
retq
movq %rax, %rcx
movsbl (%rcx), %esi
testl %esi, %esi
je 0x3591f
movl %esi, %edi
sarl $0x6, %edi
movslq %edi, %rdi
movq (%rdx,%rdi,8), %rdi
btq %rsi, %rdi
jb 0x3591f
incq %rcx
jmp 0x3592c
movl $0x1, 0x24(%rdx)
retq