LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_annot_region_tools.cpp
// Function: get_regions_per_end_max(std::vector<t_annot_region*, std::allocator<t_annot_region*>>*, int)
vector<t_annot_region*>* get_regions_per_end_max(vector<t_annot_region*>* annot_regions, int end_max)
{
	vector<t_annot_region*>* end_max_regs = new vector<t_annot_region*>();
	for(int i_reg = 0; i_reg < (int)annot_regions->size(); i_reg++)
	{
		if(annot_regions->at(i_reg)->end < end_max)
		{
			end_max_regs->push_back(annot_regions->at(i_reg));
		}
	} // i_reg loop.

	return(end_max_regs);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movl $0x18, %edi
callq 0x2180
movq %rax, %r15
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq (%r14), %rdx
movq 0x8(%r14), %rax
subq %rdx, %rax
sarq $0x3, %rax
testl %eax, %eax
jle 0x1b054
xorl %r13d, %r13d
xorl %r12d, %r12d
cmpq %r12, %rax
jbe 0x1b061
movq (%rdx,%r13), %rax
cmpl %ebx, 0x20(%rax)
jge 0x1b030
movq 0x8(%r15), %rsi
cmpq 0x10(%r15), %rsi
je 0x1b025
movq %rax, (%rsi)
addq $0x8, 0x8(%r15)
jmp 0x1b030
addq %r13, %rdx
movq %r15, %rdi
callq 0xb976
incq %r12
movq (%r14), %rdx
movq 0x8(%r14), %rcx
subq %rdx, %rcx
movq %rcx, %rax
sarq $0x3, %rax
shrq $0x3, %rcx
movslq %ecx, %rcx
addq $0x8, %r13
cmpq %rcx, %r12
jl 0x1b003
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x1286e(%rip), %rdi     # 0x2d8d6
movq %r12, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_annot_region_tools.cpp
// Function: get_regions_per_min_run(std::vector<t_annot_region*, std::allocator<t_annot_region*>>*, int)
vector<t_annot_region*>* get_regions_per_min_run(vector<t_annot_region*>* annot_regions, int l_min_run)
{
	vector<t_annot_region*>* min_run_regs = new vector<t_annot_region*>();
	for(int i_reg = 0; i_reg < (int)annot_regions->size(); i_reg++)
	{
		if(annot_regions->at(i_reg)->end - annot_regions->at(i_reg)->start > l_min_run)
		{
			min_run_regs->push_back(annot_regions->at(i_reg));
		}
	} // i_reg loop.

	return(min_run_regs);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movl $0x18, %edi
callq 0x2180
movq %rax, %r15
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq (%r14), %rdx
movq 0x8(%r14), %rax
subq %rdx, %rax
sarq $0x3, %rax
testl %eax, %eax
jle 0x1b10c
xorl %r13d, %r13d
xorl %r12d, %r12d
cmpq %r12, %rax
jbe 0x1b119
movq (%rdx,%r13), %rax
movl 0x20(%rax), %ecx
subl 0xc(%rax), %ecx
cmpl %ebx, %ecx
jle 0x1b0e8
movq 0x8(%r15), %rsi
cmpq 0x10(%r15), %rsi
je 0x1b0dd
movq %rax, (%rsi)
addq $0x8, 0x8(%r15)
jmp 0x1b0e8
addq %r13, %rdx
movq %r15, %rdi
callq 0xb976
incq %r12
movq (%r14), %rdx
movq 0x8(%r14), %rcx
subq %rdx, %rcx
movq %rcx, %rax
sarq $0x3, %rax
shrq $0x3, %rcx
movslq %ecx, %rcx
addq $0x8, %r13
cmpq %rcx, %r12
jl 0x1b0b6
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x127b6(%rip), %rdi     # 0x2d8d6
movq %r12, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_annot_region_tools.cpp
// Function: get_regions_per_max_run(std::vector<t_annot_region*, std::allocator<t_annot_region*>>*, int)
vector<t_annot_region*>* get_regions_per_max_run(vector<t_annot_region*>* annot_regions, int l_max_run)
{
	vector<t_annot_region*>* min_run_regs = new vector<t_annot_region*>();
	for(int i_reg = 0; i_reg < (int)annot_regions->size(); i_reg++)
	{
		if(annot_regions->at(i_reg)->end - annot_regions->at(i_reg)->start < l_max_run)
		{
			min_run_regs->push_back(annot_regions->at(i_reg));
		}
	} // i_reg loop.

	return(min_run_regs);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movl $0x18, %edi
callq 0x2180
movq %rax, %r15
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq (%r14), %rdx
movq 0x8(%r14), %rax
subq %rdx, %rax
sarq $0x3, %rax
testl %eax, %eax
jle 0x1b1c4
xorl %r13d, %r13d
xorl %r12d, %r12d
cmpq %r12, %rax
jbe 0x1b1d1
movq (%rdx,%r13), %rax
movl 0x20(%rax), %ecx
subl 0xc(%rax), %ecx
cmpl %ebx, %ecx
jge 0x1b1a0
movq 0x8(%r15), %rsi
cmpq 0x10(%r15), %rsi
je 0x1b195
movq %rax, (%rsi)
addq $0x8, 0x8(%r15)
jmp 0x1b1a0
addq %r13, %rdx
movq %r15, %rdi
callq 0xb976
incq %r12
movq (%r14), %rdx
movq 0x8(%r14), %rcx
subq %rdx, %rcx
movq %rcx, %rax
sarq $0x3, %rax
shrq $0x3, %rcx
movslq %ecx, %rcx
addq $0x8, %r13
cmpq %rcx, %r12
jl 0x1b16e
movq %r15, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x126fe(%rip), %rdi     # 0x2d8d6
movq %r12, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_annot_region_tools.cpp
// Function: get_left_flanking_regions(std::vector<t_annot_region*, std::allocator<t_annot_region*>>*, int)
vector<t_annot_region*>* get_left_flanking_regions(vector<t_annot_region*>* regions, int l_flank)
{
	vector<t_annot_region*>* left_flanking_regions = new vector<t_annot_region*>();

	for(int i_reg = 0; i_reg < (int)regions->size(); i_reg++)
	{
		t_annot_region* new_region = new t_annot_region();
		new_region->chrom = new char[strlen(regions->at(i_reg)->chrom) + 2];
		strcpy(new_region->chrom, regions->at(i_reg)->chrom);
		new_region->start = (regions->at(i_reg)->start > l_flank)?(regions->at(i_reg)->start - l_flank):1;
		new_region->end = regions->at(i_reg)->start;
		new_region->strand = regions->at(i_reg)->strand;

		left_flanking_regions->push_back(new_region);
	} // i_reg loop.

	return(left_flanking_regions);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, 0xc(%rsp)
movq %rdi, %r14
movl $0x18, %edi
callq 0x2180
movq %rax, %r15
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq (%r14), %rbx
movq 0x8(%r14), %rbp
subq %rbx, %rbp
sarq $0x3, %rbp
testl %ebp, %ebp
jle 0x1b2f0
xorl %r12d, %r12d
movl $0x50, %edi
callq 0x2180
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movaps %xmm0, 0x10(%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x30(%rax)
movaps %xmm0, 0x40(%rax)
movq %rax, 0x10(%rsp)
cmpq %r12, %rbp
jbe 0x1b302
movq %rax, %r13
movq (%rbx,%r12,8), %rax
movq (%rax), %rdi
callq 0x20d0
leaq 0x2(%rax), %rdi
callq 0x2040
movq %rax, (%r13)
movq (%rbx,%r12,8), %rcx
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x2150
movq (%rbx,%r12,8), %rax
movl 0xc(%rax), %ecx
subl 0xc(%rsp), %ecx
movl $0x1, %edx
cmovlel %edx, %ecx
movl %ecx, 0xc(%r13)
movl 0xc(%rax), %ecx
movl %ecx, 0x20(%r13)
movb 0x8(%rax), %al
movb %al, 0x8(%r13)
movq 0x8(%r15), %rsi
cmpq 0x10(%r15), %rsi
je 0x1b2c0
movq %r13, (%rsi)
addq $0x8, 0x8(%r15)
jmp 0x1b2cd
movq %r15, %rdi
leaq 0x10(%rsp), %rdx
callq 0xb976
incq %r12
movq (%r14), %rbx
movq 0x8(%r14), %rax
subq %rbx, %rax
movq %rax, %rbp
sarq $0x3, %rbp
shrq $0x3, %rax
cltq
cmpq %rax, %r12
jl 0x1b22e
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x125cd(%rip), %rdi     # 0x2d8d6
movq %r12, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_annot_region_tools.cpp
// Function: load_chromosome_lengths_per_tabbed_file(char*, std::vector<char*, std::allocator<char*>>*, std::vector<int, std::allocator<int>>*)
void load_chromosome_lengths_per_tabbed_file(char* chr_lengths_fp, vector<char*>* chr_ids, vector<int>* chr_lengths)
{
	FILE* f_l_chrs = open_f(chr_lengths_fp, "r");

	while(1)
	{
		char* cur_line = getline(f_l_chrs);
		if(cur_line == NULL)
		{
			break;
		}

		char cur_chr_id[1000];
		int cur_l_chr = 0;
		if(sscanf(cur_line, "%s %d", cur_chr_id, &cur_l_chr) != 2)
		{
			fprintf(stderr, "Could not read chromosome lengths from: %s\n", cur_line);
			exit(0);
		} // check if reading is succesful.

		chr_ids->push_back(t_string::copy_me_str(cur_chr_id));
		chr_lengths->push_back(cur_l_chr);
	} // file reading loop.

	fclose(f_l_chrs);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3f8, %rsp            # imm = 0x3F8
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x129d4(%rip), %rsi     # 0x2dd08
callq 0x26387
movq %rax, %r15
leaq 0x10(%rsp), %r13
leaq 0x4(%rsp), %rbp
movq %r15, %rdi
callq 0x26258
testq %rax, %rax
je 0x1b3be
movq %rax, %r12
movl $0x0, 0x4(%rsp)
movq %rax, %rdi
leaq 0x13aad(%rip), %rsi     # 0x2ee15
movq %r13, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x2160
cmpl $0x2, %eax
jne 0x1b3d8
movq %r13, %rdi
callq 0x273e0
movq %rax, 0x8(%rsp)
movq %r14, %rdi
leaq 0x8(%rsp), %rsi
callq 0xb476
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x1b3ae
movl 0x4(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
jmp 0x1b3b9
movq %rbx, %rdi
movq %rbp, %rdx
callq 0xadd0
testq %r12, %r12
jne 0x1b346
movq %r15, %rdi
callq 0x2170
addq $0x3f8, %rsp            # imm = 0x3F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
callq 0x4e1f
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_annot_region_tools.cpp
// Function: get_right_flanking_regions(std::vector<t_annot_region*, std::allocator<t_annot_region*>>*, int)
vector<t_annot_region*>* get_right_flanking_regions(vector<t_annot_region*>* regions, int l_flank)
{
	vector<t_annot_region*>* right_flanking_regions = new vector<t_annot_region*>();

	for(int i_reg = 0; i_reg < (int)regions->size(); i_reg++)
	{
		t_annot_region* new_region = new t_annot_region();
		new_region->chrom = new char[strlen(regions->at(i_reg)->chrom) + 2];
		strcpy(new_region->chrom, regions->at(i_reg)->chrom);
		new_region->start = regions->at(i_reg)->end;
		new_region->end = regions->at(i_reg)->end + l_flank;
		new_region->strand = regions->at(i_reg)->strand;

		right_flanking_regions->push_back(new_region);
	} // i_reg loop.

	return(right_flanking_regions);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, 0xc(%rsp)
movq %rdi, %r14
movl $0x18, %edi
callq 0x2180
movq %rax, %r15
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq (%r14), %rbx
movq 0x8(%r14), %rbp
subq %rbx, %rbp
sarq $0x3, %rbp
testl %ebp, %ebp
jle 0x1b4e0
xorl %r12d, %r12d
movl $0x50, %edi
callq 0x2180
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movaps %xmm0, 0x10(%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x30(%rax)
movaps %xmm0, 0x40(%rax)
movq %rax, 0x10(%rsp)
cmpq %r12, %rbp
jbe 0x1b4f2
movq %rax, %r13
movq (%rbx,%r12,8), %rax
movq (%rax), %rdi
callq 0x20d0
leaq 0x2(%rax), %rdi
callq 0x2040
movq %rax, (%r13)
movq (%rbx,%r12,8), %rcx
movq (%rcx), %rsi
movq %rax, %rdi
callq 0x2150
movq (%rbx,%r12,8), %rax
movl 0x20(%rax), %ecx
movl %ecx, 0xc(%r13)
addl 0xc(%rsp), %ecx
movl %ecx, 0x20(%r13)
movb 0x8(%rax), %al
movb %al, 0x8(%r13)
movq 0x8(%r15), %rsi
cmpq 0x10(%r15), %rsi
je 0x1b4b0
movq %r13, (%rsi)
addq $0x8, 0x8(%r15)
jmp 0x1b4bd
movq %r15, %rdi
leaq 0x10(%rsp), %rdx
callq 0xb976
incq %r12
movq (%r14), %rbx
movq 0x8(%r14), %rax
subq %rbx, %rax
movq %rax, %rbp
sarq $0x3, %rbp
shrq $0x3, %rax
cltq
cmpq %rax, %r12
jl 0x1b429
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x123dd(%rip), %rdi     # 0x2d8d6
movq %r12, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_annot_region_tools.cpp
// Function: delete_annot_regions(t_annot_region*)
void delete_annot_regions(t_annot_region* region)
{
	if(region != NULL)
	{
		delete [] region->chrom;

		if(region->name != NULL)
		{
			delete [] region->name;
		}

		delete(region);
	}
}

// Assembly:
testq %rdi, %rdi
je 0x1be1c
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x1be00
callq 0x2220
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x1be0e
callq 0x2220
movl $0x50, %esi
movq %rbx, %rdi
popq %rbx
jmp 0x2190
retq
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_annot_region_tools.cpp
// Function: merge_annot_regions(std::vector<std::vector<t_annot_region*, std::allocator<t_annot_region*>>*, std::allocator<std::vector<t_annot_region*, std::allocator<t_annot_region*>>*>>*, int, bool)
vector<t_annot_region*>* merge_annot_regions(vector<vector<t_annot_region*>*>* annot_regions_list,
												int max_gap, 
												bool match_strands)
{
	vector<t_annot_region*>* total_annot_regions = new vector<t_annot_region*>();
	for(int i_reg_list = 0; i_reg_list < (int)annot_regions_list->size(); i_reg_list++)
	{
		vector<t_annot_region*>* cur_annot_regions = annot_regions_list->at(i_reg_list);
		for(int i = 0; i < (int)cur_annot_regions->size(); i++)
		{
			total_annot_regions->push_back(cur_annot_regions->at(i));
		} // i loop.
	} // i_reg_list loop.

	vector<t_annot_region*>* merged_annot_regions = merge_annot_regions(total_annot_regions,
																			max_gap, 
																			match_strands);

	delete(total_annot_regions);

	return(merged_annot_regions);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, (%rsp)
movl %esi, 0x4(%rsp)
movq %rdi, %r15
movl $0x18, %edi
callq 0x2180
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq (%r15), %rax
movq 0x8(%r15), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
testl %edx, %edx
jle 0x1bf00
xorl %r12d, %r12d
cmpq %r12, %rdx
jbe 0x1bf5a
movq (%rax,%r12,8), %rbp
movq (%rbp), %rdx
movq 0x8(%rbp), %rax
subq %rdx, %rax
sarq $0x3, %rax
testl %eax, %eax
jle 0x1bedc
xorl %r14d, %r14d
xorl %r13d, %r13d
cmpq %r13, %rax
jbe 0x1bf46
addq %r14, %rdx
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x1beaf
movq (%rdx), %rax
movq %rax, (%rsi)
addq $0x8, 0x8(%rbx)
jmp 0x1beb7
movq %rbx, %rdi
callq 0xb976
incq %r13
movq (%rbp), %rdx
movq 0x8(%rbp), %rcx
subq %rdx, %rcx
movq %rcx, %rax
sarq $0x3, %rax
shrq $0x3, %rcx
movslq %ecx, %rcx
addq $0x8, %r14
cmpq %rcx, %r13
jl 0x1be8c
incq %r12
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
movq %rcx, %rdx
sarq $0x3, %rdx
shrq $0x3, %rcx
movslq %ecx, %rcx
cmpq %rcx, %r12
jl 0x1be66
movzbl (%rsp), %edx
movq %rbx, %rdi
movl 0x4(%rsp), %esi
callq 0x1ab1c
movq %rax, %r14
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x1bf27
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x2190
movl $0x18, %esi
movq %rbx, %rdi
callq 0x2190
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x11989(%rip), %rdi     # 0x2d8d6
movq %r13, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2270
leaq 0x11975(%rip), %rdi     # 0x2d8d6
movq %r12, %rsi
jmp 0x1bf53
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_annot_region_tools.cpp
// Function: delete_annot_regions_with_line_information(std::vector<t_annot_region*, std::allocator<t_annot_region*>>*)
void delete_annot_regions_with_line_information(vector<t_annot_region*>* region_list)
{
	for(int i_reg = 0; i_reg < (int)region_list->size(); i_reg++)
	{
		if(region_list->at(i_reg) != NULL)
		{
			delete [] region_list->at(i_reg)->chrom;
			char* cur_line_info = (char*)region_list->at(i_reg)->data;
			if(cur_line_info != NULL)
			{
				delete [] cur_line_info;
			}
			delete(region_list->at(i_reg));
		}
	} // i_reg loop.

	region_list->clear();
	delete(region_list);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
movq 0x8(%rbx), %rax
movq %rax, %rdx
subq %rdi, %rdx
sarq $0x3, %rdx
testl %edx, %edx
jle 0x1c3e8
xorl %r14d, %r14d
cmpq %r14, %rdx
jbe 0x1c416
movq (%rdi,%r14,8), %rax
testq %rax, %rax
je 0x1c3c1
movq (%rax), %rdi
testq %rdi, %rdi
je 0x1c372
callq 0x2220
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r14, %rdx
jbe 0x1c416
movq (%rax,%r14,8), %rax
movq 0x48(%rax), %rdi
testq %rdi, %rdi
je 0x1c39b
callq 0x2220
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %r14, %rdx
jbe 0x1c416
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x1c3c1
movl $0x50, %esi
callq 0x2190
incq %r14
movq (%rbx), %rdi
movq 0x8(%rbx), %rax
movq %rax, %rcx
subq %rdi, %rcx
movq %rcx, %rdx
sarq $0x3, %rdx
shrq $0x3, %rcx
movslq %ecx, %rcx
cmpq %rcx, %r14
jl 0x1c353
cmpq %rdi, %rax
je 0x1c3f1
movq %rdi, 0x8(%rbx)
testq %rdi, %rdi
je 0x1c402
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x2190
movl $0x18, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2190
leaq 0x114b9(%rip), %rdi     # 0x2d8d6
movq %r14, %rsi
xorl %eax, %eax
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_annot_region_tools.cpp
// Function: locate_posn_per_sorted_posn_list(int, std::vector<int, std::allocator<int>>*, int, int)
int locate_posn_per_sorted_posn_list(int posn, vector<int>* sorted_posn_list, int i, int j)
{
	int i_mid = (i + j) / 2;

	if(i_mid == i ||
		i_mid == j)
	{
		return(i);
	}

	if(sorted_posn_list->at(i_mid) == posn)
	{
		// Move back while the entry is larger than or equal to the requestd position.
		while(i_mid > 0 &&
			sorted_posn_list->at(i_mid) >= posn)
		{
			i_mid--;
		}

		//// If the above loop hit the end, move back once.
		//if(i_mid == sorted_posn_list->size())
		//{
		//	i_mid--;
		//}

		//// If the above loop moved beyond the query move back once, which is the exact element just before query.
		//if(i_mid > 0 &&
		//	sorted_posn_list->at(i_mid) > posn)
		//{
		//	i_mid--;

		return(i_mid);
	}
	else if(sorted_posn_list->at(i_mid) > posn)
	{
		return(locate_posn_per_sorted_posn_list(posn, sorted_posn_list, i, i_mid));
	}
	else if(sorted_posn_list->at(i_mid) < posn)
	{
		return(locate_posn_per_sorted_posn_list(posn, sorted_posn_list, i_mid, j));
	}
	else
	{
		fprintf(stderr, "Current indices are (%d, %d), searching for %d @ %s(%d)\n", sorted_posn_list->at(i), sorted_posn_list->at(j),
			posn, __FILE__, __LINE__);
		exit(0);
	}
}

// Assembly:
pushq %rax
movl %edi, %r8d
movl %edx, %eax
movl %ecx, %edx
movl %edx, %ecx
leal (%rcx,%rax), %r11d
movl %r11d, %edx
shrl $0x1f, %edx
addl %r11d, %edx
sarl %edx
cmpl %eax, %edx
je 0x1c4a2
cmpl %ecx, %edx
je 0x1c4a2
movslq %edx, %r10
movq (%rsi), %rdi
movq 0x8(%rsi), %r9
subq %rdi, %r9
sarq $0x2, %r9
cmpq %r10, %r9
jbe 0x1c4a4
movl (%rdi,%r10,4), %r10d
cmpl %r8d, %r10d
je 0x1c47f
jg 0x1c437
jl 0x1c433
movl %eax, %edi
movl %ecx, %edx
movl %r8d, %ecx
callq 0x4e42
cmpl $0x2, %r11d
jl 0x1c4a0
movl %edx, %esi
cmpq %rsi, %r9
jbe 0x1c4b0
cmpl %r8d, (%rdi,%rsi,4)
jl 0x1c4a0
leal -0x1(%rdx), %eax
cmpl $0x1, %edx
movl %eax, %edx
jg 0x1c485
xorl %eax, %eax
jmp 0x1c4a2
movl %edx, %eax
popq %rcx
retq
leaq 0x1142b(%rip), %rdi     # 0x2d8d6
movq %r10, %rsi
jmp 0x1c4b7
leaq 0x1141f(%rip), %rdi     # 0x2d8d6
movq %r9, %rdx
xorl %eax, %eax
callq 0x2270
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_annot_region_tools.cpp
// Function: locate_posn_per_sorted_obj_list(int, std::vector<void*, std::allocator<void*>>*, int, int, int (*)(void*))
int locate_posn_per_sorted_obj_list(int posn, vector<void*>* obj_list, int i, int j, int (*prop_accession)(void*))
{
	int i_mid = (i + j) / 2;

	if(i_mid == i ||
		i_mid == j)
	{
		return(i);
	}

	if(prop_accession(obj_list->at(i_mid)) == posn)
	{
		// Move back while the entry is larger than or equal to the requestd position.
		while(i_mid > 0 &&
			prop_accession(obj_list->at(i_mid)) >= posn)
		{
			i_mid--;
		}

		return(i_mid);
	}
	else if(prop_accession(obj_list->at(i_mid)) > posn)
	{
		return(locate_posn_per_sorted_obj_list(posn, obj_list, i, i_mid, prop_accession));
	}
	else if(prop_accession(obj_list->at(i_mid)) < posn)
	{
		return(locate_posn_per_sorted_obj_list(posn, obj_list, i_mid, j, prop_accession));
	}
	else
	{
		fprintf(stderr, "Current indices are (%d, %d), searching for %d @ %s(%d)\n", prop_accession(obj_list->at(i)), prop_accession(obj_list->at(j)),
			posn, __FILE__, __LINE__);
		exit(0);
	}	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, 0x10(%rsp)
movl %ecx, %r13d
movl %edx, %r12d
movq %rsi, %r15
movl %edi, 0xc(%rsp)
movl %r12d, %ebp
movl %r13d, %r12d
movl %r12d, %r13d
leal (%r13,%rbp), %r14d
movl %r14d, %r12d
shrl $0x1f, %r12d
addl %r14d, %r12d
sarl %r12d
cmpl %ebp, %r12d
je 0x1c7d1
cmpl %r13d, %r12d
je 0x1c7d1
movslq %r12d, %rbx
movq (%r15), %rax
movq 0x8(%r15), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rbx, %rdx
jbe 0x1c7e2
movq (%rax,%rbx,8), %rdi
callq *0x10(%rsp)
cmpl 0xc(%rsp), %eax
je 0x1c792
movq (%r15), %rax
movq 0x8(%r15), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rbx, %rdx
jbe 0x1c7e2
movq (%rax,%rbx,8), %rdi
callq *0x10(%rsp)
cmpl 0xc(%rsp), %eax
jg 0x1c68f
movq (%r15), %rax
movq 0x8(%r15), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rbx, %rdx
jbe 0x1c7e2
movq (%rax,%rbx,8), %rdi
callq *0x10(%rsp)
cmpl 0xc(%rsp), %eax
jl 0x1c689
movq 0x1d8a9(%rip), %rax     # 0x39fe0
movq (%rax), %rbx
movslq %ebp, %rsi
movq %r15, %rdi
callq 0x1c842
movq (%rax), %rdi
movq 0x10(%rsp), %r14
callq *%r14
movl %eax, %ebp
movslq %r13d, %rsi
movq %r15, %rdi
callq 0x1c842
movq (%rax), %rdi
callq *%r14
movl $0xc4d, (%rsp)          # imm = 0xC4D
leaq 0x126f7(%rip), %rsi     # 0x2ee68
leaq 0x1226b(%rip), %r9      # 0x2e9e3
movq %rbx, %rdi
movl %ebp, %edx
movl %eax, %ecx
movl 0xc(%rsp), %r8d
xorl %eax, %eax
callq 0x2250
xorl %edi, %edi
callq 0x21e0
cmpl $0x2, %r14d
jl 0x1c7ce
movl %r12d, %esi
movq (%r15), %rax
movq 0x8(%r15), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq %rsi, %rdx
jbe 0x1c7f3
movq (%rax,%rsi,8), %rdi
callq *0x10(%rsp)
cmpl 0xc(%rsp), %eax
jl 0x1c7ce
leal -0x1(%r12), %eax
cmpl $0x1, %r12d
movl %eax, %r12d
jg 0x1c798
xorl %ebp, %ebp
jmp 0x1c7d1
movl %r12d, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x110ed(%rip), %rdi     # 0x2d8d6
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2270
leaq 0x110dc(%rip), %rdi     # 0x2d8d6
jmp 0x1c7ec
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_signal_track_tools.cpp
// Function: dump_per_nucleotide_uchar_binary_profile(unsigned char*, int, char*)
void dump_per_nucleotide_uchar_binary_profile(unsigned char* signal_profile, int l_profile, char* op_fp)
{
	// Dump the per nucleotide signal profile.
	FILE* f_op = open_f(op_fp, "wb");

	// Write data length to first couple bytes.
	fwrite(&(l_profile), sizeof(int), 1, f_op);

	// Dump the data: Dump 0 based data.
	fwrite(&(signal_profile[1]), sizeof(unsigned char), l_profile+1, f_op);

	fclose(f_op);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0xc(%rsp), %r14
movl %esi, (%r14)
leaq 0x104d5(%rip), %rsi     # 0x2d5a0
movq %rdx, %rdi
callq 0x26387
movq %rax, %r15
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rax, %rcx
callq 0x2340
incq %rbx
movslq (%r14), %rdx
incq %rdx
movl $0x1, %esi
movq %rbx, %rdi
movq %r15, %rcx
callq 0x2340
movq %r15, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2170
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_signal_track_tools.cpp
// Function: load_per_nucleotide_binary_uchar_profile(char*, int&)
unsigned char* load_per_nucleotide_binary_uchar_profile(char* binary_per_nucleotide_profile_fp, int& l_profile)
{
	FILE* f_prof = open_f(binary_per_nucleotide_profile_fp, "rb");

	// Read the profile length.
	int l_data = 0;
	fread(&l_data, sizeof(int), 1, f_prof);
	l_profile = l_data;

	// Read the data.
	unsigned char* signal_profile_buffer = new unsigned char[l_profile+2];

if(__DUMP_SIGNAL_TRACK_MSGS__)
	fprintf(stderr, "Loading %d data values.\n", l_profile);

	// Following is to use the codebase indexing: 1 based indexing.
	fread(&(signal_profile_buffer[1]), sizeof(char), l_profile+1, f_prof);
	
	fclose(f_prof);

	return(signal_profile_buffer);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
leaq 0x11e09(%rip), %rsi     # 0x2ef30
callq 0x26387
movq %rax, %rbx
leaq 0x4(%rsp), %r15
movl $0x0, (%r15)
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rax, %rcx
callq 0x2260
movslq (%r15), %r12
movl %r12d, (%r14)
movq %r12, %rdi
addq $0x2, %rdi
callq 0x2040
movq %rax, %r15
cmpb $0x1, 0x1d063(%rip)     # 0x3a1cf
je 0x1d19e
movq %r15, %rdi
incq %rdi
movslq (%r14), %rdx
incq %rdx
movl $0x1, %esi
movq %rbx, %rcx
callq 0x2260
movq %rbx, %rdi
callq 0x2170
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x1ce3b(%rip), %rax     # 0x39fe0
movq (%rax), %rdi
leaq 0x11d84(%rip), %rsi     # 0x2ef33
movl %r12d, %edx
xorl %eax, %eax
callq 0x2250
jmp 0x1d16e
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_signal_track_tools.cpp
// Function: get_profile_extrema(double*, int, double&, double&)
void get_profile_extrema(double* profile, int l_profile, double& prof_min, double& prof_max)
{
	prof_min = 1000*1000;
	prof_max = -1000*1000;
	for(int i = 1; i <= l_profile; i++)
	{
		if(profile[i] > prof_max)
		{
			prof_max = profile[i];
		}

		if(profile[i] < prof_min)
		{
			prof_min = profile[i];
		}
	} // i loop.
}

// Assembly:
movabsq $0x412e848000000000, %rax # imm = 0x412E848000000000
movq %rax, (%rdx)
movabsq $-0x3ed17b8000000000, %rax # imm = 0xC12E848000000000
movq %rax, (%rcx)
testl %esi, %esi
jle 0x1d20a
incl %esi
movl $0x1, %eax
movsd (%rdi,%rax,8), %xmm0
ucomisd (%rcx), %xmm0
jbe 0x1d1ef
movsd %xmm0, (%rcx)
movsd (%rdi,%rax,8), %xmm0
movsd (%rdx), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x1d202
movsd %xmm0, (%rdx)
incq %rax
cmpq %rax, %rsi
jne 0x1d1e0
retq
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_signal_track_tools.cpp
// Function: get_zero_indexed_per_one_indexed_data(double*, int)
double* get_zero_indexed_per_one_indexed_data(double* one_indexed_data, int l_profile)
{
	double* zero_indexed_data = new double[l_profile];
	for(int i = 1; i <= l_profile; i++)
	{
		zero_indexed_data[i-1] = one_indexed_data[i];
	} // i loop.

	return(zero_indexed_data);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movslq %esi, %r14
leaq (,%r14,8), %rax
testl %r14d, %r14d
movq $-0x1, %rdi
cmovnsq %rax, %rdi
callq 0x2040
testl %r14d, %r14d
jle 0x1d250
addq $0x8, %rbx
movl %ebp, %edx
shlq $0x3, %rdx
movq %rax, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x2130
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_signal_track_tools.cpp
// Function: get_one_indexed_per_zero_indexed_data(double*, int)
double* get_one_indexed_per_zero_indexed_data(double* zero_indexed_data, int l_profile)
{
	double* one_indexed_data = new double[l_profile+2];
	for(int i = 0; i < l_profile; i++)
	{
		one_indexed_data[i+1] = zero_indexed_data[i];
	} // i loop.

	return(one_indexed_data);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movslq %esi, %r15
leaq 0x10(,%r15,8), %rax
cmpl $-0x2, %r15d
movq $-0x1, %rdi
cmovgeq %rax, %rdi
callq 0x2040
movq %rax, %r14
testl %r15d, %r15d
jle 0x1d29d
movq %r14, %rdi
addq $0x8, %rdi
movl %ebp, %edx
shlq $0x3, %rdx
movq %rbx, %rsi
callq 0x2130
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_signal_track_tools.cpp
// Function: joint_prune_multiple_profiles_per_thresholds(double**, int, int, double*, int&)
double** joint_prune_multiple_profiles_per_thresholds(double** profiles, int n_profiles, int l_profile, double* threshold_per_profile, int& l_pruned_profile)
{
	// Go over all the profiles, find the regions.	
	double** pruned_profiles = new double*[n_profiles];
	for(int i_p = 0; i_p < n_profiles; i_p++)
	{
		pruned_profiles[i_p] = new double[l_profile+2];
	} // i_p loop.

	// Prune the columns.
	l_pruned_profile = 1;
	for(int i_sig = 1; i_sig <= l_profile; i_sig++)
	{
		bool include_cur_val = false;
		for(int i_p = 0; i_p < n_profiles; i_p++)
		{
			if(threshold_per_profile[i_p] <= -1000)
			{
				//fprintf(stderr, "Not using %d. profile for joint pruning.\n");
			}
			else if(profiles[i_p][i_sig] > threshold_per_profile[i_p])
			{
				include_cur_val = true;
			}
		} // i_p loop.

		if(include_cur_val)
		{
			// Add this columns to all the pruned profiles.
			for(int i_p = 0; i_p < n_profiles; i_p++)
			{
				// Copy the value.
				pruned_profiles[i_p][l_pruned_profile] = profiles[i_p][i_sig];
			} // i_p loop.	

			l_pruned_profile++;
		}
	} // i_sig loop.

	// Pruned profiles are indexed 1 based.
	l_pruned_profile--;

	return(pruned_profiles);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, 0x10(%rsp)
movq %rcx, %r14
movq %rdx, 0x8(%rsp)
movl %esi, %ebp
movq %rdi, %r12
movslq %esi, %rbx
leaq (,%rbx,8), %rdi
testl %ebx, %ebx
movq $-0x1, %rax
cmovsq %rax, %rdi
callq 0x2040
movq %rax, %r13
movl %ebp, 0x4(%rsp)
movl %ebp, %r15d
testl %ebx, %ebx
jle 0x1d412
movslq 0x8(%rsp), %rax
leaq 0x10(,%rax,8), %rbx
cmpl $-0x2, %eax
movq $-0x1, %rax
cmovlq %rax, %rbx
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x2040
movq %rax, (%r13,%rbp,8)
incq %rbp
cmpq %rbp, %r15
jne 0x1d3fd
movq 0x10(%rsp), %r8
movl $0x1, (%r8)
movq 0x8(%rsp), %r9
testl %r9d, %r9d
movl 0x4(%rsp), %r10d
jle 0x1d4a7
movl (%r8), %eax
incl %r9d
movl $0x1, %ecx
movsd 0x11ae8(%rip), %xmm0    # 0x2ef28
testl %r10d, %r10d
jle 0x1d49f
xorl %edx, %edx
xorl %esi, %esi
movsd (%r14,%rdx,8), %xmm1
ucomisd %xmm1, %xmm0
jae 0x1d467
movq (%r12,%rdx,8), %rdi
movsd (%rdi,%rcx,8), %xmm2
ucomisd %xmm1, %xmm2
jbe 0x1d467
movb $0x1, %sil
incq %rdx
cmpq %rdx, %r15
jne 0x1d449
testb $0x1, %sil
je 0x1d49f
testl %r10d, %r10d
jle 0x1d49a
movslq %eax, %rdx
xorl %esi, %esi
movq (%r12,%rsi,8), %rdi
movsd (%rdi,%rcx,8), %xmm1
movq (%r13,%rsi,8), %rdi
movsd %xmm1, (%rdi,%rdx,8)
incq %rsi
cmpq %rsi, %r15
jne 0x1d47f
incl %eax
movl %eax, (%r8)
incq %rcx
cmpq %r9, %rcx
jne 0x1d440
decl (%r8)
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_signal_track_tools.cpp
// Function: copy_profile(double*, int)
double* copy_profile(double* signal_profile, int l_profile)
{
	double* copy_prof = new double[l_profile+2];

	for(int i_sig = 1; i_sig <= l_profile; i_sig++)
	{
		copy_prof[i_sig] = signal_profile[i_sig];
	} // i_sig loop.

	return(copy_prof);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movslq %esi, %r15
leaq 0x10(,%r15,8), %rax
cmpl $-0x2, %r15d
movq $-0x1, %rdi
cmovgeq %rax, %rdi
callq 0x2040
movq %rax, %r14
testl %r15d, %r15d
jle 0x1d508
movq %r14, %rdi
addq $0x8, %rdi
addq $0x8, %rbx
movl %ebp, %edx
shlq $0x3, %rdx
movq %rbx, %rsi
callq 0x2130
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_signal_track_tools.cpp
// Function: extract_one_indexed_profile_per_profile(double*, int, int, int, int&)
double* extract_one_indexed_profile_per_profile(double* signal_profile_buffer, int l_profile, int start, int end, int& l_extracted_profile)
{
	double* extracted_prof = new double[end - start + 3];	
	for(int i_sig = start; i_sig <= end; i_sig++)
	{
		extracted_prof[i_sig - start] = 0;
	} // i_sig loop.
	
	// Count the extracted profile.
	l_extracted_profile = 1;
	for(int i_sig = start; i_sig <= MIN(l_profile, end); i_sig++)
	{
		extracted_prof[l_extracted_profile] = signal_profile_buffer[i_sig];
		l_extracted_profile++;
	} // i_sig loop.

	// Profiles are one based.
	l_extracted_profile--;

	return(extracted_prof);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movl %ecx, %r14d
movl %edx, %ebp
movl %esi, %r13d
movq %rdi, %r12
movl %ecx, %eax
subl %edx, %eax
cltq
leaq 0x18(,%rax,8), %rcx
cmpl $-0x3, %eax
movq $-0x1, %rdi
cmovgeq %rcx, %rdi
callq 0x2040
movq %rax, %r15
movl %r14d, %eax
subl %ebp, %eax
jl 0x1d56c
leaq 0x8(,%rax,8), %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x20f0
movl $0x1, (%rbx)
cmpl %r14d, %r13d
cmovll %r13d, %r14d
subl %ebp, %r14d
jl 0x1d5a0
movq %r15, %rdi
addq $0x8, %rdi
movslq %ebp, %rax
leaq (%r12,%rax,8), %rsi
leaq 0x8(,%r14,8), %rdx
callq 0x2130
addl $0x2, %r14d
movl %r14d, (%rbx)
decl (%rbx)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_signal_track_tools.cpp
// Function: dump_per_nucleotide_binary_profile(double*, int, char*)
void dump_per_nucleotide_binary_profile(double* signal_profile, int l_profile, char* op_fp)
{
	// Dump the per nucleotide signal profile.
	FILE* f_op = open_f(op_fp, "wb");

	// Write data length to first couple bytes.
	fwrite(&(l_profile), sizeof(int), 1, f_op);

	// Dump the data: Dump 0 based data.
	fwrite(&(signal_profile[1]), sizeof(double), l_profile+1, f_op);

	fclose(f_op);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0xc(%rsp), %r14
movl %esi, (%r14)
leaq 0xfec7(%rip), %rsi      # 0x2d5a0
movq %rdx, %rdi
callq 0x26387
movq %rax, %r15
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rax, %rcx
callq 0x2340
addq $0x8, %rbx
movslq (%r14), %rdx
incq %rdx
movl $0x8, %esi
movq %rbx, %rdi
movq %r15, %rcx
callq 0x2340
movq %r15, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x2170
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_signal_track_tools.cpp
// Function: load_per_nucleotide_binary_profile(char*, int&)
double* load_per_nucleotide_binary_profile(char* binary_per_nucleotide_profile_fp, int& l_profile)
{
	FILE* f_prof = open_f(binary_per_nucleotide_profile_fp, "rb");

	// Read the profile length.
	int l_data = 0;
	fread(&l_data, sizeof(int), 1, f_prof);
	l_profile = l_data;

	// Read the data.
	double* signal_profile_buffer = new double[l_profile+2];

if(__DUMP_SIGNAL_TRACK_MSGS__)
	fprintf(stderr, "Loading %d data values.\n", l_profile);

	// Following is to use the codebase indexing: 1 based indexing.
	fread(&(signal_profile_buffer[1]), sizeof(double), l_profile+1, f_prof);
	
	fclose(f_prof);

	return(signal_profile_buffer);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
leaq 0x117fa(%rip), %rsi     # 0x2ef30
callq 0x26387
movq %rax, %rbx
leaq 0x4(%rsp), %r15
movl $0x0, (%r15)
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rax, %rcx
callq 0x2260
movslq (%r15), %r12
cmpq $-0x2, %r12
movl %r12d, (%r14)
leaq 0x10(,%r12,8), %rax
movq $-0x1, %rdi
cmovgeq %rax, %rdi
callq 0x2040
movq %rax, %r15
cmpb $0x1, 0x1ca44(%rip)     # 0x3a1cf
je 0x1d7be
movq %r15, %rdi
addq $0x8, %rdi
movslq (%r14), %rdx
incq %rdx
movl $0x8, %esi
movq %rbx, %rcx
callq 0x2260
movq %rbx, %rdi
callq 0x2170
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x1c81b(%rip), %rax     # 0x39fe0
movq (%rax), %rdi
leaq 0x11764(%rip), %rsi     # 0x2ef33
movl %r12d, %edx
xorl %eax, %eax
callq 0x2250
jmp 0x1d78d
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_signal_track_tools.cpp
// Function: get_log_plus_one_profile(double*, double, int)
void get_log_plus_one_profile(double* signal_profile, double base, int l_profile)
{
	for(int i = 1; i <= l_profile; i++)
	{
		double cur_log_value = xlog(signal_profile[i]+1.0)/xlog(base);
		signal_profile[i] = cur_log_value;
	} // i loop.
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movsd %xmm0, (%rsp)
testl %esi, %esi
jle 0x1db24
movl %esi, %ebx
movq %rdi, %r14
incl %ebx
movl $0x1, %r15d
movsd (%r14,%r15,8), %xmm0
addsd 0xd511(%rip), %xmm0     # 0x2b008
callq 0x25878
movsd %xmm0, 0x8(%rsp)
movsd (%rsp), %xmm0
callq 0x25878
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%r14,%r15,8)
incq %r15
cmpq %r15, %rbx
jne 0x1dae9
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_signal_track_tools.cpp
// Function: floorize_profile(double*, int)
void floorize_profile(double* signal_profile, int l_profile)
{
	for(int i = 1; i <= l_profile; i++)
	{
		double cur_floor_val = floor(signal_profile[i]);
		signal_profile[i] = cur_floor_val;
	} // i loop.
}

// Assembly:
testl %esi, %esi
jle 0x1db62
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
incl %ebx
movl $0x1, %r15d
movsd (%r14,%r15,8), %xmm0
callq 0x22c0
movsd %xmm0, (%r14,%r15,8)
incq %r15
cmpq %r15, %rbx
jne 0x1db44
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_signal_track_tools.cpp
// Function: get_zero_profile(int)
double* get_zero_profile(int l_profile)
{
	double* cur_profile = new double[l_profile+2];
	for(int i = 0; i <= l_profile; i++)
	{
		cur_profile[i] = 0.0;
	} // i loop.

	return(cur_profile);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movslq %edi, %r14
leaq 0x10(,%r14,8), %rax
cmpl $-0x2, %r14d
movq $-0x1, %rdi
cmovgeq %rax, %rdi
callq 0x2040
testl %r14d, %r14d
js 0x1dba8
movl %ebx, %ecx
leaq 0x8(,%rcx,8), %rdx
movq %rax, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x20f0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_signal_enrichment_utils.cpp
// Function: get_binomial_p_val_per_enriched_background_values(int, int, double*)
double get_binomial_p_val_per_enriched_background_values(int enriched_value, int background_value, double* _log_factorials)
{
	int grand_total_int = (int)(enriched_value + background_value);

	// Setup the log factorials.
	double* log_factorials = NULL;
	if(_log_factorials == NULL)
	{
		log_factorials = buffer_log_factorials(grand_total_int+3);
	}
	else
	{
		log_factorials = _log_factorials;
	}

	// Compute the p-values.
	double log_flip = log(.5);
	double cur_region_log_p_val = xlog(0.0);
	for(int i = 0; i <= background_value; i++)
	{
		double log_cur_half_pow = log_flip * grand_total_int;
		double log_cur_perm = 0.0; // = xlog(1.0).

		// Compute the current permutation, using shortcuts, bypassing the function calls from xlog_math library.
		log_cur_perm = xlog_div(log_factorials[grand_total_int], xlog_mul(log_factorials[i], log_factorials[grand_total_int-i]));
		cur_region_log_p_val = xlog_sum(cur_region_log_p_val, xlog_mul(log_cur_perm, log_cur_half_pow));
	} // i loop.

	// Free memory if it is allocated in the function.
	if(_log_factorials == NULL)
	{
		delete [] log_factorials;
	}
	else
	{
	}

	return(cur_region_log_p_val);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movl %esi, %r15d
movl %edi, %r12d
addl %esi, %r12d
movq %rdx, %r14
testq %rdx, %rdx
jne 0x1e26f
leal 0x3(%r12), %edi
callq 0x23bc5
movq %rax, %r14
xorps %xmm0, %xmm0
callq 0x25878
testl %r15d, %r15d
js 0x1e2f0
cvtsi2sd %r12d, %xmm1
mulsd 0x10e57(%rip), %xmm1    # 0x2f0e0
movsd %xmm1, 0x8(%rsp)
movslq %r12d, %r12
incl %r15d
leaq (%r14,%r12,8), %r13
xorl %ebp, %ebp
movsd %xmm0, (%rsp)
movsd (%r14,%r12,8), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd (%r14,%rbp,8), %xmm0
movsd (%r13), %xmm1
callq 0x259e1
movaps %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
callq 0x25a1c
movsd 0x8(%rsp), %xmm1
callq 0x259e1
movapd %xmm0, %xmm1
movsd (%rsp), %xmm0
callq 0x258cc
incq %rbp
addq $-0x8, %r13
cmpq %rbp, %r15
jne 0x1e29b
testq %rbx, %rbx
setne %al
testq %r14, %r14
sete %cl
orb %al, %cl
jne 0x1e312
movq %r14, %rdi
movsd %xmm0, (%rsp)
callq 0x2220
movsd (%rsp), %xmm0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_genome_sequence_tools.cpp
// Function: load_binary_sequence_file(char*, int&)
char* load_binary_sequence_file(char* bin_seq_fp, int& l_seq)
{
	FILE* f_bin_seq = open_f(bin_seq_fp, "rb");
	int l_bin_seq = 0;

	// Read the length.
	fread(&l_bin_seq, sizeof(int), 1, f_bin_seq);

	l_seq = l_bin_seq;

	// Read the sequence.
	char* bin_seq = new char[l_bin_seq+2];
	fread(bin_seq, sizeof(char), l_bin_seq, f_bin_seq);
	fclose(f_bin_seq);

	return(bin_seq);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
leaq 0xcd36(%rip), %rsi      # 0x2ef30
callq 0x26387
movq %rax, %r14
leaq 0xc(%rsp), %r15
movl $0x0, (%r15)
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rax, %rcx
callq 0x2260
movslq (%r15), %r15
movl %r15d, (%rbx)
leaq 0x2(%r15), %rdi
callq 0x2040
movq %rax, %rbx
movl $0x1, %esi
movq %rax, %rdi
movq %r15, %rdx
movq %r14, %rcx
callq 0x2260
movq %r14, %rdi
callq 0x2170
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_genome_sequence_tools.cpp
// Function: load_BED_with_sequences(char*)
vector<t_annot_region*>* load_BED_with_sequences(char* bed_w_seq_fp)
{
	vector<t_annot_region*>* regs_w_seqs = new vector<t_annot_region*>();

	FILE* f_bed_w_seq = open_f(bed_w_seq_fp, "r");

	while(1)
	{
		char* cur_line = getline(f_bed_w_seq);
		if(cur_line == NULL)
		{
			break;
		}

		char chrom[100];
		int start;
		int end;
		char strand;
		char name[100];
		char* cur_seq = new char[t_string::string_length(cur_line) + 2];		

		if(sscanf(cur_line, "%s %d %d %s %*s %c %s", chrom, 
			&start, &end, name, &strand, cur_seq) != 6)
		{
			fprintf(stderr, "Could not parse the sequence bed file line:\n%s\n", cur_line);
			exit(0);
		}

		t_annot_region* cur_region = get_empty_region();
		cur_region->chrom = t_string::copy_me_str(chrom);
		cur_region->start = translate_coord(start, BED_COORDS::start_base, CODEBASE_COORDS::start_base);
		cur_region->end = translate_coord(end, BED_COORDS::end_base, CODEBASE_COORDS::end_base);
		cur_region->strand = strand;

		// The sequence is stored in the data entry.
		cur_region->data = (void*)cur_seq;

		regs_w_seqs->push_back(cur_region);
	} // file reading loop.

	fclose(f_bed_w_seq);

	return(regs_w_seqs);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdi, %r14
movl $0x18, %edi
callq 0x2180
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
leaq 0xb8e1(%rip), %rsi      # 0x2dd08
movq %r14, %rdi
callq 0x26387
movq %rax, %r14
leaq 0x90(%rsp), %r12
leaq 0x20(%rsp), %r15
movq %r14, %rdi
callq 0x26258
testq %rax, %rax
je 0x22503
movq %rax, %r13
movq %rax, %rdi
callq 0x26e82
addl $0x2, %eax
movslq %eax, %rdi
callq 0x2040
movq %rax, %rbp
movq %r13, %rdi
leaq 0xce79(%rip), %rsi      # 0x2f2ec
movq %r12, %rdx
leaq 0x1c(%rsp), %rcx
leaq 0x18(%rsp), %r8
movq %r15, %r9
xorl %eax, %eax
pushq %rbp
leaq 0x17(%rsp), %r10
pushq %r10
callq 0x2160
addq $0x10, %rsp
cmpl $0x6, %eax
jne 0x22520
callq 0x15990
movq %rax, 0x10(%rsp)
movq %r12, %rdi
callq 0x273e0
movq 0x10(%rsp), %rcx
movq %rax, (%rcx)
movl 0x1c(%rsp), %ecx
incl %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0xc(%rax)
movl 0x18(%rsp), %ecx
movl %ecx, 0x20(%rax)
movb 0xf(%rsp), %cl
movb %cl, 0x8(%rax)
movq %rbp, 0x48(%rax)
movq 0x8(%rbx), %rsi
cmpq 0x10(%rbx), %rsi
je 0x224ed
movq %rax, (%rsi)
addq $0x8, 0x8(%rbx)
jmp 0x224fa
movq %rbx, %rdi
leaq 0x10(%rsp), %rdx
callq 0xb976
testq %r13, %r13
jne 0x2243f
movq %r14, %rdi
callq 0x2170
movq %rbx, %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
callq 0x5359
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_genome_sequence_tools.cpp
// Function: get_reverse_complement(char*, int, int)
char* get_reverse_complement(char* cur_aln_line, int i_nuc_min, int i_nuc_max)
{
	char* rev_comp_DNA = new char[i_nuc_max - i_nuc_min + 2];
	memset(rev_comp_DNA, 0, sizeof(char) * (i_nuc_max - i_nuc_min + 2));

	//printf("Forward strand RNA for strand:\n");
	//for(int i_nuc = i_nuc_min; i_nuc <= i_nuc_max; i_nuc++)
	//{
	//	printf("%c", cur_aln_line[i_nuc]);
	//}
	//printf("\n");

	int i_dna_nuc = 0;

	// The forward strand RNA is transcribed from 3' end.
	for(int i_nuc = i_nuc_max; i_nuc >= i_nuc_min; i_nuc--)
	{
		if(cur_aln_line[i_nuc] == 'A')
		{
			rev_comp_DNA[i_dna_nuc] = 'T';
			i_dna_nuc++;
		}
		else if(cur_aln_line[i_nuc] == 'T')
		{
			rev_comp_DNA[i_dna_nuc] = 'A';
			i_dna_nuc++;
		}
		else if(cur_aln_line[i_nuc] == 'G')
		{
			rev_comp_DNA[i_dna_nuc] = 'C';
			i_dna_nuc++;
		}
		else if(cur_aln_line[i_nuc] == 'C')
		{
			rev_comp_DNA[i_dna_nuc] = 'G';
			i_dna_nuc++;
		}
		else if(cur_aln_line[i_nuc] == 'a')
		{
			rev_comp_DNA[i_dna_nuc] = 't';
			i_dna_nuc++;
		}
		else if(cur_aln_line[i_nuc] == 't')
		{
			rev_comp_DNA[i_dna_nuc] = 'a';
			i_dna_nuc++;
		}
		else if(cur_aln_line[i_nuc] == 'g')
		{
			rev_comp_DNA[i_dna_nuc] = 'c';
			i_dna_nuc++;
		}
		else if(cur_aln_line[i_nuc] == 'c')
		{
			rev_comp_DNA[i_dna_nuc] = 'g';
			i_dna_nuc++;
		}
		//else if(cur_aln_line[i_nuc] == '-')
		//{
		//	rev_comp_DNA[i_dna_nuc] = '-';
		//	i_dna_nuc++;
		//}
		else
		{
			//printf("Found %c in the alignment line @ %s(%d):\n%s\n",  cur_aln_line[i_nuc], __FILE__, __LINE__, cur_aln_line);
			//exit(0);
			rev_comp_DNA[i_dna_nuc] = cur_aln_line[i_nuc];
			i_dna_nuc++;
		}
	} // i_nuc loop.

	//printf("%s", rev_comp_DNA);
	//getc(stdin);
	
	return(rev_comp_DNA);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %rbx
movl %edx, %eax
subl %esi, %eax
addl $0x2, %eax
movslq %eax, %r12
movq %r12, %rdi
callq 0x2040
movq %rax, %r14
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x20f0
movl %ebp, %eax
subl %r15d, %eax
jl 0x22c4e
movslq %ebp, %rcx
incl %eax
addq %rcx, %rbx
xorl %ecx, %ecx
movb (%rbx), %dl
movzbl %dl, %esi
cmpl $0x60, %esi
jg 0x22bfc
cmpl $0x46, %esi
jg 0x22c10
movb $0x54, %dil
cmpl $0x41, %esi
je 0x22c3f
cmpl $0x43, %esi
jne 0x22c3d
movb $0x47, %dil
jmp 0x22c3f
cmpl $0x66, %esi
jg 0x22c1f
cmpl $0x61, %esi
je 0x22c2e
cmpl $0x63, %esi
jne 0x22c3d
movb $0x67, %dil
jmp 0x22c3f
cmpl $0x47, %esi
je 0x22c33
cmpl $0x54, %esi
jne 0x22c3d
movb $0x41, %dil
jmp 0x22c3f
cmpl $0x67, %esi
je 0x22c38
cmpl $0x74, %esi
jne 0x22c3d
movb $0x61, %dil
jmp 0x22c3f
movb $0x74, %dil
jmp 0x22c3f
movb $0x43, %dil
jmp 0x22c3f
movb $0x63, %dil
jmp 0x22c3f
movl %edx, %edi
movb %dil, (%r14,%rcx)
incq %rcx
decq %rbx
cmpq %rcx, %rax
jne 0x22bdb
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/gersteinlab[P]MUSIC/src/ms_genome_sequence_tools.cpp
// Function: load_whole_chromosome_sequence_per_bin_file(char*, int&)
char* load_whole_chromosome_sequence_per_bin_file(char* chr_fp, int& n_nucs)
{
	FILE* f_chr = open_f(chr_fp, "rb");
	
	// Get the file size.
	fseek (f_chr, 0 , SEEK_END);
	n_nucs = (int)(ftell(f_chr));
	rewind(f_chr);

	char* nucs = new char[n_nucs+2]; 

	fread(nucs, sizeof(char), n_nucs, f_chr);

	fclose(f_chr);

	return(nucs);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
leaq 0xbf71(%rip), %rsi      # 0x2ef30
callq 0x26387
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x21a0
movq %rbx, %rdi
callq 0x2030
movl %eax, (%r14)
movq %rbx, %rdi
callq 0x2060
movslq (%r14), %r14
leaq 0x2(%r14), %rdi
callq 0x2040
movq %rax, %r15
movl $0x1, %esi
movq %rax, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x2260
movq %rbx, %rdi
callq 0x2170
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq