// File: /workspace/github_cpp_makefile_star2_O2/BU-DiSC[P]BF-Shared-Hashing/db.cpp
// Function: db::PrintStat(double, double)
void db::PrintStat(double program_total, double data_load_total)
{
	// log file
	string out_path_cmd = "mkdir -p " + out_path;
	system(out_path_cmd.c_str());
	string file_result = out_path + "result.txt";
	ofstream result_file(file_result);
	result_file << "Total false positives:\t" << total_fp << endl;
	result_file << "Total negatives:\t" << total_n << endl;
	result_file << "FPR:\t" << (double) total_fp/total_n << endl;
	double total = total_duration.count()/tries;
	result_file << "Total query time:\t" << total  << endl;
	total -= data_duration.count()/tries;
	result_file << "Data access time:\t" << data_duration.count()/tries << endl;
	result_file << "Program total time:\t" << program_total/tries << endl;
	result_file << "Data input time:\t" << data_load_total/tries << endl;
	total -= hash_duration.count()/tries;
	result_file << "Hash time:\t" << hash_duration.count()/tries << endl;
	//total -= bs_duration.count()/tries;
	//result_file << "BS time:\t" << bs_duration.count()/tries << endl;
	result_file << "Other time:\t" << total << endl;
	//cout << "Other2 time:\t" << other2_duration.count()/tries << endl;
	
	result_file << endl;


	/*
	for( int i=0 ; i<num_filter_units; i++ ){
		result_file << "qnum " << i << " : " << qnum_histogram->at(i) << endl;
		cout << "qnum " << i << " : " << qnum_histogram->at(i) << endl;
	}*/

	result_file.close();

	return;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x18(%rsp)
movq %rdi, %rbx
leaq 0x174f6(%rip), %rsi     # 0x22346
leaq 0x48(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
callq 0xb2b0
movq (%r14), %rdi
callq 0x6370
leaq 0x17530(%rip), %rdx     # 0x2239f
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0xb278
leaq 0x68(%rsp), %rdi
leaq 0x28(%rsp), %rsi
pushq $0x10
popq %rdx
callq 0x6730
leaq 0x17515(%rip), %rsi     # 0x223aa
leaq 0x68(%rsp), %rdi
callq 0x6410
movq 0x1a8(%rbx), %rsi
movq %rax, %rdi
callq 0x62b0
movq %rax, %rdi
callq 0x6210
leaq 0x17505(%rip), %rsi     # 0x223c2
leaq 0x68(%rsp), %rdi
callq 0x6410
movq 0x198(%rbx), %rsi
movq %rax, %rdi
callq 0x62b0
movq %rax, %rdi
callq 0x6210
leaq 0x174ef(%rip), %rsi     # 0x223d4
leaq 0x68(%rsp), %rdi
callq 0x6410
movsd 0x1a8(%rbx), %xmm1
movsd 0x17211(%rip), %xmm2    # 0x22110
unpcklps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x17216(%rip), %xmm3    # 0x22120
subpd %xmm3, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movsd 0x198(%rbx), %xmm1
unpcklps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
subpd %xmm3, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
movq %rax, %rdi
callq 0x6630
movq %rax, %rdi
callq 0x6210
movss 0x188(%rbx), %xmm0
movss %xmm0, 0x8(%rsp)
cvtsi2ssl 0x230(%rbx), %xmm0
movss %xmm0, 0x4(%rsp)
leaq 0x1746e(%rip), %rsi     # 0x223da
leaq 0x68(%rsp), %rdi
callq 0x6410
movss 0x8(%rsp), %xmm0
divss 0x4(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movq %rax, %rdi
movsd %xmm0, 0x8(%rsp)
callq 0x6630
movq %rax, %rdi
callq 0x6210
movss 0x18c(%rbx), %xmm0
movss %xmm0, 0x4(%rsp)
cvtsi2ssl 0x230(%rbx), %xmm0
movss %xmm0, 0x24(%rsp)
leaq 0x1742e(%rip), %rsi     # 0x223ed
leaq 0x68(%rsp), %rdi
callq 0x6410
movss 0x18c(%rbx), %xmm0
cvtsi2ssl 0x230(%rbx), %xmm1
divss %xmm1, %xmm0
movq %rax, %rdi
callq 0x6310
movq %rax, %rdi
callq 0x6210
leaq 0x1740c(%rip), %rsi     # 0x22400
leaq 0x68(%rsp), %rdi
callq 0x6410
cvtsi2sdl 0x230(%rbx), %xmm1
movsd 0x18(%rsp), %xmm0
divsd %xmm1, %xmm0
movq %rax, %rdi
callq 0x6630
movq %rax, %rdi
callq 0x6210
leaq 0x173ee(%rip), %rsi     # 0x22415
leaq 0x68(%rsp), %rdi
callq 0x6410
cvtsi2sdl 0x230(%rbx), %xmm1
movsd 0x10(%rsp), %xmm0
divsd %xmm1, %xmm0
movq %rax, %rdi
callq 0x6630
movq %rax, %rdi
callq 0x6210
movss 0x190(%rbx), %xmm0
movss %xmm0, 0x18(%rsp)
cvtsi2ssl 0x230(%rbx), %xmm0
movss %xmm0, 0x10(%rsp)
leaq 0x173b1(%rip), %rsi     # 0x22427
leaq 0x68(%rsp), %rdi
callq 0x6410
movss 0x190(%rbx), %xmm0
cvtsi2ssl 0x230(%rbx), %xmm1
divss %xmm1, %xmm0
movq %rax, %rdi
callq 0x6310
movq %rax, %rdi
callq 0x6210
leaq 0x17388(%rip), %rsi     # 0x22433
leaq 0x68(%rsp), %rdi
callq 0x6410
movss 0x4(%rsp), %xmm0
divss 0x24(%rsp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
subsd %xmm1, %xmm0
movss 0x18(%rsp), %xmm1
divss 0x10(%rsp), %xmm1
cvtss2sd %xmm1, %xmm1
subsd %xmm1, %xmm0
movq %rax, %rdi
callq 0x6630
movq %rax, %rdi
callq 0x6210
leaq 0x68(%rsp), %rdi
callq 0x6210
leaq 0x68(%rsp), %rdi
callq 0x6590
leaq 0x68(%rsp), %rdi
callq 0x65d0
leaq 0x28(%rsp), %rdi
callq 0x61f0
leaq 0x48(%rsp), %rdi
callq 0x61f0
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r14
retq
movq %rax, %rbx
jmp 0xb14b
jmp 0xb137
movq %rax, %rbx
jmp 0xb155
jmp 0xb13e
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x65d0
leaq 0x28(%rsp), %rdi
callq 0x61f0
leaq 0x48(%rsp), %rdi
callq 0x61f0
movq %rbx, %rdi
callq 0x66b0
nop