LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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 0x12dbb(%rip), %rax     # 0x3ace8
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 0x1350d(%rip), %rax     # 0x3b4cc
cmpb $0x1, (%rax)
jne 0x2802e
pshufd $0xff, %xmm0, %xmm0     # xmm0 = xmm0[3,3,3,3]
movd %xmm0, %r14d
cmpl $0x2, %r14d
jb 0x28038
leal -0x2(,%r14,2), %edi
shlq $0x3, %rdi
callq 0x4030
movq %rax, 0x18(%rbx)
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
cmpl $0x1, %r14d
je 0x28040
xorl %r15d, %r15d
callq 0x40e0
movl %eax, %r14d
shlq $0x20, %r14
callq 0x40e0
cltq
orq %r14, %rax
movq 0x18(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
movl 0x430(%rbx), %eax
leal -0x2(,%rax,2), %eax
cmpq %rax, %r15
jb 0x27ff9
jmp 0x28040
movq $0x0, 0x18(%rbx)
jmp 0x2806d
movq $0x0, 0x18(%rbx)
xorl %eax, %eax
movl $0x8, %ecx
movl %eax, %edx
movl %edx, %esi
andl $0x1, %edx
negl %edx
shrl %esi
andl $0xeb31d82e, %edx       # imm = 0xEB31D82E
xorl %esi, %edx
decl %ecx
jne 0x28049
movl %edx, 0x20(%rbx,%rax,4)
incq %rax
cmpq $0x100, %rax            # imm = 0x100
jne 0x28042
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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
testl %edx, %edx
je 0x28265
notl %eax
movl %edx, %ecx
xorl %edx, %edx
movb (%rsi,%rdx), %dil
xorb %al, %dil
movzbl %dil, %edi
shrl $0x8, %eax
xorl (%r8,%rdi,4), %eax
incq %rdx
cmpl %edx, %ecx
jne 0x2824a
notl %eax
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x40e0
cltq
imulq $0x68db8bad, %rax, %rcx # imm = 0x68DB8BAD
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x2c, %rcx
addl %edx, %ecx
imull $0x2710, %ecx, %ecx     # imm = 0x2710
leaq 0x11560(%rip), %rdx     # 0x3b418
movsd (%rdx), %xmm0
mulsd 0x958c(%rip), %xmm0     # 0x33450
subl %ecx, %eax
cvttsd2si %xmm0, %ecx
cmpl %ecx, %eax
jge 0x29f91
callq 0x40e0
movl %eax, %ebx
shlq $0x20, %rbx
callq 0x40e0
movslq %eax, %r14
orq %rbx, %r14
movabsq $0x446f86562d9faee5, %rcx # imm = 0x446F86562D9FAEE5
movq %r14, %rax
mulq %rcx
movq %r14, %rax
subq %rdx, %rax
shrq %rax
addq %rdx, %rax
shrq $0x6, %rax
imulq $0x65, %rax, %rax
movq %r14, %r15
subq %rax, %r15
leaq 0x11507(%rip), %rax     # 0x3b420
cvttsd2si (%rax), %eax
movslq %eax, %r12
movl $0x30, %edi
callq 0x42f0
movq %rax, %rbx
leaq 0x1156c(%rip), %rax     # 0x3b4a0
movl (%rax), %ecx
movq 0x12493(%rip), %r8      # 0x3c3d0
cmpq %r12, %r15
jbe 0x29f54
movq %rbx, %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x2b6d0
jmp 0x29f61
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x2b6d0
movq %rbx, (%rsp)
movq 0x12454(%rip), %rsi     # 0x3c3c0
cmpq 0x12455(%rip), %rsi     # 0x3c3c8
je 0x29f82
movq %rbx, (%rsi)
addq $0x8, 0x12440(%rip)     # 0x3c3c0
jmp 0x29f91
leaq 0x1242f(%rip), %rdi     # 0x3c3b8
movq %rsp, %rdx
callq 0x140c6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x29f9f
movq %rax, %r14
movl $0x30, %esi
movq %rbx, %rdi
callq 0x4300
movq %r14, %rdi
callq 0x4540
// File: /workspace/github_cpp_makefile_star2_O3/estwings57[P]CasHMC/sources/VaultController.cpp
// Function: CasHMC::VaultController::~VaultController()
VaultController::~VaultController()
{
	pendingReadData.clear(); 
	writeDataToSend.clear(); 
	writeDataCountdown.clear(); 

	delete commandQueue;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0xdf37(%rip), %rax      # 0x3ad48
movq %rax, (%rdi)
movq 0x238(%rdi), %rax
cmpq %rax, 0x240(%rdi)
je 0x2ce2b
movq %rax, 0x240(%rbx)
movq 0x278(%rbx), %rax
cmpq %rax, 0x280(%rbx)
je 0x2ce42
movq %rax, 0x280(%rbx)
movq 0x290(%rbx), %rdi
cmpq %rdi, 0x298(%rbx)
je 0x2ce59
movq %rdi, 0x298(%rbx)
movq 0x218(%rbx), %rax
testq %rax, %rax
je 0x2ce75
movq (%rax), %rcx
movq %rax, %rdi
callq *0x8(%rcx)
movq 0x290(%rbx), %rdi
testq %rdi, %rdi
je 0x2ce89
movq 0x2a0(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x278(%rbx), %rdi
testq %rdi, %rdi
je 0x2cea4
movq 0x288(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq 0x238(%rbx), %rdi
testq %rdi, %rdi
je 0x2cebf
movq 0x248(%rbx), %rsi
subq %rdi, %rsi
callq 0x4300
movq %rbx, %rdi
popq %rbx
jmp 0x1a396
// File: /workspace/github_cpp_makefile_star2_O3/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 %r14
pushq %rbx
movl %ecx, %r9d
leaq 0xdcb2(%rip), %rax      # 0x3b58c
movl (%rax), %ebx
bsrl %ebx, %eax
xorl %r11d, %r11d
cmpl $0x2, %ebx
cmovbl %r11d, %eax
movl $0x1, %r10d
movl $0x1, %ebp
movl %eax, %ecx
shll %cl, %ebp
cmpl %ebx, %ebp
adcl $0x0, %eax
movl %r8d, %r8d
leaq 0xdc81(%rip), %rcx      # 0x3b588
movl (%rcx), %ebx
bsrl %ebx, %ecx
cmpl $0x2, %ebx
cmovbl %r11d, %ecx
movl $0x1, %ebp
shll %cl, %ebp
xorl %r14d, %r14d
cmpl %ebx, %ebp
setb %r14b
subl %eax, %ecx
addl %r14d, %ecx
shlq %cl, %r8
movl %eax, %ecx
shrl %cl, %r9d
addq %r8, %r9
leaq 0xdc46(%rip), %rcx      # 0x3b580
movl (%rcx), %ebx
bsrl %ebx, %ecx
cmpl $0x2, %ebx
cmovbl %r11d, %ecx
movl $0x1, %ebp
shll %cl, %ebp
xorl %r8d, %r8d
cmpl %ebx, %ebp
setb %r8b
addl %ecx, %r8d
movl %r8d, %ecx
shlq %cl, %r9
movl %edx, %r8d
addq %r9, %r8
leaq 0xdc10(%rip), %rcx      # 0x3b57c
movl (%rcx), %r9d
bsrl %r9d, %ecx
cmpl $0x2, %r9d
cmovbl %r11d, %ecx
shll %cl, %r10d
xorl %edx, %edx
cmpl %r9d, %r10d
setb %dl
addl %ecx, %edx
movl %edx, %ecx
shlq %cl, %r8
movl 0x204(%rdi), %edx
addq %r8, %rdx
movl %eax, %ecx
shlq %cl, %rdx
movq %rdx, (%rsi)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0xc1ec(%rip), %rax      # 0x3b598
cmpb $0x1, (%rax)
jne 0x2f41d
movq %rdi, %rbx
movq 0x218(%rdi), %rdi
callq 0x16994
testb %al, %al
je 0x2f3d4
movq 0x218(%rbx), %rax
cmpb $0x0, 0x1d0(%rax)
je 0x2f406
cmpb $0x1, 0x20c(%rbx)
jne 0x2f41d
movq 0x210(%rbx), %rdi
movq 0x1d8(%rdi), %rax
movq (%rax), %rax
movq 0x30(%rax), %rax
cmpq 0x8(%rbx), %rax
ja 0x2f41d
callq 0x1ba16
movb $0x0, 0x20c(%rbx)
jmp 0x2f41d
movq 0x210(%rbx), %rdi
callq 0x1b9a0
testb %al, %al
je 0x2f41d
movb $0x1, 0x20c(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
movq %rcx, %rdi
leaq 0xc161(%rip), %rax      # 0x3b58c
movl (%rax), %r9d
bsrl %r9d, %eax
xorl %r10d, %r10d
cmpl $0x2, %r9d
cmovbl %r10d, %eax
movl $0x1, %r11d
movl %eax, %ecx
shll %cl, %r11d
cmpl %r9d, %r11d
adcl %r10d, %eax
leaq 0xc127(%rip), %rcx      # 0x3b57c
movl (%rcx), %r11d
bsrl %r11d, %ecx
cmpl $0x2, %r11d
cmovbl %r10d, %ecx
movl $0x1, %ebx
shll %cl, %ebx
xorl %r9d, %r9d
cmpl %r11d, %ebx
setb %r9b
addl %ecx, %r9d
addl %eax, %r9d
movl %r9d, %ecx
shrq %cl, %rsi
leaq 0xc0f8(%rip), %rcx      # 0x3b580
movl (%rcx), %r9d
decl %r9d
movl %esi, %r11d
andl %r9d, %r11d
movl %r11d, (%rdx)
movl (%rcx), %r9d
bsrl %r9d, %ecx
cmpl $0x2, %r9d
cmovbl %r10d, %ecx
movl $0x1, %r11d
shll %cl, %r11d
xorl %edx, %edx
cmpl %r9d, %r11d
setb %dl
addl %ecx, %edx
movl %edx, %ecx
shrq %cl, %rsi
leaq 0xc0c3(%rip), %rdx      # 0x3b588
movl (%rdx), %r9d
decl %r9d
movl %eax, %ecx
sarl %cl, %r9d
movl %esi, %r11d
andl %r9d, %r11d
shll %cl, %r11d
movl $0x1, %r9d
movl %r11d, (%rdi)
movl (%rdx), %edx
bsrl %edx, %ecx
cmpl $0x2, %edx
cmovbl %r10d, %ecx
shll %cl, %r9d
xorl %edi, %edi
cmpl %edx, %r9d
setb %dil
subl %eax, %ecx
addl %edi, %ecx
shrq %cl, %rsi
leaq 0xc07c(%rip), %rax      # 0x3b584
movl (%rax), %eax
decl %eax
andl %eax, %esi
movl %esi, (%r8)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x36108(%rip), %rax     # 0x38fe0
movq (%rax), %rdi
leaq 0x29b0e(%rip), %rsi     # 0x2c9f0
movl %ecx, %edx
xorl %eax, %eax
callq 0x2250
leal 0x2(%rbx), %eax
shlq $0x3, %rax
cmpl $-0x2, %ebx
pushq $-0x1
popq %rdi
cmovgeq %rax, %rdi
callq 0x2040
movq %rax, %r15
testl %ebx, %ebx
js 0x2f2c
movq %r15, %rdi
addq $0x8, %rdi
addl %ebp, %ebx
movslq %ebp, %rax
leaq (%r14,%rax,8), %rsi
cmpl %ebx, %eax
cmovgl %eax, %ebx
subl %eax, %ebx
leaq 0x8(,%rbx,8), %rdx
callq 0x2130
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
pushq %rax
movq %rdi, %r14
movq 0x8(%rdi), %rbx
subq (%rdi), %rbx
movl %esi, %ebp
shrq $0x3, %rbx
movq 0x3489e(%rip), %rax     # 0x38fe0
movq (%rax), %rdi
leaq 0x2915a(%rip), %rsi     # 0x2d8a6
movl %ebx, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2250
movl %ebp, %r15d
leaq (,%r15,8), %rax
testl %ebp, %ebp
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
callq 0x2040
testl %ebp, %ebp
jle 0x47c1
movl %ebx, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %esi, %esi
testl %ebx, %ebx
jle 0x47b0
movq (%r14), %rdi
movq 0x8(%r14), %rdx
subq %rdi, %rdx
sarq $0x3, %rdx
xorpd %xmm0, %xmm0
xorl %r8d, %r8d
cmpq %r8, %rdx
je 0x47cc
movq (%rdi,%r8,8), %r9
addsd (%r9,%rsi,8), %xmm0
incq %r8
cmpq %r8, %rcx
jne 0x4797
jmp 0x47b4
xorpd %xmm0, %xmm0
movsd %xmm0, (%rax,%rsi,8)
incq %rsi
cmpq %r15, %rsi
jne 0x477e
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
decl %ebx
cmpq %rbx, %rdx
cmovbq %rdx, %rbx
leaq 0x280f4(%rip), %rdi     # 0x2c8d0
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O3/gersteinlab[P]MUSIC/src/ms_utils.cpp
// Function: subsample_file_lines_no_buffer(char*, int)
void subsample_file_lines_no_buffer(char* fp, int n_lines_to_subsample)
{
	fprintf(stderr, "Counting the number of lines.\n");
	int n_lines = get_n_non_empty_lines(fp);
	fprintf(stderr, "%d lines in the file, subsampling %d lines.\n", n_lines, n_lines_to_subsample);

	//double p_select = (double)n_lines_to_subsample/n_lines;

	int n_sampled_lines = 0;
	//t_rng* rng = new t_rng(t_seed_manager::seed_me());

	// Open the file.
	FILE* f_sub = open_f("subsampled.txt", "w");
	FILE* f = open_f(fp, "r");

	// Loop to sample required number of lines.
	while(n_sampled_lines != n_lines_to_subsample)
	{
		fseek(f, 0, SEEK_SET);

		while(1)
		{
			char* cur_line = getline(f);
			if(cur_line == NULL)
			{
				break;
			}
			
			// Make sure that the line is not empty.
			if(!line_empty(cur_line))
			{
				fprintf(f_sub, "%s\n", cur_line);

				n_sampled_lines++;

				if(n_sampled_lines % 10000 == 0)
				{
					fprintf(stderr, "Sampled %d. line.         \r", n_sampled_lines);
				}
			}

			delete [] cur_line;
		} // file reading loop.
	} // sampling loop.

	fclose(f);
	fclose(f_sub);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r15
movq 0x339cb(%rip), %r14     # 0x38fe0
movq (%r14), %rcx
leaq 0x29265(%rip), %rdi     # 0x2e884
pushq $0x1e
popq %rsi
pushq $0x1
popq %rdx
callq 0x2340
movq %r15, %rdi
callq 0x25dc7
movq (%r14), %rdi
leaq 0x29267(%rip), %rsi     # 0x2e8a3
movl %eax, %edx
movl %ebx, %ecx
xorl %eax, %eax
callq 0x2250
leaq 0x29282(%rip), %rdi     # 0x2e8d0
leaq 0x25453(%rip), %rsi     # 0x2aaa8
callq 0x25d5a
movq %rax, %r14
leaq 0x276a4(%rip), %rsi     # 0x2cd08
movq %r15, %rdi
callq 0x25d5a
movq %rax, %r15
movl %ebx, 0x4(%rsp)
testl %ebx, %ebx
je 0x5708
leaq 0x2833b(%rip), %r12     # 0x2d9bd
movl $0x2710, %ebx           # imm = 0x2710
xorl %ebp, %ebp
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x21a0
movq %r15, %rdi
callq 0x25c1e
testq %rax, %rax
je 0x5702
movq %rax, %r13
movq %r13, %rdi
callq 0x25e26
testb %al, %al
jne 0x56cc
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x2250
incl %ebp
movl %ebp, %eax
cltd
idivl %ebx
testl %edx, %edx
je 0x56e6
movq %r13, %rdi
callq 0x2220
movq %r15, %rdi
callq 0x25c1e
movq %rax, %r13
testq %rax, %rax
jne 0x56a5
jmp 0x5702
movq 0x338f3(%rip), %rax     # 0x38fe0
movq (%rax), %rdi
leaq 0x291e8(%rip), %rsi     # 0x2e8df
movl %ebp, %edx
xorl %eax, %eax
callq 0x2250
jmp 0x56cc
cmpl 0x4(%rsp), %ebp
jne 0x5689
movq %r15, %rdi
callq 0x2170
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2170
// File: /workspace/github_cpp_makefile_star2_O3/gersteinlab[P]MUSIC/src/ms_peak_calling_utils.cpp
// Function: load_normalized_multimappability_profile(char*, int&)
double* load_normalized_multimappability_profile(char* mapability_signal_profile_fp, int& l_mapability_profile)
{
	double* mapability_signal_profile = NULL;

	if(!check_file(mapability_signal_profile_fp))
	{
		l_mapability_profile = 0;
		return(NULL);
	}

#ifdef __DOUBLE_MAPPABILITY__
	// Load the mapability map signal profile, do filtering.
	mapability_signal_profile = load_per_nucleotide_binary_profile(mapability_signal_profile_fp, l_mapability_profile);

	// Do mapability aware median filtering on the current signal profile.
if(__DUMP_PEAK_CALLING_UTILS_MSGS__)
	fprintf(stderr, "Scaling the mapability map with %d.\n", l_read_mapability_signal * 2);

	int mapability_scaling = l_read * 2;
	for(int i = 1; i <= l_mapability_profile; i++)
	{
		mapability_signal_profile[i] /= mapability_scaling;
	} // i loop.
#elif defined(__UCHAR_MAPPABILITY__)
	// Following loads the mappability signal profile from the char version of the multi-mappability profile.
	// Load the mapability map signal profile, do filtering.
	unsigned char* mapability_signal_char_profile = load_per_nucleotide_binary_uchar_profile(mapability_signal_profile_fp, l_mapability_profile);
	mapability_signal_profile = new double[l_mapability_profile + 2];
	for(int i = 1; i <= l_mapability_profile; i++)
	{
		unsigned char unsigned_char_val = (unsigned char)(mapability_signal_char_profile[i]);
		mapability_signal_profile[i] = (double)(unsigned_char_val);
		mapability_signal_profile[i] /= 100;

		if(mapability_signal_profile[i] < 0)
		{
			fprintf(stderr, "Sanity check failed.\n");
			exit(0);
		}
	} // i loop.
	delete [] mapability_signal_char_profile;
#else
	#error "Must define the type of mappability."
#endif

	return(mapability_signal_profile);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x25d35
testb %al, %al
je 0xbfbd
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1ccbd
movq %rax, %r14
movslq (%rbx), %r15
cmpq $-0x2, %r15
leaq 0x10(,%r15,8), %rax
movq $-0x1, %rdi
cmovgeq %rax, %rdi
callq 0x2040
movq %rax, %rbx
testq %r15, %r15
jle 0xbfc7
movl %r15d, %eax
incq %rax
movl $0x1, %ecx
movsd 0x1e082(%rip), %xmm0    # 0x2a020
movzbl (%r14,%rcx), %edx
xorps %xmm1, %xmm1
cvtsi2sd %edx, %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rbx,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0xbf9e
jmp 0xbfcc
movl $0x0, (%rbx)
xorl %ebx, %ebx
jmp 0xbfd4
testq %r14, %r14
je 0xbfd4
movq %r14, %rdi
callq 0x2220
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x1a988(%rip), %rsi     # 0x2aaa8
movq %rax, %rdi
callq 0x25d5a
movq %rax, %r14
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
testl %edx, %edx
jle 0x101d3
xorl %r15d, %r15d
leaq 0x1d125(%rip), %r12     # 0x2d270
cmpq %r15, %rdx
jbe 0x101e6
movq (%rax,%r15,8), %rax
movq 0x48(%rax), %rsi
movsd 0x38(%rsi), %xmm1
movsd 0x40(%rsi), %xmm0
addsd 0x19e9a(%rip), %xmm0    # 0x2a008
divsd %xmm0, %xmm1
movq 0x40(%rax), %rdi
movq (%rax), %rdx
movl 0xc(%rax), %ecx
movl 0x20(%rax), %r8d
movsd 0x8(%rdi), %xmm0
divsd 0x1c833(%rip), %xmm0    # 0x2c9c0
movsbl 0x8(%rax), %r9d
movl 0x48(%rsi), %r10d
movl 0x60(%rsi), %r11d
movq %r14, %rdi
movq %r12, %rsi
movb $0x2, %al
pushq %r11
pushq %r10
callq 0x2250
addq $0x10, %rsp
incq %r15
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
movq %rcx, %rdx
sarq $0x3, %rdx
shrq $0x3, %rcx
movslq %ecx, %rcx
cmpq %rcx, %r15
jl 0x1014b
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2170
leaq 0x1c6e3(%rip), %rdi     # 0x2c8d0
movq %r15, %rsi
xorl %eax, %eax
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1a896(%rip), %rsi     # 0x2aaa8
movq %rax, %rdi
callq 0x25d5a
movq %rax, 0x10(%rsp)
movq (%rbx), %rax
movq %rbx, 0x18(%rsp)
movq 0x8(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
testl %edx, %edx
jle 0x1030d
xorl %r15d, %r15d
cmpq %r15, %rdx
jbe 0x10325
movq (%rax,%r15,8), %rax
movq 0x48(%rax), %rcx
movsd 0x38(%rcx), %xmm0
movsd 0x40(%rcx), %xmm1
addsd 0x19da8(%rip), %xmm1    # 0x2a008
divsd %xmm1, %xmm0
movq 0x40(%rax), %rbx
movq (%rax), %r13
movl 0xc(%rax), %ebp
movl 0x20(%rax), %r12d
cvttsd2si %xmm0, %r14d
movsd (%rbx), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x1c73f(%rip), %xmm0    # 0x2c9c8
callq 0x2525c
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x8(%rbx), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x1c717(%rip), %xmm0    # 0x2c9c8
callq 0x2525c
movsd 0x20(%rsp), %xmm1
divsd %xmm0, %xmm1
movq 0x10(%rsp), %rdi
leaq 0x1cf87(%rip), %rsi     # 0x2d253
movq %r13, %rdx
movl %ebp, %ecx
movl %r12d, %r8d
movl %r14d, %r9d
movsd 0x8(%rsp), %xmm0
movb $0x2, %al
callq 0x2250
incq %r15
movq 0x18(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
movq %rcx, %rdx
sarq $0x3, %rdx
shrq $0x3, %rcx
movslq %ecx, %rcx
cmpq %rcx, %r15
jl 0x1023d
movq 0x10(%rsp), %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2170
leaq 0x1c5a4(%rip), %rdi     # 0x2c8d0
movq %r15, %rsi
xorl %eax, %eax
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O3/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
xorl %eax, %eax
movl %eax, (%rsi)
movl %eax, (%rdx)
leaq 0x1ba88(%rip), %rsi     # 0x2cd08
callq 0x25d5a
movq %rax, %r15
leaq 0x10(%rsp), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %rax, %rdx
callq 0x22a0
testq %rax, %rax
je 0x112f1
leaq 0x1c21c(%rip), %r12     # 0x2d4c2
leaq 0x10(%rsp), %r13
leaq 0xf(%rsp), %rbp
movq %r13, %rdi
movq %r12, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x2160
cmpl $0x1, %eax
jne 0x112f1
movzbl 0xf(%rsp), %eax
movq %r14, %rcx
cmpl $0x46, %eax
je 0x112da
cmpl $0x52, %eax
jne 0x112dc
movq %rbx, %rcx
incl (%rcx)
movq %r13, %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %r15, %rdx
callq 0x22a0
testq %rax, %rax
jne 0x112b0
movq %r15, %rdi
callq 0x2170
addq $0x3f8, %rsp            # imm = 0x3F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1bad1(%rip), %rsi     # 0x2d413
leaq 0x14(%rsp), %rcx
leaq 0x10(%rsp), %r8
leaq 0xf(%rsp), %r9
xorl %eax, %eax
callq 0x2160
cmpl $0x4, %eax
jne 0x119a2
movq 0x40(%rsp), %rdi
movl 0x10(%rsp), %edx
subl 0x14(%rsp), %edx
incl %edx
leaq 0x1bab4(%rip), %rsi     # 0x2d427
xorl %eax, %eax
callq 0x2080
cmpb $0x2d, 0xf(%rsp)
movl $0x52, %eax
movl $0x46, %ecx
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 0x119a7
movb $0x0, (%r12)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1b953(%rip), %rsi     # 0x2d47d
leaq 0x10(%rsp), %rcx
leaq 0x80(%rsp), %r8
movq %r12, %r9
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x2160
addq $0x10, %rsp
cmpl $0x6, %eax
jne 0x11b93
movq 0x110(%rsp), %r12
movl 0xc(%rsp), %eax
movl %eax, (%r15)
leaq 0x10(%rsp), %rdi
callq 0x20d0
movl %eax, (%r14)
leaq 0x1b8b6(%rip), %rsi     # 0x2d427
movq %r12, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x2080
cmpb $0x2d, 0xb(%rsp)
movl $0x52, %eax
movl $0x46, %ecx
cmovel %eax, %ecx
movb %cl, (%rbx)
jmp 0x11b98
movb $0x0, (%r12)
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1b8c1(%rip), %rsi     # 0x2d49b
leaq 0x80(%rsp), %rcx
leaq 0x10(%rsp), %r9
movq %r12, %r8
xorl %eax, %eax
callq 0x2160
cmpl $0x5, %eax
jne 0x11c57
movb 0x80(%rsp), %r12b
leaq 0x10(%rsp), %rdi
callq 0x2290
movl %eax, %ebp
incl %ebp
leaq 0xf0(%rsp), %r13
movq %r13, %rdi
callq 0x20d0
leaq 0x1b804(%rip), %rsi     # 0x2d427
movq 0x510(%rsp), %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x2080
cmpb $0x2d, %r12b
movl $0x52, %eax
movl $0x46, %ecx
cmovel %eax, %ecx
movb %cl, (%r14)
movl %ebp, (%r15)
movq %r13, %rdi
callq 0x20d0
movl %eax, (%rbx)
jmp 0x11c5c
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_O3/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 0x1b82d(%rip), %rsi     # 0x2d4b9
leaq 0x14(%rsp), %rcx
leaq 0x10(%rsp), %r8
leaq 0xf(%rsp), %r9
xorl %eax, %eax
callq 0x2160
cmpl $0x4, %eax
jne 0x11cea
movq 0x40(%rsp), %rdi
movl 0x10(%rsp), %edx
subl 0x14(%rsp), %edx
leaq 0x1b76c(%rip), %rsi     # 0x2d427
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)
movl $0x52, %eax
movl $0x46, %edx
cmovel %eax, %edx
movb %dl, (%rbx)
movl %ecx, (%r14)
jmp 0x11cef
movb $0x0, (%r12)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rax
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
testl %edx, %edx
jle 0x11e56
cmpq %rax, %rcx
je 0x11e5c
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
xorpd %xmm0, %xmm0
xorl %ecx, %ecx
movq (%rax,%rcx,8), %rsi
xorps %xmm1, %xmm1
cvtsi2sdl 0x4(%rsi), %xmm1
addsd %xmm1, %xmm0
incq %rcx
cmpq %rcx, %rdx
jne 0x11e3c
jmp 0x11e5a
xorpd %xmm0, %xmm0
popq %rax
retq
leaq 0x1aa6d(%rip), %rdi     # 0x2c8d0
movq %rdx, %rsi
xorl %eax, %eax
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O3/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
movb $0x0, 0xb(%rsp)
leaq 0x1ae7c(%rip), %rsi     # 0x2cd08
callq 0x25d5a
movq %rax, %r14
movq %rax, %rdi
callq 0x25c1e
testq %rax, %rax
je 0x11f31
movq %rax, %r13
addl $0x3e8, %ebx            # imm = 0x3E8
leaq 0xc(%rsp), %r15
xorl %r12d, %r12d
xorl %ebp, %ebp
movl %r12d, %eax
imulq $0x431bde83, %rax, %rax # imm = 0x431BDE83
shrq $0x32, %rax
imull $0xf4240, %eax, %eax    # imm = 0xF4240
cmpl %r12d, %eax
je 0x11f14
movq %r13, %rdi
leaq 0x18b89(%rip), %rsi     # 0x2aa64
leaq 0x10(%rsp), %rdx
leaq 0xb(%rsp), %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x2160
cmpl $0x3, %eax
jne 0x11f4f
incl %r12d
movl 0xc(%rsp), %eax
addl %ebx, %eax
cmpl %ebp, %eax
cmovgl %eax, %ebp
movq %r14, %rdi
callq 0x25c1e
movq %rax, %r13
testq %rax, %rax
jne 0x11eb8
jmp 0x11f33
movq 0x270c5(%rip), %rax     # 0x38fe0
movq (%rax), %rdi
leaq 0x1b5b8(%rip), %rsi     # 0x2d4dd
movl %r12d, %edx
xorl %eax, %eax
callq 0x2250
jmp 0x11ed1
xorl %ebp, %ebp
movq %r14, %rdi
callq 0x2170
movl %ebp, %eax
addq $0x2728, %rsp           # imm = 0x2728
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
callq 0x38b0
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %edi, %r15d
leal 0x2(%r15), %eax
shlq $0x2, %rax
cmpl $-0x2, %edi
movq $-0x1, %rdi
cmovgeq %rax, %rdi
callq 0x2040
movq %rax, %rbx
testl %r15d, %r15d
jle 0x124e5
movl %r15d, %edx
shlq $0x2, %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x20f0
movq (%r14), %rax
movq 0x8(%r14), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
testl %edx, %edx
jle 0x12530
movl %edx, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %esi, %esi
cmpq %rsi, %rdx
je 0x12539
movq (%rax,%rsi,8), %rdi
movslq (%rdi), %rdi
imulq $0x431bde83, %rdi, %rdi # imm = 0x431BDE83
movq %rdi, %r8
shrq $0x3f, %r8
sarq $0x32, %rdi
addl %r8d, %edi
movslq %edi, %rdi
incl (%rbx,%rdi,4)
incq %rsi
cmpq %rsi, %rcx
jne 0x12501
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1a390(%rip), %rdi     # 0x2c8d0
movq %rdx, %rsi
xorl %eax, %eax
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O3/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 0x1a9c5(%rip), %rsi     # 0x2d5dd
movl $0x5f, %edx
callq 0x275da
leaq 0x1a9cc(%rip), %rsi     # 0x2d5f5
movq %rbx, %rdi
callq 0x290c2
testb %al, %al
jne 0x12c5b
leaq 0x1a9bd(%rip), %rsi     # 0x2d5f9
movq %rbx, %rdi
callq 0x290c2
testb %al, %al
jne 0x12c5b
leaq 0x1a9ae(%rip), %rsi     # 0x2d5fd
movq %rbx, %rdi
callq 0x290c2
testb %al, %al
je 0x12c75
leaq 0x3(%rbx), %rsi
movq %rsp, %r14
movq %r14, %rdi
callq 0x2150
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2150
addq $0x3e8, %rsp            # imm = 0x3E8
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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
movl $0x10, %edi
callq 0x2180
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_O3/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 0x12ccb
movq (%rbx), %r14
jmp 0x12d38
movsd %xmm0, 0x8(%rsp)
cmpb $0x1, 0x264f5(%rip)     # 0x391cd
je 0x12d4c
leal (%rdx,%rdx), %ebp
movslq %ebp, %rax
shlq $0x3, %rax
testl %edx, %edx
movq $-0x1, %rdi
cmovnsq %rax, %rdi
callq 0x2040
movq %rax, %r14
movslq 0x8(%rbx), %rax
movq (%rbx), %rdi
testq %rax, %rax
jle 0x12d1c
xorl %ecx, %ecx
movsd (%rdi,%rcx,8), %xmm0
movsd %xmm0, (%r14,%rcx,8)
incq %rcx
cmpq %rcx, %rax
jne 0x12d07
jmp 0x12d21
testq %rdi, %rdi
je 0x12d29
callq 0x2220
movl 0x8(%rbx), %eax
movsd 0x8(%rsp), %xmm0
movl %ebp, 0xc(%rbx)
movq %r14, (%rbx)
leal 0x1(%rax), %ecx
cltq
movsd %xmm0, (%r14,%rax,8)
movl %ecx, 0x8(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x2628d(%rip), %rax     # 0x38fe0
movq (%rax), %rdi
leal (%rdx,%rdx), %ecx
leaq 0x1a8b8(%rip), %rsi     # 0x2d618
xorl %eax, %eax
callq 0x2250
movl 0xc(%rbx), %edx
jmp 0x12cda
// File: /workspace/github_cpp_makefile_star2_O3/gersteinlab[P]MUSIC/src/ms_filter_utils.cpp
// Function: get_next_2_exp(int, int&, int&)
void get_next_2_exp(int val, int& larger_exp_val, int& expon)
{
	int cur_val = 1;
	int cur_exp = 0;
	while(cur_val < val)
	{
		cur_exp++;
		cur_val *= 2;
	}

	expon = cur_exp;
	larger_exp_val = cur_val;
}

// Assembly:
cmpl $0x2, %edi
jl 0x12d85
movl $0x1, %eax
xorl %ecx, %ecx
incl %ecx
addl %eax, %eax
cmpl %edi, %eax
jl 0x12d7b
jmp 0x12d8c
xorl %ecx, %ecx
movl $0x1, %eax
movl %ecx, (%rdx)
movl %eax, (%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O3/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, %ebx
movq %rdi, %r14
leal 0x2(%rbx), %eax
shlq $0x3, %rax
cmpl $-0x2, %esi
movq $-0x1, %rdi
cmovgeq %rax, %rdi
callq 0x2040
movq %rax, %r15
testl %ebx, %ebx
jle 0x15050
movslq %r13d, %rax
leal 0x1(%rbx), %ecx
movl $0x1, %edx
movsd 0x1504a(%rip), %xmm0    # 0x2a070
cmpq %rax, %rdx
jge 0x1503c
movsd (%r12,%rdx,8), %xmm1
ucomisd (%rsp), %xmm1
movapd %xmm0, %xmm1
ja 0x15042
movsd (%r14,%rdx,8), %xmm1
movsd %xmm1, (%r15,%rdx,8)
incq %rdx
cmpq %rdx, %rcx
jne 0x15026
cmpb $0x0, 0x24176(%rip)     # 0x391cd
jne 0x150d2
movq %r15, %rdi
movl %ebx, %esi
movl %ebp, %edx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x12f2c
movq %rax, %r12
leal 0x5(%rbx), %eax
shlq $0x3, %rax
cmpl $-0x5, %ebx
movq $-0x1, %rdi
cmovgeq %rax, %rdi
callq 0x2040
movq %rax, %r13
testl %ebx, %ebx
jle 0x150b0
incl %ebx
movl $0x1, %eax
movsd (%r12,%rax,8), %xmm0
maxsd (%r14,%rax,8), %xmm0
movsd %xmm0, (%r13,%rax,8)
incq %rax
cmpq %rax, %rbx
jne 0x15095
movq %r12, %rdi
callq 0x2220
movq %r15, %rdi
callq 0x2220
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4875
jmp 0x15059
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r14
pushq %rbx
subl %r8d, %esi
cmpl %r8d, %esi
jle 0x1516d
movl %r8d, %r14d
movq %rcx, %rbx
testl %r8d, %r8d
jle 0x1517a
movslq %r14d, %rcx
movslq %esi, %rdx
leaq (%rdi,%rcx,8), %rdi
movb $0x1, %bpl
movapd 0x178d3(%rip), %xmm0    # 0x2c9e0
movsd 0x184fb(%rip), %xmm1    # 0x2d610
movq %rcx, %rax
movl $0x1, %r9d
xorl %r8d, %r8d
movsd -0x8(%rdi,%r9,8), %xmm2
subsd (%rdi,%r8), %xmm2
andpd %xmm0, %xmm2
ucomisd %xmm1, %xmm2
ja 0x15148
leaq 0x1(%r9), %r10
addq $-0x8, %r8
cmpq %rcx, %r9
movq %r10, %r9
jl 0x15121
ucomisd %xmm1, %xmm2
jbe 0x15168
incq %rax
cmpq %rdx, %rax
setl %bpl
cmpl %eax, %esi
je 0x1516f
addq $0x8, %rdi
testl %r14d, %r14d
jg 0x15118
movb $0x1, %bpl
movl %eax, %r14d
jmp 0x1517d
xorl %ebp, %ebp
andb $0x1, %bpl
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movb $0x1, %bpl
movq 0x23e5c(%rip), %rax     # 0x38fe0
movq (%rax), %rdi
leaq 0x186f9(%rip), %rsi     # 0x2d887
movl %r14d, %edx
xorl %eax, %eax
callq 0x2250
movl %r14d, (%rbx)
jmp 0x1516f
nop