LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/aaronpuchert[P]throttle/src/throttle.hpp
// Function: Conf::Parser<unsigned int>::parse(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
T Conf::Parser<T>::parse(const std::string &str)
{
	T ret;
	std::istringstream stream(str);
	stream >> ret;
	return ret;
}

// Assembly:
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movq %rdi, %rsi
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movl $0x8, %edx
callq 0x22f0
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
callq 0x2320
movl 0xc(%rsp), %ebx
movq 0x49df(%rip), %rsi      # 0x7fc0
leaq 0x10(%rsp), %rdi
callq 0x2240
leaq 0x88(%rsp), %rdi
callq 0x2080
movl %ebx, %eax
addq $0x190, %rsp            # imm = 0x190
popq %rbx
retq
movq %rax, %rbx
movq 0x49b3(%rip), %rsi      # 0x7fc0
leaq 0x10(%rsp), %rdi
callq 0x2240
leaq 0x88(%rsp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x2330
// File: /workspace/github_cpp_makefile_star2_O1/aaronpuchert[P]throttle/src/conf.cpp
// Function: Conf::GetAttr[abi:cxx11](char const*) const
const std::string& Conf::GetAttr(const char *name) const
{
	auto it = std::find_if(attributes.begin(), attributes.end(),
		[name](const std::pair<std::string, std::string>& p)
		{
			return p.first == name;
		});

	if (it != attributes.end())
		return it->second;
	else
		throw std::runtime_error(std::string("No such attribute: ") + name);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %r15
movq 0x8(%rdi), %r13
movq %r13, %rbp
subq %r15, %rbp
sarq $0x8, %rbp
testq %rbp, %rbp
jle 0x3a5b
incq %rbp
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2060
testl %eax, %eax
je 0x3ab3
leaq 0x40(%r15), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2060
testl %eax, %eax
je 0x3ab6
leaq 0x80(%r15), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2060
testl %eax, %eax
je 0x3ab6
leaq 0xc0(%r15), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2060
testl %eax, %eax
je 0x3ab6
addq $0x100, %r15            # imm = 0x100
decq %rbp
cmpq $0x1, %rbp
jg 0x39f1
movq %r13, %rax
subq %r15, %rax
sarq $0x6, %rax
cmpq $0x1, %rax
je 0x3a9d
cmpq $0x2, %rax
je 0x3a8a
cmpq $0x3, %rax
jne 0x3aae
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2060
testl %eax, %eax
je 0x3ab3
addq $0x40, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2060
testl %eax, %eax
je 0x3ab3
addq $0x40, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2060
testl %eax, %eax
cmoveq %r15, %r13
movq %r13, %r12
jmp 0x3ab6
movq %r15, %r12
cmpq 0x8(%r14), %r12
je 0x3ad2
addq $0x20, %r12
movq %r12, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x20f0
movq %rax, %r14
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1623(%rip), %rsi      # 0x5112
leaq 0x162f(%rip), %rdx      # 0x5125
leaq 0x28(%rsp), %rdi
callq 0x408a
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x2370
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x3b30
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x3b3d
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bpl
movq %r14, %rdi
callq 0x22c0
xorl %ebp, %ebp
movq 0x4483(%rip), %rsi      # 0x7ff0
movq 0x4454(%rip), %rdx      # 0x7fc8
movq %r14, %rdi
callq 0x2300
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x3b9e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21f0
jmp 0x3b9e
movq %rax, %rbx
movb $0x1, %bpl
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x3bbd
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21f0
jmp 0x3bbd
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x3bca
movq %r14, %rdi
callq 0x2160
movq %rbx, %rdi
callq 0x2330
// File: /workspace/github_cpp_makefile_star2_O1/aaronpuchert[P]throttle/src/conf.cpp
// Function: CommQueue::CommQueue(Throttle*, char const*)
CommQueue::CommQueue(Throttle *parent, const char *pipe_fn) : Throt(parent)
{
	// Open the command pipe
	comm_file = open(pipe_fn, O_RDONLY | O_NONBLOCK);

	if (comm_file < 0)
		throw std::runtime_error(std::string("Couldn't open command pipe '") + pipe_fn + '\'');
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rdx, %r14
movq %rdi, %rbx
movq %rsi, (%rdi)
movq %rdx, %rdi
movl $0x800, %esi            # imm = 0x800
xorl %eax, %eax
callq 0x2170
movl %eax, 0x8(%rbx)
testl %eax, %eax
js 0x3c0a
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x20f0
movq %rax, %rbx
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x14ff(%rip), %rsi      # 0x5126
leaq 0x1514(%rip), %rdx      # 0x5142
leaq 0x20(%rsp), %rdi
callq 0x408a
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x2370
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x3c68
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x3c74
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
movq 0x8(%rax), %rdx
movq %rsp, %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x40(%rsp), %rdi
movl $0x27, %edx
callq 0x3fec
movb $0x1, %bpl
leaq 0x40(%rsp), %rsi
movq %rbx, %rdi
callq 0x22c0
xorl %ebp, %ebp
movq 0x433a(%rip), %rsi      # 0x7ff0
movq 0x430b(%rip), %rdx      # 0x7fc8
movq %rbx, %rdi
callq 0x2300
movq %rax, %r14
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3ceb
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x21f0
jmp 0x3ceb
movq %rax, %r14
movb $0x1, %bpl
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x3d09
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
jmp 0x3d09
movq %rax, %r14
movb $0x1, %bpl
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x3d28
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x21f0
jmp 0x3d28
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x3d35
movq %rbx, %rdi
callq 0x2160
movq %r14, %rdi
callq 0x2330
nop
// File: /workspace/github_cpp_makefile_star2_O1/aaronpuchert[P]throttle/src/conf.cpp
// Function: CommQueue::update()
void CommQueue::update()
{
	char buf[LINE_LENGTH];
	ssize_t ret;
	while (true) {
		ret = read(comm_file, buf, LINE_LENGTH-1);
		if (ret <= 0)
			break;
		processCommand(std::string(buf, ret));
	}

	// This should be because there's nothing more to read
	if (ret != 0 && errno != EAGAIN)
		throw std::runtime_error("Read error while checking command pipe");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x428, %rsp            # imm = 0x428
movq %rdi, %rbx
movl 0x8(%rdi), %edi
leaq 0x20(%rsp), %rsi
movl $0x3ff, %edx            # imm = 0x3FF
callq 0x2250
testq %rax, %rax
jle 0x3dd4
leaq 0x10(%rsp), %r12
movq %rsp, %r14
leaq 0x20(%rsp), %r15
movq %r12, (%rsp)
leaq (%rsp,%rax), %rdx
addq $0x20, %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x408a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3e58
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x3dbf
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movl 0x8(%rbx), %edi
movl $0x3ff, %edx            # imm = 0x3FF
movq %r15, %rsi
callq 0x2250
testq %rax, %rax
jg 0x3d87
testq %rax, %rax
je 0x3de3
callq 0x2030
cmpl $0xb, (%rax)
jne 0x3df2
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0x10, %edi
callq 0x20f0
movq %rax, %r14
leaq 0x133d(%rip), %rsi      # 0x5143
movq %rax, %rdi
callq 0x20a0
movq 0x41db(%rip), %rsi      # 0x7ff0
movq 0x41ac(%rip), %rdx      # 0x7fc8
movq %r14, %rdi
callq 0x2300
movq %rax, %rbx
movq %r14, %rdi
callq 0x2160
jmp 0x3e4f
movq %rax, %rbx
jmp 0x3e4f
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x3e4f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %rbx, %rdi
callq 0x2330
nop
// File: /workspace/github_cpp_makefile_star2_O1/aaronpuchert[P]throttle/src/conf.cpp
// Function: CommQueue::processCommand(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void CommQueue::processCommand(const std::string &comm)
{
	std::istringstream stream(comm);

	std::string command;
	stream >> command;

	if (command == "min") {
		int temp;
		stream >> temp;
		Throt->setMinTemp(temp);
		DEBUG_PRINT("[CommQueue] Set minimum temperature to " << temp);
	}
	else if (command == "max") {
		int temp;
		stream >> temp;
		Throt->setMaxTemp(temp);
		DEBUG_PRINT("[CommQueue] Set maximum temperature to " << temp);
	}
	else if (command == "freq") {
		int freq;
		stream >> freq;
		Throt->setOverrideFreq(freq);
		DEBUG_PRINT("[CommQueue] Set frequency to " << freq);
	}
	else if (command == "reset") {
		Throt->setOverrideFreq(0);
		DEBUG_PRINT("[CommQueue] Reset mechanism");
	}
	else {
		DEBUG_PRINT("[CommQueue] Ignored unknown command: " << command);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, %rbx
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movl $0x8, %edx
callq 0x22f0
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x2230
leaq 0x11d2(%rip), %rsi      # 0x5074
leaq 0x10(%rsp), %rdi
callq 0x2060
testl %eax, %eax
je 0x3eff
leaq 0x11c6(%rip), %rsi      # 0x507d
leaq 0x10(%rsp), %rdi
callq 0x2060
testl %eax, %eax
je 0x3f1e
leaq 0x129e(%rip), %rsi      # 0x516a
leaq 0x10(%rsp), %rdi
callq 0x2060
testl %eax, %eax
je 0x3f3d
leaq 0x128e(%rip), %rsi      # 0x516f
leaq 0x10(%rsp), %rdi
callq 0x2060
testl %eax, %eax
jne 0x3f64
movq (%rbx), %rax
xorl %ecx, %ecx
movl %ecx, 0x88(%rax)
movl %ecx, 0x70(%rax)
jmp 0x3f64
leaq 0x30(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x2130
movq (%rbx), %rax
imull $0x3e8, 0xc(%rsp), %ecx # imm = 0x3E8
movl %ecx, 0x4c(%rax)
jmp 0x3f64
leaq 0x30(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x2130
movq (%rbx), %rax
imull $0x3e8, 0xc(%rsp), %ecx # imm = 0x3E8
movl %ecx, 0x48(%rax)
jmp 0x3f64
leaq 0x30(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x2130
movq (%rbx), %rax
imull $0x3e8, 0xc(%rsp), %ecx # imm = 0x3E8
movl %ecx, 0x88(%rax)
movl $0x0, 0x70(%rax)
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x3f7b
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x403e(%rip), %rsi      # 0x7fc0
leaq 0x30(%rsp), %rdi
callq 0x2240
leaq 0xa8(%rsp), %rdi
callq 0x2080
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbx
popq %r14
popq %r15
retq
jmp 0x3fac
jmp 0x3fac
jmp 0x3fac
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x3fc6
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21f0
movq 0x3ff3(%rip), %rsi      # 0x7fc0
leaq 0x30(%rsp), %rdi
callq 0x2240
leaq 0xa8(%rsp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x2330
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bamtk.c
// Function: main.cold.1
static int usage()
{
	fprintf(stderr, "\n");
	fprintf(stderr, "Program: samtools (Tools for alignments in the SAM format)\n");
	fprintf(stderr, "Version: %s\n\n", PACKAGE_VERSION);
	fprintf(stderr, "Usage:   samtools <command> [options]\n\n");
	fprintf(stderr, "Command: view        SAM<->BAM conversion\n");
	fprintf(stderr, "         sort        sort alignment file\n");
	fprintf(stderr, "         pileup      generate pileup output\n");
	fprintf(stderr, "         faidx       index/extract FASTA\n");
#if _CURSES_LIB != 0
	fprintf(stderr, "         tview       text alignment viewer\n");
#endif
	fprintf(stderr, "         index       index alignment\n");
	fprintf(stderr, "         fixmate     fix mate information\n");
	fprintf(stderr, "         glfview     print GLFv3 file\n");
	fprintf(stderr, "         flagstat    simple stats\n");
	fprintf(stderr, "         calmd       recalculate MD/NM tags, also BAQ adjustment around indels\n");
	fprintf(stderr, "         merge       merge sorted alignments\n");
	fprintf(stderr, "         rmdup       remove PCR duplicates\n");
	fprintf(stderr, "\n");
	return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x2b37d(%rip), %r13     # 0x2efe8
movq (%r13), %rsi
pushq $0xa
popq %rbx
movl %ebx, %edi
callq 0x3290
movq (%r13), %rcx
leaq 0x22186(%rip), %rdi     # 0x25e0a
pushq $0x3b
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
callq 0x3600
movq (%r13), %rdi
leaq 0x221a8(%rip), %rsi     # 0x25e46
leaq 0x221af(%rip), %rdx     # 0x25e54
xorl %eax, %eax
callq 0x3630
movq (%r13), %rcx
leaq 0x221b8(%rip), %rdi     # 0x25e6f
pushq $0x27
popq %rsi
movq %r14, %rdx
callq 0x3600
movq (%r13), %rcx
leaq 0x221ca(%rip), %rdi     # 0x25e97
pushq $0x2a
popq %r12
movq %r12, %rsi
movq %r14, %rdx
callq 0x3600
movq (%r13), %rcx
leaq 0x221db(%rip), %rdi     # 0x25ec2
pushq $0x29
popq %r15
movq %r15, %rsi
movq %r14, %rdx
callq 0x3600
movq (%r13), %rcx
leaq 0x221eb(%rip), %rdi     # 0x25eec
pushq $0x2c
popq %rsi
movq %r14, %rdx
callq 0x3600
movq (%r13), %rcx
leaq 0x22202(%rip), %rdi     # 0x25f19
movq %r15, %rsi
movq %r14, %rdx
callq 0x3600
movq (%r13), %rcx
leaq 0x22216(%rip), %rdi     # 0x25f43
pushq $0x2b
popq %r15
movq %r15, %rsi
movq %r14, %rdx
callq 0x3600
movq (%r13), %rcx
leaq 0x22228(%rip), %rdi     # 0x25f6f
pushq $0x25
popq %rsi
movq %r14, %rdx
callq 0x3600
movq (%r13), %rcx
leaq 0x22238(%rip), %rdi     # 0x25f95
movq %r12, %rsi
movq %r14, %rdx
callq 0x3600
movq (%r13), %rcx
leaq 0x2224d(%rip), %rdi     # 0x25fc0
pushq $0x26
popq %rsi
movq %r14, %rdx
callq 0x3600
movq (%r13), %rcx
leaq 0x2225e(%rip), %rdi     # 0x25fe7
pushq $0x22
popq %rsi
movq %r14, %rdx
callq 0x3600
movq (%r13), %rcx
leaq 0x2226b(%rip), %rdi     # 0x2600a
pushq $0x4f
popq %rsi
movq %r14, %rdx
callq 0x3600
movq (%r13), %rcx
leaq 0x222a5(%rip), %rdi     # 0x2605a
pushq $0x2d
popq %rsi
movq %r14, %rdx
callq 0x3600
movq (%r13), %rcx
leaq 0x222bd(%rip), %rdi     # 0x26088
movq %r15, %rsi
movq %r14, %rdx
callq 0x3600
movq (%r13), %rsi
movl %ebx, %edi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x3290
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bam_tview.c
// Function: tv_destroy
void tv_destroy(tview_t *tv)
{
	delwin(tv->wgoto); delwin(tv->whelp);
	endwin();

	bam_lplbuf_destroy(tv->lplbuf);
	bam_maqcns_destroy(tv->bmc);
	bam_index_destroy(tv->idx);
	if (tv->fai) fai_destroy(tv->fai);
	free(tv->ref);
	bam_header_destroy(tv->header);
	bam_close(tv->fp);
	free(tv);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x3390
movq 0x10(%rbx), %rdi
callq 0x3390
callq 0x34d0
movq 0x20(%rbx), %rdi
callq 0x187b3
movq 0x48(%rbx), %rdi
callq 0x71ce
movq 0x18(%rbx), %rdi
callq 0x15bce
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0x5a01
callq 0x1aa39
movq 0x78(%rbx), %rdi
callq 0x32c0
movq 0x28(%rbx), %rdi
callq 0x11c9f
movq 0x30(%rbx), %rdi
callq 0x1050e
movq %rbx, %rdi
popq %rbx
jmp 0x32c0
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bam_tview.c
// Function: tv_fetch_func
int tv_fetch_func(const bam1_t *b, void *data)
{
	tview_t *tv = (tview_t*)data;
	if (tv->no_skip) {
		uint32_t *cigar = bam1_cigar(b); // this is cheating...
		int i;
		for (i = 0; i <b->core.n_cigar; ++i) {
			if ((cigar[i]&0xf) == BAM_CREF_SKIP)
				cigar[i] = cigar[i]>>4<<4 | BAM_CDEL;
		}
	}
	bam_lplbuf_push(b, tv->lplbuf);
	return 0;
}

// Assembly:
pushq %rax
cmpl $0x0, 0x70(%rsi)
je 0x5a64
movq 0x8(%rdi), %rax
movq %rax, %rcx
shrq $0x30, %rcx
je 0x5a64
shrl $0x18, %eax
addq 0x30(%rdi), %rax
xorl %ecx, %ecx
movl (%rax,%rcx,4), %edx
movl %edx, %r8d
andl $0xf, %r8d
cmpl $0x3, %r8d
jne 0x5a58
andl $-0xe, %edx
movl %edx, (%rax,%rcx,4)
incq %rcx
movzwl 0xe(%rdi), %edx
cmpq %rdx, %rcx
jb 0x5a42
movq 0x20(%rsi), %rsi
callq 0x18940
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bam_tview.c
// Function: tv_draw_aln
int tv_draw_aln(tview_t *tv, int tid, int pos)
{
	// reset
	clear();
	tv->curr_tid = tid; tv->left_pos = pos;
	tv->last_pos = tv->left_pos - 1;
	tv->ccol = 0;
	// print ref and consensus
	if (tv->fai) {
		char *str;
		if (tv->ref) free(tv->ref);
		str = (char*)calloc(strlen(tv->header->target_name[tv->curr_tid]) + 30, 1);
		sprintf(str, "%s:%d-%d", tv->header->target_name[tv->curr_tid], tv->left_pos + 1, tv->left_pos + tv->mcol);
		tv->ref = fai_fetch(tv->fai, str, &tv->l_ref);
		free(str);
	}
	// draw aln
	bam_lplbuf_reset(tv->lplbuf);
	bam_fetch(tv->fp, tv->idx, tv->curr_tid, tv->left_pos, tv->left_pos + tv->mcol, tv, tv_fetch_func);
	bam_lplbuf_push(0, tv->lplbuf);

	while (tv->ccol < tv->mcol) {
		int pos = tv->last_pos + 1;
		if (pos%10 == 0 && tv->mcol - tv->ccol >= 10) mvprintw(0, tv->ccol, "%-d", pos+1);
		mvaddch(1, tv->ccol++, (tv->ref && pos < tv->l_ref)? tv->ref[pos - tv->left_pos] : 'N');
		++tv->last_pos;
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
movq 0x2954c(%rip), %r12     # 0x2efd8
movq (%r12), %rdi
callq 0x3070
movl %r14d, 0x38(%rbx)
movl %ebp, 0x3c(%rbx)
decl %ebp
movl %ebp, 0x54(%rbx)
movl $0x0, 0x50(%rbx)
cmpq $0x0, 0x40(%rbx)
je 0x5b22
movq 0x78(%rbx), %rdi
testq %rdi, %rdi
je 0x5abd
callq 0x32c0
movq 0x28(%rbx), %rax
movq 0x8(%rax), %rax
movslq 0x38(%rbx), %rcx
movq (%rax,%rcx,8), %r14
movq %r14, %rdi
callq 0x32d0
leaq 0x1e(%rax), %rdi
movl $0x1, %esi
callq 0x3530
movq %rax, %r15
movl 0x3c(%rbx), %r8d
leal 0x1(%r8), %ecx
addl 0x4(%rbx), %r8d
leaq 0x1e604(%rip), %rsi     # 0x240fd
movq %rax, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x3350
movq 0x40(%rbx), %rdi
leaq 0x68(%rbx), %rdx
movq %r15, %rsi
callq 0x1b053
movq %rax, 0x78(%rbx)
movq %r15, %rdi
callq 0x32c0
movq 0x20(%rbx), %rdi
callq 0x1820c
movq 0x18(%rbx), %rsi
movq 0x30(%rbx), %rdi
movl 0x38(%rbx), %edx
movl 0x3c(%rbx), %ecx
movl 0x4(%rbx), %r8d
addl %ecx, %r8d
leaq -0x122(%rip), %rax      # 0x5a25
movq %rax, (%rsp)
movq %rbx, %r9
callq 0x169e0
movq 0x20(%rbx), %rsi
xorl %edi, %edi
callq 0x18940
movl 0x4(%rbx), %eax
movl 0x50(%rbx), %esi
cmpl %eax, %esi
jge 0x5bf7
movl $0x19999998, %ebp       # imm = 0x19999998
leaq 0x1e530(%rip), %r14     # 0x240a8
movslq 0x54(%rbx), %rcx
leaq 0x1(%rcx), %r15
imull $0xcccccccd, %r15d, %edx # imm = 0xCCCCCCCD
addl %ebp, %edx
rorl %edx
cmpl %ebp, %edx
ja 0x5ba5
subl %esi, %eax
cmpl $0xa, %eax
jl 0x5ba5
addl $0x2, %ecx
xorl %edi, %edi
movq %r14, %rdx
xorl %eax, %eax
callq 0x3260
movq (%r12), %rdi
movl 0x50(%rbx), %edx
leal 0x1(%rdx), %eax
movl %eax, 0x50(%rbx)
movl $0x1, %esi
callq 0x3490
cmpl $-0x1, %eax
je 0x5bea
movq 0x78(%rbx), %rax
movl $0x4e, %esi
testq %rax, %rax
je 0x5be1
cmpl 0x68(%rbx), %r15d
jge 0x5be1
movslq 0x3c(%rbx), %rcx
subq %rcx, %r15
movsbl (%rax,%r15), %esi
movq (%r12), %rdi
callq 0x3300
incl 0x54(%rbx)
movl 0x4(%rbx), %eax
movl 0x50(%rbx), %esi
cmpl %eax, %esi
jl 0x5b78
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bam_tview.c
// Function: bam_tview_main
int bam_tview_main(int argc, char *argv[])
{
	tview_t *tv;
	if (argc == 1) {
		fprintf(stderr, "Usage: bamtk tview <aln.bam> [ref.fasta]\n");
		return 1;
	}
	tv = tv_init(argv[1], (argc == 2)? 0 : argv[2]);
	tv_draw_aln(tv, 0, 0);
	tv_loop(tv);
	tv_destroy(tv);
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x1, %edi
je 0x633d
movl %edi, %eax
movq 0x8(%rsi), %rdi
xorl %ebx, %ebx
cmpl $0x2, %eax
jne 0x630b
xorl %esi, %esi
jmp 0x630f
movq 0x10(%rsi), %rsi
callq 0x57a1
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5a71
movq %r14, %rdi
callq 0x5c06
movq %r14, %rdi
callq 0x59bd
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x36b0
movl $0x1, %ebx
jmp 0x6333
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bam_maqcns.c
// Function: bam_maqcns_init
bam_maqcns_t *bam_maqcns_init()
{
	bam_maqcns_t *bm;
	bm = (bam_maqcns_t*)calloc(1, sizeof(bam_maqcns_t));
	bm->aux = (bmc_aux_t*)calloc(1, sizeof(bmc_aux_t));
	bm->het_rate = 0.001;
	bm->theta = 0.85;
	bm->n_hap = 2;
	bm->eta = 0.03;
	bm->cap_mapQ = 60;
	return bm;
}

// Assembly:
pushq %rbx
movl $0x1, %edi
movl $0x40, %esi
callq 0x3530
movq %rax, %rbx
movl $0x1, %edi
movl $0x10, %esi
callq 0x3530
movq %rax, 0x38(%rbx)
movabsq $0x3f59999a3a83126f, %rax # imm = 0x3F59999A3A83126F
movq %rax, (%rbx)
movabsq $0x3c00000002, %rax     # imm = 0x3C00000002
movq %rax, 0x8(%rbx)
movl $0x3cf5c28f, 0x14(%rbx) # imm = 0x3CF5C28F
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bam_maqcns.c
// Function: bam_maqcns_call
uint32_t bam_maqcns_call(int n, const bam_pileup1_t *pl, bam_maqcns_t *bm)
{
	glf1_t *g;
	uint32_t x;
	if (n) {
		g = bam_maqcns_glfgen(n, pl, 0xf, bm);
		x = glf2cns(g, (int)(bm->q_r + 0.5));
		free(g);
	} else x = 0xfU<<28 | 0xfU<<24;
	return x;
}

// Assembly:
testl %edi, %edi
je 0x7c45
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl $0xf, %edx
movq %rbx, %rcx
callq 0x7212
movq %rax, %r14
cvtss2sd 0x18(%rbx), %xmm0
addsd 0x1c873(%rip), %xmm0    # 0x24498
cvttsd2si %xmm0, %esi
movq %rax, %rdi
callq 0x7a84
movl %eax, %ebx
movq %r14, %rdi
callq 0x32c0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0xff000000, %eax       # imm = 0xFF000000
retq
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bam_maqcns.c
// Function: bam_tpos2qpos
int bam_tpos2qpos(const bam1_core_t *c, const uint32_t *cigar, int32_t tpos, int is_left, int32_t *_tpos)
{
	int k, x = c->pos, y = 0, last_y = 0;
	*_tpos = c->pos;
	for (k = 0; k < c->n_cigar; ++k) {
		int op = cigar[k] & BAM_CIGAR_MASK;
		int l = cigar[k] >> BAM_CIGAR_SHIFT;
		if (op == BAM_CMATCH) {
			if (c->pos > tpos) return y;
			if (x + l > tpos) {
				*_tpos = tpos;
				return y + (tpos - x);
			}
			x += l; y += l;
			last_y = y;
		} else if (op == BAM_CINS || op == BAM_CSOFT_CLIP) y += l;
		else if (op == BAM_CDEL || op == BAM_CREF_SKIP) {
			if (x + l > tpos) {
				*_tpos = is_left? x : x + l;
				return y;
			}
			x += l;
		}
	}
	*_tpos = x;
	return last_y;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
movl 0x4(%rdi), %r9d
movl %r9d, (%r8)
xorl %r10d, %r10d
cmpw $0x0, 0xe(%rdi)
je 0x7d4a
xorl %r11d, %r11d
xorl %r10d, %r10d
xorl %ebx, %ebx
movl (%rsi,%r11,4), %r15d
movl %r15d, %ebp
andl $0xf, %ebp
movl %r15d, %r14d
shrl $0x4, %r14d
cmpl $0x4, %ebp
je 0x7cf1
cmpl $0x1, %ebp
je 0x7cf1
testl %ebp, %ebp
jne 0x7cfc
cmpl %edx, 0x4(%rdi)
jg 0x7d1a
leal (%r14,%r9), %r15d
cmpl %edx, %r15d
jle 0x7d20
movl %edx, (%r8)
movl %edx, %eax
subl %r9d, %eax
addl %ebx, %eax
xorl %ebp, %ebp
jmp 0x7d34
addl %ebx, %r14d
movb $0x1, %bpl
movl %r14d, %ebx
jmp 0x7d34
andl $0xe, %r15d
movb $0x1, %bpl
cmpl $0x2, %r15d
jne 0x7d34
addl %r9d, %r14d
cmpl %edx, %r14d
jle 0x7d31
testl %ecx, %ecx
cmovnel %r9d, %r14d
movl %r14d, (%r8)
xorl %ebp, %ebp
movl %ebx, %eax
jmp 0x7d34
addl %ebx, %r14d
movb $0x1, %bpl
movl %r15d, %r9d
movl %r14d, %ebx
movl %r14d, %r10d
jmp 0x7d34
movl %r14d, %r9d
testb %bpl, %bpl
je 0x7d50
incq %r11
movzwl 0xe(%rdi), %r14d
cmpq %r14, %r11
jb 0x7cb6
movl %r9d, (%r8)
movl %r10d, %eax
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/sam_view.c
// Function: view_func
static inline int __g_skip_aln(const bam_header_t *h, const bam1_t *b)
{
	if (b->core.qual < g_min_mapQ || ((b->core.flag & g_flag_on) != g_flag_on) || (b->core.flag & g_flag_off))
		return 1;
	if (g_rg) {
		uint8_t *s = bam_aux_get(b, "RG");
		if (s && strcmp(g_rg, (char*)(s + 1)) == 0) return 0;
	}
	if (g_library) {
		const char *p = bam_get_library((bam_header_t*)h, b);
		return (p && strcmp(p, g_library) == 0)? 0 : 1;
	}
	return 0;
}

// Assembly:
movq 0x8(%rdi), %rax
movl %eax, %ecx
shrl $0x10, %ecx
movzbl %cl, %ecx
cmpl 0x25461(%rip), %ecx     # 0x30108
jl 0xad5a
shrq $0x20, %rax
movzwl %ax, %eax
movl %eax, %ecx
notl %ecx
testl %ecx, 0x25442(%rip)     # 0x30100
jne 0xad5a
testl %eax, 0x2543a(%rip)     # 0x30104
jne 0xad5a
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rsi), %r15
cmpq $0x0, 0x25431(%rip)     # 0x30118
je 0xad1d
leaq 0x1a1e9(%rip), %rsi     # 0x24ed9
movq %rbx, %rdi
callq 0x1110a
testq %rax, %rax
je 0xad13
movq 0x25414(%rip), %rdi     # 0x30118
incq %rax
movq %rax, %rsi
callq 0x34e0
testl %eax, %eax
je 0xad17
xorl %eax, %eax
jmp 0xad19
movb $0x1, %al
testb %al, %al
jne 0xad4a
cmpq $0x0, 0x253eb(%rip)     # 0x30110
je 0xad4a
movq %r15, %rdi
movq %rbx, %rsi
callq 0x12e37
testq %rax, %rax
je 0xad55
movq 0x253d2(%rip), %rsi     # 0x30110
movq %rax, %rdi
callq 0x34e0
testl %eax, %eax
jne 0xad55
movq %r14, %rdi
movq %rbx, %rsi
callq 0x14c93
popq %rbx
popq %r14
popq %r15
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/sam_view.c
// Function: main_import
int main_import(int argc, char *argv[])
{
	int argc2, ret;
	char **argv2;
	if (argc != 4) {
		fprintf(stderr, "Usage: bamtk import <in.ref_list> <in.sam> <out.bam>\n");
		return 1;
	}
	argc2 = 6;
	argv2 = calloc(6, sizeof(char*));
	argv2[0] = "import", argv2[1] = "-o", argv2[2] = argv[3], argv2[3] = "-bt", argv2[4] = argv[1], argv2[5] = argv[2];
	ret = main_samview(argc2, argv2);
	free(argv2);
	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x4, %edi
jne 0xadd4
movq %rsi, %rbx
movl $0x6, %edi
movl $0x8, %esi
callq 0x3530
movq %rax, %r14
leaq 0x1a149(%rip), %rax     # 0x24ecb
movq %rax, (%r14)
leaq 0x1a146(%rip), %rax     # 0x24ed2
movq %rax, 0x8(%r14)
movq 0x18(%rbx), %rax
movq %rax, 0x10(%r14)
leaq 0x1a136(%rip), %rax     # 0x24ed5
movq %rax, 0x18(%r14)
movq 0x8(%rbx), %rax
movq %rax, 0x20(%r14)
movq 0x10(%rbx), %rax
movq %rax, 0x28(%r14)
movl $0x6, %edi
movq %r14, %rsi
callq 0xa548
movl %eax, %ebx
movq %r14, %rdi
callq 0x32c0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x39fb
movl $0x1, %eax
jmp 0xadcc
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bam_rmdup.c
// Function: clear_best
static void clear_best(khash_t(lib) *aux, int max)
{
	khint_t k;
	for (k = kh_begin(aux); k != kh_end(aux); ++k) {
		if (kh_exist(aux, k)) {
			lib_aux_t *q = &kh_val(aux, k);
			if (kh_size(q->best_hash) >= max)
				kh_clear(pos, q->best_hash);
		}
	}
}

// Assembly:
cmpl $0x0, (%rdi)
je 0xba25
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
xorl %ebp, %ebp
xorl %r15d, %r15d
movq 0x10(%r14), %rax
movl %r15d, %ecx
shrl $0x4, %ecx
movl (%rax,%rcx,4), %eax
movl %ebp, %ecx
andb $0x1e, %cl
shrl %cl, %eax
testb $0x3, %al
je 0xb9d3
incl %r15d
addl $0x2, %ebp
cmpl (%r14), %r15d
jne 0xb9ae
jmp 0xba1d
movq 0x20(%r14), %rax
movl %r15d, %ecx
leaq (%rcx,%rcx,2), %rcx
movq 0x10(%rax,%rcx,8), %r12
testq %r12, %r12
je 0xb9c6
cmpl %ebx, 0x4(%r12)
jb 0xb9c6
movq 0x10(%r12), %rdi
testq %rdi, %rdi
je 0xb9c6
movl (%r12), %eax
shrl $0x4, %eax
leaq 0x4(,%rax,4), %rdx
movl $0xaa, %esi
callq 0x3060
movq $0x0, 0x4(%r12)
jmp 0xb9c6
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bam_rmdup.c
// Function: clear_del_set
static void clear_del_set(khash_t(name) *del_set)
{
	khint_t k;
	for (k = kh_begin(del_set); k < kh_end(del_set); ++k)
		if (kh_exist(del_set, k))
			free((char*)kh_key(del_set, k));
	kh_clear(name, del_set);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %eax
testl %eax, %eax
je 0xba6e
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
movl %r15d, %ecx
shrl $0x4, %ecx
movl (%rax,%rcx,4), %eax
movl %r14d, %ecx
andb $0x1e, %cl
shrl %cl, %eax
testb $0x3, %al
jne 0xba60
movq 0x18(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x32c0
incq %r15
movl (%rbx), %eax
addl $0x2, %r14d
cmpq %rax, %r15
jb 0xba3a
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0xba93
shrl $0x4, %eax
leal 0x4(,%rax,4), %edx
movl $0xaa, %esi
callq 0x3060
movq $0x0, 0x4(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bam_rmdup.c
// Function: bam_rmdup
int bam_rmdup(int argc, char *argv[])
{
	int c, is_se = 0, force_se = 0;
	samfile_t *in, *out;
	while ((c = getopt(argc, argv, "sS")) >= 0) {
		switch (c) {
		case 's': is_se = 1; break;
		case 'S': force_se = is_se = 1; break;
		}
	}
	if (optind + 2 > argc) {
		fprintf(stderr, "\n");
		fprintf(stderr, "Usage:  samtools rmdup [-sS] <input.srt.bam> <output.bam>\n\n");
		fprintf(stderr, "Option: -s    rmdup for SE reads\n");
		fprintf(stderr, "        -S    treat PE reads as SE in rmdup (force -s)\n\n");
		return 1;
	}
	in = samopen(argv[optind], "rb", 0);
	out = samopen(argv[optind+1], "wb", in->header);
	if (in == 0 || out == 0) {
		fprintf(stderr, "[bam_rmdup] fail to read/write input files\n");
		return 1;
	}
	if (is_se) bam_rmdupse_core(in, out, force_se);
	else bam_rmdup_core(in, out);
	samclose(in); samclose(out);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebp
leaq 0x198db(%rip), %rdx     # 0x2586b
callq 0x31a0
testl %eax, %eax
js 0xbfd6
xorl %r12d, %r12d
leaq 0x198c8(%rip), %r15     # 0x2586b
xorl %ebx, %ebx
cmpl $0x53, %eax
je 0xbfb1
cmpl $0x73, %eax
je 0xbfb6
jmp 0xbfbc
movl $0x1, %ebx
movl $0x1, %r12d
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x31a0
testl %eax, %eax
jns 0xbfa5
testl %r12d, %r12d
sete %r12b
jmp 0xbfdb
movb $0x1, %r12b
xorl %ebx, %ebx
movq 0x22fd6(%rip), %r13     # 0x2efb8
movslq (%r13), %rax
leal 0x2(%rax), %ecx
cmpl %ebp, %ecx
jg 0xc062
movq (%r14,%rax,8), %rdi
leaq 0x18b97(%rip), %rsi     # 0x24b8f
xorl %edx, %edx
callq 0x1485f
movq %rax, %r15
movslq (%r13), %rax
movq 0x8(%r14,%rax,8), %rdi
movq 0x10(%r15), %rdx
leaq 0x198ef(%rip), %rsi     # 0x25905
callq 0x1485f
testq %r15, %r15
je 0xc069
movq %rax, %r14
testq %rax, %rax
je 0xc069
movq %r15, %rdi
movq %r14, %rsi
testb %r12b, %r12b
je 0xc03a
callq 0xade0
jmp 0xc041
movl %ebx, %edx
callq 0xc564
movq %r15, %rdi
callq 0x14c18
movq %r14, %rdi
callq 0x14c18
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3a7a
jmp 0xc06e
callq 0x3a5e
movl $0x1, %eax
jmp 0xc053
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bam_rmdupse.c
// Function: dump_alignment
static void dump_alignment(samfile_t *out, queue_t *queue, int32_t pos, khash_t(lib) *h)
{
	if (queue->size > QUEUE_CLEAR_SIZE || pos == MAX_POS) {
		khint_t k;
		while (1) {
			elem_t *q;
			if (queue->head == queue->tail) break;
			q = &kl_val(queue->head);
			if (q->discarded) {
				q->b->data_len = 0;
				kl_shift(q, queue, 0);
				continue;
			}
			if ((q->b->core.flag&BAM_FREVERSE) && q->endpos > pos) break;
			samwrite(out, q->b);
			q->b->data_len = 0;
			kl_shift(q, queue, 0);
		}
		for (k = kh_begin(h); k != kh_end(h); ++k) {
			if (kh_exist(h, k)) {
				clear_besthash(kh_val(h, k).left, pos);
				clear_besthash(kh_val(h, k).rght, pos);
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
cmpl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
je 0xcc3e
cmpq $0x100001, 0x18(%r14)   # imm = 0x100001
jb 0xcca2
jmp 0xcc3e
cmpl $0x0, 0x4(%r12)
movq 0x8(%r12), %rsi
js 0xcbdb
testb $0x10, 0xc(%rsi)
je 0xcbc2
cmpl %ebp, (%r12)
jg 0xcc4b
movq %r15, %rdi
callq 0x14c93
movq 0x8(%r12), %rax
movl $0x0, 0x24(%rax)
movq (%r14), %r12
jmp 0xcbe2
movl $0x0, 0x24(%rsi)
movq 0x10(%r12), %rax
testq %rax, %rax
je 0xcc3e
decq 0x18(%r14)
movq %rax, (%r14)
movq 0x10(%r14), %r13
decq (%r13)
movq 0x10(%r13), %rax
cmpq %rax, 0x8(%r13)
jne 0xcc2a
leaq (%rax,%rax), %rsi
testq %rax, %rax
movl $0x10, %eax
cmoveq %rax, %rsi
movq %rsi, 0x10(%r13)
movq 0x18(%r13), %rdi
shlq $0x3, %rsi
callq 0x3610
movq %rax, 0x18(%r13)
movq 0x8(%r13), %rax
movq 0x18(%r13), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, 0x8(%r13)
movq %r12, (%rcx,%rax,8)
movq (%r14), %r12
cmpq 0x8(%r14), %r12
jne 0xcba5
cmpl $0x0, (%rbx)
je 0xcca2
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
movl %r15d, %ecx
shrl $0x4, %ecx
movl (%rax,%rcx,4), %eax
movl %r14d, %ecx
andb $0x1e, %cl
shrl %cl, %eax
testb $0x3, %al
jne 0xcc96
movq 0x20(%rbx), %rax
movl %r15d, %r12d
shlq $0x5, %r12
movq 0x10(%rax,%r12), %rdi
movl %ebp, %esi
callq 0xd0e2
movq 0x20(%rbx), %rax
movq 0x18(%rax,%r12), %rdi
movl %ebp, %esi
callq 0xd0e2
incl %r15d
addl $0x2, %r14d
cmpl (%rbx), %r15d
jne 0xcc56
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bam_rmdupse.c
// Function: push_queue
static inline elem_t *push_queue(queue_t *queue, const bam1_t *b, int endpos, int score)
{
	elem_t *p = kl_pushp(q, queue);
	p->discarded = 0;
	p->endpos = endpos; p->score = score;
	if (p->b == 0) p->b = bam_init1();
	bam_copy1(p->b, b);
	return p;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movq %rdi, %r15
movq 0x10(%rdi), %rax
incq (%rax)
movl %edx, %r12d
movq %rsi, %rbx
movq 0x8(%rax), %rcx
testq %rcx, %rcx
je 0xcce7
movq 0x18(%rax), %rdx
leaq -0x1(%rcx), %rsi
movq %rsi, 0x8(%rax)
movq -0x8(%rdx,%rcx,8), %rax
jmp 0xccf6
movl $0x1, %edi
movl $0x18, %esi
callq 0x3530
movq 0x8(%r15), %r14
movq $0x0, 0x10(%rax)
movq %rax, 0x10(%r14)
movq %rax, 0x8(%r15)
incq 0x18(%r15)
movl %r12d, (%r14)
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
movl %ebp, 0x4(%r14)
cmpq $0x0, 0x8(%r14)
jne 0xcd35
movl $0x1, %edi
movl $0x38, %esi
callq 0x3530
movq %rax, 0x8(%r14)
movq 0x8(%r14), %r12
movq 0x30(%r12), %r15
movl 0x28(%r12), %ebp
movl 0x28(%rbx), %eax
cmpl %eax, %ebp
jge 0xcd7e
decl %eax
movl %eax, %ecx
sarl %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x2, %eax
orl %ecx, %eax
movl %eax, %ecx
sarl $0x4, %ecx
orl %eax, %ecx
movl %ecx, %eax
sarl $0x8, %eax
orl %ecx, %eax
movl %eax, %ebp
sarl $0x10, %ebp
orl %eax, %ebp
incl %ebp
movslq %ebp, %rsi
movq %r15, %rdi
callq 0x3610
movq %rax, %r15
movq 0x30(%rbx), %rsi
movslq 0x24(%rbx), %rdx
movq %r15, %rdi
callq 0x3680
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movups %xmm2, 0x20(%r12)
movq 0x30(%rbx), %rax
movq %rax, 0x30(%r12)
movups %xmm0, (%r12)
movups %xmm1, 0x10(%r12)
movl %ebp, 0x28(%r12)
movq %r15, 0x30(%r12)
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bam_rmdupse.c
// Function: clear_besthash
static void clear_besthash(besthash_t *h, int32_t pos)
{
	khint_t k;
	for (k = kh_begin(h); k != kh_end(h); ++k)
		if (kh_exist(h, k) && kh_val(h, k)->endpos <= pos)
			kh_del(best, h, k);
}

// Assembly:
cmpl $0x0, (%rdi)
je 0xd134
pushq %rbx
movq 0x10(%rdi), %rax
xorl %edx, %edx
xorl %r8d, %r8d
movl %r8d, %r9d
shrl $0x4, %r9d
movl (%rax,%r9,4), %r10d
movl %edx, %ecx
andl $0x1e, %ecx
movl %r10d, %r11d
shrl %cl, %r11d
testb $0x3, %r11b
jne 0xd128
movq 0x20(%rdi), %r11
movl %r8d, %ebx
movq (%r11,%rbx,8), %r11
cmpl %esi, (%r11)
jg 0xd128
btsl %ecx, %r10d
movl %r10d, (%rax,%r9,4)
decl 0x4(%rdi)
incl %r8d
addl $0x2, %edx
cmpl (%rdi), %r8d
jne 0xd0f1
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bam_mate.c
// Function: bam_mating
int bam_mating(int argc, char *argv[])
{
	bamFile in, out;
	if (argc < 3) {
		fprintf(stderr, "samtools fixmate <in.nameSrt.bam> <out.nameSrt.bam>\n");
		return 1;
	}
	in = (strcmp(argv[1], "-") == 0)? bam_dopen(fileno(stdin), "r") : bam_open(argv[1], "r");
    out = (strcmp(argv[2], "-") == 0)? bam_dopen(fileno(stdout), "w") : bam_open(argv[2], "w");
	bam_mating_core(in, out);
	bam_close(in); bam_close(out);
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x2, %edi
jle 0xd9d3
movq %rsi, %r14
movq 0x8(%rsi), %rbx
leaq 0x1748d(%rip), %rsi     # 0x24db6
movq %rbx, %rdi
callq 0x34e0
testl %eax, %eax
je 0xd946
leaq 0x1a68b(%rip), %rsi     # 0x27fc7
movq %rbx, %rdi
callq 0xfa04
jmp 0xd963
movq 0x21683(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
callq 0x3030
leaq 0x1a66b(%rip), %rsi     # 0x27fc7
movl %eax, %edi
callq 0xfb6d
movq %rax, %rbx
movq 0x10(%r14), %r14
leaq 0x17445(%rip), %rsi     # 0x24db6
movq %r14, %rdi
callq 0x34e0
testl %eax, %eax
je 0xd98e
leaq 0x16a11(%rip), %rsi     # 0x24395
movq %r14, %rdi
callq 0xfa04
jmp 0xd9ab
movq 0x21663(%rip), %rax     # 0x2eff8
movq (%rax), %rdi
callq 0x3030
leaq 0x169f1(%rip), %rsi     # 0x24395
movl %eax, %edi
callq 0xfb6d
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0xd614
movq %rbx, %rdi
callq 0x1050e
movq %r14, %rdi
callq 0x1050e
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x3bcf
movl $0x1, %eax
jmp 0xd9cb
nop
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bam_stat.c
// Function: bam_flagstat_core
bam_flagstat_t *bam_flagstat_core(bamFile fp)
{
	bam_flagstat_t *s;
	bam1_t *b;
	bam1_core_t *c;
	int ret;
	s = (bam_flagstat_t*)calloc(1, sizeof(bam_flagstat_t));
	b = bam_init1();
	c = &b->core;
	while ((ret = bam_read1(fp, b)) >= 0)
		flagstat_loop(s, c);
	bam_destroy1(b);
	if (ret != -1)
		fprintf(stderr, "[bam_flagstat_core] Truncated file? Continue anyway.\n");
	return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r15
movl $0x1, %edi
movl $0x60, %esi
callq 0x3530
movq %rax, %rbx
movl $0x1, %edi
movl $0x38, %esi
callq 0x3530
movq %rax, %r14
movq %r15, %rdi
movq %rax, %rsi
callq 0x1204b
testl %eax, %eax
js 0xdad2
movq (%rbx), %r12
movq 0x8(%r14), %rax
btq $0x20, %rax
jae 0xda94
incq 0x10(%rbx)
btq $0x21, %rax
jae 0xda3f
incq 0x20(%rbx)
btq $0x26, %rax
jae 0xda4a
incq 0x30(%rbx)
btq $0x27, %rax
jae 0xda55
incq 0x38(%rbx)
movq %rax, %rcx
shrq $0x20, %rcx
movl %ecx, %edx
andl $0xc, %edx
cmpl $0x8, %edx
jne 0xda6a
incq 0x28(%rbx)
testb $0xc, %cl
jne 0xda94
incq 0x18(%rbx)
movl 0x14(%r14), %ecx
cmpl (%r14), %ecx
je 0xda94
incq 0x50(%rbx)
movl %eax, %ecx
andl $0xff0000, %ecx         # imm = 0xFF0000
cmpl $0x40001, %ecx          # imm = 0x40001
jb 0xda94
incq 0x58(%rbx)
btq $0x22, %rax
jb 0xda9f
incq 0x8(%rbx)
btq $0x29, %rax
jae 0xdaaa
incq 0x40(%rbx)
btq $0x2a, %rax
jae 0xdab5
incq 0x48(%rbx)
movq %r15, %rdi
movq %r14, %rsi
callq 0x1204b
incq %r12
testl %eax, %eax
jns 0xda25
movl %eax, %ebp
movq %r12, (%rbx)
jmp 0xdad4
movl %eax, %ebp
testq %r14, %r14
je 0xdaea
movq 0x30(%r14), %rdi
callq 0x32c0
movq %r14, %rdi
callq 0x32c0
cmpl $-0x1, %ebp
jne 0xdafb
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x3beb
jmp 0xdaef
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bam_color.c
// Function: bam_aux_getCSi
char bam_aux_getCSi(bam1_t *b, int i)
{
	uint8_t *c = bam_aux_get(b, "CS");
	char *cs = NULL;

	// return the base if the tag was not found
	if(0 == c) return 0;

	cs = bam_aux2Z(c);
	// adjust for strandedness and leading adaptor
	if(bam1_strand(b)) i = strlen(cs) - 1 - i;
	else i++;
	return cs[i];
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r15
leaq 0x17f51(%rip), %rsi     # 0x25c76
callq 0x1110a
testq %rax, %rax
je 0xdd47
movq %rax, %rdi
callq 0x1199d
movq %rax, %r14
testb $0x10, 0xc(%r15)
jne 0xdd4b
incl %ebx
movl %ebx, %eax
jmp 0xdd57
xorl %eax, %eax
jmp 0xdd5d
movq %r14, %rdi
callq 0x32d0
notl %ebx
addl %ebx, %eax
cltq
movb (%r14,%rax), %al
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bam_color.c
// Function: bam_aux_getCQi
char bam_aux_getCQi(bam1_t *b, int i)
{
	uint8_t *c = bam_aux_get(b, "CQ");
	char *cq = NULL;
	
	// return the base if the tag was not found
	if(0 == c) return 0;

	cq = bam_aux2Z(c);
	// adjust for strandedness
	if(bam1_strand(b)) i = strlen(cq) - 1 - i;
	return cq[i];
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r15
leaq 0x17f05(%rip), %rsi     # 0x25c79
callq 0x1110a
testq %rax, %rax
je 0xdda7
movq %rax, %rdi
callq 0x1199d
movq %rax, %r14
testb $0x10, 0xc(%r15)
je 0xdd9e
movq %r14, %rdi
callq 0x32d0
notl %ebx
addl %ebx, %eax
movl %eax, %ebx
movslq %ebx, %rax
movb (%r14,%rax), %al
jmp 0xdda9
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bam_color.c
// Function: bam_aux_nt2int
char bam_aux_nt2int(char a)
{
	switch(toupper(a)) {
		case 'A':
			return 0;
			break;
		case 'C':
			return 1;
			break;
		case 'G':
			return 2;
			break;
		case 'T':
			return 3;
			break;
		default:
			return 4;
			break;
	}
}

// Assembly:
pushq %rbx
movl %edi, %ebx
callq 0x3280
movq (%rax), %rax
movslq %ebx, %rcx
movl (%rax,%rcx,4), %eax
cmpl $0x46, %eax
jg 0xddd3
cmpl $0x41, %eax
je 0xdde5
cmpl $0x43, %eax
jne 0xdde1
movb $0x1, %al
jmp 0xddeb
cmpl $0x47, %eax
je 0xdde9
cmpl $0x54, %eax
jne 0xdde1
movb $0x3, %al
jmp 0xddeb
movb $0x4, %al
jmp 0xddeb
xorl %eax, %eax
jmp 0xddeb
movb $0x2, %al
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bam_color.c
// Function: bam_aux_ntnt2cs
char bam_aux_ntnt2cs(char a, char b)
{
	a = bam_aux_nt2int(a);
	b = bam_aux_nt2int(b);
	if(4 == a || 4 == b) return '4';
	return "0123"[(int)(a ^ b)];
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
callq 0xddaf
movl %eax, %ebx
movl %ebp, %edi
callq 0xddaf
cmpb $0x4, %bl
sete %cl
cmpb $0x4, %al
sete %dl
orb %cl, %dl
movb $0x34, %cl
jne 0xde20
xorb %bl, %al
movzbl %al, %eax
leaq 0x17e5f(%rip), %rcx     # 0x25c7c
movb (%rax,%rcx), %cl
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bam_color.c
// Function: bam_aux_getCEi
char bam_aux_getCEi(bam1_t *b, int i)
{
	int cs_i;
	uint8_t *c = bam_aux_get(b, "CS");
	char *cs = NULL;
	char prev_b, cur_b;
	char cur_color, cor_color;

	// return the base if the tag was not found
	if(0 == c) return 0;
	
	cs = bam_aux2Z(c);

	// adjust for strandedness and leading adaptor
	if(bam1_strand(b)) { //reverse strand
		cs_i = strlen(cs) - 1 - i;
		// get current color
		cur_color = cs[cs_i];
		// get previous base.  Note: must rc adaptor
		prev_b = (cs_i == 1) ? "TGCAN"[(int)bam_aux_nt2int(cs[0])] : bam_nt16_rev_table[bam1_seqi(bam1_seq(b), i+1)];
		// get current base
		cur_b = bam_nt16_rev_table[bam1_seqi(bam1_seq(b), i)]; 
	}
	else {
		cs_i=i+1;
		// get current color
		cur_color = cs[cs_i];
		// get previous base
		prev_b = (0 == i) ? cs[0] : bam_nt16_rev_table[bam1_seqi(bam1_seq(b), i-1)];
		// get current base
		cur_b = bam_nt16_rev_table[bam1_seqi(bam1_seq(b), i)];
	}

	// corrected color
	cor_color = bam_aux_ntnt2cs(prev_b, cur_b);

	if(cur_color == cor_color) { 
		return '-';
	}
	else {
		return cur_color;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
leaq 0x17e39(%rip), %rsi     # 0x25c76
callq 0x1110a
testq %rax, %rax
je 0xde93
movq %rax, %rdi
callq 0x1199d
movq %rax, %r15
movq 0x8(%r14), %r12
btq $0x24, %r12
jb 0xde9a
movslq %ebx, %rax
movb 0x1(%r15,%rax), %bpl
testl %ebx, %ebx
je 0xdf18
movq %r12, %rax
shrq $0x30, %rax
shlq $0x2, %rax
addq 0x30(%r14), %rax
movl %r12d, %ecx
shrl $0x18, %ecx
addq %rax, %rcx
leal -0x1(%rbx), %eax
movl %eax, %edx
shrl $0x1f, %edx
addl %ebx, %edx
decl %edx
jmp 0xdeef
xorl %eax, %eax
jmp 0xdf78
movq %r15, %rdi
callq 0x32d0
movl %ebx, %ecx
notl %ecx
addl %ecx, %eax
cltq
movb (%r15,%rax), %bpl
cmpl $0x1, %eax
jne 0xdecb
movsbl (%r15), %edi
callq 0xddaf
movzbl %al, %eax
leaq 0x17dbb(%rip), %r15     # 0x25c81
addq %rax, %r15
jmp 0xdf18
movq %r12, %rax
shrq $0x30, %rax
shlq $0x2, %rax
addq 0x30(%r14), %rax
movl %r12d, %ecx
shrl $0x18, %ecx
addq %rax, %rcx
leal 0x1(%rbx), %eax
movl %eax, %edx
shrl $0x1f, %edx
addl %ebx, %edx
incl %edx
movl %edx, %esi
sarl %esi
movslq %esi, %rsi
movzbl (%rsi,%rcx), %r15d
andl $0x3e, %edx
subl %edx, %eax
shll $0x2, %eax
movb $0x4, %cl
subb %al, %cl
shrl %cl, %r15d
leaq 0x21fcf(%rip), %rax     # 0x2fee0
andl $0xf, %r15d
addq (%rax), %r15
leaq 0x21fc1(%rip), %rax     # 0x2fee0
movq %r12, %rcx
shrq $0x30, %rcx
shlq $0x2, %rcx
addq 0x30(%r14), %rcx
shrl $0x18, %r12d
addq %rcx, %r12
movl %ebx, %ecx
shrl $0x1f, %ecx
addl %ebx, %ecx
movl %ecx, %edx
sarl %edx
movslq %edx, %rdx
movzbl (%rdx,%r12), %edx
andl $0x3e, %ecx
subl %ecx, %ebx
shll $0x2, %ebx
movb $0x4, %cl
subb %bl, %cl
shrl %cl, %edx
movq (%rax), %rax
andl $0xf, %edx
movsbl (%rax,%rdx), %esi
movsbl (%r15), %edi
callq 0xdded
cmpb %al, %bpl
movzbl %bpl, %ecx
movl $0x2d, %eax
cmovnel %ecx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bgzf.c
// Function: bgzf_open
BGZF*
bgzf_open(const char* __restrict path, const char* __restrict mode)
{
    BGZF* fp = NULL;
    if (strchr(mode, 'r') || strchr(mode, 'R')) { /* The reading mode is preferred. */
#ifdef _USE_KNETFILE
		knetFile *file = knet_open(path, mode);
		if (file == 0) return 0;
		fp = bgzf_read_init();
		fp->file_descriptor = -1;
		fp->open_mode = 'r';
		fp->x.fpr = file;
#else
		int fd, oflag = O_RDONLY;
#ifdef _WIN32
		oflag |= O_BINARY;
#endif
		fd = open(path, oflag);
		if (fd == -1) return 0;
        fp = open_read(fd);
#endif
    } else if (strchr(mode, 'w') || strchr(mode, 'W')) {
		int fd, oflag = O_WRONLY | O_CREAT | O_TRUNC;
#ifdef _WIN32
		oflag |= O_BINARY;
#endif
		fd = open(path, oflag, 0666);
		if (fd == -1) return 0;
        fp = open_write(fd, strchr(mode, 'u')? 1 : 0);
    }
    if (fp != NULL) fp->owned_file = 1;
    return fp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
movl $0x72, %esi
callq 0x3440
testq %rax, %rax
jne 0xfa35
movq %r14, %rdi
movl $0x52, %esi
callq 0x3440
testq %rax, %rax
je 0xfa72
movq %r15, %rdi
movq %r14, %rsi
callq 0x1c348
movq %rax, %r14
testq %rax, %rax
je 0xfa60
callq 0x10749
movq %rax, %rbx
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movb $0x72, 0x4(%rax)
movq %r14, 0x8(%rax)
jmp 0xfa62
xorl %ebx, %ebx
testq %r14, %r14
je 0xfad8
testq %rbx, %rbx
je 0xfada
movb $0x1, 0x5(%rbx)
jmp 0xfada
movq %r14, %rdi
movl $0x77, %esi
callq 0x3440
testq %rax, %rax
jne 0xfa96
movq %r14, %rdi
movl $0x57, %esi
callq 0x3440
testq %rax, %rax
je 0xfae8
xorl %ebx, %ebx
movq %r15, %rdi
movl $0x241, %esi            # imm = 0x241
movl $0x1b6, %edx            # imm = 0x1B6
xorl %eax, %eax
callq 0x33b0
movl %eax, %ebp
cmpl $-0x1, %eax
je 0xfad3
movq %r14, %rdi
movl $0x75, %esi
callq 0x3440
xorl %esi, %esi
testq %rax, %rax
setne %sil
movl %ebp, %edi
callq 0xfaef
movq %rax, %rbx
cmpl $-0x1, %ebp
jne 0xfa67
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
jmp 0xfa67
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bgzf.c
// Function: open_write
static
BGZF*
open_write(int fd, bool is_uncompressed)
{
    FILE* file = fdopen(fd, "w");
    BGZF* fp;
	if (file == 0) return 0;
	fp = malloc(sizeof(BGZF));
    fp->file_descriptor = fd;
    fp->open_mode = 'w';
    fp->owned_file = 0; fp->is_uncompressed = is_uncompressed;
#ifdef _USE_KNETFILE
    fp->x.fpw = file;
#else
    fp->file = file;
#endif
    fp->uncompressed_block_size = DEFAULT_BLOCK_SIZE;
    fp->uncompressed_block = NULL;
    fp->compressed_block_size = MAX_BLOCK_SIZE;
    fp->compressed_block = malloc(MAX_BLOCK_SIZE);
    fp->block_address = 0;
    fp->block_offset = 0;
    fp->block_length = 0;
    fp->error = NULL;
    return fp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movl %edi, %r14d
leaq 0x14893(%rip), %rsi     # 0x24395
callq 0x3360
testq %rax, %rax
je 0xfb5d
movq %rax, %r15
movl $0x50, %edi
callq 0x31d0
movq %rax, %rbx
movl %r14d, (%rax)
movw $0x77, 0x4(%rax)
movb %bpl, 0x6(%rax)
movq %r15, 0x8(%rax)
movabsq $0x1000000010000, %rax  # imm = 0x1000000010000
movq %rax, 0x10(%rbx)
xorl %r14d, %r14d
movq %r14, 0x18(%rbx)
movl $0x10000, %edi          # imm = 0x10000
callq 0x31d0
movq %rax, 0x20(%rbx)
movq %r14, 0x40(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rbx)
jmp 0xfb5f
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq