LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/samtools-0.1.18/bam.c
// Function: bam_header_write
int bam_header_write(bamFile fp, const bam_header_t *header)
{
	char buf[4];
	int32_t i, name_len, x;
	// write "BAM1"
	strncpy(buf, "BAM\001", 4);
	bam_write(fp, buf, 4);
	// write plain text and the number of reference sequences
	if (bam_is_be) {
		x = bam_swap_endian_4(header->l_text);
		bam_write(fp, &x, 4);
		if (header->l_text) bam_write(fp, header->text, header->l_text);
		x = bam_swap_endian_4(header->n_targets);
		bam_write(fp, &x, 4);
	} else {
		bam_write(fp, &header->l_text, 4);
		if (header->l_text) bam_write(fp, header->text, header->l_text);
		bam_write(fp, &header->n_targets, 4);
	}
	// write sequence names and lengths
	for (i = 0; i != header->n_targets; ++i) {
		char *p = header->target_name[i];
		name_len = strlen(p) + 1;
		if (bam_is_be) {
			x = bam_swap_endian_4(name_len);
			bam_write(fp, &x, 4);
		} else bam_write(fp, &name_len, 4);
		bam_write(fp, p, name_len);
		if (bam_is_be) {
			x = bam_swap_endian_4(header->target_len[i]);
			bam_write(fp, &x, 4);
		} else bam_write(fp, &header->target_len[i], 4);
	}
	bgzf_flush(fp);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x14(%rsp), %rsi
movl $0x14d4142, (%rsi)      # imm = 0x14D4142
pushq $0x4
popq %rdx
callq 0x2d6c60
leaq 0x248cbc(%rip), %rax    # 0x43d998
leaq 0x30(%r14), %r12
cmpl $0x0, (%rax)
je 0x1f4d21
movl (%r12), %eax
bswapl %eax
leaq 0xc(%rsp), %r15
movl %eax, (%r15)
pushq $0x4
popq %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2d6c60
movq (%r12), %rdx
testq %rdx, %rdx
je 0x1f4d16
movq 0x40(%r14), %rsi
movq %rbx, %rdi
callq 0x2d6c60
movl (%r14), %eax
bswapl %eax
movl %eax, 0xc(%rsp)
jmp 0x1f4d4a
pushq $0x4
popq %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2d6c60
movq (%r12), %rdx
movq %r14, %r15
testq %rdx, %rdx
je 0x1f4d4a
movq 0x40(%r14), %rsi
movq %rbx, %rdi
callq 0x2d6c60
movq %r14, %r15
pushq $0x4
popq %rbp
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x2d6c60
xorl %r13d, %r13d
xorl %r15d, %r15d
movl (%r14), %eax
cmpq %rax, %r15
je 0x1f4df2
movq 0x8(%r14), %rax
movq (%rax,%r13,2), %r12
movq %r12, %rdi
callq 0x172d0
incl %eax
movl %eax, 0x10(%rsp)
leaq 0x248c0f(%rip), %rcx    # 0x43d998
cmpl $0x0, (%rcx)
leaq 0x10(%rsp), %rsi
je 0x1f4d9e
bswapl %eax
movl %eax, 0xc(%rsp)
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x2d6c60
movl 0x10(%rsp), %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2d6c60
movq 0x10(%r14), %rsi
addq %r13, %rsi
leaq 0x248bd3(%rip), %rax    # 0x43d998
cmpl $0x0, (%rax)
je 0x1f4ddc
movl (%rsi), %eax
bswapl %eax
movl %eax, 0xc(%rsp)
movq %rbx, %rdi
leaq 0xc(%rsp), %rsi
jmp 0x1f4ddf
movq %rbx, %rdi
movl %ebp, %edx
callq 0x2d6c60
incq %r15
addq $0x4, %r13
jmp 0x1f4d60
movq %rbx, %rdi
callq 0x2d6a0d
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/samtools-0.1.18/bam.c
// Function: bam_write1_core
inline int bam_write1_core(bamFile fp, const bam1_core_t *c, int data_len, uint8_t *data)
{
	uint32_t x[8], block_len = data_len + BAM_CORE_SIZE, y;
	int i;
	assert(BAM_CORE_SIZE == 32);
	x[0] = c->tid;
	x[1] = c->pos;
	x[2] = (uint32_t)c->bin<<16 | c->qual<<8 | c->l_qname;
	x[3] = (uint32_t)c->flag<<16 | c->n_cigar;
	x[4] = c->l_qseq;
	x[5] = c->mtid;
	x[6] = c->mpos;
	x[7] = c->isize;
	bgzf_flush_try(fp, 4 + block_len);
	if (bam_is_be) {
		for (i = 0; i < 8; ++i) bam_swap_endian_4p(x + i);
		y = block_len;
		bam_write(fp, bam_swap_endian_4p(&y), 4);
		swap_endian_data(c, data_len, data);
	} else bam_write(fp, &block_len, 4);
	bam_write(fp, x, BAM_CORE_SIZE);
	bam_write(fp, data, data_len);
	if (bam_is_be) swap_endian_data(c, data_len, data);
	return 4 + block_len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %rbx
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %r12
leal 0x20(%r14), %ebp
movl %ebp, 0x8(%rsp)
movq (%rsi), %rax
movq %rax, 0x10(%rsp)
movq 0x8(%rsi), %rax
movl %eax, %ecx
shll $0x10, %ecx
movl %eax, %edx
shrl $0x8, %edx
andl $0xff00, %edx           # imm = 0xFF00
orl %ecx, %edx
movl %eax, %ecx
shrl $0x18, %ecx
orl %edx, %ecx
movl %ecx, 0x18(%rsp)
movq %rax, %rcx
shrq $0x10, %rcx
andl $0xffff0000, %ecx       # imm = 0xFFFF0000
shrq $0x30, %rax
orl %ecx, %eax
movl %eax, 0x1c(%rsp)
movups 0x10(%rsi), %xmm0
movaps %xmm0, 0x20(%rsp)
leal 0x24(%r14), %esi
callq 0x2d6c50
leaq 0x2487dc(%rip), %r13    # 0x43d998
cmpl $0x0, (%r13)
je 0x1f51fe
xorl %eax, %eax
cmpq $0x8, %rax
je 0x1f51da
movl 0x10(%rsp,%rax,4), %ecx
bswapl %ecx
movl %ecx, 0x10(%rsp,%rax,4)
incq %rax
jmp 0x1f51c5
bswapl %ebp
leaq 0xc(%rsp), %rsi
movl %ebp, (%rsi)
pushq $0x4
popq %rdx
movq %r12, %rdi
callq 0x2d6c60
movq %r15, %rdi
movl %r14d, %esi
movq %rbx, %rdx
callq 0x1f4f86
jmp 0x1f520e
leaq 0x8(%rsp), %rsi
pushq $0x4
popq %rdx
movq %r12, %rdi
callq 0x2d6c60
leaq 0x10(%rsp), %rsi
pushq $0x20
popq %rdx
movq %r12, %rdi
callq 0x2d6c60
movq %r12, %rdi
movq %rbx, %rsi
movl %r14d, %edx
callq 0x2d6c60
cmpl $0x0, (%r13)
je 0x1f5241
movq %r15, %rdi
movl %r14d, %esi
movq %rbx, %rdx
callq 0x1f4f86
movl 0x8(%rsp), %eax
addl $0x4, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/samtools-0.1.18/bam.c
// Function: bam_validate1
int bam_validate1(const bam_header_t *header, const bam1_t *b)
{
	char *s;

	if (b->core.tid < -1 || b->core.mtid < -1) return 0;
	if (header && (b->core.tid >= header->n_targets || b->core.mtid >= header->n_targets)) return 0;

	if (b->data_len < b->core.l_qname) return 0;
	s = memchr(bam1_qname(b), '\0', b->core.l_qname);
	if (s != &bam1_qname(b)[b->core.l_qname-1]) return 0;

	// FIXME: Other fields could also be checked, especially the auxiliary data

	return 1;
}

// Assembly:
movl (%rsi), %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
jl 0x1f5c5c
movl 0x14(%rsi), %edx
cmpl $-0x1, %edx
jl 0x1f5c5c
testq %rdi, %rdi
je 0x1f5c20
movl (%rdi), %edi
cmpl %edi, %ecx
setge %cl
cmpl %edi, %edx
setge %dl
orb %cl, %dl
jne 0x1f5c5c
movl 0x8(%rsi), %ecx
shrl $0x18, %ecx
cmpl %ecx, 0x24(%rsi)
jl 0x1f5c5c
pushq %r14
pushq %rbx
pushq %rax
movq 0x30(%rsi), %rbx
movl %ecx, %r14d
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x17850
movq %rax, %rcx
leaq (%rbx,%r14), %rdx
decq %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/samtools-0.1.18/bam.c
// Function: bam_get_library
const char *bam_get_library(bam_header_t *h, const bam1_t *b)
{
	const uint8_t *rg;
	if (h->dict == 0) h->dict = sam_header_parse2(h->text);
	if (h->rg2lib == 0) h->rg2lib = sam_header2tbl(h->dict, "RG", "ID", "LB");
	rg = bam_aux_get(b, "RG");
	return (rg == 0)? 0 : sam_tbl_get(h->rg2lib, (const char*)(rg + 1));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rdi), %rax
testq %rax, %rax
jne 0x1f5c7d
movq 0x40(%rbx), %rdi
callq 0x1fa50b
movq %rax, 0x18(%rbx)
cmpq $0x0, 0x28(%rbx)
jne 0x1f5ca5
leaq 0x172341(%rip), %rsi    # 0x367fcc
leaq 0x184da5(%rip), %rdx    # 0x37aa37
leaq 0x174947(%rip), %rcx    # 0x36a5e0
movq %rax, %rdi
callq 0x1fa805
movq %rax, 0x28(%rbx)
leaq 0x172320(%rip), %rsi    # 0x367fcc
movq %r14, %rdi
callq 0x2d7518
testq %rax, %rax
je 0x1f5ccf
movq 0x28(%rbx), %rdi
incq %rax
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x1faf94
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/samtools-0.1.18/sam.c
// Function: samwrite
int samwrite(samfile_t *fp, const bam1_t *b)
{
	if (fp == 0 || (fp->type & TYPE_READ)) return -1; // not open for writing
	if (fp->type & TYPE_BAM) return bam_write1(fp->x.bam, b);
	else {
		char *s = bam_format1_core(fp->header, b, fp->type>>2&3);
		int l = strlen(s);
		fputs(s, fp->x.tamw); fputc('\n', fp->x.tamw);
		free(s);
		return l + 1;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
pushq $-0x1
popq %r14
testq %rdi, %rdi
je 0x1f812f
movq %rdi, %rbx
movl (%rdi), %edx
testb $0x2, %dl
jne 0x1f812f
testb $0x1, %dl
jne 0x1f8138
movq 0x10(%rbx), %rdi
shrl $0x2, %edx
andl $0x3, %edx
callq 0x1f5263
movq %rax, %r15
movq %rax, %rdi
callq 0x172d0
movq %rax, %r14
movq 0x8(%rbx), %rsi
movq %r15, %rdi
callq 0x17870
movq 0x8(%rbx), %rsi
pushq $0xa
popq %rdi
callq 0x17930
movq %r15, %rdi
callq 0x17f48
incl %r14d
movl %r14d, %eax
popq %rbx
popq %r14
popq %r15
retq
movq 0x8(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1f5257
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/samtools-0.1.18/sam.c
// Function: sampileup
int sampileup(samfile_t *fp, int mask, bam_pileup_f func, void *func_data)
{
	bam_plbuf_t *buf;
	int ret;
	bam1_t *b;
	b = bam_init1();
	buf = bam_plbuf_init(func, func_data);
	bam_plbuf_set_mask(buf, mask);
	while ((ret = samread(fp, b)) >= 0)
		bam_plbuf_push(b, buf);
	bam_plbuf_push(0, buf);
	bam_plbuf_destroy(buf);
	bam_destroy1(b);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r15
movq %rdx, %r12
movl %esi, %ebp
movq %rdi, %r14
pushq $0x1
popq %rdi
pushq $0x38
popq %rsi
callq 0x174c0
movq %rax, %rbx
movq %r12, %rdi
movq %r15, %rsi
callq 0x1f8d1a
movq %rax, %r15
movq %rax, %rdi
movl %ebp, %esi
callq 0x1f8d50
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f809f
testl %eax, %eax
js 0x1f819b
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1f8d66
jmp 0x1f817f
xorl %edi, %edi
movq %r15, %rsi
callq 0x1f8d66
movq %r15, %rdi
callq 0x1f8dd3
testq %rbx, %rbx
je 0x1f81c3
movq 0x30(%rbx), %rdi
callq 0x17f48
movq %rbx, %rdi
callq 0x17f48
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/samtools-0.1.18/sam.c
// Function: samfaipath
char *samfaipath(const char *fn_ref)
{
	char *fn_list = 0;
	if (fn_ref == 0) return 0;
	fn_list = calloc(strlen(fn_ref) + 5, 1);
	strcat(strcpy(fn_list, fn_ref), ".fai");
	if (access(fn_list, R_OK) == -1) { // fn_list is unreadable
		if (access(fn_ref, R_OK) == -1) {
			fprintf(stderr, "[samfaipath] fail to read file %s.\n", fn_ref);
		} else {
			if (bam_verbose >= 3) fprintf(stderr, "[samfaipath] build FASTA index...\n");
			if (fai_build(fn_ref) == -1) {
				fprintf(stderr, "[samfaipath] fail to build FASTA index.\n");
				free(fn_list); fn_list = 0;
			}
		}
	}
	return fn_list;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x1f826e
movq %rdi, %r14
callq 0x172d0
leaq 0x5(%rax), %rdi
pushq $0x1
popq %rsi
callq 0x174c0
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq 0x17730
movq %rbx, %rdi
callq 0x172d0
movl $0x6961662e, (%rbx,%rax) # imm = 0x6961662E
movb $0x0, 0x4(%rbx,%rax)
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0x17cb0
cmpl $-0x1, %eax
jne 0x1f8270
pushq $0x4
popq %rsi
movq %r14, %rdi
callq 0x17cb0
cmpl $-0x1, %eax
je 0x1f827b
leaq 0x241de8(%rip), %rax    # 0x43a020
cmpl $0x3, (%rax)
jge 0x1f8298
movq %r14, %rdi
callq 0x1f9a98
cmpl $-0x1, %eax
jne 0x1f8270
movq 0x23fd17(%rip), %rax    # 0x437f68
movq (%rax), %rcx
leaq 0x172880(%rip), %rdi    # 0x36aadb
pushq $0x28
popq %rsi
pushq $0x1
popq %rdx
callq 0x17f00
movq %rbx, %rdi
callq 0x17f48
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x23fce6(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x172808(%rip), %rsi    # 0x36aa94
movq %r14, %rdx
xorl %eax, %eax
callq 0x17a50
jmp 0x1f8270
movq 0x23fcc9(%rip), %rax    # 0x437f68
movq (%rax), %rcx
leaq 0x17280f(%rip), %rdi    # 0x36aab8
pushq $0x22
popq %rsi
pushq $0x1
popq %rdx
callq 0x17f00
jmp 0x1f823d
nop
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/samtools-0.1.18/bam_pileup.c
// Function: bam_plp_init
bam_plp_t bam_plp_init(bam_plp_auto_f func, void *data)
{
	bam_plp_t iter;
	iter = calloc(1, sizeof(struct __bam_plp_t));
	iter->mp = mp_init();
	iter->head = iter->tail = mp_alloc(iter->mp);
	iter->dummy = mp_alloc(iter->mp);
	iter->max_tid = iter->max_pos = -1;
	iter->flag_mask = BAM_DEF_MASK;
	iter->maxcnt = 8000;
	if (func) {
		iter->func = func;
		iter->data = data;
		iter->b = bam_init1();
	}
	return iter;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
pushq $0x1
popq %r12
pushq $0x68
popq %rsi
movq %r12, %rdi
callq 0x174c0
movq %rax, %rbx
pushq $0x18
popq %rsi
movq %r12, %rdi
callq 0x174c0
movq %rax, %r12
movq %rax, (%rbx)
movq %rax, %rdi
callq 0x1f8343
movq %rax, 0x10(%rbx)
movq %rax, 0x8(%rbx)
movq %r12, %rdi
callq 0x1f8343
movq %rax, 0x18(%rbx)
orq $-0x1, 0x28(%rbx)
movl $0x704, 0x34(%rbx)      # imm = 0x704
movl $0x1f40, 0x40(%rbx)     # imm = 0x1F40
testq %r15, %r15
je 0x1f8334
movq %r15, 0x58(%rbx)
movq %r14, 0x60(%rbx)
pushq $0x1
popq %rdi
pushq $0x38
popq %rsi
callq 0x174c0
movq %rax, 0x50(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/samtools-0.1.18/bam_pileup.c
// Function: bam_pileup_file
int bam_pileup_file(bamFile fp, int mask, bam_pileup_f func, void *func_data)
{
	bam_plbuf_t *buf;
	int ret;
	bam1_t *b;
	b = bam_init1();
	buf = bam_plbuf_init(func, func_data);
	bam_plbuf_set_mask(buf, mask);
	while ((ret = bam_read1(fp, b)) >= 0)
		bam_plbuf_push(b, buf);
	bam_plbuf_push(0, buf);
	bam_plbuf_destroy(buf);
	bam_destroy1(b);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r15
movq %rdx, %r12
movl %esi, %ebp
movq %rdi, %r14
pushq $0x1
popq %rdi
pushq $0x38
popq %rsi
callq 0x174c0
movq %rax, %rbx
movq %r12, %rdi
movq %r15, %rsi
callq 0x1f8d1a
movq %rax, %r15
movq (%rax), %rax
movl %ebp, %ecx
orl $0x4, %ecx
testl %ebp, %ebp
movl $0x704, %edx            # imm = 0x704
cmovnsl %ecx, %edx
movl %edx, 0x34(%rax)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f4e0b
testl %eax, %eax
js 0x1f8ce7
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1f8d66
jmp 0x1f8ccb
xorl %edi, %edi
movq %r15, %rsi
callq 0x1f8d66
movq %r15, %rdi
callq 0x1f8dd3
testq %rbx, %rbx
je 0x1f8d0f
movq 0x30(%rbx), %rdi
callq 0x17f48
movq %rbx, %rdi
callq 0x17f48
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/samtools-0.1.18/bam_pileup.c
// Function: bam_plbuf_init
bam_plbuf_t *bam_plbuf_init(bam_pileup_f func, void *data)
{
	bam_plbuf_t *buf;
	buf = calloc(1, sizeof(bam_plbuf_t));
	buf->iter = bam_plp_init(0, 0);
	buf->func = func;
	buf->data = data;
	return buf;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x174c0
movq %rax, %r15
xorl %edi, %edi
xorl %esi, %esi
callq 0x1f82b8
movq %rax, (%r15)
movq %r14, 0x8(%r15)
movq %rbx, 0x10(%r15)
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/samtools-0.1.18/bam_pileup.c
// Function: bam_plbuf_push
int bam_plbuf_push(const bam1_t *b, bam_plbuf_t *buf)
{
	int ret, n_plp, tid, pos;
	const bam_pileup1_t *plp;
	ret = bam_plp_push(buf->iter, b);
	if (ret < 0) return ret;
	while ((plp = bam_plp_next(buf->iter, &tid, &pos, &n_plp)) != 0)
		buf->func(tid, pos, n_plp, plp, buf->data);
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %rsi
movq (%rbx), %rdi
callq 0x1f89a2
testl %eax, %eax
js 0x1f8dc4
leaq 0x10(%rsp), %r14
leaq 0xc(%rsp), %r15
leaq 0x14(%rsp), %r12
movq (%rbx), %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x1f847c
testq %rax, %rax
je 0x1f8dc0
movl 0x10(%rsp), %edi
movl 0xc(%rsp), %esi
movl 0x14(%rsp), %edx
movq 0x10(%rbx), %r8
movq %rax, %rcx
callq *0x8(%rbx)
jmp 0x1f8d92
xorl %eax, %eax
jmp 0x1f8dc7
pushq $-0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/samtools-0.1.18/bam_pileup.c
// Function: bam_mplp_init
bam_mplp_t bam_mplp_init(int n, bam_plp_auto_f func, void **data)
{
	int i;
	bam_mplp_t iter;
	iter = calloc(1, sizeof(struct __bam_mplp_t));
	iter->pos = calloc(n, 8);
	iter->n_plp = calloc(n, sizeof(int));
	iter->plp = calloc(n, sizeof(void*));
	iter->iter = calloc(n, sizeof(void*));
	iter->n = n;
	iter->min = (uint64_t)-1;
	for (i = 0; i < n; ++i) {
		iter->iter[i] = bam_plp_init(func, data[i]);
		iter->pos[i] = iter->min;
	}
	return iter;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
pushq $0x1
popq %rdi
pushq $0x30
popq %rsi
callq 0x174c0
movq %rax, %r15
movslq %ebp, %r12
pushq $0x8
popq %rbp
movq %r12, %rdi
movq %rbp, %rsi
callq 0x174c0
movq %rax, %r13
movq %rax, 0x10(%r15)
pushq $0x4
popq %rsi
movq %r12, %rdi
callq 0x174c0
movq %rax, 0x20(%r15)
movq %r12, %rdi
movq %rbp, %rsi
callq 0x174c0
movq %rax, 0x28(%r15)
movq %r12, %rdi
movq %rbp, %rsi
callq 0x174c0
movq %rax, %rbp
movq %rax, 0x18(%r15)
movl %r12d, (%r15)
movq %r15, (%rsp)
orq $-0x1, 0x8(%r15)
xorl %r15d, %r15d
testl %r12d, %r12d
cmovlel %r15d, %r12d
cmpq %r15, %r12
je 0x1f8e90
movq (%rbx,%r15,8), %rsi
movq %r14, %rdi
callq 0x1f82b8
movq %rax, (%rbp,%r15,8)
orq $-0x1, (%r13,%r15,8)
incq %r15
jmp 0x1f8e6f
movq (%rsp), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/samtools-0.1.18/faidx.c
// Function: fai_destroy
void fai_destroy(faidx_t *fai)
{
	int i;
	for (i = 0; i < fai->n; ++i) free(fai->name[i]);
	free(fai->name);
	kh_destroy(s, fai->hash);
	if (fai->rz) razf_close(fai->rz);
	free(fai);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movslq 0x8(%rbx), %rax
movq 0x10(%rbx), %rdi
cmpq %rax, %r14
jge 0x1f9812
movq (%rdi,%r14,8), %rdi
callq 0x17f48
incq %r14
jmp 0x1f97f7
callq 0x17f48
movq 0x18(%rbx), %r14
testq %r14, %r14
je 0x1f9843
movq 0x18(%r14), %rdi
callq 0x17f48
movq 0x10(%r14), %rdi
callq 0x17f48
movq 0x20(%r14), %rdi
callq 0x17f48
movq %r14, %rdi
callq 0x17f48
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x1f9850
callq 0x2d8f44
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x17f48
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/samtools-0.1.18/faidx.c
// Function: fai_save
void fai_save(const faidx_t *fai, FILE *fp)
{
	khint_t k;
	int i;
	for (i = 0; i < fai->n; ++i) {
		faidx1_t x;
		k = kh_get(s, fai->hash, fai->name[i]);
		x = kh_value(fai->hash, k);
#ifdef _WIN32
		fprintf(fp, "%s\t%d\t%ld\t%d\t%d\n", fai->name[i], (int)x.len, (long)x.offset, (int)x.line_blen, (int)x.line_len);
#else
		fprintf(fp, "%s\t%d\t%lld\t%d\t%d\n", fai->name[i], (int)x.len, (long long)x.offset, (int)x.line_blen, (int)x.line_len);
#endif
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x1714f0(%rip), %r15    # 0x36ad67
xorl %ebp, %ebp
movslq 0x8(%r14), %rax
cmpq %rax, %rbp
jge 0x1f98cd
movq 0x10(%r14), %rax
movq 0x18(%r14), %r12
movq (%rax,%rbp,8), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x1f98dc
movq 0x20(%r12), %rdx
movl %eax, %eax
imulq $0x18, %rax, %rax
movl (%rdx,%rax), %esi
movl 0x4(%rdx,%rax), %r9d
movl 0x8(%rdx,%rax), %ecx
movq 0x10(%rdx,%rax), %r8
movl %esi, (%rsp)
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x17a50
incq %rbp
jmp 0x1f9879
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/samtools-0.1.18/faidx.c
// Function: fai_read
faidx_t *fai_read(FILE *fp)
{
	faidx_t *fai;
	char *buf, *p;
	int len, line_len, line_blen;
#ifdef _WIN32
	long offset;
#else
	long long offset;
#endif
	fai = (faidx_t*)calloc(1, sizeof(faidx_t));
	fai->hash = kh_init(s);
	buf = (char*)calloc(0x10000, 1);
	while (!feof(fp) && fgets(buf, 0x10000, fp)) {
		for (p = buf; *p && isgraph(*p); ++p);
		*p = 0; ++p;
#ifdef _WIN32
		sscanf(p, "%d%ld%d%d", &len, &offset, &line_blen, &line_len);
#else
		sscanf(p, "%d%lld%d%d", &len, &offset, &line_blen, &line_len);
#endif
		fai_insert_index(fai, buf, len, line_len, line_blen, offset);
	}
	free(buf);
	return fai;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
pushq $0x1
popq %r15
pushq $0x20
popq %rsi
movq %r15, %rdi
callq 0x174c0
movq %rax, %r14
callq 0x1fa22c
movq %rax, 0x18(%r14)
movl $0x10000, %edi          # imm = 0x10000
movq %r15, %rsi
callq 0x174c0
movq %rax, %r15
movq %rax, %r12
incq %r12
movq %rbx, %rdi
callq 0x17b70
testl %eax, %eax
jne 0x1f9a7e
movq %r15, %rdi
movl $0x10000, %esi          # imm = 0x10000
movq %rbx, %rdx
callq 0x17bc0
testq %rax, %rax
je 0x1f9a7e
movq %r12, %rbp
movsbq -0x1(%rbp), %r13
testq %r13, %r13
je 0x1f9a33
callq 0x17820
movq (%rax), %rax
cmpw $0x0, (%rax,%r13,2)
jns 0x1f9a33
incq %rbp
jmp 0x1f9a14
movb $0x0, -0x1(%rbp)
movq %rbp, %rdi
leaq 0x171338(%rip), %rsi    # 0x36ad79
leaq 0xc(%rsp), %rdx
leaq 0x10(%rsp), %rcx
leaq 0x4(%rsp), %r8
leaq 0x8(%rsp), %r9
xorl %eax, %eax
callq 0x177b0
movl 0xc(%rsp), %edx
movl 0x8(%rsp), %ecx
movl 0x4(%rsp), %r8d
movq 0x10(%rsp), %r9
movq %r14, %rdi
movq %r15, %rsi
callq 0x1f9326
jmp 0x1f99ec
movq %r15, %rdi
callq 0x17f48
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/samtools-0.1.18/faidx.c
// Function: fai_build
int fai_build(const char *fn)
{
	char *str;
	RAZF *rz;
	FILE *fp;
	faidx_t *fai;
	str = (char*)calloc(strlen(fn) + 5, 1);
	sprintf(str, "%s.fai", fn);
	rz = razf_open(fn, "r");
	if (rz == 0) {
		fprintf(stderr, "[fai_build] fail to open the FASTA file %s\n",fn);
		free(str);
		return -1;
	}
	fai = fai_build_core(rz);
	razf_close(rz);
	fp = fopen(str, "wb");
	if (fp == 0) {
		fprintf(stderr, "[fai_build] fail to write FASTA index %s\n",str);
		fai_destroy(fai); free(str);
		return -1;
	}
	fai_save(fai, fp);
	fclose(fp);
	free(str);
	fai_destroy(fai);
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
callq 0x172d0
leaq 0x5(%rax), %rdi
pushq $0x1
popq %rsi
callq 0x174c0
movq %rax, %rbx
leaq 0x1712c9(%rip), %rsi    # 0x36ad84
movq %rax, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x17120
leaq 0x10135e(%rip), %rsi    # 0x2fae2d
movq %r14, %rdi
callq 0x2d890f
testq %rax, %rax
je 0x1f9b34
movq %rax, %r15
movq %rax, %rdi
callq 0x1f9014
movq %rax, %r14
movq %r15, %rdi
callq 0x2d8f44
leaq 0xfbff8(%rip), %rsi     # 0x2f5af1
movq %rbx, %rdi
callq 0x17860
testq %rax, %rax
je 0x1f9b51
movq %rax, %r15
movq %r14, %rdi
movq %rax, %rsi
callq 0x1f985f
movq %r15, %rdi
callq 0x177c0
movq %rbx, %rdi
callq 0x17f48
movq %r14, %rdi
callq 0x1f97ed
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
movq 0x23e42d(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x171246(%rip), %rsi    # 0x36ad8b
movq %r14, %rdx
xorl %eax, %eax
callq 0x17a50
jmp 0x1f9b74
movq 0x23e410(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x171255(%rip), %rsi    # 0x36adb7
movq %rbx, %rdx
xorl %eax, %eax
callq 0x17a50
movq %r14, %rdi
callq 0x1f97ed
movq %rbx, %rdi
callq 0x17f48
pushq $-0x1
popq %rax
jmp 0x1f9b2e
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/samtools-0.1.18/faidx.c
// Function: fai_load
faidx_t *fai_load(const char *fn)
{
	char *str;
	FILE *fp;
	faidx_t *fai;
	str = (char*)calloc(strlen(fn) + 5, 1);
	sprintf(str, "%s.fai", fn);

#ifdef _USE_KNETFILE
    if (strstr(fn, "ftp://") == fn || strstr(fn, "http://") == fn)
    {
        fp = download_and_open(str);
        if ( !fp )
        {
            fprintf(stderr, "[fai_load] failed to open remote FASTA index %s\n", str);
            free(str);
            return 0;
        }
    }
    else
#endif
        fp = fopen(str, "rb");
	if (fp == 0) {
		fprintf(stderr, "[fai_load] build FASTA index.\n");
		fai_build(fn);
		fp = fopen(str, "rb");
		if (fp == 0) {
			fprintf(stderr, "[fai_load] fail to open FASTA index.\n");
			free(str);
			return 0;
		}
	}

	fai = fai_read(fp);
	fclose(fp);

	fai->rz = razf_open(fn, "rb");
	free(str);
	if (fai->rz == 0) {
		fprintf(stderr, "[fai_load] fail to open FASTA file.\n");
		return 0;
	}
	return fai;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x172d0
leaq 0x5(%rax), %rdi
pushq $0x1
popq %rsi
callq 0x174c0
movq %rax, %rbx
leaq 0x1711dd(%rip), %rsi    # 0x36ad84
movq %rax, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x17120
leaq 0x14bee2(%rip), %rsi    # 0x345a9d
movq %rbx, %rdi
callq 0x17860
testq %rax, %rax
je 0x1f9c0f
movq %rax, %r12
movq %rax, %rdi
callq 0x1f99aa
movq %rax, %r15
movq %r12, %rdi
callq 0x177c0
leaq 0x14beb8(%rip), %rsi    # 0x345a9d
movq %r14, %rdi
callq 0x2d890f
movq %rax, %r14
movq %rax, (%r15)
movq %rbx, %rdi
callq 0x17f48
testq %r14, %r14
je 0x1f9c66
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x23e352(%rip), %r15    # 0x437f68
movq (%r15), %rcx
leaq 0x1711c1(%rip), %rdi    # 0x36ade1
pushq $0x1e
popq %rsi
pushq $0x1
popq %rdx
callq 0x17f00
movq %r14, %rdi
callq 0x1f9a98
leaq 0x14be63(%rip), %rsi    # 0x345a9d
movq %rbx, %rdi
callq 0x17860
testq %rax, %rax
jne 0x1f9bc8
movq (%r15), %rcx
leaq 0x1711af(%rip), %rdi    # 0x36ae00
pushq $0x25
popq %rsi
pushq $0x1
popq %rdx
callq 0x17f00
movq %rbx, %rdi
callq 0x17f48
jmp 0x1f9c82
movq 0x23e2fb(%rip), %rax    # 0x437f68
movq (%rax), %rcx
leaq 0x1711af(%rip), %rdi    # 0x36ae26
pushq $0x24
popq %rsi
pushq $0x1
popq %rdx
callq 0x17f00
xorl %r15d, %r15d
jmp 0x1f9c00
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/samtools-0.1.18/faidx.c
// Function: faidx_main
int faidx_main(int argc, char *argv[])
{
	if (argc == 1) {
		fprintf(stderr, "Usage: faidx <in.fasta> [<reg> [...]]\n");
		return 1;
	} else {
		if (argc == 2) fai_build(argv[1]);
		else {
			int i, j, k, l;
			char *s;
			faidx_t *fai;
			fai = fai_load(argv[1]);
			if (fai == 0) return 1;
			for (i = 2; i != argc; ++i) {
				printf(">%s\n", argv[i]);
				s = fai_fetch(fai, argv[i], &l);
				for (j = 0; j < l; j += 60) {
					for (k = 0; k < 60 && k < l - j; ++k)
						putchar(s[j + k]);
					putchar('\n');
				}
				free(s);
			}
			fai_destroy(fai);
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
cmpl $0x2, %edi
je 0x1fa0ab
movl %edi, %ebp
cmpl $0x1, %edi
je 0x1fa0c4
movq 0x8(%rbx), %rdi
callq 0x1f9b81
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x1fa0e0
movl %ebp, %eax
movq %rax, 0x20(%rsp)
pushq $0x2
popq %r14
pushq $0xa
popq %rbp
movq %rbx, 0x18(%rsp)
cmpq 0x20(%rsp), %r14
je 0x1fa0b6
movq (%rbx,%r14,8), %rsi
leaq 0xf01a9(%rip), %rdi     # 0x2ea1d3
xorl %eax, %eax
callq 0x17070
movq %r14, 0x30(%rsp)
movq (%rbx,%r14,8), %rsi
movq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x1f9c8a
movq %rax, %r13
movslq 0xc(%rsp), %r14
movq %rax, 0x28(%rsp)
xorl %ebx, %ebx
movq %r14, %r15
subq %rbx, %r15
jle 0x1fa08f
xorl %r12d, %r12d
cmpq $0x3b, %r12
ja 0x1fa07e
cmpq %r15, %r12
jge 0x1fa07e
movsbl (%r13,%r12), %edi
callq 0x179c0
incq %r12
jmp 0x1fa063
movl %ebp, %edi
callq 0x179c0
addq $0x3c, %rbx
addq $0x3c, %r13
jmp 0x1fa058
movq 0x28(%rsp), %rdi
callq 0x17f48
movq 0x30(%rsp), %r14
incq %r14
movq 0x18(%rsp), %rbx
jmp 0x1fa014
movq 0x8(%rbx), %rdi
callq 0x1f9a98
jmp 0x1fa0c0
movq 0x10(%rsp), %rdi
callq 0x1f97ed
xorl %eax, %eax
jmp 0x1fa0e3
movq 0x23de9d(%rip), %rax    # 0x437f68
movq (%rax), %rcx
leaq 0x170d76(%rip), %rdi    # 0x36ae4b
pushq $0x26
popq %rsi
pushq $0x1
popq %rdx
callq 0x17f00
pushq $0x1
popq %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/samtools-0.1.18/faidx.c
// Function: faidx_fetch_seq
char *faidx_fetch_seq(const faidx_t *fai, char *c_name, int p_beg_i, int p_end_i, int *len)
{
	int l;
	char c;
    khiter_t iter;
    faidx1_t val;
	char *seq=NULL;

    // Adjust position
    iter = kh_get(s, fai->hash, c_name);
    if(iter == kh_end(fai->hash)) return 0;
    val = kh_value(fai->hash, iter);
	if(p_end_i < p_beg_i) p_beg_i = p_end_i;
    if(p_beg_i < 0) p_beg_i = 0;
    else if(val.len <= p_beg_i) p_beg_i = val.len - 1;
    if(p_end_i < 0) p_end_i = 0;
    else if(val.len <= p_end_i) p_end_i = val.len - 1;

    // Now retrieve the sequence 
	l = 0;
	seq = (char*)malloc(p_end_i - p_beg_i + 2);
	razf_seek(fai->rz, val.offset + p_beg_i / val.line_blen * val.line_len + p_beg_i % val.line_blen, SEEK_SET);
	while (razf_read(fai->rz, &c, 1) == 1 && l < p_end_i - p_beg_i + 1)
		if (isgraph(c)) seq[l++] = c;
	seq[l] = '\0';
	*len = l;
	return seq;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %rbx
movl %ecx, %ebp
movl %edx, %r15d
movq %rdi, %r14
movq 0x18(%rdi), %r13
movq %r13, %rdi
callq 0x1f98dc
xorl %r12d, %r12d
cmpl (%r13), %eax
jne 0x1fa12b
xorl %ecx, %ecx
jmp 0x1fa21a
movq %rbx, 0x20(%rsp)
movq 0x20(%r13), %rcx
movl %eax, %eax
imulq $0x18, %rax, %rdx
movq 0x8(%rcx,%rdx), %rax
cmpl %r15d, %ebp
cmovll %ebp, %r15d
testl %r15d, %r15d
js 0x1fa15a
movl %r15d, %esi
movl %r15d, %r12d
cmpq %rsi, %rax
jg 0x1fa15a
leal -0x1(%rax), %r12d
movslq (%rcx,%rdx), %rsi
movq %rsi, 0x18(%rsp)
movl 0x4(%rcx,%rdx), %esi
movl %esi, 0xc(%rsp)
movq 0x10(%rcx,%rdx), %r13
xorl %ebx, %ebx
movl $0x0, %r15d
testl %ebp, %ebp
js 0x1fa18b
movl %ebp, %ecx
movl %ebp, %r15d
cmpq %rcx, %rax
jg 0x1fa18b
decl %eax
movl %eax, %r15d
subl %r12d, %r15d
leal 0x2(%r15), %eax
movslq %eax, %rdi
callq 0x17f50
movq %rax, 0x10(%rsp)
movq (%r14), %rdi
movl %r12d, %eax
cltd
idivl 0xc(%rsp)
cltq
imulq 0x18(%rsp), %rax
movslq %edx, %rcx
addq %rcx, %r13
addq %rax, %r13
movq %r13, %rsi
xorl %edx, %edx
callq 0x2d8e09
leaq 0xb(%rsp), %r12
pushq $0x1
popq %rbp
movq (%r14), %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x2d8a3a
movl %ebx, %r13d
cmpl $0x1, %eax
jne 0x1fa209
cmpl %r15d, %ebx
jg 0x1fa209
callq 0x17820
movq (%rax), %rcx
movsbq 0xb(%rsp), %rax
cmpw $0x0, (%rcx,%rax,2)
jns 0x1fa1cd
incl %ebx
movq 0x10(%rsp), %rcx
movb %al, (%rcx,%r13)
jmp 0x1fa1cd
movq 0x10(%rsp), %rcx
movb $0x0, (%rcx,%r13)
movq 0x20(%rsp), %rax
movl %ebx, (%rax)
movq %rcx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/samtools-0.1.18/sam_header.c
// Function: tag_exists
static int tag_exists(const char *tag, const char **tags)
{
    int itag=0;
    if ( !tags ) return -1;
    while ( tags[itag] )
    {
        if ( tags[itag][0]==tag[0] && tags[itag][1]==tag[1] ) return itag; 
        itag++;
    }
    return -1;
}

// Assembly:
xorl %ecx, %ecx
leaq 0x23f0af(%rip), %rdx    # 0x43a480
pushq $-0x1
popq %rax
movq (%rdx,%rcx,8), %rsi
testq %rsi, %rsi
je 0x1fb3f6
movb (%rsi), %r8b
cmpb (%rdi), %r8b
jne 0x1fb3ef
movb 0x1(%rsi), %sil
cmpb 0x1(%rdi), %sil
je 0x1fb3f4
incq %rcx
jmp 0x1fb3d4
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: XML_ParserCreate_MM
XML_Parser XMLCALL
XML_ParserCreate_MM(const XML_Char *encodingName,
                    const XML_Memory_Handling_Suite *memsuite,
                    const XML_Char *nameSep)
{
  XML_Parser parser = parserCreate(encodingName, memsuite, nameSep, NULL);
  if (parser != NULL && ns) {
    /* implicit context only set for root parser, since child
       parsers (i.e. external entity parsers) will inherit it
    */
    if (!setContext(parser, implicitContext)) {
      XML_ParserFree(parser);
      return NULL;
    }
  }
  return parser;
}

// Assembly:
pushq %rbx
callq 0x1fb4ec
testq %rax, %rax
je 0x1fb4d3
movq %rax, %rbx
cmpb $0x0, 0x1c8(%rax)
je 0x1fb4d5
leaq 0x16fed1(%rip), %rsi    # 0x36b390
movq %rbx, %rdi
callq 0x1fb78d
testb %al, %al
jne 0x1fb4d5
movq %rbx, %rdi
callq 0x1fba21
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: XML_ParserReset
XML_Bool XMLCALL
XML_ParserReset(XML_Parser parser, const XML_Char *encodingName)
{
  TAG *tStk;
  OPEN_INTERNAL_ENTITY *openEntityList;
  if (parentParser)
    return XML_FALSE;
  /* move tagStack to freeTagList */
  tStk = tagStack;
  while (tStk) {
    TAG *tag = tStk;
    tStk = tStk->parent;
    tag->parent = freeTagList;
    moveToFreeBindingList(parser, tag->bindings);
    tag->bindings = NULL;
    freeTagList = tag;
  }
  /* move openInternalEntities to freeInternalEntities */
  openEntityList = openInternalEntities;
  while (openEntityList) {
    OPEN_INTERNAL_ENTITY *openEntity = openEntityList;
    openEntityList = openEntity->next;
    openEntity->next = freeInternalEntities;
    freeInternalEntities = openEntity;
  }
  moveToFreeBindingList(parser, inheritedBindings);
  FREE(unknownEncodingMem);
  if (unknownEncodingRelease)
    unknownEncodingRelease(unknownEncodingData);
  poolClear(&tempPool);
  poolClear(&temp2Pool);
  parserInit(parser, encodingName);
  dtdReset(_dtd, &parser->m_mem);
  return setContext(parser, implicitContext);
}

// Assembly:
cmpq $0x0, 0x370(%rdi)
je 0x1fbc1b
xorl %eax, %eax
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x2a0(%rdi), %r15
testq %r15, %r15
je 0x1fbc63
movq (%r15), %r12
movq 0x50(%r15), %rsi
movq 0x2a8(%rbx), %rax
movq %rax, (%r15)
movq %rbx, %rdi
callq 0x1fbdc3
andq $0x0, 0x50(%r15)
movq %r15, 0x2a8(%rbx)
movq %r12, %r15
jmp 0x1fbc34
movq 0x228(%rbx), %rax
testq %rax, %rax
je 0x1fbc8a
movq 0x10(%rax), %rcx
movq 0x230(%rbx), %rdx
movq %rdx, 0x10(%rax)
movq %rax, 0x230(%rbx)
movq %rcx, %rax
jmp 0x1fbc6a
movq 0x2b0(%rbx), %rsi
movq %rbx, %rdi
callq 0x1fbdc3
movq 0x1d0(%rbx), %rdi
callq *0x28(%rbx)
movq 0x1e8(%rbx), %rax
testq %rax, %rax
je 0x1fbcb8
movq 0x1d8(%rbx), %rdi
callq *%rax
leaq 0x300(%rbx), %rdi
callq 0x1fbde4
leaq 0x330(%rbx), %rdi
callq 0x1fbde4
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1fbe1c
movq 0x290(%rbx), %r14
leaq 0x28(%r14), %r15
movq 0x28(%r14), %rax
movq %rsp, %r12
movq %rax, (%r12)
movq 0x38(%r14), %rcx
leaq (%rax,%rcx,8), %rax
movq %rax, 0x8(%r12)
movq %r12, %rdi
callq 0x201894
testq %rax, %rax
je 0x1fbd1a
cmpl $0x0, 0x1c(%rax)
je 0x1fbcfe
movq 0x20(%rax), %rdi
callq *0x28(%rbx)
jmp 0x1fbcfe
movq %r14, %rdi
callq 0x20233b
movq %r15, %rdi
callq 0x20233b
leaq 0x50(%r14), %rdi
callq 0x20233b
leaq 0x78(%r14), %rdi
callq 0x20233b
leaq 0xa0(%r14), %rdi
callq 0x1fbde4
leaq 0xd0(%r14), %rdi
callq 0x1fbde4
xorl %ebp, %ebp
movb %bpl, 0x118(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x108(%r14)
movq 0x138(%r14), %rdi
callq *0x28(%rbx)
andq $0x0, 0x138(%r14)
movq 0x120(%r14), %rdi
callq *0x28(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x120(%r14)
andq $0x0, 0x130(%r14)
movw $0x1, 0x100(%r14)
movb %bpl, 0x102(%r14)
leaq 0x16f5e1(%rip), %rsi    # 0x36b390
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1fb78d
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: moveToFreeBindingList
static void FASTCALL
moveToFreeBindingList(XML_Parser parser, BINDING *bindings)
{
  while (bindings) {
    BINDING *b = bindings;
    bindings = bindings->nextTagBinding;
    b->nextTagBinding = freeBindingList;
    freeBindingList = b;
  }
}

// Assembly:
testq %rsi, %rsi
je 0x1fbde3
movq 0x8(%rsi), %rax
movq 0x2b8(%rdi), %rcx
movq %rcx, 0x8(%rsi)
movq %rsi, 0x2b8(%rdi)
movq %rax, %rsi
jmp 0x1fbdc3
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: poolClear
static void FASTCALL
poolClear(STRING_POOL *pool)
{
  if (!pool->freeBlocks)
    pool->freeBlocks = pool->blocks;
  else {
    BLOCK *p = pool->blocks;
    while (p) {
      BLOCK *tem = p->next;
      p->next = pool->freeBlocks;
      pool->freeBlocks = p;
      p = tem;
    }
  }
  pool->blocks = NULL;
  pool->start = NULL;
  pool->ptr = NULL;
  pool->end = NULL;
}

// Assembly:
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
testq %rcx, %rcx
je 0x1fbe07
testq %rax, %rax
je 0x1fbe0b
movq (%rax), %rdx
movq %rcx, (%rax)
movq %rax, 0x8(%rdi)
movq %rax, %rcx
movq %rdx, %rax
jmp 0x1fbdf0
movq %rax, 0x8(%rdi)
andq $0x0, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
andq $0x0, 0x20(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: XML_SetEncoding
enum XML_Status XMLCALL
XML_SetEncoding(XML_Parser parser, const XML_Char *encodingName)
{
  /* Block after XML_Parse()/XML_ParseBuffer() has been called.
     XXX There's no way for the caller to determine which of the
     XXX possible error cases caused the XML_STATUS_ERROR return.
  */
  if (ps_parsing == XML_PARSING || ps_parsing == XML_SUSPENDED)
    return XML_STATUS_ERROR;
  if (encodingName == NULL)
    protocolEncodingName = NULL;
  else {
    protocolEncodingName = poolCopyString(&tempPool, encodingName);
    if (!protocolEncodingName)
      return XML_STATUS_ERROR;
  }
  return XML_STATUS_OK;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl 0x378(%rdi), %eax
xorl %ebx, %ebx
orl $0x2, %eax
cmpl $0x3, %eax
je 0x1fbfac
movq %rdi, %r14
testq %rsi, %rsi
je 0x1fbfa1
leaq 0x300(%r14), %rdi
callq 0x1fbfb6
movq %rax, 0x1c0(%r14)
testq %rax, %rax
jne 0x1fbfa9
jmp 0x1fbfac
andq $0x0, 0x1c0(%r14)
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: poolCopyString
static const XML_Char * FASTCALL
poolCopyString(STRING_POOL *pool, const XML_Char *s)
{
  do {
    if (!poolAppendChar(pool, *s))
      return NULL;
  } while (*s++);
  s = pool->start;
  poolFinish(pool);
  return s;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
xorl %ebx, %ebx
movq 0x18(%r14), %rax
cmpq 0x10(%r14), %rax
jne 0x1fbfdd
movq %r14, %rdi
callq 0x1ff0dd
testb %al, %al
je 0x1fc000
movq 0x18(%r14), %rax
movb (%r15), %cl
leaq 0x1(%rax), %rdx
movq %rdx, 0x18(%r14)
movb %cl, (%rax)
cmpb $0x0, (%r15)
leaq 0x1(%r15), %r15
jne 0x1fbfc3
movq 0x18(%r14), %rax
movq 0x20(%r14), %rbx
movq %rax, 0x20(%r14)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: externalEntityInitProcessor
static enum XML_Error PTRCALL
externalEntityInitProcessor(XML_Parser parser,
                            const char *start,
                            const char *end,
                            const char **endPtr)
{
  enum XML_Error result = initializeEncoding(parser);
  if (result != XML_ERROR_NONE)
    return result;
  processor = externalEntityInitProcessor2;
  return externalEntityInitProcessor2(parser, start, end, endPtr);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
callq 0x1fd1d6
testl %eax, %eax
je 0x1fc760
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x5a4f(%rip), %rax      # 0x2021b6
movq %rax, 0x200(%r12)
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2021b6
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: destroyBindings
static void FASTCALL
destroyBindings(BINDING *bindings, XML_Parser parser)
{
  for (;;) {
    BINDING *b = bindings;
    if (!b)
      break;
    bindings = b->nextTagBinding;
    FREE(b->uri);
    FREE(b);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
testq %r14, %r14
je 0x1fc7b1
movq 0x8(%r14), %r15
movq 0x20(%r14), %rdi
callq *0x28(%rbx)
movq %r14, %rdi
callq *0x28(%rbx)
movq %r15, %r14
jmp 0x1fc796
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: poolDestroy
static void FASTCALL
poolDestroy(STRING_POOL *pool)
{
  BLOCK *p = pool->blocks;
  while (p) {
    BLOCK *tem = p->next;
    pool->mem->free_fcn(p);
    p = tem;
  }
  p = pool->freeBlocks;
  while (p) {
    BLOCK *tem = p->next;
    pool->mem->free_fcn(p);
    p = tem;
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x1fc7d5
movq (%rdi), %r14
movq 0x28(%rbx), %rax
callq *0x10(%rax)
movq %r14, %rdi
jmp 0x1fc7c1
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x1fc7ed
movq (%rdi), %r14
movq 0x28(%rbx), %rax
callq *0x10(%rax)
movq %r14, %rdi
jmp 0x1fc7d9
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: XML_ParseBuffer
enum XML_Status XMLCALL
XML_ParseBuffer(XML_Parser parser, int len, int isFinal)
{
  const char *start;
  enum XML_Status result = XML_STATUS_OK;

  switch (ps_parsing) {
  case XML_SUSPENDED:
    errorCode = XML_ERROR_SUSPENDED;
    return XML_STATUS_ERROR;
  case XML_FINISHED:
    errorCode = XML_ERROR_FINISHED;
    return XML_STATUS_ERROR;
  default:
    ps_parsing = XML_PARSING;
  }

  start = bufferPtr;
  positionPtr = start;
  bufferEnd += len;
  parseEndPtr = bufferEnd;
  parseEndByteIndex += len;
  ps_finalBuffer = (XML_Bool)isFinal;

  errorCode = processor(parser, start, parseEndPtr, &bufferPtr);

  if (errorCode != XML_ERROR_NONE) {
    eventEndPtr = eventPtr;
    processor = errorProcessor;
    return XML_STATUS_ERROR;
  }
  else {
    switch (ps_parsing) {
    case XML_SUSPENDED:
      result = XML_STATUS_SUSPENDED;
      break;
    case XML_INITIALIZED: 
    case XML_PARSING:
      if (isFinal) {
        ps_parsing = XML_FINISHED;
        return result;
      }
    default: ;  /* should not happen */
    }
  }

  XmlUpdatePosition(encoding, positionPtr, bufferPtr, &position);
  positionPtr = bufferPtr;
  return result;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x378(%rdi), %eax
cmpl $0x2, %eax
je 0x1fcd4d
cmpl $0x3, %eax
jne 0x1fcd59
movl $0x21, 0x208(%rbx)
jmp 0x1fcdc4
movl $0x24, 0x208(%rbx)
jmp 0x1fcdc4
movl %edx, %r14d
movl $0x1, 0x378(%rbx)
leaq 0x30(%rbx), %rcx
movq 0x30(%rbx), %rax
movq %rax, 0x220(%rbx)
movslq %esi, %rsi
movq 0x38(%rbx), %rdx
addq %rsi, %rdx
movq %rdx, 0x38(%rbx)
movq %rdx, 0x50(%rbx)
addq %rsi, 0x48(%rbx)
movb %r14b, 0x37c(%rbx)
movq %rbx, %rdi
movq %rax, %rsi
callq *0x200(%rbx)
movl %eax, 0x208(%rbx)
testl %eax, %eax
je 0x1fcdcd
movq 0x210(%rbx), %rax
movq %rax, 0x218(%rbx)
leaq -0x1a4(%rip), %rax      # 0x1fcc19
movq %rax, 0x200(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl 0x378(%rbx), %eax
pushq $0x1
popq %rbp
cmpl $0x2, %eax
jae 0x1fcdec
testl %r14d, %r14d
je 0x1fcdf4
movl $0x2, 0x378(%rbx)
jmp 0x1fcdc6
cmpl $0x3, %eax
jne 0x1fcdf4
pushq $0x2
popq %rbp
movq 0x30(%rbx), %rdx
movq 0x120(%rbx), %rdi
movq 0x220(%rbx), %rsi
leaq 0x2f0(%rbx), %rcx
callq *0x60(%rdi)
movq 0x30(%rbx), %rax
movq %rax, 0x220(%rbx)
jmp 0x1fcdc6
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: XML_ResumeParser
enum XML_Status XMLCALL
XML_ResumeParser(XML_Parser parser)
{
  enum XML_Status result = XML_STATUS_OK;

  if (ps_parsing != XML_SUSPENDED) {
    errorCode = XML_ERROR_NOT_SUSPENDED;
    return XML_STATUS_ERROR;
  }
  ps_parsing = XML_PARSING;

  errorCode = processor(parser, bufferPtr, parseEndPtr, &bufferPtr);

  if (errorCode != XML_ERROR_NONE) {
    eventEndPtr = eventPtr;
    processor = errorProcessor;
    return XML_STATUS_ERROR;
  }
  else {
    switch (ps_parsing) {
    case XML_SUSPENDED:
      result = XML_STATUS_SUSPENDED;
      break;
    case XML_INITIALIZED: 
    case XML_PARSING:
      if (ps_finalBuffer) {
        ps_parsing = XML_FINISHED;
        return result;
      }
    default: ;
    }
  }

  XmlUpdatePosition(encoding, positionPtr, bufferPtr, &position);
  positionPtr = bufferPtr;
  return result;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x3, 0x378(%rdi)
jne 0x1fcec0
movl $0x1, 0x378(%rbx)
leaq 0x30(%rbx), %rcx
movq 0x30(%rbx), %rsi
movq 0x50(%rbx), %rdx
movq %rbx, %rdi
callq *0x200(%rbx)
movl %eax, 0x208(%rbx)
testl %eax, %eax
je 0x1fced5
movq 0x210(%rbx), %rax
movq %rax, 0x218(%rbx)
leaq -0x29e(%rip), %rax      # 0x1fcc19
movq %rax, 0x200(%rbx)
jmp 0x1fceca
movl $0x22, 0x208(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl 0x378(%rbx), %eax
pushq $0x1
popq %rbp
cmpl $0x2, %eax
jae 0x1fcef8
cmpb $0x0, 0x37c(%rbx)
je 0x1fcf00
movl $0x2, 0x378(%rbx)
jmp 0x1fcecc
cmpl $0x3, %eax
jne 0x1fcf00
pushq $0x2
popq %rbp
movq 0x30(%rbx), %rdx
movq 0x120(%rbx), %rdi
movq 0x220(%rbx), %rsi
leaq 0x2f0(%rbx), %rcx
callq *0x60(%rdi)
movq 0x30(%rbx), %rax
movq %rax, 0x220(%rbx)
jmp 0x1fcecc
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: XML_GetCurrentLineNumber
XML_Size XMLCALL
XML_GetCurrentLineNumber(XML_Parser parser)
{
  if (eventPtr && eventPtr >= positionPtr) {
    XmlUpdatePosition(encoding, positionPtr, eventPtr, &position);
    positionPtr = eventPtr;
  }
  return position.lineNumber + 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x210(%rdi), %rdx
testq %rdx, %rdx
je 0x1fcfd6
movq 0x220(%rbx), %rsi
cmpq %rsi, %rdx
jb 0x1fcfd6
movq 0x120(%rbx), %rdi
leaq 0x2f0(%rbx), %rcx
callq *0x60(%rdi)
movq 0x210(%rbx), %rax
movq %rax, 0x220(%rbx)
movq 0x2f0(%rbx), %rax
incq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: XML_GetCurrentColumnNumber
XML_Size XMLCALL
XML_GetCurrentColumnNumber(XML_Parser parser)
{
  if (eventPtr && eventPtr >= positionPtr) {
    XmlUpdatePosition(encoding, positionPtr, eventPtr, &position);
    positionPtr = eventPtr;
  }
  return position.columnNumber;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x210(%rdi), %rdx
testq %rdx, %rdx
je 0x1fd01d
movq 0x220(%rbx), %rsi
cmpq %rsi, %rdx
jb 0x1fd01d
movq 0x120(%rbx), %rdi
leaq 0x2f0(%rbx), %rcx
callq *0x60(%rdi)
movq 0x210(%rbx), %rax
movq %rax, 0x220(%rbx)
movq 0x2f8(%rbx), %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/external/expat-2.0.1/lib/xmlparse.c
// Function: XML_DefaultCurrent
void XMLCALL
XML_DefaultCurrent(XML_Parser parser)
{
  if (defaultHandler) {
    if (openInternalEntities)
      reportDefault(parser,
                    internalEncoding,
                    openInternalEntities->internalEventPtr,
                    openInternalEntities->internalEventEndPtr);
    else
      reportDefault(parser, encoding, eventPtr, eventEndPtr);
  }
}

// Assembly:
cmpq $0x0, 0xa0(%rdi)
je 0x1fd073
movq 0x228(%rdi), %rax
testq %rax, %rax
je 0x1fd074
movq 0x1b8(%rdi), %rsi
movq (%rax), %rdx
movq 0x8(%rax), %rcx
jmp 0x1fd08b
retq
movq 0x120(%rdi), %rsi
movq 0x210(%rdi), %rdx
movq 0x218(%rdi), %rcx
jmp 0x1fd08b