// File: gvaumour[P]cache-simulator/src/Cerebron.cc
// Function: CerebronPredictor::drawFeatureMaps()
void
CerebronPredictor::drawFeatureMaps()
{

	ofstream file("output_PHC.out");
	for(unsigned i = 0 ; i < stats_global_error.size() ; i++)
	{
		for(unsigned j =  0 ; j < stats_global_error[i].size() ; j++)
		{
			double a = stats_global_error[i][j].first;
//			double b = stats_global_error[i][j].second;
//			double dummy = 0;
//			if( !(a == 0 && b == 0) )
//				dummy = a / (a + b);

			file << a << ",";
		}
		file << endl;
	}
	file.close();

	ofstream file1("output_PHC1.out");
	for(unsigned i = 0 ; i < stats_local_error.size() ; i++)
	{
		for(unsigned j =  0 ; j < stats_local_error[i].size() ; j++)
		{
			double a = stats_local_error[i][j].first;
//			double b = stats_local_error[i][j].second;
//			double dummy = a / (a + b);
			file1 << a << ",";
		}
		file1 << endl;
	}
	file1.close();

}

// Assembly:
subq $0x478, %rsp            # imm = 0x478
movq %rdi, 0x470(%rsp)
movq 0x470(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0x270(%rsp), %rdi
leaq 0x63197(%rip), %rsi     # 0x716e2
movl $0x10, %edx
callq 0x53f0
movl $0x0, 0x26c(%rsp)
movq 0x38(%rsp), %rdi
movl 0x26c(%rsp), %eax
movq %rax, 0x30(%rsp)
addq $0x490, %rdi            # imm = 0x490
callq 0xfcc0
movq %rax, %rcx
movq 0x30(%rsp), %rax
cmpq %rcx, %rax
jae 0xe69f
movl $0x0, 0x268(%rsp)
movq 0x38(%rsp), %rdi
movl 0x268(%rsp), %eax
movq %rax, 0x28(%rsp)
addq $0x490, %rdi            # imm = 0x490
movl 0x26c(%rsp), %eax
movl %eax, %esi
callq 0xf9e0
movq %rax, %rdi
callq 0xfce0
movq %rax, %rcx
movq 0x28(%rsp), %rax
cmpq %rcx, %rax
jae 0xe671
movq 0x38(%rsp), %rdi
addq $0x490, %rdi            # imm = 0x490
movl 0x26c(%rsp), %eax
movl %eax, %esi
callq 0xf9e0
movq %rax, %rdi
movl 0x268(%rsp), %eax
movl %eax, %esi
callq 0xfa00
cvtsi2sdl (%rax), %xmm0
movsd %xmm0, 0x260(%rsp)
movsd 0x260(%rsp), %xmm0
leaq 0x270(%rsp), %rdi
callq 0x56f0
movq %rax, 0x20(%rsp)
jmp 0xe62d
movq 0x20(%rsp), %rdi
leaq 0x62a09(%rip), %rsi     # 0x71042
callq 0x5380
jmp 0xe640
jmp 0xe642
movl 0x268(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x268(%rsp)
jmp 0xe599
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x258(%rsp)
movl %eax, 0x254(%rsp)
jmp 0xe815
movq 0x84940(%rip), %rsi     # 0x92fb8
leaq 0x270(%rsp), %rdi
callq 0x53d0
jmp 0xe687
jmp 0xe689
movl 0x26c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x26c(%rsp)
jmp 0xe560
leaq 0x270(%rsp), %rdi
callq 0x5550
jmp 0xe6ae
leaq 0x6303c(%rip), %rsi     # 0x716f1
leaq 0x50(%rsp), %rdi
movl $0x10, %edx
callq 0x53f0
jmp 0xe6c6
movl $0x0, 0x4c(%rsp)
movq 0x38(%rsp), %rdi
movl 0x4c(%rsp), %eax
movq %rax, 0x18(%rsp)
addq $0x478, %rdi            # imm = 0x478
callq 0xfcc0
movq %rax, %rcx
movq 0x18(%rsp), %rax
cmpq %rcx, %rax
jae 0xe7ea
movl $0x0, 0x48(%rsp)
movq 0x38(%rsp), %rdi
movl 0x48(%rsp), %eax
movq %rax, 0x10(%rsp)
addq $0x478, %rdi            # imm = 0x478
movl 0x4c(%rsp), %eax
movl %eax, %esi
callq 0xf9e0
movq %rax, %rdi
callq 0xfce0
movq %rax, %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
jae 0xe7c5
movq 0x38(%rsp), %rdi
addq $0x478, %rdi            # imm = 0x478
movl 0x4c(%rsp), %eax
movl %eax, %esi
callq 0xf9e0
movq %rax, %rdi
movl 0x48(%rsp), %eax
movl %eax, %esi
callq 0xfa00
cvtsi2sdl (%rax), %xmm0
movsd %xmm0, 0x40(%rsp)
movsd 0x40(%rsp), %xmm0
leaq 0x50(%rsp), %rdi
callq 0x56f0
movq %rax, 0x8(%rsp)
jmp 0xe780
movq 0x8(%rsp), %rdi
leaq 0x628b6(%rip), %rsi     # 0x71042
callq 0x5380
jmp 0xe793
jmp 0xe795
movl 0x48(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x48(%rsp)
jmp 0xe701
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x258(%rsp)
movl %eax, 0x254(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x5770
jmp 0xe815
movq 0x847ec(%rip), %rsi     # 0x92fb8
leaq 0x50(%rsp), %rdi
callq 0x53d0
jmp 0xe7d8
jmp 0xe7da
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0xe6ce
leaq 0x50(%rsp), %rdi
callq 0x5550
jmp 0xe7f6
leaq 0x50(%rsp), %rdi
callq 0x5770
leaq 0x270(%rsp), %rdi
callq 0x5770
addq $0x478, %rsp            # imm = 0x478
retq
leaq 0x270(%rsp), %rdi
callq 0x5770
movq 0x258(%rsp), %rdi
callq 0x5690
nop