LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/estwings57[P]CasHMC/sources/Packet.cpp
// Function: CasHMC::Packet::Packet(CasHMC::Packet const&)
Packet::Packet(const Packet &f)
{
	trace = f.trace;
	packetType = f.packetType;
	bufPopDelay = f.bufPopDelay;
	chkCRC = f.chkCRC;
	chkRRP = f.chkRRP;
	segment = f.segment;
	reqDataSize = f.reqDataSize;
	
	CUB = f.CUB;	TAG = f.TAG;
	LNG = f.LNG;	CMD = f.CMD;
	
	CRC = f.CRC;	RTC = f.RTC;
	SLID = f.SLID;	SEQ = f.SEQ;
	FRP = f.FRP;	RRP = f.RRP;
	
	ADRS = f.ADRS;	Pb = f.Pb;
	
	AF = f.AF;		ERRSTAT = f.ERRSTAT;
	DINV = f.DINV;
	
	if(CRC_CHECK) {
		if(LNG>1) {
			DATA = new uint64_t[(LNG-1)*2];
			uint64_t tempData;
			for(int i=0; i<(LNG-1)*2; i++) {
				tempData = rand();
				tempData = (tempData<<32)|rand();
				DATA[i] = tempData;
			}
		}
		else {
			DATA = NULL;
		}
		MakeCRCtable(CRCtable, 0xEB31D82E);
	}
	else {
		DATA = NULL;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x12d59(%rip), %rax     # 0x30d00
movq %rax, (%rdi)
movq 0x8(%rsi), %rax
movq %rax, 0x8(%rdi)
movq 0x10(%rsi), %rax
movq %rax, 0x10(%rdi)
movb 0x420(%rsi), %al
movb %al, 0x420(%rdi)
movb 0x421(%rsi), %al
movb %al, 0x421(%rdi)
movb 0x422(%rsi), %al
movb %al, 0x422(%rdi)
movdqu 0x424(%rsi), %xmm0
movdqu %xmm0, 0x424(%rdi)
movups 0x434(%rsi), %xmm1
movups %xmm1, 0x434(%rdi)
movq 0x444(%rsi), %rax
movq %rax, 0x444(%rdi)
movl 0x44c(%rsi), %eax
movl %eax, 0x44c(%rdi)
movq 0x450(%rsi), %rax
movq %rax, 0x450(%rdi)
movups 0x458(%rsi), %xmm1
movups %xmm1, 0x458(%rdi)
leaq 0x13493(%rip), %rax     # 0x314cc
cmpb $0x1, (%rax)
jne 0x1e09d
pshufd $0xff, %xmm0, %xmm0     # xmm0 = xmm0[3,3,3,3]
movd %xmm0, %r14d
cmpl $0x2, %r14d
jb 0x1e0a8
leal -0x2(,%r14,2), %edi
shlq $0x3, %rdi
callq 0x4030
movq %rax, 0x18(%rbx)
xorl %r15d, %r15d
leal -0x2(,%r14,2), %eax
cmpq %rax, %r15
jae 0x1e0ad
callq 0x4100
movl %eax, %r14d
shlq $0x20, %r14
callq 0x4100
cltq
orq %r14, %rax
movq 0x18(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
movl 0x430(%rbx), %r14d
jmp 0x1e066
andq $0x0, 0x18(%rbx)
popq %rbx
popq %r14
popq %r15
retq
andq $0x0, 0x18(%rbx)
addq $0x20, %rbx
movq %rbx, %rsi
movl $0xeb31d82e, %edx       # imm = 0xEB31D82E
popq %rbx
popq %r14
popq %r15
jmp 0x1de34
nop
// File: /workspace/github_cpp_makefile_star2_O2/estwings57[P]CasHMC/sources/Packet.cpp
// Function: CasHMC::Packet::CalcCRC(unsigned char const*, int, unsigned int, unsigned int*)
uint32_t Packet::CalcCRC(const unsigned char *mem, signed int size, uint32_t crc, uint32_t *table)
{
	crc = ~crc;
	while(size--){
		crc = table[(crc ^ *(mem++)) & 0xFF] ^ (crc >> 8);
	}
	return ~crc;
}

// Assembly:
movl %ecx, %eax
notl %eax
movl %edx, %ecx
xorl %edx, %edx
cmpl %edx, %ecx
je 0x1e2bb
movb (%rsi,%rdx), %dil
xorb %al, %dil
movzbl %dil, %edi
shrl $0x8, %eax
xorl (%r8,%rdi,4), %eax
incq %rdx
jmp 0x1e2a0
notl %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/estwings57[P]CasHMC/sources/RunSim.cpp
// Function: MakeRandomTransaction()
void MakeRandomTransaction(void)
{
	int rand_tran = rand()%10000+1;
	if(rand_tran <= (int)(memUtil*10000)) {
		Transaction *newTran;
		uint64_t physicalAddress = rand();
		physicalAddress = (physicalAddress<<32)|rand();
		
		if(physicalAddress%101 <= (int)rwRatio) {
			newTran = new Transaction(DATA_READ, physicalAddress, TRANSACTION_SIZE, casHMCWrapper);		// Read transaction
		}
		else {
			newTran = new Transaction(DATA_WRITE, physicalAddress, TRANSACTION_SIZE, casHMCWrapper);	// Write transaction
		}
		transactionBuffers.push_back(newTran);
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
callq 0x4100
movl $0x2710, %ecx           # imm = 0x2710
cltd
idivl %ecx
leaq 0x11b95(%rip), %rax     # 0x31418
movsd (%rax), %xmm0
mulsd 0x7bb1(%rip), %xmm0     # 0x27440
cvttsd2si %xmm0, %eax
cmpl %eax, %edx
jge 0x1f91c
callq 0x4100
movl %eax, %ebx
shlq $0x20, %rbx
callq 0x4100
movslq %eax, %r14
orq %rbx, %r14
pushq $0x65
popq %rcx
movq %r14, %rax
xorl %edx, %edx
divq %rcx
movq %rdx, %r15
leaq 0x11b5a(%rip), %rax     # 0x31420
cvttsd2si (%rax), %eax
movslq %eax, %r12
pushq $0x30
popq %rdi
callq 0x4310
movq %rax, %rbx
leaq 0x11bc1(%rip), %rax     # 0x314a0
movl (%rax), %ecx
movq 0x12ae8(%rip), %r8      # 0x323d0
cmpq %r12, %r15
jbe 0x1f8fd
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x20a5c
jmp 0x1f90a
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x20a5c
movq %rsp, %rsi
movq %rbx, (%rsi)
leaq 0x12aa1(%rip), %rdi     # 0x323b8
callq 0xe99e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x1f92a
movq %rax, %r14
pushq $0x30
popq %rsi
movq %rbx, %rdi
callq 0x4320
movq %r14, %rdi
callq 0x4520
// File: /workspace/github_cpp_makefile_star2_O2/estwings57[P]CasHMC/sources/VaultController.cpp
// Function: CasHMC::VaultController::VaultController(std::basic_ofstream<char, std::char_traits<char>>&, std::basic_ofstream<char, std::char_traits<char>>&, unsigned int)
VaultController::VaultController(ofstream &debugOut_, ofstream &stateOut_, unsigned id):
	DualVectorObject<Packet, Packet>(debugOut_, stateOut_, MAX_VLT_BUF, MAX_VLT_BUF),
	vaultContID(id)
{	
	classID << vaultContID;
	header = "        (VC_" + classID.str() + ")";
	
	refreshCountdown = 0;
	powerDown = false;
	poppedCMD = NULL;
	atomicCMD = NULL;
	atomicOperLeft = 0;
	pendingDataSize = 0;
	
	cmdBus = NULL;
	cmdCyclesLeft = 0;
	dataBus = NULL;
	dataCyclesLeft = 0;
	
	//Make class objects
	commandQueue = new CommandQueue(debugOut, stateOut, vaultContID, this);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movl %ecx, %ebp
movq %rdi, %rbx
leaq 0x10004(%rip), %rax     # 0x314c0
movl (%rax), %ecx
movl %ecx, %r8d
callq 0x13168
leaq 0xf893(%rip), %rax      # 0x30d60
movq %rax, (%rbx)
movl %ebp, 0x204(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x238(%rbx)
andq $0x0, 0x248(%rbx)
leaq 0x50(%rbx), %rdi
movl %ebp, %esi
movups %xmm0, 0x278(%rbx)
movups %xmm0, 0x288(%rbx)
movups %xmm0, 0x298(%rbx)
callq 0x4210
leaq 0x58(%rbx), %rsi
movq %rsp, %rdi
callq 0x4450
leaq 0x6688(%rip), %rsi      # 0x27ba3
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
callq 0xdcaa
leaq 0x5fa2(%rip), %rdx      # 0x274d1
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0xdeea
leaq 0x20(%rbx), %rdi
leaq 0x40(%rsp), %r14
movq %r14, %rsi
callq 0x4380
movq %r14, %rdi
callq 0x4598
leaq 0x20(%rsp), %rdi
callq 0x4598
movq %rsp, %rdi
callq 0x4598
andl $0x0, 0x208(%rbx)
movb $0x0, 0x20c(%rbx)
andq $0x0, 0x258(%rbx)
andl $0x0, 0x260(%rbx)
andq $0x0, 0x268(%rbx)
andl $0x0, 0x270(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x220(%rbx)
andq $0x0, 0x230(%rbx)
movl $0x280, %edi            # imm = 0x280
callq 0x4310
movq %rax, %r15
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
movl 0x204(%rbx), %ecx
movq %rax, %rdi
movq %rbx, %r8
callq 0xec04
movq %r15, 0x218(%rbx)
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movl $0x280, %esi            # imm = 0x280
movq %r15, %rdi
callq 0x4320
jmp 0x21614
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x4598
jmp 0x21605
movq %rax, %r14
movq %rsp, %rdi
callq 0x4598
jmp 0x21614
jmp 0x21611
movq %rax, %r14
leaq 0x238(%rbx), %r15
leaq 0x278(%rbx), %r12
leaq 0x290(%rbx), %rdi
callq 0xe140
movq %r12, %rdi
callq 0x114fa
movq %r15, %rdi
callq 0xe140
movq %rbx, %rdi
callq 0x135ba
movq %r14, %rdi
callq 0x4520
// File: /workspace/github_cpp_makefile_star2_O2/estwings57[P]CasHMC/sources/VaultController.cpp
// Function: CasHMC::VaultController::~VaultController()
VaultController::~VaultController()
{
	pendingReadData.clear(); 
	writeDataToSend.clear(); 
	writeDataCountdown.clear(); 

	delete commandQueue;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xf700(%rip), %rax      # 0x30d60
movq %rax, (%rdi)
movq 0x238(%rdi), %rax
cmpq %rax, 0x240(%rdi)
je 0x2167a
movq %rax, 0x240(%rbx)
movq 0x278(%rbx), %rax
cmpq %rax, 0x280(%rbx)
je 0x21691
movq %rax, 0x280(%rbx)
movq 0x290(%rbx), %rax
cmpq %rax, 0x298(%rbx)
je 0x216a8
movq %rax, 0x298(%rbx)
leaq 0x238(%rbx), %r14
leaq 0x278(%rbx), %r15
leaq 0x290(%rbx), %r12
movq 0x218(%rbx), %rdi
testq %rdi, %rdi
je 0x216cf
movq (%rdi), %rax
callq *0x8(%rax)
movq %r12, %rdi
callq 0xe140
movq %r15, %rdi
callq 0x114fa
movq %r14, %rdi
callq 0xe140
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x135ba
// File: /workspace/github_cpp_makefile_star2_O2/estwings57[P]CasHMC/sources/VaultController.cpp
// Function: CasHMC::VaultController::ReverseAddressMapping(unsigned long&, unsigned int, unsigned int, unsigned int)
void VaultController::ReverseAddressMapping(uint64_t &physicalAddress, unsigned bankAdd, unsigned colAdd, unsigned rowAdd)
{
	unsigned maxBlockBit = _log2(ADDRESS_MAPPING);
	
	physicalAddress = rowAdd;
	physicalAddress <<= (_log2(NUM_COLS)-maxBlockBit);
	physicalAddress += (colAdd>>maxBlockBit);
	
	physicalAddress <<= _log2(NUM_BANKS);
	physicalAddress += bankAdd;
	
	physicalAddress <<= _log2(NUM_VAULTS);
	physicalAddress += vaultContID;
	
	physicalAddress <<= maxBlockBit;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %r13d
movl %ecx, %r12d
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xf683(%rip), %rax      # 0x3158c
movl (%rax), %edi
callq 0x13324
movl %eax, %ebp
movl %r13d, %eax
movq %rax, (%rbx)
leaq 0xf669(%rip), %rax      # 0x31588
movl (%rax), %edi
callq 0x13324
subl %ebp, %eax
movq (%rbx), %rdx
movl %eax, %ecx
shlq %cl, %rdx
movl %ebp, %ecx
shrl %cl, %r12d
addq %rdx, %r12
movq %r12, (%rbx)
leaq 0xf63e(%rip), %rax      # 0x31580
movl (%rax), %edi
callq 0x13324
movq (%rbx), %rdx
movl %eax, %ecx
shlq %cl, %rdx
movl %r15d, %eax
addq %rdx, %rax
movq %rax, (%rbx)
leaq 0xf61b(%rip), %rax      # 0x3157c
movl (%rax), %edi
callq 0x13324
movq (%rbx), %rdx
movl %eax, %ecx
shlq %cl, %rdx
movl 0x204(%r14), %eax
addq %rdx, %rax
movl %ebp, %ecx
shlq %cl, %rax
movq %rax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/estwings57[P]CasHMC/sources/VaultController.cpp
// Function: CasHMC::VaultController::EnablePowerdown()
void VaultController::EnablePowerdown()
{
	if(USE_LOW_POWER) {
		if(commandQueue->isEmpty() && !commandQueue->refreshWaiting) {
			if(dramP->powerDown()) {
				powerDown = true;
			}
		}
		else if(powerDown && dramP->bankStates[0]->nextPowerUp <= currentClockCycle) {
			dramP->powerUp();
			powerDown = false;
		}
	}
}

// Assembly:
pushq %rbx
leaq 0xe44e(%rip), %rax      # 0x31598
cmpb $0x1, (%rax)
jne 0x231bb
movq %rdi, %rbx
movq 0x218(%rdi), %rdi
callq 0x109b8
testb %al, %al
je 0x23172
movq 0x218(%rbx), %rax
cmpb $0x0, 0x1d0(%rax)
je 0x231a4
cmpb $0x1, 0x20c(%rbx)
jne 0x231bb
movq 0x210(%rbx), %rdi
movq 0x1d8(%rdi), %rax
movq (%rax), %rax
movq 0x30(%rax), %rax
cmpq 0x8(%rbx), %rax
ja 0x231bb
callq 0x14a58
movb $0x0, 0x20c(%rbx)
jmp 0x231bb
movq 0x210(%rbx), %rdi
callq 0x149f2
testb %al, %al
je 0x231bb
movb $0x1, 0x20c(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/estwings57[P]CasHMC/sources/VaultController.cpp
// Function: CasHMC::VaultController::AddressMapping(unsigned long, unsigned int&, unsigned int&, unsigned int&)
void VaultController::AddressMapping(uint64_t physicalAddress, unsigned &bankAdd, unsigned &colAdd, unsigned &rowAdd)
{
	unsigned maxBlockBit = _log2(ADDRESS_MAPPING);
	physicalAddress >>= maxBlockBit/*max block bits*/ + _log2(NUM_VAULTS)/*vault address bits*/;
	
	//Extract bank address
	bankAdd = physicalAddress & (NUM_BANKS-1);
	physicalAddress >>= _log2(NUM_BANKS);
	
	//Extract column address
	colAdd = physicalAddress & ((NUM_COLS-1)>>maxBlockBit);
	colAdd <<= maxBlockBit;
	physicalAddress >>= (_log2(NUM_COLS)-maxBlockBit);
	
	//Extract row address
	rowAdd = physicalAddress & (NUM_ROWS-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, %r14
leaq 0xe3b2(%rip), %rax      # 0x3158c
movl (%rax), %edi
callq 0x13324
movl %eax, %r12d
leaq 0xe391(%rip), %rax      # 0x3157c
movl (%rax), %edi
callq 0x13324
leal (%rax,%r12), %ecx
shrq %cl, %r14
leaq 0xe380(%rip), %rax      # 0x31580
movl (%rax), %ecx
decl %ecx
movl %r14d, %edx
andl %ecx, %edx
movl %edx, (%r13)
movl (%rax), %edi
callq 0x13324
movl %eax, %ecx
shrq %cl, %r14
leaq 0xe368(%rip), %rax      # 0x31588
movl (%rax), %edx
decl %edx
movl %r12d, %ecx
sarl %cl, %edx
movl %r14d, %esi
andl %edx, %esi
shll %cl, %esi
movl %esi, (%r15)
movl (%rax), %edi
callq 0x13324
subl %r12d, %eax
movl %eax, %ecx
shrq %cl, %r14
leaq 0xe33b(%rip), %rax      # 0x31584
movl (%rax), %eax
decl %eax
andl %eax, %r14d
movl %r14d, (%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gersteinlab[P]MUSIC/src/ms_peak_calling_utils.cpp
// Function: replace_profiles_for_debug(double*, int, int, int)
double* replace_profiles_for_debug(double* signal_profile, int l_profile, int base_posn, int l_new_profile)
{
	fprintf(stderr, "Replacing signal profile with %d long profile.\n", l_new_profile);
	double* _signal_profile = new double[l_new_profile + 2];
	for(int i = base_posn; i <= base_posn + l_new_profile; i++)
	{
		_signal_profile[i-base_posn+1] = signal_profile[i];
	}

	return(_signal_profile);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %ebp
movq %rdi, %r14
movq 0x2cc73(%rip), %rax     # 0x34fe0
movq (%rax), %rdi
leaq 0x1e679(%rip), %rsi     # 0x269f0
xorl %r15d, %r15d
movl %ecx, %edx
xorl %eax, %eax
callq 0x2240
leal 0x2(%rbx), %eax
shlq $0x3, %rax
cmpl $-0x2, %ebx
pushq $-0x1
popq %rdi
cmovgeq %rax, %rdi
callq 0x2040
addl %ebp, %ebx
movslq %ebp, %rcx
movslq %ebx, %rdx
leaq (%r14,%rcx,8), %rsi
leaq (%rcx,%r15), %rdi
cmpq %rdx, %rdi
jg 0x83c0
movsd (%rsi,%r15,8), %xmm0
movsd %xmm0, 0x8(%rax,%r15,8)
incq %r15
jmp 0x83a5
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/gersteinlab[P]MUSIC/src/ms_peak_calling_utils.cpp
// Function: dump_ERs_per_q_value_and_summit(std::vector<t_annot_region*, std::allocator<t_annot_region*>>*, char*)
void dump_ERs_per_q_value_and_summit(vector<t_annot_region*>* regions, char* op_fp)
{
	FILE* f_op = open_f(op_fp, "w");

	for(int i_reg = 0; i_reg < (int)regions->size(); i_reg++)
	{
		t_ER_info* cur_reg_info = (t_ER_info*)(regions->at(i_reg)->data);

		double FC = cur_reg_info->total_chip_mass / (cur_reg_info->total_control_mass+1);

		//t_significance_info* sig_info = (t_significance_info*)(regions->at(i_reg)->significance_info);
		//fprintf(f_op, "%s\t%d\t%d\t.\t%lf\t%c\t%d\t%d\t%d\t%d\t%lf\t%lf\n", regions->at(i_reg)->chrom, regions->at(i_reg)->start, regions->at(i_reg)->end, 
		//	sig_info->log_q_val, 
		//	regions->at(i_reg)->strand,
		//	(int)((cur_reg_info->rev_strand_mass_of_center + cur_reg_info->fore_strand_mass_of_center) / 2), 
		//	(int)((cur_reg_info->fore_climax_posn + cur_reg_info->rev_climax_posn) / 2), 
		//	(int)(cur_reg_info->climax_posn), 
		//	(int)(cur_reg_info->mappable_trough), 
		//	FC,
		//	cur_reg_info->max_chip_mass / cur_reg_info->max_control_mass);
		t_significance_info* sig_info = (t_significance_info*)(regions->at(i_reg)->significance_info);
		fprintf(f_op, "%s\t%d\t%d\t.\t%lf\t%c\t%d\t%d\t%lf\n", regions->at(i_reg)->chrom, regions->at(i_reg)->start, regions->at(i_reg)->end, 
			sig_info->log_q_val / log(10.0), 
			regions->at(i_reg)->strand,
			(int)(cur_reg_info->climax_posn), 
			(int)(cur_reg_info->mappable_trough), 
			FC);
	} // i_reg loop.

	fclose(f_op);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x18218(%rip), %rsi     # 0x24aa8
movq %rax, %rdi
callq 0x2027c
movq %rax, 0x8(%rsp)
xorl %r15d, %r15d
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x3, %rax
cltq
cmpq %rax, %r15
jge 0xc997
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7404
movq (%rax), %rax
movq 0x48(%rax), %r14
movsd 0x38(%r14), %xmm1
movsd 0x40(%r14), %xmm0
addsd 0x1772c(%rip), %xmm0    # 0x24008
divsd %xmm0, %xmm1
movsd %xmm1, 0x20(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7404
movq (%rax), %rax
movq 0x40(%rax), %r13
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7404
movq (%rax), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7404
movq (%rax), %rax
movl 0xc(%rax), %ebp
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7404
movq (%rax), %rax
movl 0x20(%rax), %r12d
movsd 0x8(%r13), %xmm0
divsd 0x1a091(%rip), %xmm0    # 0x269d0
movsd %xmm0, 0x10(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7404
movq (%rax), %rax
movsbl 0x8(%rax), %r9d
movl 0x48(%r14), %r10d
movl 0x60(%r14), %r11d
movq 0x8(%rsp), %rdi
leaq 0x1a904(%rip), %rsi     # 0x27270
movq 0x18(%rsp), %rdx
movl %ebp, %ecx
movl %r12d, %r8d
movsd 0x10(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movb $0x2, %al
pushq %r11
pushq %r10
callq 0x2240
popq %rcx
popq %rdx
incq %r15
jmp 0xc8a0
movq 0x8(%rsp), %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2160
// File: /workspace/github_cpp_makefile_star2_O2/gersteinlab[P]MUSIC/src/ms_peak_calling_utils.cpp
// Function: dump_broadPeak_formatted_op(std::vector<t_annot_region*, std::allocator<t_annot_region*>>*, char*)
void dump_broadPeak_formatted_op(vector<t_annot_region*>* regions, char* op_fp)
{
	FILE* f_op = open_f(op_fp, "w");

	for(int i_reg = 0; i_reg < (int)regions->size(); i_reg++)
	{
		t_ER_info* cur_reg_info = (t_ER_info*)(regions->at(i_reg)->data);

		double FC = cur_reg_info->total_chip_mass / (cur_reg_info->total_control_mass+1);

		t_significance_info* sig_info = (t_significance_info*)(regions->at(i_reg)->significance_info);
		fprintf(f_op, "%s\t%d\t%d\t.\t.\t+\t%d\t%.6f\t%.6f\n", regions->at(i_reg)->chrom, regions->at(i_reg)->start, regions->at(i_reg)->end, 
			(int)(FC),
			sig_info->log_p_val / xlog(10), 
			sig_info->log_q_val / xlog(10));
	} // i_reg loop.

	fclose(f_op);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x180de(%rip), %rsi     # 0x24aa8
movq %rax, %rdi
callq 0x2027c
movq %rax, 0x10(%rsp)
xorl %r15d, %r15d
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x3, %rax
cltq
cmpq %rax, %r15
jge 0xcaea
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7404
movq (%rax), %rax
movq 0x48(%rax), %rax
movsd 0x38(%rax), %xmm1
movsd 0x40(%rax), %xmm0
addsd 0x175f4(%rip), %xmm0    # 0x24008
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7404
movq (%rax), %rax
movq 0x40(%rax), %r13
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7404
movq (%rax), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7404
movq (%rax), %rax
movl 0xc(%rax), %ebp
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7404
movq (%rax), %rax
movl 0x20(%rax), %r12d
cvttsd2si 0x8(%rsp), %r14d
movsd (%r13), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x19f54(%rip), %xmm0    # 0x269d8
callq 0x1f860
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x8(%r13), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x19f2b(%rip), %xmm0    # 0x269d8
callq 0x1f860
movsd 0x18(%rsp), %xmm1
divsd %xmm0, %xmm1
movq 0x10(%rsp), %rdi
leaq 0x1a78b(%rip), %rsi     # 0x27253
movq 0x20(%rsp), %rdx
movl %ebp, %ecx
movl %r12d, %r8d
movl %r14d, %r9d
movsd 0x8(%rsp), %xmm0
movb $0x2, %al
callq 0x2240
incq %r15
jmp 0xc9da
movq 0x10(%rsp), %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2160
// File: /workspace/github_cpp_makefile_star2_O2/gersteinlab[P]MUSIC/src/ms_mapped_read_tools.cpp
// Function: count_preprocessed_reads(char*, int&, int&)
void count_preprocessed_reads(char* mapped_reads_fp, int& n_F, int& n_R)
{
	n_F = 0;
	n_R = 0;

	FILE* f_mapped_reads = open_f(mapped_reads_fp, "r");
	char cur_line[1000];
	while(1)
	{
		if(fgets(cur_line, 1000, f_mapped_reads) == NULL)
		{
			break;
		}

		char cur_strand_char;
		if(sscanf(cur_line, "%*s %c", &cur_strand_char) != 1)
		{
			break;
		}

		if(cur_strand_char == 'F')
		{
			n_F++;
		}

		if(cur_strand_char == 'R')
		{
			n_R++;
		}
	} // file reading loop.
	fclose(f_mapped_reads);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3f8, %rsp            # imm = 0x3F8
movq %rdx, %rbx
movq %rsi, %r14
andl $0x0, (%rsi)
andl $0x0, (%rdx)
leaq 0x192a5(%rip), %rsi     # 0x26d08
callq 0x2027c
movq %rax, %r15
leaq 0x10(%rsp), %r12
leaq 0x19a4b(%rip), %r13     # 0x274c2
leaq 0xf(%rsp), %rbp
movq %r12, %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %r15, %rdx
callq 0x2290
testq %rax, %rax
je 0xdabf
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x2150
cmpl $0x1, %eax
jne 0xdabf
movzbl 0xf(%rsp), %eax
movq %r14, %rcx
cmpl $0x46, %eax
je 0xdabb
cmpl $0x52, %eax
jne 0xda7c
movq %rbx, %rcx
incl (%rcx)
jmp 0xda7c
movq %r15, %rdi
callq 0x2160
addq $0x3f8, %rsp            # imm = 0x3F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/gersteinlab[P]MUSIC/src/ms_mapped_read_tools.cpp
// Function: preprocess_tagAlign_read_line(char*, char*, char*, int&, int&, char&, char*)
void preprocess_tagAlign_read_line(char* cur_line, 
	char* read_id,
	char* chrom, 
	int& chr_index, int& sequenced_length, 
	char& strand_char, 
	char* cigar_str)
{
	int chr_start_index;
	int chr_end_index;
	char strand_sign;

	if(sscanf(cur_line, "%s %d %d %*s %*d %c", chrom, &chr_start_index, &chr_end_index, &strand_sign) == 4)
	{
		// Note that the indices in tagAlign file are 0 based, these must be translated to 1 based indices.
		//chr_start_index += (CODEBASE_START_BASE - tagAlign_START_BASE);
		//chr_end_index += (CODEBASE_START_BASE - tagAlign_START_BASE);
		chr_start_index = translate_coord(chr_start_index, TAGALIGN_COORDS::start_base, CODEBASE_COORDS::start_base);
		chr_end_index = translate_coord(chr_end_index, TAGALIGN_COORDS::end_base, CODEBASE_COORDS::end_base);

		// Set quality to all matches.
		sprintf(cigar_str, "%dM", chr_end_index-chr_start_index+1);

		// Check the flag and determine the strand.
		strand_char = 'F';
		if(strand_sign == '-')
		{
			strand_char = 'R';
		}

		chr_index = chr_start_index;
		sequenced_length = chr_end_index-chr_start_index+1;
	}
	else
	{
		chrom[0] = 0;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r15
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r12
leaq 0x19389(%rip), %rsi     # 0x27413
leaq 0x14(%rsp), %rcx
leaq 0x10(%rsp), %r8
leaq 0xf(%rsp), %r9
xorl %eax, %eax
callq 0x2150
cmpl $0x4, %eax
jne 0xe0e6
movq 0x40(%rsp), %rdi
movl 0x10(%rsp), %edx
subl 0x14(%rsp), %edx
incl %edx
leaq 0x1936c(%rip), %rsi     # 0x27427
xorl %eax, %eax
callq 0x2080
cmpb $0x2d, 0xf(%rsp)
pushq $0x52
popq %rax
pushq $0x46
popq %rcx
cmovel %eax, %ecx
movb %cl, (%r15)
movl 0x14(%rsp), %eax
movl %eax, (%r14)
movl 0x10(%rsp), %ecx
subl %eax, %ecx
incl %ecx
movl %ecx, (%rbx)
jmp 0xe0eb
movb $0x0, (%r12)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/gersteinlab[P]MUSIC/src/ms_mapped_read_tools.cpp
// Function: preprocess_preprocessed_LH_GFF3_read_line(char*, char*, char*, int&, int&, char&, char*)
void preprocess_preprocessed_LH_GFF3_read_line(char* cur_line, 
	char* read_id,
	char* chrom, 
	int& chr_index, int& sequenced_length, 
	char& strand_char, 
	char* mapping_quality_str)
{
	// Skip the comment and headers.
	if(cur_line[0] == '@')
	{
		chrom[0] = 0;
		chr_index = 0;
		return;
	}

	int _chr_index;
	char strand;

	//if(sscanf(cur_line, "%*s %d %s %d %*d %s %*s %*d %*d %s %s", &flag, chrom, &_chr_index, mapping_quality_str, fragment, phred_quality_str) == 6)
	// X       14705460        35M     +
	if(sscanf(cur_line, "%s %d %s %c", chrom, &_chr_index, mapping_quality_str, &strand) == 4)
	{
		// Translate the 0 based index in SAM file to ELAND's 1 based indexing.
		//chr_index += (CODEBASE_START_BASE - SAM_START_BASE);
		chr_index = _chr_index;

		// Check the flag and determine the strand.
		strand_char = 'F';
		if(strand == '-')
		{
			strand_char = 'R';
		}

			chr_index = _chr_index;
			sequenced_length = 0;
	}
	else
	{
		chrom[0] = 0;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r12
cmpb $0x40, (%rdi)
jne 0xe114
movb $0x0, (%r12)
andl $0x0, (%rbx)
jmp 0xe161
movq %r9, %r15
movq %r8, %r14
movq 0x30(%rsp), %r8
leaq 0x19305(%rip), %rsi     # 0x2742b
leaq 0x4(%rsp), %rcx
leaq 0x3(%rsp), %r9
movq %r12, %rdx
xorl %eax, %eax
callq 0x2150
cmpl $0x4, %eax
jne 0xe15c
movl 0x4(%rsp), %eax
cmpb $0x2d, 0x3(%rsp)
pushq $0x52
popq %rcx
pushq $0x46
popq %rdx
cmovel %ecx, %edx
movb %dl, (%r15)
movl %eax, (%rbx)
andl $0x0, (%r14)
jmp 0xe161
movb $0x0, (%r12)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/gersteinlab[P]MUSIC/src/ms_mapped_read_tools.cpp
// Function: preprocess_ELAND_read_line(char*, char*, char*, int&, int&, char&, char*)
void preprocess_ELAND_read_line(char* cur_line, 
	char* read_id,
	char* chrom, 
	int& chr_index, int& sequenced_length, 
	char& strand_char, 
	char* mapping_quality_str)
{
	char cur_fragment[100];
	char quality_str[100];
	int _chr_index;
	char _strand_char;

	if(sscanf(cur_line, "%s %s %s %*d %*d %*d %s %d %c", read_id, cur_fragment, quality_str, chrom, &_chr_index, &_strand_char) == 6)
	{
		chr_index = _chr_index;
		sequenced_length = strlen(cur_fragment);
		sprintf(mapping_quality_str, "%dM", sequenced_length);

		strand_char = 'F';
		if(_strand_char == '-')
		{
			strand_char = 'R';
		}
	}
	else
	{
		chrom[0] = 0;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %rdx
leaq 0xb(%rsp), %r10
leaq 0xc(%rsp), %r11
leaq 0x19220(%rip), %rsi     # 0x2747d
leaq 0x10(%rsp), %rcx
leaq 0x80(%rsp), %r8
movq %r12, %r9
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x2150
popq %rcx
popq %rdx
cmpl $0x6, %eax
jne 0xe2c0
movq 0x110(%rsp), %r12
movl 0xc(%rsp), %eax
movl %eax, (%r15)
leaq 0x10(%rsp), %rdi
callq 0x20d0
movl %eax, (%r14)
leaq 0x19185(%rip), %rsi     # 0x27427
movq %r12, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x2080
cmpb $0x2d, 0xb(%rsp)
pushq $0x52
popq %rax
pushq $0x46
popq %rcx
cmovel %eax, %ecx
movb %cl, (%rbx)
jmp 0xe2c5
movb $0x0, (%r12)
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/gersteinlab[P]MUSIC/src/ms_mapped_read_tools.cpp
// Function: preprocess_bowtie_read_line(char*, char*, char*, int&, int&, char&, char*)
void preprocess_bowtie_read_line(char* cur_line, 
	char* read_id,
	char* chrom, 
	int& chr_index, int& sequenced_length, 
	char& strand_char, 
	char* mapping_quality_str)
{
	char strand_sign;
	int chr_start_index;
	char nucs[1000];
	char strand_sign_str[100];
	char chr_start_index_str[100];
	//if(sscanf(cur_line, "%s %c %s %d %s", read_id, &strand_sign, chrom, &chr_start_index, nucs) == 4)
	if(sscanf(cur_line, "%[^\t] %[^\t] %[^\t] %[^\t] %[^\t]", read_id, strand_sign_str, chrom, chr_start_index_str, nucs) == 5)
    {
		strand_sign = strand_sign_str[0];
		chr_start_index = atoi(chr_start_index_str);

		// Note that the indices in tagAlign file are 0 based, these must be translated to 1 based indices.
		chr_start_index = translate_coord(chr_start_index, BOWTIE_COORDS::start_base, CODEBASE_COORDS::start_base);

		sprintf(mapping_quality_str, "%dM", (int)strlen(nucs));

		// Check the flag and determine the strand.
		strand_char = 'F';
		if(strand_sign == '-')
		{
			strand_char = 'R';
		}

		chr_index = chr_start_index;
		sequenced_length = strlen(nucs);
	}
	else
	{
		chrom[0] = 0;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4d8, %rsp            # imm = 0x4D8
movq %r9, %r14
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %rdx
leaq 0xf0(%rsp), %rax
movq %rax, (%rsp)
leaq 0x19194(%rip), %rsi     # 0x2749b
leaq 0x80(%rsp), %rcx
leaq 0x10(%rsp), %r9
movq %r12, %r8
xorl %eax, %eax
callq 0x2150
cmpl $0x5, %eax
jne 0xe380
movb 0x80(%rsp), %r12b
leaq 0x10(%rsp), %rdi
callq 0x2280
movl %eax, %ebp
incl %ebp
leaq 0xf0(%rsp), %r13
movq %r13, %rdi
callq 0x20d0
leaq 0x190d7(%rip), %rsi     # 0x27427
movq 0x510(%rsp), %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x2080
cmpb $0x2d, %r12b
pushq $0x52
popq %rax
pushq $0x46
popq %rcx
cmovel %eax, %ecx
movb %cl, (%r14)
movl %ebp, (%r15)
movq %r13, %rdi
callq 0x20d0
movl %eax, (%rbx)
jmp 0xe385
movb $0x0, (%r12)
addq $0x4d8, %rsp            # imm = 0x4D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/gersteinlab[P]MUSIC/src/ms_mapped_read_tools.cpp
// Function: preprocess_BED4_read_line(char*, char*, char*, int&, int&, char&, char*)
void preprocess_BED4_read_line(char* cur_line, 
	char* read_id,
	char* chrom, 
	int& chr_index, int& sequenced_length, 
	char& strand_char, 
	char* mapping_quality_str)
{
	char strand_sign;
	int chr_start_index;
	int chr_end_index;
	//if(sscanf(cur_line, "%s %d %d %*s %*s %c", chrom, &chr_start_index, &chr_end_index, &strand_sign) == 4)
	if(sscanf(cur_line, "%s %d %d %*s %c", chrom, &chr_start_index, &chr_end_index, &strand_sign) == 4)
    {
		// Note that the indices in tagAlign file are 0 based, these must be translated to 1 based indices.
		sprintf(mapping_quality_str, "%dM", chr_end_index-chr_start_index);
		sequenced_length = chr_end_index-chr_start_index;

		chr_start_index = translate_coord(chr_start_index, BED_COORDS::start_base, CODEBASE_COORDS::start_base);

		// Check the flag and determine the strand.
		strand_char = 'F';
		if(strand_sign == '-')
		{
			strand_char = 'R';
		}

		chr_index = chr_start_index;
	}
	else
	{
		chrom[0] = 0;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %rbx
movq %r8, %r15
movq %rcx, %r14
movq %rdx, %r12
leaq 0x19104(%rip), %rsi     # 0x274b9
leaq 0x14(%rsp), %rcx
leaq 0x10(%rsp), %r8
leaq 0xf(%rsp), %r9
xorl %eax, %eax
callq 0x2150
cmpl $0x4, %eax
jne 0xe40f
movq 0x40(%rsp), %rdi
movl 0x10(%rsp), %edx
subl 0x14(%rsp), %edx
leaq 0x19043(%rip), %rsi     # 0x27427
xorl %eax, %eax
callq 0x2080
movl 0x10(%rsp), %eax
movl 0x14(%rsp), %ecx
subl %ecx, %eax
movl %eax, (%r15)
incl %ecx
cmpb $0x2d, 0xf(%rsp)
pushq $0x52
popq %rax
pushq $0x46
popq %rdx
cmovel %eax, %edx
movb %dl, (%rbx)
movl %ecx, (%r14)
jmp 0xe414
movb $0x0, (%r12)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/gersteinlab[P]MUSIC/src/ms_mapped_read_tools.cpp
// Function: get_n_mapped_nucs(std::vector<t_mapped_fragment*, std::allocator<t_mapped_fragment*>>*)
double get_n_mapped_nucs(vector<t_mapped_fragment*>* fragments)
{
	double n_mapped_nucs = 0.0;

	for(int i_frag = 0; i_frag < (int)fragments->size(); i_frag++)
	{
		n_mapped_nucs += fragments->at(i_frag)->sequenced_fragment_length;
	} // i_frag loop.

	return(n_mapped_nucs);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorps %xmm0, %xmm0
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x3, %rax
cltq
cmpq %rax, %r14
jge 0xe581
movq %rbx, %rdi
movq %r14, %rsi
movsd %xmm0, (%rsp)
callq 0xecf8
movq (%rax), %rax
cvtsi2sdl 0x4(%rax), %xmm0
movsd (%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%rsp), %xmm0
incq %r14
jmp 0xe53f
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/gersteinlab[P]MUSIC/src/ms_mapped_read_tools.cpp
// Function: get_l_signal_per_reads(char*, int)
int get_l_signal_per_reads(char* reads_fp, int l_ext_tag)
{
	char strand_char = 0;
	//char cur_fragment[10000];
	char mapping_map_str[10000];
	int chr_index;
	int n_processed_reads = 0;
	int l_profile = 0;
	FILE* f_sorted_reads = open_f(reads_fp, "r");
	while(1)
	{
		char* cur_read = getline(f_sorted_reads);

		if(cur_read == NULL)
		{
			break;
		}
		else if((n_processed_reads % (1000*1000)) == 0)
		{
			fprintf(stderr, "Processing %d. read.                        \r", n_processed_reads);
		}	

		n_processed_reads++;

		if(sscanf(cur_read, "%s %c %d", mapping_map_str, &strand_char, &chr_index) != 3)
		{
			fprintf(stderr, "Could not parse %s\n", cur_read);
			exit(0);
		}

		int cur_l_profile = chr_index + 1000 + l_ext_tag;
		if(cur_l_profile > l_profile)
		{
			l_profile = cur_l_profile;
		}
	} // file loading loop.

	fclose(f_sorted_reads);

	return(l_profile);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2728, %rsp           # imm = 0x2728
movl %esi, %ebx
leaq 0x7(%rsp), %rax
movb $0x0, (%rax)
leaq 0x1875d(%rip), %rsi     # 0x26d08
callq 0x2027c
movq %rax, %r15
addl $0x3e8, %ebx            # imm = 0x3E8
movl %ebx, 0x8(%rsp)
xorl %ebx, %ebx
xorl %ebp, %ebp
xorl %r13d, %r13d
movl %r13d, %eax
xorl %edx, %edx
movl $0xf4240, %ecx          # imm = 0xF4240
divl %ecx
movl %eax, %r14d
movq %r15, %rdi
callq 0x2017f
testq %rax, %rax
je 0xe644
movq %rax, %r12
imull $0xf4240, %r14d, %eax   # imm = 0xF4240
addl %ebx, %eax
je 0xe627
movq %r12, %rdi
leaq 0x1646c(%rip), %rsi     # 0x24a64
leaq 0x10(%rsp), %rdx
leaq 0x7(%rsp), %rcx
leaq 0xc(%rsp), %r8
xorl %eax, %eax
callq 0x2150
cmpl $0x3, %eax
jne 0xe660
incl %r13d
movl 0xc(%rsp), %eax
addl 0x8(%rsp), %eax
cmpl %ebp, %eax
cmovgl %eax, %ebp
decl %ebx
jmp 0xe5c4
movq 0x269b2(%rip), %rax     # 0x34fe0
movq (%rax), %rdi
leaq 0x18ea5(%rip), %rsi     # 0x274dd
movl %r13d, %edx
xorl %eax, %eax
callq 0x2240
jmp 0xe5ee
movq %r15, %rdi
callq 0x2160
movl %ebp, %eax
addq $0x2728, %rsp           # imm = 0x2728
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x26979(%rip), %rax     # 0x34fe0
movq (%rax), %rdi
leaq 0x18e9a(%rip), %rsi     # 0x2750b
movq %r12, %rdx
xorl %eax, %eax
callq 0x2240
xorl %edi, %edi
callq 0x21d0
// File: /workspace/github_cpp_makefile_star2_O2/gersteinlab[P]MUSIC/src/ms_mapped_read_tools.cpp
// Function: get_n_reads_per_window(int, std::vector<t_mapped_fragment*, std::allocator<t_mapped_fragment*>>*)
int* get_n_reads_per_window(int n_wins, vector<t_mapped_fragment*>* frag_list)
{
	int* n_reads_per_window = new int[n_wins + 2];
	for(int i_win = 0; i_win < n_wins; i_win++)
	{
		n_reads_per_window[i_win] = 0;
	} // i_win loop

	for(int i_frag = 0; i_frag < (int)frag_list->size(); i_frag++)
	{
		int cur_i_win = frag_list->at(i_frag)->base_index / MEG_BASE;

		n_reads_per_window[cur_i_win]++;
	} // i_nuc loop.

	return(n_reads_per_window);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r15d
leal 0x2(%r15), %eax
shlq $0x2, %rax
cmpl $-0x2, %edi
pushq $-0x1
popq %rdi
cmovgeq %rax, %rdi
callq 0x2040
movq %rax, %r14
xorl %eax, %eax
testl %r15d, %r15d
cmovlel %eax, %r15d
cmpq %rax, %r15
je 0xec3a
andl $0x0, (%r14,%rax,4)
incq %rax
jmp 0xec2b
xorl %r15d, %r15d
movl $0xf4240, %ebp          # imm = 0xF4240
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x3, %rax
cltq
cmpq %rax, %r15
jge 0xec72
movq %rbx, %rdi
movq %r15, %rsi
callq 0xecf8
movq (%rax), %rax
movl (%rax), %eax
cltd
idivl %ebp
cltq
incl (%r14,%rax,4)
incq %r15
jmp 0xec42
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/gersteinlab[P]MUSIC/src/ms_nomenclature.cpp
// Function: normalize_chr_id(char*)
void normalize_chr_id(char* raw_chr_id)
{
	t_string::replace_avoid_list(raw_chr_id, "+-./\*^$#@!&()~+=?\"`][}{", '_');

	if(t_string::starts_with(raw_chr_id, "chr") || 
		t_string::starts_with(raw_chr_id, "Chr") ||
		t_string::starts_with(raw_chr_id, "CHR"))
	{
		// Get rid of the first 3 characters.
		char temp[1000];
		strcpy(temp, &raw_chr_id[3]);
		strcpy(raw_chr_id, temp);
	}
	else
	{
		// No need to change.
		return;
	}
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x3e8, %rsp            # imm = 0x3E8
movq %rdi, %rbx
leaq 0x17f8d(%rip), %rsi     # 0x275dd
pushq $0x5f
popq %rdx
callq 0x216f2
leaq 0x17f96(%rip), %rsi     # 0x275f5
movq %rbx, %rdi
callq 0x22aa6
testb %al, %al
jne 0xf691
leaq 0x17f87(%rip), %rsi     # 0x275f9
movq %rbx, %rdi
callq 0x22aa6
testb %al, %al
jne 0xf691
leaq 0x17f78(%rip), %rsi     # 0x275fd
movq %rbx, %rdi
callq 0x22aa6
testb %al, %al
je 0xf6ab
leaq 0x3(%rbx), %rsi
movq %rsp, %r14
movq %r14, %rdi
callq 0x2140
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2140
addq $0x3e8, %rsp            # imm = 0x3E8
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gersteinlab[P]MUSIC/src/ms_filter_utils.cpp
// Function: alloc_ext_array()
t_ext_double_array* alloc_ext_array()
{
	t_ext_double_array* ext_array = new t_ext_double_array();
	ext_array->buffer = new double[1000];
	ext_array->buffer_length = 1000;
	ext_array->n_vals = 0;

	return(ext_array);
}

// Assembly:
pushq %rbx
pushq $0x10
popq %rdi
callq 0x2170
movq %rax, %rbx
movl $0x1f40, %edi           # imm = 0x1F40
callq 0x2040
movq %rax, (%rbx)
movabsq $0x3e800000000, %rax    # imm = 0x3E800000000
movq %rax, 0x8(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/gersteinlab[P]MUSIC/src/ms_filter_utils.cpp
// Function: add_val(t_ext_double_array*, double)
void add_val(t_ext_double_array* ext_array, double val)
{
	// Check if the buffer memory will be overwhelmed by adding the new value.
	if(ext_array->n_vals+1 >= ext_array->buffer_length)
	{
if(__DUMP_FILTER_MSGS__)
		fprintf(stderr, "Extending the array: %d -> %d\n", ext_array->buffer_length, ext_array->buffer_length * 2);
		int l_ext_ext_buffer = ext_array->buffer_length * 2;
		double* new_ext_buffer = new double [l_ext_ext_buffer];

		// Copy the values.
		for(int i = 0; i < ext_array->n_vals; i++)
		{
			new_ext_buffer[i] = ext_array->buffer[i];
		} // i loop.

		// Copy the new buffer the extended array.		
		delete [] ext_array->buffer;
		ext_array->buffer_length = l_ext_ext_buffer;
		ext_array->buffer = new_ext_buffer;
	}

	// Add the value and return.
	ext_array->buffer[ext_array->n_vals] = val;
	ext_array->n_vals++;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl 0x8(%rdi), %eax
movl 0xc(%rdi), %edx
leal 0x1(%rax), %ecx
cmpl %edx, %ecx
jge 0xf701
movq (%rbx), %r14
jmp 0xf767
movsd %xmm0, 0x8(%rsp)
cmpb $0x1, 0x25ab7(%rip)     # 0x351c5
je 0xf77b
leal (%rdx,%rdx), %ebp
movslq %ebp, %rax
shlq $0x3, %rax
testl %edx, %edx
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
callq 0x2040
movq %rax, %r14
movl 0x8(%rbx), %eax
movslq %eax, %rcx
movq (%rbx), %rdi
xorl %edx, %edx
cmpq %rcx, %rdx
jge 0xf74b
movsd (%rdi,%rdx,8), %xmm0
movsd %xmm0, (%r14,%rdx,8)
incq %rdx
jmp 0xf736
testq %rdi, %rdi
je 0xf758
callq 0x2210
movl 0x8(%rbx), %eax
movl %ebp, 0xc(%rbx)
movq %r14, (%rbx)
leal 0x1(%rax), %ecx
movsd 0x8(%rsp), %xmm0
cltq
movsd %xmm0, (%r14,%rax,8)
movl %ecx, 0x8(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x2585e(%rip), %rax     # 0x34fe0
movq (%rax), %rdi
leal (%rdx,%rdx), %ecx
leaq 0x17e89(%rip), %rsi     # 0x27618
xorl %eax, %eax
callq 0x2240
movl 0xc(%rbx), %edx
jmp 0xf710
// File: /workspace/github_cpp_makefile_star2_O2/gersteinlab[P]MUSIC/src/ms_filter_utils.cpp
// Function: mapability_aware_median_filter(double*, int, double*, int, double, int)
double* mapability_aware_median_filter(double* signal_profile, int l_profile,
	double* scaled_mapability_profile, int l_mapability_profile,
	double max_mapable_signal_2_use_in_filter,
	int l_mapability_filtering_win)
{
	// Generate the signal profile to input to the filtering.
	double* input_signal_profile = new double[l_profile + 2];
	for(int i = 1; i <= l_profile; i++)
	{
		if(l_mapability_profile > i)
		{
			if(scaled_mapability_profile[i] > max_mapable_signal_2_use_in_filter)
			{
				input_signal_profile[i] = -1;
			}
			else
			{
				input_signal_profile[i] = signal_profile[i];
			}
		}
		else
		{
			input_signal_profile[i] = signal_profile[i];
		}
	} // i loop.

if(__DUMP_FILTER_MSGS__)
{
	fprintf(stderr, "Mapability aware filtering.\n");
}

	double* mapable_median_profile = median_filter_data(input_signal_profile,
													l_profile, 
													l_mapability_filtering_win,
													-1);

	double* filtered_signal = new double[l_profile + 5];

	// Compare the actual signal profile with the 
	for(int i = 1; i <= l_profile; i++)
	{
		filtered_signal[i] = MAX(mapable_median_profile[i], signal_profile[i]);
	} // i loop.

	delete [] mapable_median_profile;
	delete [] input_signal_profile;

	return(filtered_signal);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movsd %xmm0, (%rsp)
movl %ecx, %r13d
movq %rdx, %r12
movl %esi, %r15d
movq %rdi, %rbx
leal 0x2(%r15), %edi
shlq $0x3, %rdi
cmpl $-0x2, %esi
pushq $-0x1
popq %rax
cmovlq %rax, %rdi
callq 0x2040
movsd (%rsp), %xmm2
movq %rax, %r14
movslq %r13d, %rax
xorl %r13d, %r13d
testl %r15d, %r15d
cmovgl %r15d, %r13d
movq %r13, %rcx
negq %rcx
pushq $0x1
popq %rdx
movsd 0x13170(%rip), %xmm0    # 0x24070
leaq (%rcx,%rdx), %rsi
cmpq $0x1, %rsi
je 0x10f2f
cmpq %rax, %rdx
jge 0x10f1f
movsd (%r12,%rdx,8), %xmm1
ucomisd %xmm2, %xmm1
movapd %xmm0, %xmm1
ja 0x10f24
movsd (%rbx,%rdx,8), %xmm1
movsd %xmm1, (%r14,%rdx,8)
incq %rdx
jmp 0x10f00
cmpb $0x0, 0x2428f(%rip)     # 0x351c5
jne 0x10fab
pushq $-0x1
popq %rcx
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0xf92d
movq %rax, %r12
leal 0x5(%r15), %edi
shlq $0x3, %rdi
cmpl $-0x5, %r15d
pushq $-0x1
popq %rax
cmovlq %rax, %rdi
callq 0x2040
movq %rax, %r15
movl %r13d, %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x10f89
movsd 0x8(%r12,%rcx,8), %xmm0
maxsd 0x8(%rbx,%rcx,8), %xmm0
movsd %xmm0, 0x8(%r15,%rcx,8)
incq %rcx
jmp 0x10f6b
movq %r12, %rdi
callq 0x2210
movq %r14, %rdi
callq 0x2210
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2402e(%rip), %rax     # 0x34fe0
movq (%rax), %rcx
leaq 0x16796(%rip), %rdi     # 0x27752
pushq $0x1c
popq %rsi
pushq $0x1
popq %rdx
callq 0x2330
jmp 0x10f38
// File: /workspace/github_cpp_makefile_star2_O2/gersteinlab[P]MUSIC/src/ms_filter_utils.cpp
// Function: get_origin_of_symmetry(double*, int, int, int&, int)
bool get_origin_of_symmetry(double* filtered_data, int l_signal, int search_start_i, int& origin, int l_mirror_check)
{
	if(search_start_i < l_mirror_check)
	{
		search_start_i = l_mirror_check;
	}

	for(int i_c = l_mirror_check; i_c < l_signal-l_mirror_check; i_c++)
	{
		bool current_origin_check = true;
		for(int i = 0; 
			current_origin_check && i < l_mirror_check; 
			i++)
		{
			if(fabs(filtered_data[i_c+i] - filtered_data[i_c-i]) > 0.00001)
			{
				current_origin_check = false;
			}
		} // i loop.

		if(current_origin_check)
		{
			fprintf(stderr, "Found origin of symmetry @ %d\n", i_c);
			origin = i_c;
			return(true);
		}
	} // i_c loop.

	return(false);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %rbx
subl %r8d, %esi
movslq %r8d, %rax
movslq %esi, %r15
leaq (%rdi,%rax,8), %rcx
movapd 0x15131(%rip), %xmm0    # 0x269e0
movsd 0x15d59(%rip), %xmm1    # 0x27610
movq %rax, %r14
cmpq %r15, %r14
jge 0x1191d
movb $0x1, %dil
xorl %edx, %edx
xorl %esi, %esi
testb $0x1, %dil
je 0x118f0
cmpq %rax, %rsi
jge 0x118f0
movsd (%rcx,%rsi,8), %xmm2
subsd (%rcx,%rdx), %xmm2
andpd %xmm0, %xmm2
ucomisd %xmm1, %xmm2
setbe %dil
incq %rsi
addq $-0x8, %rdx
jmp 0x118c6
testb $0x1, %dil
jne 0x118ff
incq %r14
addq $0x8, %rcx
jmp 0x118ba
movq 0x236da(%rip), %rax     # 0x34fe0
movq (%rax), %rdi
leaq 0x15f77(%rip), %rsi     # 0x27887
movl %r14d, %edx
xorl %eax, %eax
callq 0x2240
movl %r14d, (%rbx)
cmpq %r15, %r14
setl %al
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/gersteinlab[P]MUSIC/src/ms_filter_utils.cpp
// Function: sum_tracks(std::vector<double*, std::allocator<double*>>*, int)
double* sum_tracks(vector<double*>* multitrack_data, int l_signal)
{
	int n_tracks = (int)multitrack_data->size();
	fprintf(stderr, "Summing %d tracks of %d data points.\n", n_tracks, l_signal);
	double* aggregate_track = new double[l_signal];

	for(int i = 0; i < l_signal; i++)
	{
		double cur_aggregated_val = 0.0;

		// Go over all the tracks and sum their values at this position.
		for(int i_t = 0; i_t < n_tracks; i_t++)
		{
			cur_aggregated_val += (multitrack_data->at(i_t))[i];
		} // i_t loop.

		aggregate_track[i] = cur_aggregated_val;
	} // i loop.

	return(aggregate_track);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %r14
subq (%rdi), %r14
movl %esi, %r15d
shrq $0x3, %r14
movq 0x23694(%rip), %rax     # 0x34fe0
movq (%rax), %rdi
leaq 0x15f50(%rip), %rsi     # 0x278a6
xorl %ebp, %ebp
movl %r14d, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x2240
movl %r15d, %eax
shlq $0x3, %rax
testl %r15d, %r15d
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
cmovlel %ebp, %r15d
callq 0x2040
movq %rax, %r12
testl %r14d, %r14d
cmovlel %ebp, %r14d
cmpq %r15, %rbp
je 0x119c7
xorpd %xmm0, %xmm0
xorl %r13d, %r13d
cmpq %r13, %r14
je 0x119bc
movq %rbx, %rdi
movq %r13, %rsi
movsd %xmm0, (%rsp)
callq 0x119f8
movsd (%rsp), %xmm0
movq (%rax), %rax
addsd (%rax,%rbp,8), %xmm0
incq %r13
jmp 0x11995
movsd %xmm0, (%r12,%rbp,8)
incq %rbp
jmp 0x11989
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gersteinlab[P]MUSIC/src/ms_annot_region_tools.cpp
// Function: extract_region_mids(std::vector<t_annot_region*, std::allocator<t_annot_region*>>*, int)
vector<t_annot_region*>* extract_region_mids(vector<t_annot_region*>* regions, int l_mid_reg)
{
	vector<t_annot_region*>* region_mids = new vector<t_annot_region*>();
	for(int i = 0; i < (int)regions->size(); i++)
	{
		int cur_mid = (regions->at(i)->start + regions->at(i)->end) / 2;
		t_annot_region* cur_mid_reg = get_empty_region();
		cur_mid_reg->chrom = t_string::copy_me_str(regions->at(i)->chrom);
		cur_mid_reg->start = (cur_mid > l_mid_reg/2)?(cur_mid - l_mid_reg/2):(1);
		cur_mid_reg->end = cur_mid + l_mid_reg/2;
		cur_mid_reg->strand = regions->at(i)->strand;

		region_mids->push_back(cur_mid_reg);
	} // i loop.

	return(region_mids);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
pushq $0x18
popq %rdi
callq 0x2170
movq %rax, %r14
pushq $0x2
popq %rcx
movl %ebp, %eax
cltd
idivl %ecx
movl %eax, %ebp
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
andq $0x0, 0x10(%r14)
xorl %r15d, %r15d
movq %rsp, %r12
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x3, %rax
cltq
cmpq %rax, %r15
jge 0x11e5f
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7404
movq (%rax), %rax
movl 0xc(%rax), %r13d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7404
movq (%rax), %rax
addl 0x20(%rax), %r13d
movl %r13d, %eax
cltd
pushq $0x2
popq %rcx
idivl %ecx
movl %eax, %r13d
callq 0x11e71
movq %rax, (%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7404
movq (%rax), %rax
movq (%rax), %rdi
callq 0x21062
movq (%rsp), %rcx
movq %rax, (%rcx)
movl %r13d, %eax
subl %ebp, %eax
pushq $0x1
popq %rcx
cmovlel %ecx, %eax
movq (%rsp), %rcx
movl %eax, 0xc(%rcx)
addl %ebp, %r13d
movl %r13d, 0x20(%rcx)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7404
movq (%rax), %rax
movb 0x8(%rax), %al
movq (%rsp), %rcx
movb %al, 0x8(%rcx)
movq %r14, %rdi
movq %r12, %rsi
callq 0x7448
incq %r15
jmp 0x11daf
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq