LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/garbage_collection.cpp
// Function: greedy_algorithm(ssd_info*, local*)
STATE greedy_algorithm(ssd_info * ssd,  local * location){
	int active_block = get_active_block(ssd,location);
	int cold_active_block = get_cold_active_block(ssd, location); 
	location->block = best_cost(ssd, ssd->channel_head[location->channel]->lun_head[location->lun]->plane_head[location->plane], active_block, cold_active_block);
	return SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x5b4b
movl %eax, %ebp
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5bf9
movq 0x90(%r14), %rcx
movslq (%rbx), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x50(%rcx), %rcx
movslq 0x4(%rbx), %rdx
movq (%rcx,%rdx,8), %rcx
movq (%rcx), %rcx
movslq 0x8(%rbx), %rdx
movq (%rcx,%rdx,8), %rsi
movq %r14, %rdi
movl %ebp, %edx
movl %eax, %ecx
callq 0x71a8
movl %eax, 0xc(%rbx)
pushq $0x1
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/garbage_collection.cpp
// Function: fifo_algorithm(ssd_info*, local*)
STATE fifo_algorithm(ssd_info * ssd,  local * location){
	int block = -1;
	int64_t min_time = 10000000000000;
	plane_info * the_plane = ssd->channel_head[location->channel]->lun_head[location->lun]->plane_head[location->plane]; 
	int active_block = get_active_block(ssd,location);
	int cold_active_block = get_cold_active_block(ssd, location); 
	for (int i = 0; i < ssd->parameter->block_plane; i++){
		if ((i == active_block) || (i == cold_active_block)) continue;
		if(the_plane->blk_head[i]->free_page_num > 0) continue; 
		if(the_plane->blk_head[i]->invalid_page_num == 0) continue; 

		if (the_plane->blk_head[i]->last_write_time <= min_time){
			min_time = the_plane->blk_head[i]->last_write_time;
			block = i;
		}
	}
	location->block = block;
	return SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x90(%rdi), %rax
movslq (%rsi), %rcx
movq (%rax,%rcx,8), %rax
movq 0x50(%rax), %rax
movslq 0x4(%rsi), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
movslq 0x8(%rsi), %rcx
movq (%rax,%rcx,8), %r15
callq 0x5b4b
movl %eax, %ebp
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5bf9
movq 0x58(%r14), %rcx
movl 0x230(%rcx), %ecx
movl %ebp, %edx
movl %eax, %eax
pushq $-0x1
popq %rsi
movabsq $0x9184e72a000, %rdi    # imm = 0x9184E72A000
xorl %r8d, %r8d
cmpq %r8, %rcx
je 0x6b20
cmpq %r8, %rdx
je 0x6b1b
cmpq %r8, %rax
je 0x6b1b
movq 0x20(%r15), %r9
movq (%r9,%r8,8), %r9
cmpl $0x0, 0x4(%r9)
jg 0x6b1b
cmpl $0x0, 0x8(%r9)
je 0x6b1b
movq 0x18(%r9), %r9
cmpq %rdi, %r9
cmovlq %r9, %rdi
cmovlel %r8d, %esi
incq %r8
jmp 0x6ae7
movl %esi, 0xc(%rbx)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/garbage_collection.cpp
// Function: RANDOM_algorithm(ssd_info*, local*)
STATE RANDOM_algorithm(ssd_info * ssd, local * location){
	unsigned int block = -1;
	int active_block = get_active_block(ssd,location);
	int cold_active_block = get_cold_active_block(ssd, location); 
	unsigned int rand_block = rand() % ssd->parameter->block_plane;
	plane_info * the_plane = ssd->channel_head[location->channel]->lun_head[location->lun]->plane_head[location->plane]; 
	while ((rand_block == active_block) || (rand_block == cold_active_block) || (the_plane->blk_head[rand_block]->free_page_num > 0))
		rand_block = rand() % ssd->parameter->block_plane;

	location->block = rand_block;
	return SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x5b4b
movl %eax, %ebp
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5bf9
movl %eax, %r15d
callq 0x2090
movq 0x58(%r14), %rcx
movq 0x90(%r14), %rsi
xorl %edx, %edx
divl 0x230(%rcx)
movslq (%rbx), %rax
movq (%rsi,%rax,8), %rax
movq 0x50(%rax), %rax
movslq 0x4(%rbx), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
movslq 0x8(%rbx), %rcx
movq (%rax,%rcx,8), %r12
cmpl %ebp, %edx
je 0x6d37
cmpl %r15d, %edx
je 0x6d37
movq 0x20(%r12), %rax
movl %edx, %ecx
movq (%rax,%rcx,8), %rax
cmpl $0x0, 0x4(%rax)
jle 0x6d4a
callq 0x2090
movq 0x58(%r14), %rcx
xorl %edx, %edx
divl 0x230(%rcx)
jmp 0x6d1d
movl %edx, 0xc(%rbx)
pushq $0x1
popq %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/garbage_collection.cpp
// Function: RANDOM_p_algorithm(ssd_info*, local*)
STATE RANDOM_p_algorithm(ssd_info * ssd, local * location){
	unsigned int block = -1;
	int active_block = get_active_block(ssd,location);
	int cold_active_block = get_cold_active_block(ssd, location); 

	unsigned int rand_block = rand() % ssd->parameter->block_plane;
	while ((rand_block == active_block) || (rand_block == cold_active_block) || ssd->channel_head[location->channel]->lun_head[location->lun]->plane_head[location->plane]->blk_head[rand_block]->invalid_page_num == 0)
		rand_block = rand() % ssd->parameter->block_plane;

	location->block = rand_block;

	return SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x5b4b
movl %eax, %ebp
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5bf9
movl %eax, %r15d
callq 0x2090
movq 0x58(%r14), %rcx
xorl %edx, %edx
divl 0x230(%rcx)
cmpl %ebp, %edx
je 0x6d7b
cmpl %r15d, %edx
je 0x6d7b
movq 0x90(%r14), %rax
movslq (%rbx), %rcx
movq (%rax,%rcx,8), %rax
movq 0x50(%rax), %rax
movslq 0x4(%rbx), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
movslq 0x8(%rbx), %rcx
movq (%rax,%rcx,8), %rax
movq 0x20(%rax), %rax
movl %edx, %ecx
movq (%rax,%rcx,8), %rax
cmpl $0x0, 0x8(%rax)
je 0x6d7b
movl %edx, 0xc(%rbx)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/garbage_collection.cpp
// Function: RANDOM_pp_algorithm(ssd_info*, local*)
STATE RANDOM_pp_algorithm(ssd_info * ssd, local * location){
	unsigned int least_invalid = ssd->parameter->overprovide * ssd->parameter->block_plane;

	unsigned int block = -1;
	int active_block = get_active_block(ssd,location);
	int cold_active_block = get_cold_active_block(ssd, location); 
	unsigned int rand_block = rand() % ssd->parameter->block_plane;
	plane_info * the_plane = ssd->channel_head[location->channel]->lun_head[location->lun]->plane_head[location->plane]; 
	int counter = 0;
	while ((rand_block == active_block) || (rand_block == cold_active_block )||(the_plane->blk_head[rand_block]->invalid_page_num < least_invalid && counter <= ssd->parameter->block_plane)
				|| (the_plane->blk_head[rand_block]->free_page_num > 0)){
		rand_block = rand() % ssd->parameter->block_plane;
		counter++;
	}

	location->block = rand_block;
	return SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x58(%rdi), %rax
movl 0x230(%rax), %ecx
cvtsi2ss %rcx, %xmm0
mulss 0x25c(%rax), %xmm0
cvttss2si %xmm0, %r12
callq 0x5b4b
movl %eax, %ebp
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5bf9
movl %eax, %r15d
callq 0x2090
movq 0x58(%r14), %rcx
movq 0x90(%r14), %rsi
movl 0x230(%rcx), %ecx
xorl %r13d, %r13d
xorl %edx, %edx
divl %ecx
movslq (%rbx), %rax
movq (%rsi,%rax,8), %rax
movq 0x50(%rax), %rax
movslq 0x4(%rbx), %rsi
movq (%rax,%rsi,8), %rax
movq (%rax), %rax
movq %rbx, (%rsp)
movslq 0x8(%rbx), %rsi
movq (%rax,%rsi,8), %rbx
cmpl %ebp, %edx
je 0x6e80
cmpl %r15d, %edx
je 0x6e80
movq 0x20(%rbx), %rax
movl %edx, %esi
movq (%rax,%rsi,8), %rax
cmpl %r12d, 0x8(%rax)
jae 0x6e7a
cmpl %ecx, %r13d
jbe 0x6e80
cmpl $0x0, 0x4(%rax)
jle 0x6e98
callq 0x2090
movq 0x58(%r14), %rcx
movl 0x230(%rcx), %ecx
xorl %edx, %edx
divl %ecx
incl %r13d
jmp 0x6e5c
movq (%rsp), %rax
movl %edx, 0xc(%rax)
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/garbage_collection.cpp
// Function: Schedule_GC(ssd_info*, sub_request*)
bool Schedule_GC(ssd_info * ssd, sub_request * sub){
		
	local * location = sub->location; 
	unsigned int free_page = ssd->channel_head[location->channel]->lun_head[location->lun]->plane_head[location->plane]->free_page;
	unsigned int invalid_page = ssd->channel_head[location->channel]->lun_head[location->lun]->plane_head[location->plane]->invalid_page;
	unsigned int all_page = ssd->parameter->page_block*ssd->parameter->block_plane;
	gc_operation * gc_node = NULL;



	if (free_page > (all_page * ssd->parameter->gc_down_threshold)){
		return false;
	}
	gc_node = new gc_operation(location, ssd->gc_sequence_number++);

	if (add_gc_node(ssd, gc_node) != SUCCESS){
		delete gc_node;
		return false;
	}

	sub->trigger_gc = true; 	
	
	//int invalid_00 = ssd->channel_head[0]->lun_head[0]->plane_head[location->plane]->invalid_page;
	//int invalid_01 = ssd->channel_head[0]->lun_head[1]->plane_head[location->plane]->invalid_page;
	//int invalid_10 = ssd->channel_head[1]->lun_head[0]->plane_head[location->plane]->invalid_page;
	//int invalid_11 = ssd->channel_head[1]->lun_head[1]->plane_head[location->plane]->invalid_page;
	//cout << "GC starts for planes " << location->channel << location->lun << " with (" << invalid_00 << "," << invalid_01 << "," << invalid_10 << "," << invalid_11 << ")\n";
	gc_for_plane(ssd, gc_node);

	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x60(%rsi), %r12
movq 0x58(%rdi), %rax
movq 0x90(%rdi), %rcx
movslq (%r12), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x50(%rcx), %rcx
movslq 0x4(%r12), %rdx
movq (%rcx,%rdx,8), %rcx
movq (%rcx), %rcx
movslq 0x8(%r12), %rdx
movq (%rcx,%rdx,8), %rcx
movl 0x230(%rax), %edx
imull 0x234(%rax), %edx
movl (%rcx), %ecx
cvtsi2ss %rcx, %xmm0
cvtsi2ss %rdx, %xmm1
mulss 0x28c(%rax), %xmm1
ucomiss %xmm1, %xmm0
ja 0x6f6d
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x20
popq %rdi
callq 0x2160
movq %rax, %r15
movl 0x10(%rbx), %edx
leal 0x1(%rdx), %eax
movl %eax, 0x10(%rbx)
movq %r15, %rdi
movq %r12, %rsi
callq 0x7206
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6f91
testl %eax, %eax
je 0x6f5a
movb $0x1, 0x98(%r14)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x638c
movb $0x1, %al
jmp 0x6f6f
movq %r15, %rdi
callq 0x7248
pushq $0x20
popq %rsi
movq %r15, %rdi
callq 0x2170
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
pushq $0x20
popq %rsi
movq %r15, %rdi
callq 0x2170
movq %rbx, %rdi
callq 0x22b0
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/garbage_collection.cpp
// Function: delete_gc_node(ssd_info*, gc_operation*)
STATE delete_gc_node(ssd_info * ssd, gc_operation * gc_node){
	if (gc_node == NULL) return FAIL;
	if (ssd->channel_head[gc_node->location->channel]->lun_head[gc_node->location->lun]->plane_head[gc_node->location->plane]->scheduled_gc == NULL) return FAIL;
	ssd->channel_head[gc_node->location->channel]->lun_head[gc_node->location->lun]->plane_head[gc_node->location->plane]->scheduled_gc = gc_node->next_node;
	delete gc_node;
	return SUCCESS;
}

// Assembly:
xorl %eax, %eax
testq %rsi, %rsi
je 0x71a7
pushq %rbx
movq %rsi, %rbx
movq 0x90(%rdi), %rcx
movq (%rsi), %rdx
movslq (%rdx), %rsi
movq (%rcx,%rsi,8), %rcx
movq 0x50(%rcx), %rcx
movslq 0x4(%rdx), %rsi
movq (%rcx,%rsi,8), %rcx
movq (%rcx), %rcx
movslq 0x8(%rdx), %rdx
movq (%rcx,%rdx,8), %rcx
cmpq $0x0, 0x70(%rcx)
je 0x71a6
movq 0x18(%rbx), %rax
movq %rax, 0x70(%rcx)
movq %rbx, %rdi
callq 0x7248
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq 0x2170
pushq $0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/garbage_collection.cpp
// Function: best_cost(ssd_info*, plane_info*, int, int)
unsigned int best_cost(ssd_info * ssd, plane_info * the_plane, int active_block, int cold_active_block){
	int max_invalid = -1; // ssd->parameter->page_block; 
	int selected_block = -1; 
	for (int i = 0; i < ssd->parameter->block_plane; i++){
		if ((i == active_block) || (i == cold_active_block)) continue; 
		int free_count = the_plane->blk_head[i]->free_page_num; 
		int invalid_count = the_plane->blk_head[i]->invalid_page_num; 
		
		if (free_count > 0) continue; 
		if (invalid_count > max_invalid) {
			max_invalid = invalid_count; 
			selected_block = i; 
		} 
	}	
	return selected_block; 
}

// Assembly:
pushq %rbx
movq 0x58(%rdi), %rax
movl 0x230(%rax), %edi
movl %edx, %edx
movl %ecx, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %r8d, %r8d
movl %eax, %r9d
cmpq %r8, %rdi
je 0x7204
cmpq %r8, %rdx
sete %r10b
cmpq %r8, %rcx
sete %r11b
orb %r10b, %r11b
jne 0x71ff
movq 0x20(%rsi), %r10
movq (%r10,%r8,8), %r10
movl 0x8(%r10), %r11d
cmpl %r9d, %r11d
movl %eax, %ebx
cmovgl %r8d, %ebx
cmovlel %r9d, %r11d
cmpl $0x0, 0x4(%r10)
cmovlel %ebx, %eax
cmovlel %r11d, %r9d
incq %r8
jmp 0x71c2
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/./common.hh
// Function: gc_operation::gc_operation(local*, int)
gc_operation(local * loc, int gc_seq_num){
		next_node = NULL;
		state = GC_WAIT;
		if (loc == NULL) return;
		location = new local(loc->channel, loc->lun, loc->plane, 0, 0);
		seq_number = gc_seq_num;
	}

// Assembly:
andq $0x0, 0x18(%rdi)
andl $0x0, 0xc(%rdi)
testq %rsi, %rsi
je 0x7247
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
pushq $0x18
popq %rdi
callq 0x2160
movl 0x8(%r15), %ecx
movq (%r15), %rdx
movq %rdx, (%rax)
movl %ecx, 0x8(%rax)
andq $0x0, 0xc(%rax)
movq %rax, (%r14)
movl %ebx, 0x8(%r14)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/ssd.cpp
// Function: main
int  main(int argc, char * argv[]){

	if (argc < 3) {
		printf("Not enough parameters: specify parameter file and statistic file! \n");
		return 0;
	}
	parameter_value * parameters = new parameter_value(argc, argv);
	ssd_info * ssd = new ssd_info(parameters, argv[2]); 

	ssd->tracefile = fopen(ssd->parameter->trace_filename, "r"); 
	if (ssd->tracefile == NULL){
		generate_trace_file(ssd, ssd->parameter->trace_filename); 
		ssd->tracefile = fopen(ssd->parameter->trace_filename, "r"); 
	}
	if (ssd->tracefile == NULL) {
		cout << "still trace file is null " << endl; 
		return 1; 
	}

	fseek(ssd->tracefile, 0 ,SEEK_SET);

	cerr << "start pre-conditioning " << endl;
	full_write_preconditioning(ssd, true);   // sequential 
	full_write_preconditioning(ssd, false);  // random 

	ssd->stats->print_all(); // does nothing now 
	ssd->stats->reset_all();
	
	ssd->reset_ssd_stats(); // reset read, write, erase number to zero 

	simulate(ssd);

	collect_gc_statistics(ssd, 0);
	print_epoch_statistics(ssd, 0);
	print_statistics(ssd, 0);

	close_files(ssd);
				
	delete ssd; 

	printf("\nthe simulation is completed!\n");

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x2, %edi
jg 0x727b
leaq 0x2d10(%rip), %rdi      # 0x9f7f
callq 0x2270
xorl %ebp, %ebp
jmp 0x73a2
movq %rsi, %r15
movl %edi, %ebx
movl $0x350, %edi            # imm = 0x350
callq 0x2160
movq %rax, %r14
movq %rax, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x24bc
movl $0xa0, %edi
callq 0x2160
movq %rax, %rbx
movq 0x10(%r15), %rdx
movq %rax, %rdi
movq %r14, %rsi
callq 0x3792
movq 0x58(%rbx), %rax
movq 0x340(%rax), %rdi
leaq 0x1e75(%rip), %rsi      # 0x913d
callq 0x21d0
movq %rax, 0x48(%rbx)
testq %rax, %rax
jne 0x730d
movq 0x58(%rbx), %rax
movq 0x340(%rax), %rsi
movq %rbx, %rdi
callq 0x73f4
movq 0x58(%rbx), %rax
movq 0x340(%rax), %rdi
leaq 0x1e42(%rip), %rsi      # 0x913d
callq 0x21d0
movq %rax, 0x48(%rbx)
testq %rax, %rax
je 0x73af
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x21a0
movq 0x6cd0(%rip), %rdi      # 0xdff0
leaq 0x2843(%rip), %rsi      # 0x9b6a
callq 0x2140
movq %rax, %rdi
callq 0x20b0
pushq $0x1
popq %rbp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x41f8
movq %rbx, %rdi
xorl %esi, %esi
callq 0x41f8
movq 0x98(%rbx), %rdi
callq 0x3a54
movq %rbx, %rdi
callq 0x3920
movq %rbx, %rdi
callq 0x747a
movq %rbx, %rdi
callq 0x754c
movq %rbx, %rdi
xorl %esi, %esi
callq 0x788f
movq %rbx, %rdi
callq 0x7beb
movq %rbx, %rdi
callq 0x878e
movl $0xa0, %esi
movq %rbx, %rdi
callq 0x2170
leaq 0x2bc4(%rip), %rdi      # 0x9f61
callq 0x2270
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x6c1a(%rip), %rdi      # 0xdfd0
leaq 0x2793(%rip), %rsi      # 0x9b50
callq 0x2140
movq %rax, %rdi
callq 0x20b0
pushq $0x1
popq %rbp
jmp 0x73a2
movq %rax, %r15
movl $0xa0, %esi
movq %rbx, %rdi
jmp 0x73e7
movq %rax, %r15
movl $0x350, %esi            # imm = 0x350
movq %r14, %rdi
callq 0x2170
movq %r15, %rdi
callq 0x22b0
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/ssd.cpp
// Function: generate_trace_file(ssd_info*, char*)
void generate_trace_file(ssd_info * ssd, char * trace_filename){
	ssd->tracefile = fopen(trace_filename, "w"); 
	if (ssd->tracefile == NULL) {
		cout << "file is not ready " << endl; 
		return; 
	} 
	int64_t nearest_event_time = MAX_INT64; 
	struct request * request1; 
	do {
		request1 = generate_next_request(ssd, nearest_event_time);
		if (request1 != NULL && request1->time != MAX_INT64)
			request1->print_to_file(ssd->tracefile); 
	}while(request1 != NULL && request1->time != MAX_INT64);
	
	fclose(ssd->tracefile); 		

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x1c55(%rip), %rsi      # 0x905b
movq %rax, %rdi
callq 0x21d0
movq %rax, 0x48(%rbx)
testq %rax, %rax
je 0x745a
movabsq $0x7fffffffffffffff, %r14 # imm = 0x7FFFFFFFFFFFFFFF
movq %rbx, %rdi
movq %r14, %rsi
callq 0x80c9
testq %rax, %rax
je 0x744c
movq %rax, %r15
cmpq %r14, 0x8(%rax)
je 0x744c
movq 0x48(%rbx), %rsi
movq %r15, %rdi
callq 0x8870
cmpq %r14, 0x8(%r15)
jne 0x7421
movq 0x48(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2150
movq 0x6b6f(%rip), %rdi      # 0xdfd0
leaq 0x276e(%rip), %rsi      # 0x9bd6
callq 0x2140
movq %rax, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x20b0
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/ssd.cpp
// Function: simulate(ssd_info*)
ssd_info *simulate(ssd_info *ssd){

	int flag=0;
	unsigned int a=0,b=0;
	static int second = 0;

	printf("\n");
	printf("begin simulating.......................\n");
	printf("\n");

	int i = 0;
	while(flag!=100)
	{
		flag=get_requests_consolidation(ssd);
		if(flag == 1)
		{
			distribute(ssd); // in ssd.cpp
		}
		process(ssd); // in ftl.cpp
		trace_output(ssd);
		if(flag == 0 && ssd->request_queue == NULL){
			flag = 100;
		}
		if (ssd->current_time != MAX_INT64 && ssd->current_time / EPOCH_LENGTH  > second){
			print_epoch_statistics(ssd, 1);
			while (ssd->current_time / (EPOCH_LENGTH) > second)
				second++;
		}

//		if (!ssd->dram->buffer->check_buffer()) {
//			cout << "BUFFER FAIL " << endl;
//			break;
//		}
	}

	return ssd;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
pushq $0xa
popq %rbp
movl %ebp, %edi
callq 0x2230
leaq 0x2b2c(%rip), %rdi      # 0x9fc2
callq 0x2270
movl %ebp, %edi
callq 0x2230
xorl %ebp, %ebp
pushq $0x64
popq %r14
movabsq $0x7fffffffffffffff, %r15 # imm = 0x7FFFFFFFFFFFFFFF
movabsq $0x2540be400, %r12      # imm = 0x2540BE400
cmpl $0x64, %ebp
je 0x753f
movq %rbx, %rdi
callq 0x7c02
movl %eax, %ebp
cmpl $0x1, %eax
jne 0x74d8
movq %rbx, %rdi
callq 0x466d
movq %rbx, %rdi
callq 0x4bb8
movq %rbx, %rdi
callq 0x7c31
testl %ebp, %ebp
jne 0x74fa
cmpq $0x0, 0x68(%rbx)
movl $0x0, %ebp
cmovel %r14d, %ebp
movq (%rbx), %rax
cmpq %r15, %rax
je 0x74bc
cqto
idivq %r12
movslq 0x6c8e(%rip), %rcx      # 0xe19c
cmpq %rcx, %rax
jle 0x74bc
movq %rbx, %rdi
callq 0x754c
movq (%rbx), %rax
cqto
idivq %r12
movslq 0x6c72(%rip), %rcx      # 0xe19c
leal 0x1(%rcx), %edx
cmpq %rcx, %rax
jle 0x74bc
incq %rcx
movl %edx, 0x6c61(%rip)      # 0xe19c
incl %edx
jmp 0x752d
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/ssd.cpp
// Function: trace_output(ssd_info*)
void trace_output(ssd_info* ssd){
	int flag = 1;
	int64_t start_time, end_time;
	request *req, *pre_node;
	sub_request *sub, *tmp;

	pre_node=NULL;
	req = ssd->request_queue;

	if(req == NULL)
		return;

	while(req != NULL)
	{
		if(req->response_time != 0)
		{

			collect_statistics(ssd, req);
			remove_request(ssd, &req, &pre_node);
		}
		else
		{
			sub = req->subs;
			flag = 1;
			start_time = 0;
			end_time = 0;

			while(sub != NULL)
			{
				if(start_time == 0)
					start_time = sub->begin_time;
				if(start_time > sub->begin_time)
					start_time = sub->begin_time;
				if (end_time < sub->complete_time){
					end_time = sub->complete_time;
					req->critical_sub = sub;
				}

				// if any sub-request is not completed, the request is not completed
				if( find_subrequest_state(ssd, sub) == SR_MODE_COMPLETE )
				{
					sub = sub->next_subs;
				}
				else
				{
					flag=0;
					break;
				}

			}

			if (flag == 1)
			{
				req->response_time = end_time;
				req->begin_time = start_time;
				collect_statistics(ssd, req );
				remove_request(ssd, &req, &pre_node);

			}
			else
			{
				// request is not complete yet, go to the next node
				pre_node = req;
				req = req->next_node;
			}
		}
	}

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
andq $0x0, 0x8(%rsp)
movq 0x68(%rdi), %r12
movq %r12, 0x10(%rsp)
testq %r12, %r12
je 0x7d26
movq %rdi, %rbx
leaq 0x10(%rsp), %r14
leaq 0x8(%rsp), %r15
testq %r12, %r12
je 0x7d26
cmpq $0x0, 0x28(%r12)
je 0x7c8b
movq %rbx, %rdi
movq %r12, %rsi
callq 0x851d
movq %rbx, %rdi
movq %r14, %rsi
jmp 0x7d14
movq %r14, %r15
leaq 0x30(%r12), %r13
xorl %ebp, %ebp
xorl %r14d, %r14d
movq (%r13), %r13
testq %r13, %r13
je 0x7cf1
testq %rbp, %rbp
movq 0x48(%r13), %rcx
movq 0x58(%r13), %rax
cmoveq %rcx, %rbp
cmpq %rcx, %rbp
cmovgeq %rcx, %rbp
cmpq %rax, %r14
jge 0x7cc4
movq %r13, 0x40(%r12)
movq %rax, %r14
movq %rbx, %rdi
movq %r13, %rsi
callq 0x6364
addq $0x68, %r13
cmpl $0x9, %eax
je 0x7c98
movq %r12, 0x8(%rsp)
movq 0x38(%r12), %rax
movq %rax, 0x10(%rsp)
movq %r15, %r14
leaq 0x8(%rsp), %r15
jmp 0x7d1c
movq %r14, 0x28(%r12)
movq %rbp, 0x20(%r12)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x851d
movq %rbx, %rdi
movq %r15, %r14
movq %r15, %rsi
leaq 0x8(%rsp), %r15
movq %r15, %rdx
callq 0x8610
movq 0x10(%rsp), %r12
jmp 0x7c64
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/ssd.cpp
// Function: norm_dist(double, double)
double norm_dist(double mu, double sigma ) {
	const double epsilon = std::numeric_limits<double>::min(); 
	const double two_pi = 2.0 * 3.14159265358979323846; 
	
	static double z0, z1 = 0; 
	static bool generate = false; 
	generate = !generate; 
	
	if (!generate) 
		return z1 * sigma + mu; 

	double u1, u2; 
	do 
	{
		u1 = rand() * (1.0 / RAND_MAX); 
		u2 = rand() * (1.0 / RAND_MAX); 

	}while (u1 <= epsilon); 

	z0 = sqrt(-2.0 * log(u1)) * cos(two_pi * u2); 
	z1 = sqrt(-2.0 * log(u1)) * sin(two_pi * u2); 
	
	return z0 * sigma + mu; 

}

// Assembly:
subq $0x28, %rsp
movb 0x6230(%rip), %al       # 0xe1b0
movl %eax, %ecx
xorb $0x1, %cl
movb %cl, 0x6225(%rip)       # 0xe1b0
testb %al, %al
je 0x7f9b
leaq 0x6212(%rip), %rax      # 0xe1a8
jmp 0x808d
movsd %xmm0, 0x18(%rsp)
movsd %xmm1, 0x20(%rsp)
callq 0x2090
cvtsi2sd %eax, %xmm0
mulsd 0x1b30(%rip), %xmm0     # 0x9ae8
movsd %xmm0, (%rsp)
callq 0x2090
movsd (%rsp), %xmm0
movsd 0x1b21(%rip), %xmm1     # 0x9af0
ucomisd %xmm0, %xmm1
jae 0x7fa7
cvtsi2sd %eax, %xmm1
mulsd 0x1b07(%rip), %xmm1     # 0x9ae8
movsd %xmm1, 0x8(%rsp)
callq 0x20f0
mulsd 0x1b04(%rip), %xmm0     # 0x9af8
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x8004
sqrtsd %xmm0, %xmm0
jmp 0x8009
callq 0x20e0
movsd %xmm0, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
mulsd 0x1ae3(%rip), %xmm0     # 0x9b00
movsd %xmm0, 0x8(%rsp)
callq 0x22d0
mulsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x616a(%rip)     # 0xe1a0
movsd (%rsp), %xmm0
callq 0x20f0
mulsd 0x1ab0(%rip), %xmm0     # 0x9af8
ucomisd 0x1ab8(%rip), %xmm0     # 0x9b08
jb 0x8058
sqrtsd %xmm0, %xmm0
jmp 0x805d
callq 0x20e0
movsd %xmm0, (%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x2080
mulsd (%rsp), %xmm0
movsd %xmm0, 0x612e(%rip)     # 0xe1a8
leaq 0x611f(%rip), %rax      # 0xe1a0
movsd 0x20(%rsp), %xmm1
movsd 0x18(%rsp), %xmm0
mulsd (%rax), %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, %xmm0
addq $0x28, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/ssd.cpp
// Function: find_nearest_event(ssd_info*)
int64_t find_nearest_event(ssd_info *ssd) {
	unsigned int i,j;
	int64_t time=MAX_INT64;
	int64_t time1=MAX_INT64;
	int64_t time2=MAX_INT64;



	for (i=0;i<ssd->parameter->channel_number;i++)
	{
		if (ssd->channel_head[i]->next_state==CHANNEL_MODE_IDLE)
			if(time1>ssd->channel_head[i]->next_state_predict_time)
				if (ssd->channel_head[i]->next_state_predict_time > ssd->current_time)
					time1=ssd->channel_head[i]->next_state_predict_time;
		for (j=0;j<ssd->parameter->lun_channel[i];j++)
		{
			if (ssd->channel_head[i]->lun_head[j]->next_state==LUN_MODE_IDLE)
				if(time2>ssd->channel_head[i]->lun_head[j]->next_state_predict_time)
					if (ssd->channel_head[i]->lun_head[j]->next_state_predict_time>ssd->current_time)
						time2=ssd->channel_head[i]->lun_head[j]->next_state_predict_time;

		}
	}


	time=(time1>time2)?time2:time1;


	return time;
}

// Assembly:
pushq %rbx
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
movq 0x58(%rdi), %rdx
movl 0x98(%rdx), %esi
xorl %r8d, %r8d
movq %rcx, %rax
cmpq %rsi, %r8
je 0x8304
movq 0x90(%rdi), %r9
movq (%r9,%r8,8), %r9
cmpl $0x0, 0x3c(%r9)
jne 0x82cc
movq 0x48(%r9), %r10
cmpq %r10, %rcx
jle 0x82cc
cmpq (%rdi), %r10
cmovgq %r10, %rcx
movl 0x9c(%rdx,%r8,4), %r10d
xorl %r11d, %r11d
cmpq %r11, %r10
je 0x82ff
movq 0x50(%r9), %rbx
movq (%rbx,%r11,8), %rbx
cmpl $0x0, 0x20(%rbx)
jne 0x82fa
movq 0x28(%rbx), %rbx
cmpq %rbx, %rax
jle 0x82fa
cmpq (%rdi), %rbx
cmovgq %rbx, %rax
incq %r11
jmp 0x82d7
incq %r8
jmp 0x82a5
cmpq %rax, %rcx
cmovlq %rcx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/ssd.cpp
// Function: collect_statistics(ssd_info*, request*)
void collect_statistics(ssd_info * ssd, request * req){

	sub_request * sub;
	sub = req->subs; //  critical_sub;

	while (sub != NULL)
	{
		if (sub->complete_time != req->response_time) { sub = sub->next_subs; continue;  }
	for (unsigned int i = 0; i < SR_MODE_NUM; i++){
			ssd->stats->subreq_state_time[i] += sub->state_time[i];
		}

		sub = sub->next_subs;

	}

	if(req->response_time-req->begin_time==0)
	{
		printf("1. the response time is 0?? %lld %lld \n", req->response_time, req->begin_time);
		getchar();
	}
	
	if (req->operation==READ)
	{
		ssd->stats->read_request_size[req->app_id] += req->size;
		ssd->stats->read_RT.update(req->response_time - req->begin_time); 
		ssd->stats->read_throughput.add_time(req->begin_time, req->response_time); // changed 
		ssd->stats->read_throughput.add_capacity(req->size);
		ssd->stats->read_throughput.add_count(1);
	}
	else
	{
		ssd->stats->write_request_size[req->app_id] += req->size; 
		ssd->stats->write_RT.update(req->response_time - req->begin_time); 
		ssd->stats->write_throughput.add_time(req->begin_time, req->response_time); 
		ssd->stats->write_throughput.add_capacity(req->size);
		ssd->stats->write_throughput.add_count(1);
	}

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x30(%rsi), %rax
movq (%rax), %rax
testq %rax, %rax
je 0x856e
movq 0x58(%rax), %rcx
cmpq 0x28(%rbx), %rcx
jne 0x8568
movq 0x80(%rax), %rcx
movq 0x98(%r14), %rdx
movq 0x188(%rdx), %rdx
xorl %esi, %esi
cmpq $0xa, %rsi
je 0x8568
movq (%rcx,%rsi,8), %rdi
addq %rdi, (%rdx,%rsi,8)
incq %rsi
jmp 0x8555
addq $0x68, %rax
jmp 0x852c
movq 0x28(%rbx), %rdx
cmpq 0x20(%rbx), %rdx
jne 0x858e
leaq 0x167f(%rip), %rdi      # 0x9bfe
movq %rdx, %rsi
xorl %eax, %eax
callq 0x2050
callq 0x2220
movq 0x98(%r14), %rax
leaq 0x30(%rax), %rdi
xorl %r15d, %r15d
cmpl $0x1, 0x18(%rbx)
leaq 0x8(%rax), %rcx
setne %r15b
movl (%rbx), %edx
movl 0x14(%rbx), %esi
cmoveq %rcx, %rdi
movl %r15d, %ecx
shll $0x4, %ecx
movq 0x58(%rcx,%rax), %rax
addq %rsi, (%rax,%rdx,8)
shll $0x5, %r15d
movq 0x28(%rbx), %rsi
subq 0x20(%rbx), %rsi
callq 0x889e
movq 0x98(%r14), %rax
leaq (%rax,%r15), %rdi
addq $0x190, %rdi            # imm = 0x190
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
callq 0x88dc
movq 0x98(%r14), %rax
movl 0x14(%rbx), %ecx
addq %rcx, 0x198(%r15,%rax)
incq 0x1a0(%r15,%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/ssd.cpp
// Function: remove_request(ssd_info*, request**, request**)
void remove_request(ssd_info * ssd, request ** req, request ** pre_node){
	if(*pre_node == NULL)
	{
		if((*req)->next_node == NULL)
		{
			delete (*req);
			*req = NULL;
			ssd->request_queue = NULL;
			ssd->request_tail = NULL;
			ssd->request_queue_length--;
		}
		else
		{
			ssd->request_queue = (*req)->next_node;
			(*pre_node) = (*req);
			(*req) = (*req)->next_node;
			delete (*pre_node);
			*pre_node = NULL;
			ssd->request_queue_length--;
		}
	}
	else
	{
		if((*req)->next_node == NULL)
		{
			(*pre_node)->next_node = NULL;
			delete (*req);
			*req = NULL;
			ssd->request_tail = (*pre_node);
			ssd->request_queue_length--;
		}
		else
		{
			(*pre_node)->next_node = (*req)->next_node;
			delete (*req);
			(*req) = (*pre_node)->next_node;
			ssd->request_queue_length--;
		}
	}

}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rdx), %rcx
movq (%rsi), %r12
movq 0x38(%r12), %rax
testq %rcx, %rcx
je 0x8664
testq %rax, %rax
je 0x869b
movq %rax, 0x38(%rcx)
movq (%r15), %r12
testq %r12, %r12
je 0x864a
movq %r12, %rdi
callq 0x8836
pushq $0x48
popq %rsi
movq %r12, %rdi
callq 0x2170
movq (%r14), %rax
movq 0x38(%rax), %rax
movq %rax, (%r15)
jmp 0x86e6
testq %rax, %rax
je 0x86c8
movq %rax, 0x68(%rbx)
movq (%r15), %rax
movq %rax, (%r14)
movq 0x38(%rax), %rax
movq %rax, (%r15)
movq (%r14), %r15
testq %r15, %r15
je 0x868a
movq %r15, %rdi
callq 0x8836
pushq $0x48
popq %rsi
movq %r15, %rdi
callq 0x2170
andq $0x0, (%r14)
jmp 0x86e6
andq $0x0, 0x38(%rcx)
movq (%r15), %r12
testq %r12, %r12
je 0x86b0
movq %r12, %rdi
callq 0x8836
pushq $0x48
popq %rsi
movq %r12, %rdi
callq 0x2170
andq $0x0, (%r15)
movq (%r14), %rax
movq %rax, 0x70(%rbx)
jmp 0x86e6
movq %r12, %rdi
callq 0x8836
pushq $0x48
popq %rsi
movq %r12, %rdi
callq 0x2170
andq $0x0, (%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x68(%rbx)
decl 0x1c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/ssd.cpp
// Function: transfer_size(ssd_info*, unsigned int, request*)
unsigned int transfer_size(ssd_info *ssd,unsigned int lpn,request *req){
	unsigned int first_lpn,last_lpn,trans_size;
	uint64_t state;
	uint64_t mask=0,offset1=0,offset2=0;

	first_lpn=req->lsn/ssd->parameter->subpage_page;
	last_lpn=(req->lsn+req->size-1)/ssd->parameter->subpage_page;

	mask=~(0xffffffffffffffff<<(ssd->parameter->subpage_page));
	state=mask;
	if(lpn==first_lpn)
	{
		offset1=ssd->parameter->subpage_page-((lpn+1)*ssd->parameter->subpage_page-req->lsn);
		state=state&(0xffffffffffffffff<<offset1);
	}
	if(lpn==last_lpn)
	{
		offset2=ssd->parameter->subpage_page-((lpn+1)*ssd->parameter->subpage_page-(req->lsn+req->size));
		state=state&(~(0xffffffffffffffff<<offset2));
	}

	trans_size=size(state);

	return trans_size;
}

// Assembly:
pushq %rbx
movl 0x10(%rdx), %r9d
movl 0x14(%rdx), %r10d
movq 0x58(%rdi), %rax
movl 0x238(%rax), %r8d
movl %r9d, %eax
xorl %edx, %edx
divl %r8d
movl %eax, %r11d
movabsq $-0x1, %rbx
movq %rbx, %rdi
movl %r8d, %ecx
shlq %cl, %rdi
leal (%r10,%r9), %eax
decl %eax
xorl %edx, %edx
divl %r8d
notq %rdi
cmpl %esi, %r11d
jne 0x874e
movl %esi, %ecx
notl %ecx
imull %r8d, %ecx
addl %r8d, %ecx
addl %r9d, %ecx
shrq %cl, %rdi
shlq %cl, %rdi
cmpl %esi, %eax
jne 0x8768
addl %r9d, %r10d
imull %esi, %r8d
subl %r8d, %r10d
movl %r10d, %ecx
shlq %cl, %rbx
notq %rbx
andq %rbx, %rdi
popq %rbx
jmp 0x4090
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/./common.hh
// Function: ssd_info::~ssd_info()
~ssd_info(){
		for (int i=0;i<parameter->channel_number;i++)
		{
			delete channel_head[i];
		}
		delete channel_head;
		delete dram;
		delete parameter;
		delete stats;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r12d, %r12d
pushq $0x60
popq %r14
movq 0x58(%rbx), %rax
movq 0x90(%rbx), %rdi
movl 0x98(%rax), %eax
cmpq %rax, %r12
jae 0x87d7
movq (%rdi,%r12,8), %r15
testq %r15, %r15
je 0x87c7
movq %r15, %rdi
callq 0x89a0
movq %r15, %rdi
movq %r14, %rsi
callq 0x2170
incq %r12
jmp 0x87a0
pushq $0x8
popq %rsi
callq 0x2170
movq 0x60(%rbx), %r14
testq %r14, %r14
je 0x87f0
movq %r14, %rdi
callq 0x89f8
pushq $0x28
popq %rsi
movq %r14, %rdi
callq 0x2170
movq 0x58(%rbx), %rdi
movl $0x350, %esi            # imm = 0x350
callq 0x2170
movq 0x98(%rbx), %rbx
testq %rbx, %rbx
je 0x881d
movq %rbx, %rdi
callq 0x3b00
movl $0x1d0, %esi            # imm = 0x1D0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2170
nop
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/./common.hh
// Function: request::~request()
~request(){

		sub_request * tmp;
		while(subs!=NULL)
		{
			tmp = subs->next_subs;
			delete subs;
			subs = tmp;
		}

	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %r14
testq %r14, %r14
je 0x8869
movq 0x68(%r14), %r15
movq %r14, %rdi
callq 0x5d62
movl $0xa0, %esi
movq %r14, %rdi
callq 0x2170
movq %r15, 0x30(%rbx)
movq %r15, %r14
jmp 0x8842
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/./common.hh
// Function: Stat::update(long)
void update(int64_t value){
		int64_t temp_value = value / 1000; // convert ns to us 
		if (temp_value > max) max = temp_value; 
		if (temp_value < min) min = temp_value; 
		count++; 
		sum += temp_value; 
		squared_sum += (temp_value / 1000) * (temp_value / 1000); 
	}

// Assembly:
movl $0x3e8, %ecx            # imm = 0x3E8
movq %rsi, %rax
cqto
idivq %rcx
cmpq 0x18(%rdi), %rax
jle 0x88b5
movq %rax, 0x18(%rdi)
cmpq 0x20(%rdi), %rax
jge 0x88bf
movq %rax, 0x20(%rdi)
incl (%rdi)
addq %rax, 0x8(%rdi)
movl $0xf4240, %ecx          # imm = 0xF4240
movq %rsi, %rax
cqto
idivq %rcx
imulq %rax, %rax
addq %rax, 0x10(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/./common.hh
// Function: Stat::get_variance()
int64_t get_variance(){ // use different unit for variance
		if (count == 0) return 0; 
		int64_t avg = get_average(); 
		return (squared_sum / count) - ( (avg / 1000) * (avg / 1000)); 
	}

// Assembly:
movslq (%rdi), %r8
testq %r8, %r8
je 0x894d
movq 0x8(%rdi), %rax
movq 0x10(%rdi), %rcx
cqto
idivq %r8
movq %rax, %rsi
movq %rcx, %rax
cqto
idivq %r8
movq %rax, %rcx
movl $0x3e8, %edi            # imm = 0x3E8
movq %rsi, %rax
cqto
idivq %rdi
imulq %rax, %rax
subq %rax, %rcx
jmp 0x894f
xorl %ecx, %ecx
movq %rcx, %rax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/./common.hh
// Function: channel_info::~channel_info()
~channel_info(){
		for (int i = 0; i < lun_num; i++){
			delete lun_head[i];
		}
		delete lun_head;
		delete state_time;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r15d, %r15d
movslq (%rbx), %rax
movq 0x50(%rbx), %rdi
cmpq %rax, %r15
jge 0x89da
movq (%rdi,%r15,8), %r14
testq %r14, %r14
je 0x89c8
movq %r14, %rdi
callq 0x8a16
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdi
callq 0x2170
incq %r15
jmp 0x89ab
pushq $0x8
popq %r14
movq %r14, %rsi
callq 0x2170
movq 0x58(%rbx), %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x2170
nop
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/./common.hh
// Function: lun_info::~lun_info()
~lun_info(){
		for (int i = 0; i < 2; i++){
			delete plane_head[i];
		}
		delete plane_head;
		delete state_time;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r12d, %r12d
pushq $0x78
popq %r14
movq (%rbx), %rdi
cmpq $0x2, %r12
je 0x8a52
movq (%rdi,%r12,8), %r15
testq %r15, %r15
je 0x8a42
movq %r15, %rdi
callq 0x8a78
movq %r15, %rdi
movq %r14, %rsi
callq 0x2170
incq %r12
jmp 0x8a28
pushq $0x8
popq %r14
movq %r14, %rsi
callq 0x2170
movq 0x90(%rbx), %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2170
// File: /workspace/github_cpp_makefile_star2_O2/narges64[P]SIMBA/./common.hh
// Function: plane_info::~plane_info()
~plane_info(){
		for (int i = 0; i < block_num; i++){
			delete blk_head[i];
		}
		delete blk_head;
		delete state_time;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r12d, %r12d
pushq $0x28
popq %r14
movq 0x20(%rbx), %rdi
cmpq %r12, 0x28(%rbx)
jle 0x8ab5
movq (%rdi,%r12,8), %r15
testq %r15, %r15
je 0x8aa5
movq %r15, %rdi
callq 0x8ad8
movq %r15, %rdi
movq %r14, %rsi
callq 0x2170
incq %r12
jmp 0x8a8a
pushq $0x8
popq %r14
movq %r14, %rsi
callq 0x2170
movq 0x60(%rbx), %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2170
// File: /workspace/github_cpp_makefile_star2_O2/waltersharpWEI[P]CommentEliminator/main.cpp
// Function: isSource(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool isSource(string Name) {
    //The last 2 suffix
    string Bisuf = Name.c_str() + (Name.length() - 2);
    //The last 3 suffix
    string Trisuf = Name.c_str() + (Name.length() - 3);
    //The last 4 suffix
    string Fousuf = Name.c_str() + (Name.length() - 4);

    if (Bisuf == ".c" || Bisuf == ".h") {
        return true;
    }
    if (Trisuf == ".cc" || Trisuf ==".hh") {
        return true;
    }
    if (Fousuf == ".hpp" || Fousuf == ".cpp") {
        return true;
    }
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
leaq (%rax,%rcx), %rsi
addq $-0x2, %rsi
leaq -0x70(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0x32d0
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
leaq (%rax,%rcx), %rsi
addq $-0x3, %rsi
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x32d0
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
leaq (%rax,%rcx), %rsi
addq $-0x4, %rsi
leaq -0x50(%rbp), %rdi
leaq -0x9(%rbp), %rdx
callq 0x32d0
leaq 0x28a3(%rip), %rsi      # 0x5037
leaq -0x70(%rbp), %rdi
callq 0x330b
movb $0x1, %bl
testb %al, %al
jne 0x2805
leaq 0x2890(%rip), %rsi      # 0x503a
leaq -0x70(%rbp), %rdi
callq 0x330b
testb %al, %al
jne 0x2805
leaq 0x287f(%rip), %rsi      # 0x503d
leaq -0x30(%rbp), %rdi
callq 0x330b
testb %al, %al
jne 0x2805
leaq 0x286f(%rip), %rsi      # 0x5041
leaq -0x30(%rbp), %rdi
callq 0x330b
testb %al, %al
jne 0x2805
leaq 0x285f(%rip), %rsi      # 0x5045
leaq -0x50(%rbp), %rdi
callq 0x330b
testb %al, %al
jne 0x2805
leaq 0x2850(%rip), %rsi      # 0x504a
leaq -0x50(%rbp), %rdi
callq 0x330b
movl %eax, %ebx
leaq -0x50(%rbp), %rdi
callq 0x20a0
leaq -0x30(%rbp), %rdi
callq 0x20a0
leaq -0x70(%rbp), %rdi
callq 0x20a0
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x20a0
jmp 0x283a
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/waltersharpWEI[P]CommentEliminator/main.cpp
// Function: threadEliminator(void*)
void* threadEliminator(void* FilesPointer) {
    vector<string> *Files = (vector<string> *)FilesPointer;
    if (Files->size() <= 0) {
        return NULL;
    }
    for (vector<string>::iterator It = Files->begin(); It != Files->end(); It++) {
        string FilePath = *It;
        cout << "Removing comment from file " << FilePath << endl;
        removeComment(FilePath);
        cout << "Comment removed" << endl;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq (%rdi), %rbx
cmpq %rbx, 0x8(%rdi)
jne 0x2b76
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x68(%rbp), %r14
movq 0x5447(%rip), %r15      # 0x7fc8
leaq -0x48(%rbp), %r13
leaq 0x252e(%rip), %r12      # 0x50ba
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2220
movq %r15, %rdi
leaq 0x24fd(%rip), %rsi      # 0x509e
callq 0x2190
movq %rax, %rdi
movq %r14, %rsi
callq 0x2140
movq %rax, %rdi
callq 0x20b0
movq %r13, %rdi
movq %r14, %rsi
callq 0x2220
movq %r13, %rdi
callq 0x24ac
movq %r13, %rdi
callq 0x20a0
movq %r15, %rdi
movq %r12, %rsi
callq 0x2190
movq %rax, %rdi
callq 0x20b0
movq %r14, %rdi
callq 0x20a0
addq $0x20, %rbx
jmp 0x2b8c
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x20a0
jmp 0x2c06
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/waltersharpWEI[P]CommentEliminator/main.cpp
// Function: balanceThreads(int)
void balanceThreads(int NumThread) {
    vector<string> Files[NumThread];
    std::vector<pthread_t> ThreadPointers(NumThread);

    for (int I = 0;I < NumThread; I++) {
        Files[I].clear();
    }

    for (int I = 0;I < FileList.size();I++) {
        int TargetThread = rand() % NumThread;
        Files[TargetThread].push_back(FileList[I].path);
    }

    for (int I = 0;I < NumThread;I++) {
        pthread_create(&ThreadPointers[I],NULL,threadEliminator,&(Files[I]));
    }
    for (int I = 0; I < NumThread; I++) {
        pthread_join(ThreadPointers[I], NULL);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edi, %r14d
movl %edi, %eax
movq %rsp, %rbx
movq %rax, -0x40(%rbp)
imulq $0x18, %rax, %r13
leaq 0xf(%r13), %rax
andq $-0x10, %rax
subq %rax, %rbx
movq %rbx, %rsp
testl %edi, %edi
je 0x2c6d
leaq -0x18(%r13), %rcx
pushq $0x18
popq %rsi
movq %rcx, %rax
xorl %edx, %edx
divq %rsi
subq %rdx, %rcx
addq $0x18, %rcx
movq %rbx, %rdi
xorl %esi, %esi
movq %rcx, %rdx
callq 0x20e0
movslq %r14d, %rsi
leaq -0x58(%rbp), %rdi
leaq -0x2d(%rbp), %rdx
movl %r14d, -0x2c(%rbp)
callq 0x33ba
xorl %eax, %eax
testl %r14d, %r14d
cmovgl %r14d, %eax
movq %rbx, %r15
movq %rax, -0x38(%rbp)
movq %rax, %r14
subq $0x1, %r14
jb 0x2ca8
movq %r15, %rdi
callq 0x340c
addq $0x18, %r15
jmp 0x2c94
xorl %r15d, %r15d
xorl %r12d, %r12d
movl -0x2c(%rbp), %r14d
movq 0x551f(%rip), %rax      # 0x81d8
subq 0x5510(%rip), %rax      # 0x81d0
cqto
pushq $0x28
popq %rcx
idivq %rcx
cmpq %r12, %rax
jbe 0x2cf8
callq 0x2040
cltd
idivl %r14d
movslq %edx, %rax
imulq $0x18, %rax, %rdi
addq %rbx, %rdi
movq 0x54e9(%rip), %rsi      # 0x81d0
addq %r15, %rsi
callq 0x341a
incq %r12
addq $0x28, %r15
jmp 0x2cb2
movq -0x38(%rbp), %rax
leaq (,%rax,8), %r14
xorl %r15d, %r15d
movq %rbx, %r12
cmpq %r15, %r14
je 0x2d31
movq -0x58(%rbp), %rdi
addq %r15, %rdi
xorl %esi, %esi
leaq -0x1d4(%rip), %rdx      # 0x2b4b
movq %r12, %rcx
callq 0x2300
addq $0x8, %r15
addq $0x18, %r12
jmp 0x2d0a
xorl %r14d, %r14d
movq -0x38(%rbp), %r15
cmpq %r14, %r15
je 0x2d51
movq -0x58(%rbp), %rax
movq (%rax,%r14,8), %rdi
xorl %esi, %esi
callq 0x2150
incq %r14
jmp 0x2d38
leaq -0x58(%rbp), %rdi
callq 0x38b8
cmpl $0x0, -0x2c(%rbp)
je 0x2d78
addq $-0x18, %rbx
imulq $0x18, -0x40(%rbp), %r14
leaq (%rbx,%r14), %rdi
callq 0x3456
addq $-0x18, %r14
jne 0x2d69
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
jmp 0x2d9a
jmp 0x2d8e
movq %rax, %r15
leaq -0x58(%rbp), %rdi
callq 0x38b8
cmpl $0x0, -0x2c(%rbp)
je 0x2db3
addq $-0x18, %rbx
leaq (%rbx,%r13), %rdi
callq 0x3456
addq $-0x18, %r13
jne 0x2da4
movq %r15, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/waltersharpWEI[P]CommentEliminator/main.cpp
// Function: sum(std::vector<FileRecord, std::allocator<FileRecord>>)
int sum(vector<FileRecord> FileList) {
    int Result = 0;
    for (vector<FileRecord>::iterator It = FileList.begin();It != FileList.end(); It++) {
        Result += It->size;
    }
    return Result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rcx
movq 0x8(%rdi), %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
je 0x2dd6
addl 0x20(%rcx), %eax
addq $0x28, %rcx
jmp 0x2dc8
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/waltersharpWEI[P]CommentEliminator/main.cpp
// Function: completeDistribute(bool*, int)
bool completeDistribute(bool* used,int size) {
    int Result = true;
    for (int I = 0;I < size;I++) {
        if (!used[I]) {
            return false;
        }
    }
    return Result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %ecx, %ecx
testl %esi, %esi
movl $0x0, %eax
cmovgl %esi, %eax
movq %rcx, %rdx
cmpq %rcx, %rax
je 0x2dfa
leaq 0x1(%rdx), %rcx
cmpb $0x0, (%rdi,%rdx)
jne 0x2de8
movslq %esi, %rax
cmpq %rax, %rdx
setge %al
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH02_VariablesAndBasicTypes/examples/literals.cc
// Function: main
int main() 
{
	std::cout << "Hello World!";  // simple character string literal
	std::cout << "";              // empty character string literal
	// literal using newlines and tabs
	std::cout << "\nCC\toptions\tfile.[cC]\n";

    // multiline string literal
    std::cout << "a really, really long string literal "
	             "that spans two lines" << std::endl;

	// three ways to print a capital M
	std::cout << 'M' << " " << '\115' << " " << '\x4d' << std::endl;

    unsigned long long bigVal = -1ULL;
    std::cout << bigVal << std::endl;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x2dfb(%rip), %rbx      # 0x3fd8
leaq 0xe20(%rip), %rsi       # 0x2004
movq %rbx, %rdi
callq 0x1060
leaq 0xe34(%rip), %rsi       # 0x2027
movq %rbx, %rdi
callq 0x1060
leaq 0xe0f(%rip), %rsi       # 0x2011
movq %rbx, %rdi
callq 0x1060
leaq 0xe17(%rip), %rsi       # 0x2028
movq %rbx, %rdi
callq 0x1060
movq %rax, %rdi
callq 0x1030
pushq $0x4d
popq %r14
movq %rbx, %rdi
movl %r14d, %esi
callq 0x1070
leaq 0xe2b(%rip), %r15       # 0x2062
movq %rax, %rdi
movq %r15, %rsi
callq 0x1060
movq %rax, %rdi
movl %r14d, %esi
callq 0x1070
movq %rax, %rdi
movq %r15, %rsi
callq 0x1060
movq %rax, %rdi
movl %r14d, %esi
callq 0x1070
movq %rax, %rdi
callq 0x1030
pushq $-0x1
popq %rsi
movq %rbx, %rdi
callq 0x1040
movq %rax, %rdi
callq 0x1030
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/mororo18[P]simplex-method/src/model.cpp
// Function: Model::Model(void (*)(std::vector<std::vector<double, std::allocator<double>>, std::allocator<std::vector<double, std::allocator<double>>>>&), int)
Model::Model(solver_func func, int qnt){
    solver = func;

    var_qnt = qnt;

    main_func = nullptr;
    solved = false;
    analysed = false;
    analysed_mod = false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x18(%rdi), %rax
movq %rax, 0x8(%rdi)
andq $0x0, 0x10(%rdi)
xorl %r15d, %r15d
movb %r15b, 0x18(%rdi)
addq $0x58, %rdi
leaq 0x200(%rbx), %r12
movl $0x198, %edx            # imm = 0x198
xorl %esi, %esi
callq 0x2120
movq %r12, 0x1f0(%rbx)
andq $0x0, 0x1f8(%rbx)
movb %r15b, 0x200(%rbx)
leaq 0x220(%rbx), %rax
movq %rax, 0x210(%rbx)
andq $0x0, 0x218(%rbx)
movb %r15b, 0x220(%rbx)
leaq 0x240(%rbx), %rax
movq %rax, 0x230(%rbx)
andq $0x0, 0x238(%rbx)
movb %r15b, 0x240(%rbx)
leaq 0x260(%rbx), %rax
movq %rax, 0x250(%rbx)
andq $0x0, 0x258(%rbx)
movb %r15b, 0x260(%rbx)
leaq 0x280(%rbx), %rax
movq %rax, 0x270(%rbx)
andq $0x0, 0x278(%rbx)
movb %r15b, 0x280(%rbx)
leaq 0x2a0(%rbx), %rax
movq %rax, 0x290(%rbx)
andq $0x0, 0x298(%rbx)
movb %r15b, 0x2a0(%rbx)
movq %r14, 0x48(%rbx)
movl %ebp, (%rbx)
andq $0x0, 0x50(%rbx)
andw $0x0, 0x40(%rbx)
movb %r15b, 0x42(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop