LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/cram/mFILE.c
// Function: mfprintf
int mfprintf(mFILE *mf, char *fmt, ...) {
    int ret;
    size_t est_length;
    va_list args;

    va_start(args, fmt);
    est_length = vflen(fmt, args);
    va_end(args);
    while (est_length + mf->offset > mf->alloced) {
	size_t new_alloced = mf->alloced ? mf->alloced * 2 : 1024;
	void * new_data    = realloc(mf->data, new_alloced);
	if (NULL == new_data) return -1;
	mf->alloced = new_alloced;
	mf->data    = new_data;
    }

    va_start(args, fmt);
    ret = vsprintf(&mf->data[mf->offset], fmt, args);
    va_end(args);

    if (ret > 0) {
	mf->offset += ret;
	if (mf->size < mf->offset)
	    mf->size = mf->offset;
    }

    if (mf->fp == stderr) {
	/* Auto-flush for stderr */
	if (0 != mfflush(mf)) return -1;
    }

    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rsp), %r12
movq %rdx, 0x10(%r12)
movq %rcx, 0x18(%r12)
movq %r8, 0x20(%r12)
movq %r9, 0x28(%r12)
testb %al, %al
je 0x5ec44
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)
movq %rsp, %rsi
movq %r12, 0x10(%rsi)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rsi)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsi)
movq %r14, %rdi
callq 0x65c40
movslq %eax, %r13
movq 0x28(%rbx), %rax
addq %r13, %rax
movq 0x10(%rbx), %r15
cmpq %r15, %rax
jbe 0x5ecb8
movl $0x400, %ebp            # imm = 0x400
testq %r15, %r15
leaq (%r15,%r15), %r15
cmoveq %rbp, %r15
movq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0x6c80
testq %rax, %rax
je 0x5ed2a
movq %r15, 0x10(%rbx)
movq %rax, 0x8(%rbx)
movq 0x28(%rbx), %rax
addq %r13, %rax
cmpq %r15, %rax
ja 0x5ec84
movq %rsp, %rdx
movq %r12, 0x10(%rdx)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
movq 0x8(%rbx), %rdi
addq 0x28(%rbx), %rdi
movq %r14, %rsi
callq 0x6300
movl %eax, %ebp
testl %eax, %eax
jle 0x5ed02
movl %ebp, %eax
addq 0x28(%rbx), %rax
movq %rax, 0x28(%rbx)
cmpq %rax, 0x20(%rbx)
jae 0x5ed02
movq %rax, 0x20(%rbx)
movq (%rbx), %rax
movq 0x602cc(%rip), %rcx     # 0xbefd8
cmpq (%rcx), %rax
je 0x5ed15
movl %ebp, %eax
jmp 0x5ed2f
movq %rbx, %rdi
callq 0x5e758
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
jne 0x5ed2f
jmp 0x5ed11
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/cram/open_trace_file.c
// Function: find_file_url
mFILE *find_file_url(char *file, char *url) {
    char buf[8192], *cp;
    mFILE *mf = NULL;
    int maxlen = 8190 - strlen(file), len;
    hFILE *hf;

    /* Expand %s for the trace name */
    for (cp = buf; *url && cp - buf < maxlen; url++) {
	if (*url == '%' && *(url+1) == 's') {
	    url++;
	    cp += strlen(strcpy(cp, file));
	} else {
	    *cp++ = *url;
	}
    }
    *cp++ = 0;

    if (!(hf = hopen(buf, "r")))
	return NULL;

    if (NULL == (mf = mfcreate(NULL, 0)))
	return NULL;
    while ((len = hread(hf, buf, 8192)) > 0) {
	if (mfwrite(buf, len, 1, mf) <= 0) {
	    hclose_abruptly(hf);
	    mfdestroy(mf);
	    return NULL;
	}
    }
    if (hclose(hf) < 0) {
	mfdestroy(mf);
	return NULL;
    }

    mrewind(mf);
    return mf;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2008, %rsp           # imm = 0x2008
movq %rsi, %rbx
movq %rdi, %r14
callq 0x62d0
movl $0x1ffe, %ecx           # imm = 0x1FFE
subl %eax, %ecx
movslq %ecx, %r12
movb (%rbx), %al
testb %al, %al
setne %cl
testq %r12, %r12
setg %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x5f063
movq %rsp, %r13
movq %r13, %r15
cmpb $0x25, %al
jne 0x5f046
cmpb $0x73, 0x1(%rbx)
jne 0x5f046
incq %rbx
movq %r15, %rdi
movq %r14, %rsi
callq 0x6680
movq %r15, %rdi
callq 0x62d0
addq %rax, %r15
jmp 0x5f04c
movb %al, (%r15)
incq %r15
movb 0x1(%rbx), %al
testb %al, %al
je 0x5f066
incq %rbx
movq %r15, %rcx
subq %r13, %rcx
cmpq %r12, %rcx
jl 0x5f021
jmp 0x5f066
movq %rsp, %r15
movb $0x0, (%r15)
leaq 0x36db8(%rip), %rsi     # 0x95e29
movq %rsp, %rdi
callq 0x6b707
testq %rax, %rax
je 0x5f13b
movq %rax, %r14
xorl %r15d, %r15d
xorl %edi, %edi
xorl %esi, %esi
callq 0x5e25b
testq %rax, %rax
je 0x5f13e
movq %rax, %rbx
movq %rsp, %r15
movl $0x2000, %r13d          # imm = 0x2000
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rbp
subq %rsi, %rbp
cmpq %r13, %rbp
movl $0x2000, %r12d          # imm = 0x2000
cmovbq %rbp, %r12
movq %r15, %rdi
movq %r12, %rdx
callq 0x6570
addq %r12, 0x8(%r14)
movl $0x2000, %esi           # imm = 0x2000
cmpq $0x1fff, %rbp           # imm = 0x1FFF
ja 0x5f0f1
movl $0x2000, %edx           # imm = 0x2000
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rcx
callq 0x6b053
movq %rax, %rsi
testl %esi, %esi
jle 0x5f11a
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x5ea45
testq %rax, %rax
jne 0x5f0a6
movq %r14, %rdi
callq 0x6b3d8
jmp 0x5f133
movq %r14, %rdi
callq 0x6b37e
testl %eax, %eax
js 0x5f133
movq %rbx, %rdi
callq 0x5e954
movq %rbx, %r15
jmp 0x5f13e
movq %rbx, %rdi
callq 0x5e866
xorl %r15d, %r15d
movq %r15, %rax
addq $0x2008, %rsp           # imm = 0x2008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/cram/open_trace_file.c
// Function: find_file_dir
static mFILE *find_file_dir(char *file, char *dirname) {
    char *path;
    mFILE *mf = NULL;

    path = expand_path(file, dirname);

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

    free(path);
    return mf;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
callq 0x5f3f6
movq %rax, %rbx
movq %rax, %rdi
callq 0x5e108
testl %eax, %eax
je 0x5f2d5
leaq 0x3a1d2(%rip), %rsi     # 0x9949a
movq %rbx, %rdi
callq 0x5e6d8
movq %rax, %r14
jmp 0x5f2d8
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x68a0
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/cram/open_trace_file.c
// Function: find_path
char *find_path(char *file, char *path) {
    char *newsearch;
    char *ele;
    char *outpath = NULL;

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

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

    free(newsearch);

    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, (%rsp)
testq %rsi, %rsi
jne 0x5f30e
leaq 0x3a187(%rip), %rdi     # 0x9948d
callq 0x68f0
movq %rax, %rsi
movq %rsi, %rdi
callq 0x5ed8c
testq %rax, %rax
je 0x5f3e1
movq %rax, %rbp
movb (%rax), %al
testb %al, %al
je 0x5f3d9
leaq 0x3a162(%rip), %r12     # 0x99495
movq %rbp, %r14
xorl %ebx, %ebx
cmpb $0x7c, %al
sete %bl
addq %r14, %rbx
movl $0x4, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x6330
movl $0x4, %r13d
testl %eax, %eax
je 0x5f3ba
movl $0x5, %edx
movq %rbx, %rdi
leaq 0x3a115(%rip), %rsi     # 0x9947e
callq 0x6330
testl %eax, %eax
je 0x5f3ba
movl $0x4, %edx
movq %rbx, %rdi
leaq 0x3a107(%rip), %rsi     # 0x99488
callq 0x6330
testl %eax, %eax
je 0x5f3ba
movq (%rsp), %rdi
movq %rbx, %rsi
callq 0x5f3f6
movq %rax, %rbx
movq %rax, %rdi
callq 0x5e108
xorl %r13d, %r13d
testl %eax, %eax
setne %r13b
movq %rbx, %rdi
cmovneq %rbp, %rdi
cmovneq %rbx, %r15
callq 0x68a0
testb $0x3, %r13b
jne 0x5f3e4
movq %r14, %rdi
callq 0x62d0
addq %rax, %r14
incq %r14
movb (%r14), %al
testb %al, %al
jne 0x5f336
movq %rbp, %rdi
callq 0x68a0
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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
pushq %rax
movq %rdi, %rbx
leaq 0x38632(%rip), %rdi     # 0x99987
callq 0x6bb0
movq 0x18(%rbx), %rax
cmpl $0x0, (%rax)
je 0x61424
leaq 0x38465(%rip), %r13     # 0x997d3
xorl %ebp, %ebp
movq 0x10(%rax), %rcx
movl %ebp, %edx
shrl $0x4, %edx
movl (%rcx,%rdx,4), %edx
leal (,%rbp,2), %ecx
shrl %cl, %edx
testb $0x3, %dl
jne 0x61416
movq 0x18(%rax), %rcx
movq 0x20(%rax), %rax
movl %ebp, %edx
movq (%rax,%rdx,8), %r15
movzwl (%rcx,%rdx,4), %eax
rolw $0x8, %ax
movw %ax, 0x6(%rsp)
movq 0x8(%r15), %rax
movl 0x18(%rax), %edx
incl %edx
leaq 0x383fe(%rip), %rdi     # 0x997b7
leaq 0x6(%rsp), %rsi
xorl %eax, %eax
callq 0x6070
movq %r15, %r14
movl 0x18(%r14), %esi
leaq 0x383f9(%rip), %rdi     # 0x997cc
xorl %eax, %eax
callq 0x6070
movq 0x10(%r14), %r12
testq %r12, %r12
je 0x61404
movq 0x8(%r12), %rsi
movl 0x10(%r12), %edx
addl $-0x3, %edx
leaq 0x3(%rsi), %rcx
movq %r13, %rdi
xorl %eax, %eax
callq 0x6070
movq (%r12), %r12
jmp 0x613de
movl $0xa, %edi
callq 0x6a40
movq (%r14), %r14
cmpq %r15, %r14
jne 0x613c8
incl %ebp
movq 0x18(%rbx), %rax
cmpl (%rax), %ebp
jne 0x61370
leaq 0x38567(%rip), %rdi     # 0x99992
callq 0x6bb0
cmpl $0x0, 0x6c(%rbx)
jle 0x614cc
leaq 0x2cfb1(%rip), %r13     # 0x8e3f2
leaq 0x363ba(%rip), %rbp     # 0x97802
leaq 0x38399(%rip), %r15     # 0x997e8
xorl %r12d, %r12d
leaq 0x38389(%rip), %rdi     # 0x997e2
movl %r12d, %esi
xorl %eax, %eax
callq 0x6070
movq 0x88(%rbx), %rax
movl (%rax,%r12,4), %eax
cmpl $-0x1, %eax
je 0x614b6
movq 0x78(%rbx), %rdi
movq 0x88(%rbx), %rcx
cmpl (%rcx,%r12,4), %eax
movq %rbp, %rsi
cmoveq %r13, %rsi
movslq %eax, %rdx
leaq (,%rdx,8), %rax
leaq (%rax,%rax,4), %r14
movl 0x18(%rdi,%r14), %ecx
movq (%rdi,%r14), %r8
movq %r15, %rdi
xorl %eax, %eax
callq 0x6070
movq 0x78(%rbx), %rax
movl 0x20(%rax,%r14), %eax
jmp 0x6146e
movl $0xa, %edi
callq 0x6a40
incq %r12
movslq 0x6c(%rbx), %rax
cmpq %rax, %r12
jl 0x61452
leaq 0x38320(%rip), %rdi     # 0x997f3
callq 0x6bb0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x10(%rsi), %r8
testq %r8, %r8
je 0x6324e
movb (%rdx), %dil
xorl %esi, %esi
movq %r8, %rax
movq 0x8(%r8), %r8
cmpb %dil, (%r8)
jne 0x63241
movb 0x1(%r8), %r8b
cmpb 0x1(%rdx), %r8b
je 0x63258
movq (%rax), %r8
movq %rax, %rsi
testq %r8, %r8
jne 0x6322b
jmp 0x63250
xorl %eax, %eax
movq %rax, %rsi
movl $0x0, %eax
testq %rcx, %rcx
je 0x63260
movq %rsi, (%rcx)
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 $0xd8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x632c8
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)
movq %rsi, 0x10(%rsp)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
addq $0x10, %rbx
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x63305
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x63313
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %r12
testq %r12, %r12
je 0x63334
movl (%rsp), %ecx
cmpq $0x28, %rcx
ja 0x6333e
movq %rcx, %rax
addq 0x10(%rsp), %rax
addl $0x8, %ecx
movl %ecx, (%rsp)
jmp 0x6334c
movl $0x2, %ecx
jmp 0x633ff
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %rbp
movq (%rbx), %rcx
testq %rcx, %rcx
je 0x63383
movb (%r12), %al
xorl %r13d, %r13d
movq %rcx, %r15
movq 0x8(%rcx), %rcx
cmpb %al, (%rcx)
jne 0x63373
movb 0x1(%rcx), %cl
cmpb 0x1(%r12), %cl
je 0x63389
movq (%r15), %rcx
movq %r15, %r13
testq %rcx, %rcx
jne 0x6335e
movq %r15, %r13
jmp 0x63386
xorl %r13d, %r13d
xorl %r15d, %r15d
testq %r15, %r15
jne 0x633b1
movq 0x30(%r14), %rdi
callq 0x86da2
testq %rax, %rax
je 0x633fa
movq %rax, %r15
testq %r13, %r13
cmoveq %rbx, %r13
movq %rax, (%r13)
movq $0x0, (%rax)
movq (%r14), %r13
movq %r14, %rdi
leaq 0x36555(%rip), %rsi     # 0x99913
movq %r12, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x662d8
testl %eax, %eax
js 0x633fa
movq (%r14), %rax
movslq %r13d, %rsi
subq %r13, %rax
movl %eax, 0x10(%r15)
movq 0x20(%r14), %rdi
addq 0x10(%r14), %rsi
movslq %eax, %rdx
callq 0x651bb
movq %rax, 0x8(%r15)
xorl %ecx, %ecx
testq %rax, %rax
sete %cl
jmp 0x633ff
movl $0x1, %ecx
testl %ecx, %ecx
je 0x632ec
cmpl $0x2, %ecx
jne 0x63410
xorl %eax, %eax
jmp 0x63415
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 %r14
pushq %rbx
pushq %rax
movl $0x1, %edi
movl $0x4a0, %esi            # imm = 0x4A0
callq 0x6470
testq %rax, %rax
je 0x63bc5
movq %rax, %rbx
movl $0x1, %edi
movl $0x28, %esi
callq 0x6470
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x63b67
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x494(%rbx)
movl $0x0, 0x38(%rbx)
movq $0x0, 0x40(%rbx)
movl $0x1, %edi
movl $0x28, %esi
callq 0x6470
movq %rax, 0x48(%rbx)
testq %rax, %rax
je 0x63b67
movl $0x0, 0x50(%rbx)
movq $0x0, 0x58(%rbx)
movl $0x1, %edi
movl $0x28, %esi
callq 0x6470
movq %rax, 0x60(%rbx)
testq %rax, %rax
je 0x63b67
xorl %eax, %eax
movq %rax, 0x68(%rbx)
movq %rax, 0x78(%rbx)
movl $0x0, 0x70(%rbx)
movq %rax, 0x88(%rbx)
movl $0x1, %edi
movl $0x28, %esi
callq 0x6470
movq %rax, 0x80(%rbx)
testq %rax, %rax
je 0x63b67
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movl $0x18, %edi
callq 0x86ce0
movq %rax, 0x30(%rbx)
testq %rax, %rax
je 0x63b67
movl $0x20, %edi
callq 0x86ce0
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0x63b67
movl $0x2000, %edi           # imm = 0x2000
callq 0x65060
movq %rax, 0x20(%rbx)
testq %rax, %rax
jne 0x63bc7
movq 0x18(%rbx), %r14
testq %r14, %r14
je 0x63b93
movq 0x18(%r14), %rdi
callq 0x68a0
movq 0x10(%r14), %rdi
callq 0x68a0
movq 0x20(%r14), %rdi
callq 0x68a0
movq %r14, %rdi
callq 0x68a0
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0x63ba1
callq 0x86d5d
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x63baf
callq 0x86d5d
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x63bbd
callq 0x65093
movq %rbx, %rdi
callq 0x68a0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x63a4f
testq %rax, %rax
je 0x63c7c
movq %rax, %rbx
testq %r14, %r14
je 0x63d58
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x614e7
cmpl $-0x1, %eax
je 0x63c74
movq 0x18(%rbx), %rax
movl (%rax), %edx
testl %edx, %edx
je 0x63c8f
leal -0x1(%rdx), %edi
movl %edi, %r8d
andl $0x4844, %r8d           # imm = 0x4844
movq 0x10(%rax), %r9
movl $0x1, %r10d
movl %r8d, %esi
movl %esi, %ecx
shrl $0x4, %ecx
movl (%r9,%rcx,4), %r11d
leal (%rsi,%rsi), %ecx
andl $0x1e, %ecx
movl %r11d, %ebp
shrl %cl, %ebp
testb $0x2, %bpl
jne 0x63c83
testb $0x1, %bpl
jne 0x63c63
movq 0x18(%rax), %r14
movl %esi, %r15d
cmpl $0x4844, (%r14,%r15,4)  # imm = 0x4844
je 0x63c83
addl %r10d, %esi
andl %edi, %esi
incl %r10d
cmpl %r8d, %esi
jne 0x63c32
movl %edx, %esi
jmp 0x63c91
movq %rbx, %rdi
callq 0x63d6a
xorl %ebx, %ebx
jmp 0x63d58
shrl %cl, %r11d
testb $0x3, %r11b
cmovnel %edx, %esi
jmp 0x63c91
xorl %esi, %esi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl %edx, %esi
je 0x63d4a
movq 0x20(%rax), %rax
movl %esi, %edx
movq (%rax,%rdx,8), %rax
movq 0x10(%rax), %r13
testq %r13, %r13
je 0x63d4a
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
leaq 0x35c89(%rip), %r14     # 0x9994b
leaq 0x35c8b(%rip), %r15     # 0x99954
movq 0x8(%r13), %rbp
cmpb $0x53, (%rbp)
jne 0x63d2e
cmpb $0x4f, 0x1(%rbp)
jne 0x63d2e
addq $0x3, %rbp
movq %rbp, %rdi
movq %r14, %rsi
callq 0x6a50
testl %eax, %eax
je 0x63d3f
movq %rbp, %rdi
movq %r15, %rsi
callq 0x6a50
testl %eax, %eax
je 0x63d43
movq %rbp, %rdi
leaq 0x35c59(%rip), %rsi     # 0x9995e
callq 0x6a50
movl $0x2, %ecx
testl %eax, %eax
je 0x63d31
movq 0x5b2be(%rip), %rax     # 0xbefd8
movq (%rax), %rdi
leaq 0x35c45(%rip), %rsi     # 0x99969
movq %rbp, %rdx
xorl %eax, %eax
callq 0x6a90
movl %r12d, %ecx
movq (%r13), %r13
movl %ecx, %r12d
testq %r13, %r13
jne 0x63cc9
jmp 0x63d4a
xorl %ecx, %ecx
jmp 0x63d31
movl $0x1, %ecx
jmp 0x63d31
movl %ecx, 0x90(%rbx)
movq %rbx, %rdi
callq 0x63f54
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/htslib/cram/sam_header.c
// Function: sam_hdr_find_rg
SAM_RG *sam_hdr_find_rg(SAM_hdr *hdr, const char *rg) {
    khint_t k = kh_get(m_s2i, hdr->rg_hash, rg);
    return k == kh_end(hdr->rg_hash)
	? NULL
	: &hdr->rg[kh_val(hdr->rg_hash, k)];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x60(%rdi), %rax
movq %rax, (%rsp)
movl (%rax), %eax
testl %eax, %eax
je 0x6436b
movq %rsi, %r15
movq %rdi, 0x18(%rsp)
movq %rax, 0x10(%rsp)
leal -0x1(%rax), %edi
movsbl (%rsi), %ebx
testl %ebx, %ebx
je 0x64373
movb 0x1(%r15), %al
testb %al, %al
je 0x64375
leaq 0x2(%r15), %rcx
movl %ebx, %edx
shll $0x5, %edx
subl %ebx, %edx
movsbl %al, %ebx
addl %edx, %ebx
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0x64354
jmp 0x64375
xorl %r12d, %r12d
jmp 0x64404
xorl %ebx, %ebx
andl %edi, %ebx
movq (%rsp), %rax
movq 0x10(%rax), %rdx
movl $0x1, %r14d
movl %ebx, %r12d
movl %edi, 0xc(%rsp)
movq %rdx, 0x20(%rsp)
movl %r12d, %eax
shrl $0x4, %eax
movl (%rdx,%rax,4), %r13d
leal (%r12,%r12), %ebp
andl $0x1e, %ebp
movl %r13d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x643ed
testb $0x1, %al
jne 0x643d5
movq (%rsp), %rax
movq 0x18(%rax), %rax
movl %r12d, %ecx
movq (%rax,%rcx,8), %rdi
movq %r15, %rsi
callq 0x6a50
movq 0x20(%rsp), %rdx
movl 0xc(%rsp), %edi
testl %eax, %eax
je 0x643ed
addl %r14d, %r12d
andl %edi, %r12d
incl %r14d
cmpl %ebx, %r12d
jne 0x64391
movq 0x10(%rsp), %rax
movl %eax, %r12d
jmp 0x643ff
movl %ebp, %ecx
shrl %cl, %r13d
testb $0x3, %r13b
movq 0x10(%rsp), %rax
cmovnel %eax, %r12d
movq 0x18(%rsp), %rdi
cmpl %eax, %r12d
jne 0x6440d
xorl %eax, %eax
jmp 0x64424
movq (%rsp), %rax
movq 0x20(%rax), %rax
movl %r12d, %ecx
movslq (%rax,%rcx,4), %rax
shlq $0x5, %rax
addq 0x58(%rdi), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x646e6
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 0x647c6
leaq (,%r13,4), %r12
movq %r12, %rdi
callq 0x69d0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x64838
movq %rax, %r15
movq 0x88(%r14), %rsi
movq %rax, %rdi
movq %r12, %rdx
callq 0x6570
testl %r13d, %r13d
jle 0x647ba
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 0x64433
movq 0x78(%r14), %r10
movslq (%r15,%rbp,4), %rcx
leaq (%rcx,%rcx,4), %r11
movq %r14, %rdi
leaq 0x351b1(%rip), %rsi     # 0x9992b
movq %r12, %rdx
leaq 0x3487d(%rip), %rcx     # 0x99001
movq %rax, %r8
leaq 0x351a0(%rip), %r9      # 0x9992e
xorl %eax, %eax
pushq $0x0
pushq (%r10,%r11,8)
leaq 0x35194(%rip), %r10     # 0x99931
pushq %r10
pushq %rbx
callq 0x621a5
addq $0x20, %rsp
cmpl $-0x1, %eax
je 0x6482b
incq %rbp
cmpq %rbp, %r13
jne 0x64734
movq %r15, %rdi
callq 0x68a0
xorl %ebp, %ebp
jmp 0x64838
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 0x64433
leaq 0x3512e(%rip), %rsi     # 0x9992b
leaq 0x347fd(%rip), %rcx     # 0x99001
leaq 0x35123(%rip), %r9      # 0x9992e
xorl %ebp, %ebp
movq %r14, %rdi
movq %r15, %rdx
movq %rax, %r8
xorl %eax, %eax
pushq $0x0
pushq %rbx
callq 0x621a5
addq $0x10, %rsp
cmpl $-0x1, %eax
jne 0x64838
jmp 0x64833
movq %r15, %rdi
callq 0x68a0
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_c_makefile_star2_O1/icebert[P]pblat/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 0x650d8
testq %rax, %rax
je 0x651ec
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x6380
movb $0x0, (%r14,%rbx)
jmp 0x651ef
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x6ae0
movq %rbx, %rdi
callq 0x65229
movq %rax, %rbx
movq %r14, %rdi
callq 0x64f0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x65274
movq %rsi, %rdx
movl 0x10(%rdi), %ecx
movq %rax, %rsi
cmpl %ecx, 0x8(%rax)
jne 0x6522e
cmpq %rax, (%rdi)
movq %rdx, %rsi
cmoveq %rdi, %rsi
movq (%rax), %r8
movq %r8, (%rsi)
cmpq %rax, 0x8(%rdi)
jne 0x6525e
movq %rdx, 0x8(%rdi)
cmpq $0x0, (%rdi)
jne 0x6526c
movq $0x0, 0x8(%rdi)
incl %ecx
movl %ecx, 0x10(%rdi)
decl 0x18(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x6ae0
movq %r14, %rdi
callq 0x65229
testq %rax, %rax
jne 0x652ee
leaq 0x48(%r14), %r15
leaq 0x18(%rsp), %r12
leaq 0x8(%rsp), %r13
movq %r12, %rdi
xorl %esi, %esi
callq 0x6c40
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 0x6b50
movq %r14, %rdi
callq 0x65229
testq %rax, %rax
je 0x652ad
movq %rax, %rbp
movq %rbx, %rdi
callq 0x64f0
movq %rbp, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x6ae0
xorl %ebp, %ebp
cmpl $0x0, 0x18(%r14)
jne 0x65332
xorl %ebp, %ebp
cmpl $0x0, 0x1c(%r14)
sete %bpl
movq %rbx, %rdi
callq 0x64f0
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x6ae0
movl 0x18(%rbx), %ebx
movq %r14, %rdi
callq 0x64f0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x6ae0
movl 0x1c(%rbx), %ebp
addl 0x18(%rbx), %ebp
movq %r14, %rdi
callq 0x64f0
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x653b5
pushq %rbx
movq %rdi, %rbx
testl %esi, %esi
je 0x653ac
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x653ac
callq 0x68a0
movq %rbx, %rdi
popq %rbx
jmp 0x68a0
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x69d0
movq %rax, %rbx
leaq 0x20(%rax), %rdi
xorl %esi, %esi
callq 0x6b10
leaq 0x48(%rbx), %rdi
xorl %esi, %esi
callq 0x68c0
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movups %xmm0, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x6543d
pushq %rbx
movq %rdi, %rbx
addq $0x20, %rdi
callq 0x6860
leaq 0x48(%rbx), %rdi
callq 0x6e60
movaps 0x34595(%rip), %xmm0    # 0x999a0
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 0x68a0
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x69d0
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 0x69d0
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 0x6b10
leaq 0x58(%rbx), %rdi
xorl %esi, %esi
callq 0x68c0
leaq 0xb8(%rbx), %rdi
xorl %esi, %esi
callq 0x68c0
movq %r14, 0x10(%rsp)
movq %r14, %rdi
callq 0x6ae0
shlq $0x2, %r12
movq %r12, %rdi
callq 0x69d0
movq %rax, 0xe8(%rbx)
testq %rax, %rax
je 0x6557e
movl $0xffffffff, 0xf0(%rbx) # imm = 0xFFFFFFFF
testl %ebp, %ebp
jle 0x6556f
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 0x68c0
leaq (%r12,%r15), %rdi
addq $-0x38, %rdi
xorl %esi, %esi
leaq 0x3b(%rip), %rdx        # 0x65592
movq %r13, %rcx
callq 0x6dc0
testl %eax, %eax
jne 0x6557e
incq %r14
addq $0x50, %r15
cmpq %r14, %rbp
jne 0x6550c
movq 0x10(%rsp), %rdi
callq 0x64f0
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_c_makefile_star2_O1/icebert[P]pblat/htslib/cram/thread_pool.c
// Function: t_pool_dispatch
int t_pool_dispatch(t_pool *p, t_results_queue *q,
		    void *(*func)(void *arg), void *arg) {
    t_pool_job *j = malloc(sizeof(*j));

    if (!j)
	return -1;
    j->func = func;
    j->arg = arg;
    j->next = NULL;
    j->p = p;
    j->q = q;
    if (q) {
	pthread_mutex_lock(&q->result_m);
	j->serial = q->curr_serial++;
	q->pending++;
	pthread_mutex_unlock(&q->result_m);
    } else {
	j->serial = 0;
    }

#ifdef DEBUG
    fprintf(stderr, "Dispatching job %p for queue %p, serial %d\n", j, q, j->serial);
#endif

    pthread_mutex_lock(&p->pool_m);

    // Check if queue is full
    while (p->njobs >= p->qsize)
	pthread_cond_wait(&p->full_c, &p->pool_m);

    p->njobs++;

    if (p->tail) {
	p->tail->next = j;
	p->tail = j;
    } else {
	p->head = p->tail = j;
    }

    // Let a worker know we have data.
#ifdef IN_ORDER
    if (p->t_stack_top >= 0 && p->njobs > p->tsize - p->nwaiting)
	pthread_cond_signal(&p->t[p->t_stack_top].pending_c);
#else
    pthread_cond_signal(&p->pending_c);
#endif
    pthread_mutex_unlock(&p->pool_m);

#ifdef DEBUG
    fprintf(stderr, "Dispatched (serial %d)\n", j->serial);
#endif

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %rbx
movl $0x30, %edi
callq 0x69d0
testq %rax, %rax
je 0x657ea
movq %rax, %r14
movq %r13, (%rax)
movq %r12, 0x8(%rax)
movq $0x0, 0x10(%rax)
movq %rbx, 0x18(%rax)
movq %r15, 0x20(%rax)
testq %r15, %r15
je 0x657f4
leaq 0x20(%r15), %r12
movq %r12, %rdi
callq 0x6ae0
movl 0x14(%r15), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x14(%r15)
movl %eax, 0x28(%r14)
incl 0x1c(%r15)
movq %r12, %rdi
callq 0x64f0
jmp 0x657fc
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x65885
movl $0x0, 0x28(%r14)
leaq 0x30(%rbx), %r15
movq %r15, %rdi
callq 0x6ae0
movl 0x4(%rbx), %eax
cmpl (%rbx), %eax
jl 0x65828
leaq 0xb8(%rbx), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x6b90
movl 0x4(%rbx), %eax
cmpl (%rbx), %eax
jge 0x65816
leal 0x1(%rax), %ecx
movl %ecx, 0x4(%rbx)
movq 0x18(%rbx), %rdx
testq %rdx, %rdx
je 0x65841
leaq 0x18(%rbx), %rcx
movq %r14, 0x10(%rdx)
jmp 0x65849
movq %r14, 0x18(%rbx)
leaq 0x10(%rbx), %rcx
movq %r14, (%rcx)
movslq 0xf0(%rbx), %rcx
testq %rcx, %rcx
js 0x6587b
movl 0x20(%rbx), %edx
subl 0x8(%rbx), %edx
cmpl %edx, %eax
jl 0x6587b
movq 0x28(%rbx), %rax
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
leaq (%rax,%rcx), %rdi
addq $0x18, %rdi
callq 0x6040
movq %r15, %rdi
callq 0x64f0
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x6ae0
cmpl $0x0, 0x20(%r14)
jle 0x65a50
movl $0x18, %r15d
xorl %r12d, %r12d
movq 0xe8(%r14), %rax
cmpl $0x0, (%rax,%r12,4)
je 0x65a40
movq 0x28(%r14), %rdi
addq %r15, %rdi
callq 0x6040
incq %r12
movslq 0x20(%r14), %rax
addq $0x50, %r15
cmpq %rax, %r12
jl 0x65a26
leaq 0x58(%r14), %r15
cmpl $0x0, 0x4(%r14)
jne 0x65a65
movl 0x8(%r14), %eax
cmpl 0x20(%r14), %eax
je 0x65a72
movq %r15, %rdi
movq %rbx, %rsi
callq 0x6b90
jmp 0x65a54
movq %rbx, %rdi
callq 0x64f0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x65ace
cmpl $0x0, 0x20(%rbx)
jle 0x65b42
movl $0x10, %r14d
xorl %r15d, %r15d
movq 0x28(%rbx), %rax
movq (%rax,%r14), %rdi
movl $0x2, %esi
callq 0x6990
incq %r15
movslq 0x20(%rbx), %rax
addq $0x50, %r14
cmpq %rax, %r15
jl 0x65aaa
jmp 0x65b42
leaq 0x30(%rbx), %r14
movq %r14, %rdi
callq 0x6ae0
movl $0x1, 0xc(%rbx)
cmpl $0x0, 0x20(%rbx)
jle 0x65b0c
movl $0x18, %r15d
xorl %r12d, %r12d
movq 0x28(%rbx), %rdi
addq %r15, %rdi
callq 0x6040
incq %r12
movslq 0x20(%rbx), %rax
addq $0x50, %r15
cmpq %rax, %r12
jl 0x65af0
movq %r14, %rdi
callq 0x64f0
cmpl $0x0, 0x20(%rbx)
jle 0x65b42
movl $0x10, %r14d
xorl %r15d, %r15d
movq 0x28(%rbx), %rax
movq (%rax,%r14), %rdi
xorl %esi, %esi
callq 0x6610
incq %r15
movslq 0x20(%rbx), %rax
addq $0x50, %r14
cmpq %rax, %r15
jl 0x65b23
leaq 0x30(%rbx), %rdi
callq 0x6860
leaq 0x58(%rbx), %rdi
callq 0x6e60
leaq 0xb8(%rbx), %rdi
callq 0x6e60
cmpl $0x0, 0x20(%rbx)
jle 0x65b8b
movl $0x18, %r14d
xorl %r15d, %r15d
movq 0x28(%rbx), %rdi
addq %r14, %rdi
callq 0x6e60
incq %r15
movslq 0x20(%rbx), %rax
addq $0x50, %r14
cmpq %rax, %r15
jl 0x65b6f
movq 0xe8(%rbx), %rdi
testq %rdi, %rdi
je 0x65b9c
callq 0x68a0
movq 0x28(%rbx), %rdi
callq 0x68a0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x68a0
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x65fe8
movq %rsi, %rdi
movl %eax, %esi
movq %rcx, %rdx
jmp 0x6c00
movq 0x8(%rdx), %rdi
movl %eax, %edx
jmp 0x6ce0
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x66009
movq %rax, %rdi
movq %rcx, %rsi
jmp 0x6810
pushq %rax
movq 0x8(%rsi), %rdi
movq %rax, %rsi
callq 0x6e20
xorl %ecx, %ecx
cmpl $0x1, %eax
sbbl %ecx, %ecx
movl %ecx, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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 0x66047
callq 0x61e0
cmpl $-0x1, %eax
je 0x66083
movl %eax, %ebp
movq (%rbx), %rsi
movl %eax, %edi
callq 0x6150
jmp 0x66088
movq 0x8(%rbx), %rdi
movl (%rdi), %eax
testl %eax, %eax
je 0x6606a
decl %eax
movl %eax, (%rdi)
incq 0x10(%rdi)
movq 0x8(%rdi), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x8(%rdi)
movzbl (%rax), %ebp
jmp 0x66071
callq 0x6cf0
movl %eax, %ebp
cmpl $-0x1, %ebp
je 0x66083
movq 0x8(%rbx), %rsi
movl %ebp, %edi
callq 0x6690
jmp 0x66088
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/icebert[P]pblat/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;
    }

#ifdef HAVE_POPEN
    /*
     * I've no idea why, by gzgets is VERY slow, maybe because it handles
     * arbitrary seeks.
     * popen to gzip -cd is 3 times faster though.
     */
    if (*mode == 'w') {
    } else {
	if (access(path, R_OK) == 0) {
	    sprintf(path2, "gzip -cd < %.*s", 1000, path);
	    if (NULL != (zf->fp = popen(path2, "r")))
		return zf;
	}
	
	sprintf(path2, "gzip -cd < %.*s.gz", 1000, path);
	if (NULL != (zf->fp = popen(path2, "r")))
	    return zf;

	printf("Failed on %s\n", path);
    } else {
	sprintf(path2, "gzip > %.*s", 1000, path);
	if (NULL != (zf->fp = popen(path2, "w")))
	    return zf;
	}
	
	printf("Failed on %s\n", path);
    }
#else
    /* Gzopen instead */
    if ((zf->gz = gzopen(path, mode)))
	return zf;

    sprintf(path2, "%.*s.gz", 1020, path);
    if ((zf->gz = gzopen(path2, mode)))
	return zf;
#endif

    perror(path);

    free(zf);
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movq %rsi, %r15
movq %rdi, %r14
movl $0x10, %edi
callq 0x69d0
testq %rax, %rax
je 0x661ba
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
cmpb $0x7a, (%r15)
je 0x66161
cmpb $0x7a, 0x1(%r15)
je 0x66161
movq %r14, %rdi
movq %r15, %rsi
callq 0x6880
movq %rax, (%rbx)
testq %rax, %rax
je 0x66161
movq %rax, %r12
movq %rsp, %rdi
movl $0x1, %esi
movl $0x2, %edx
movq %rax, %rcx
callq 0x6b20
cmpq $0x2, %rax
jne 0x6613b
cmpb $0x1f, (%rsp)
jne 0x6614a
cmpb $-0x75, 0x1(%rsp)
jne 0x6614a
movq %r12, %rdi
callq 0x66e0
movq $0x0, (%rbx)
movb $0x1, %r13b
jmp 0x6615c
movq %rbx, %rdi
callq 0x68a0
xorl %eax, %eax
xorl %r13d, %r13d
jmp 0x6615c
xorl %r13d, %r13d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x6400
movq %rbx, %rax
testb %r13b, %r13b
je 0x661bc
movq %r14, %rdi
movq %r15, %rsi
callq 0x6b00
movq %rax, 0x8(%rbx)
testq %rax, %rax
jne 0x661a5
leaq 0x3389c(%rip), %rsi     # 0x99a18
movq %rsp, %r12
movq %r12, %rdi
movl $0x3fc, %edx            # imm = 0x3FC
movq %r14, %rcx
xorl %eax, %eax
callq 0x6170
movq %r12, %rdi
movq %r15, %rsi
callq 0x6b00
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x661aa
movq %rbx, %rax
jmp 0x661bc
movq %r14, %rdi
callq 0x6590
movq %rbx, %rdi
callq 0x68a0
xorl %eax, %eax
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq