// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
subq $0x270, %rsp            # imm = 0x270
movsd %xmm1, 0x18(%rsp)
movsd %xmm0, 0x20(%rsp)
movq %rdi, %rbx
leaq 0x1c9b6(%rip), %rsi     # 0x293c6
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
callq 0xd04f
movq (%r14), %rdi
callq 0x5360
leaq 0x40(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0x6c14
leaq 0x1c9d3(%rip), %rsi     # 0x2941f
leaq 0x30(%rsp), %rdi
callq 0x5720
leaq 0x70(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movl $0x10, %edx
callq 0x5730
leaq 0x1c9b9(%rip), %rsi     # 0x2942a
leaq 0x70(%rsp), %rdi
movl $0x17, %edx
callq 0x5470
movq 0x1a8(%rbx), %rsi
leaq 0x70(%rsp), %rdi
callq 0x5290
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
leaq 0x1c980(%rip), %rsi     # 0x29442
leaq 0x70(%rsp), %rdi
movl $0x11, %edx
callq 0x5470
movq 0x198(%rbx), %rsi
leaq 0x70(%rsp), %rdi
callq 0x5290
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
leaq 0x1c941(%rip), %rsi     # 0x29454
leaq 0x70(%rsp), %rdi
movl $0x5, %edx
callq 0x5470
movsd 0x1a8(%rbx), %xmm1
movsd 0x1c62e(%rip), %xmm2    # 0x29160
unpcklps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x1c633(%rip), %xmm3    # 0x29170
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
leaq 0x70(%rsp), %rdi
callq 0x5620
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
movss 0x188(%rbx), %xmm0
movss %xmm0, 0x10(%rsp)
xorps %xmm0, %xmm0
cvtsi2ssl 0x230(%rbx), %xmm0
movss %xmm0, 0xc(%rsp)
leaq 0x1c894(%rip), %rsi     # 0x2945a
leaq 0x70(%rsp), %rdi
movl $0x12, %edx
callq 0x5470
movss 0x10(%rsp), %xmm0
divss 0xc(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x70(%rsp), %rdi
movsd %xmm0, 0x10(%rsp)
callq 0x5620
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
movss 0x18c(%rbx), %xmm0
movss %xmm0, 0xc(%rsp)
xorps %xmm0, %xmm0
cvtsi2ssl 0x230(%rbx), %xmm0
movss %xmm0, 0x2c(%rsp)
leaq 0x1c828(%rip), %rsi     # 0x2946d
leaq 0x70(%rsp), %rdi
movl $0x12, %edx
callq 0x5470
xorps %xmm0, %xmm0
cvtsi2ssl 0x230(%rbx), %xmm0
movss 0x18c(%rbx), %xmm1
divss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
leaq 0x70(%rsp), %rdi
callq 0x5620
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
leaq 0x1c7d3(%rip), %rsi     # 0x29480
leaq 0x70(%rsp), %rdi
movl $0x14, %edx
callq 0x5470
xorps %xmm1, %xmm1
cvtsi2sdl 0x230(%rbx), %xmm1
movsd 0x20(%rsp), %xmm0
divsd %xmm1, %xmm0
leaq 0x70(%rsp), %rdi
callq 0x5620
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
leaq 0x1c789(%rip), %rsi     # 0x29495
leaq 0x70(%rsp), %rdi
movl $0x11, %edx
callq 0x5470
xorps %xmm1, %xmm1
cvtsi2sdl 0x230(%rbx), %xmm1
movsd 0x18(%rsp), %xmm0
divsd %xmm1, %xmm0
leaq 0x70(%rsp), %rdi
callq 0x5620
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
movss 0x190(%rbx), %xmm0
movss %xmm0, 0x20(%rsp)
xorps %xmm0, %xmm0
cvtsi2ssl 0x230(%rbx), %xmm0
movss %xmm0, 0x18(%rsp)
leaq 0x1c71d(%rip), %rsi     # 0x294a7
leaq 0x70(%rsp), %rdi
movl $0xb, %edx
callq 0x5470
xorps %xmm0, %xmm0
cvtsi2ssl 0x230(%rbx), %xmm0
movss 0x190(%rbx), %xmm1
divss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
leaq 0x70(%rsp), %rdi
callq 0x5620
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
leaq 0x1c6c1(%rip), %rsi     # 0x294b3
leaq 0x70(%rsp), %rdi
movl $0xc, %edx
callq 0x5470
movss 0xc(%rsp), %xmm0
divss 0x2c(%rsp), %xmm0
xorps %xmm1, %xmm1
cvtss2sd %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
subsd %xmm1, %xmm0
movss 0x20(%rsp), %xmm1
divss 0x18(%rsp), %xmm1
cvtss2sd %xmm1, %xmm1
subsd %xmm1, %xmm0
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
callq 0x5620
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
movq %r14, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
movq 0x70(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x53f0
movsbl %al, %esi
leaq 0x70(%rsp), %rdi
callq 0x5040
movq %rax, %rdi
callq 0x52a0
leaq 0x70(%rsp), %rdi
callq 0x5570
movq 0x2c10b(%rip), %rax     # 0x38fb0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x78(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x70(%rsp,%rcx)
callq 0x5350
leaq 0x168(%rsp), %rdi
callq 0x5160
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0xcedf
callq 0x53d0
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xcef2
callq 0x53d0
addq $0x270, %rsp            # imm = 0x270
popq %rbx
popq %r14
popq %r15
retq
jmp 0xcf01
movq %rax, %rbx
jmp 0xcf1c
jmp 0xcf08
movq %rax, %rbx
jmp 0xcf2b
jmp 0xcf0f
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x55c0
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0xcf2b
callq 0x53d0
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xcf3e
callq 0x53d0
movq %rbx, %rdi
callq 0x56b0