// File: gvaumour[P]cache-simulator/src/main.cc
// Function: printResults(bool, int)
void printResults(bool mergingResults, int id_trace)
{
	if(!my_system)
		return;
		
		
	string suffixe = "_" + to_string(id_trace); 
	
	ofstream configFile;
	configFile.open("config" + suffixe + ".ini");
	
	configFile << "Simulated traces:" << endl;
	for(auto p : simu_parameters.memory_traces)
		configFile << "\t-" << p << endl;
 	
	my_system->printConfig(configFile);
	configFile.close();
	
	ofstream output_file;
	output_file.open("results"+ suffixe + ".out");
	my_system->printResults(output_file);
	output_file.close();
}

// Assembly:
subq $0x538, %rsp            # imm = 0x538
movb %dil, %al
andb $0x1, %al
movb %al, 0x537(%rsp)
movl %esi, 0x530(%rsp)
cmpq $0x0, 0x24036(%rip)     # 0x94258
jne 0x70229
jmp 0x70597
movl 0x530(%rsp), %esi
leaq 0x4f0(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x101d0
movq 0x20(%rsp), %rdx
leaq 0x1fd8(%rip), %rsi      # 0x72226
leaq 0x510(%rsp), %rdi
callq 0x3d8b0
jmp 0x7025d
leaq 0x4f0(%rsp), %rdi
callq 0x5768
leaq 0x2e0(%rsp), %rdi
callq 0x5660
jmp 0x70279
leaq 0x4712(%rip), %rsi      # 0x74992
leaq 0x2a0(%rsp), %rdi
leaq 0x510(%rsp), %rdx
callq 0x2ead0
jmp 0x70297
leaq 0x46fb(%rip), %rdx      # 0x74999
leaq 0x2c0(%rsp), %rdi
leaq 0x2a0(%rsp), %rsi
callq 0x10180
jmp 0x702b5
leaq 0x2e0(%rsp), %rdi
leaq 0x2c0(%rsp), %rsi
movl $0x10, %edx
callq 0x51f0
jmp 0x702d1
leaq 0x2c0(%rsp), %rdi
callq 0x5768
leaq 0x2a0(%rsp), %rdi
callq 0x5768
leaq 0x46ac(%rip), %rsi      # 0x7499e
leaq 0x2e0(%rsp), %rdi
callq 0x5380
movq %rax, 0x18(%rsp)
jmp 0x70306
movq 0x18(%rsp), %rdi
movq 0x22ca6(%rip), %rsi     # 0x92fb8
callq 0x53d0
jmp 0x70319
leaq 0x23cd0(%rip), %rax     # 0x93ff0
addq $0x50, %rax
movq %rax, 0x298(%rsp)
leaq 0x23cbd(%rip), %rdi     # 0x93ff0
addq $0x50, %rdi
callq 0xebf0
movq %rax, 0x290(%rsp)
leaq 0x23ca5(%rip), %rdi     # 0x93ff0
addq $0x50, %rdi
callq 0xec20
movq %rax, 0x288(%rsp)
leaq 0x290(%rsp), %rdi
leaq 0x288(%rsp), %rsi
callq 0xec50
testb $0x1, %al
jne 0x7037a
jmp 0x704c6
leaq 0x290(%rsp), %rdi
callq 0xec90
movq %rax, %rsi
leaq 0x268(%rsp), %rdi
callq 0x51b0
jmp 0x70399
leaq 0x4610(%rip), %rsi      # 0x749b0
leaq 0x2e0(%rsp), %rdi
callq 0x5380
movq %rax, 0x10(%rsp)
jmp 0x703b4
movq 0x10(%rsp), %rdi
leaq 0x268(%rsp), %rsi
callq 0x5330
movq %rax, 0x8(%rsp)
jmp 0x703cd
movq 0x8(%rsp), %rdi
movq 0x22bdf(%rip), %rsi     # 0x92fb8
callq 0x53d0
jmp 0x703e0
leaq 0x268(%rsp), %rdi
callq 0x5768
leaq 0x290(%rsp), %rdi
callq 0xeca0
jmp 0x7035c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4e8(%rsp)
movl %eax, 0x4e4(%rsp)
leaq 0x4f0(%rsp), %rdi
callq 0x5768
jmp 0x70617
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4e8(%rsp)
movl %eax, 0x4e4(%rsp)
jmp 0x7060a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4e8(%rsp)
movl %eax, 0x4e4(%rsp)
jmp 0x705fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4e8(%rsp)
movl %eax, 0x4e4(%rsp)
jmp 0x7048e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4e8(%rsp)
movl %eax, 0x4e4(%rsp)
leaq 0x2c0(%rsp), %rdi
callq 0x5768
leaq 0x2a0(%rsp), %rdi
callq 0x5768
jmp 0x705fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4e8(%rsp)
movl %eax, 0x4e4(%rsp)
leaq 0x268(%rsp), %rdi
callq 0x5768
jmp 0x705fd
movq 0x23d8b(%rip), %rdi     # 0x94258
leaq 0x2e0(%rsp), %rsi
callq 0x31900
jmp 0x704dc
leaq 0x2e0(%rsp), %rdi
callq 0x5550
jmp 0x704eb
leaq 0x68(%rsp), %rdi
callq 0x5660
jmp 0x704f7
leaq 0x44b5(%rip), %rsi      # 0x749b3
leaq 0x28(%rsp), %rdi
leaq 0x510(%rsp), %rdx
callq 0x2ead0
jmp 0x70512
leaq 0x4395(%rip), %rdx      # 0x748ae
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x10180
jmp 0x7052a
leaq 0x68(%rsp), %rdi
leaq 0x48(%rsp), %rsi
movl $0x10, %edx
callq 0x51f0
jmp 0x70540
leaq 0x48(%rsp), %rdi
callq 0x5768
leaq 0x28(%rsp), %rdi
callq 0x5768
movq 0x23cfd(%rip), %rdi     # 0x94258
leaq 0x68(%rsp), %rsi
callq 0x316d0
jmp 0x70567
leaq 0x68(%rsp), %rdi
callq 0x5550
jmp 0x70573
leaq 0x68(%rsp), %rdi
callq 0x5770
leaq 0x2e0(%rsp), %rdi
callq 0x5770
leaq 0x510(%rsp), %rdi
callq 0x5768
addq $0x538, %rsp            # imm = 0x538
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4e8(%rsp)
movl %eax, 0x4e4(%rsp)
jmp 0x705f3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4e8(%rsp)
movl %eax, 0x4e4(%rsp)
jmp 0x705e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x4e8(%rsp)
movl %eax, 0x4e4(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x5768
leaq 0x28(%rsp), %rdi
callq 0x5768
leaq 0x68(%rsp), %rdi
callq 0x5770
leaq 0x2e0(%rsp), %rdi
callq 0x5770
leaq 0x510(%rsp), %rdi
callq 0x5768
movq 0x4e8(%rsp), %rdi
callq 0x5690
nopw %cs:(%rax,%rax)
nop