// File: /workspace/github_cpp_makefile_star2_O1/massykezzoul[P]jeu-de-la-vie/population/population.cpp
// Function: simulation(Population&, std::basic_fstream<char, std::char_traits<char>>&)
void simulation(Population &popu,fstream& stat) {
	if (stat) {
		time_t t = time(0);   // get time now
    	tm* now = localtime(&t);
    	stat << "Simulation : " << (now->tm_year + 1900) << '-' 
         		<< (now->tm_mon + 1) << '-'
         		<<  now->tm_mday
         		<< "\n";

		for (int i = 1; i < 100; ++i) {
			popu.init();
			popu.set_probability((float)((float)i/100.0));
			size_t vivant_debut = popu.get_vivante();
			size_t dimension = popu.get_dimension();
			while ( (popu != popu.next()) && (popu != popu.next().next()) )  {
				popu = popu.next();
			}
			stat << dimension << "x" << dimension << " : "
					<< (vivant_debut*100) / (dimension*dimension) << "%\t-> "
					<< popu.get_vivante()*100 / (dimension*dimension) << "%\t,"
					<< "generation = " << popu.get_generation() 
					<< "\t,graine = " << popu.get_graine() << endl;
		}
	} else 
		cerr << "Erreur d'ouverture du fichier " << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq (%rsi), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%rsi,%rax)
je 0x4af0
movq 0x654c(%rip), %rbx      # 0xaff0
leaq 0x293a(%rip), %rsi      # 0x73e5
movl $0x1e, %edx
movq %rbx, %rdi
callq 0x21d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2100
movq %rsi, %rbx
movq %rdi, %r14
xorl %edi, %edi
callq 0x2160
leaq 0x20(%rsp), %rdi
movq %rax, (%rdi)
callq 0x2120
movq %rax, %r12
addq $0x10, %rbx
leaq 0x289b(%rip), %rsi      # 0x73b3
movl $0xd, %edx
movq %rbx, %rdi
callq 0x21d0
movl $0x76c, %esi            # imm = 0x76C
addl 0x14(%r12), %esi
movq %rbx, 0x8(%rsp)
movq %rbx, %rdi
callq 0x22d0
movb $0x2d, %bl
leaq 0x28(%rsp), %r15
movb %bl, (%r15)
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x21d0
movl 0x10(%r12), %esi
incl %esi
movq %rax, %rdi
callq 0x22d0
movb %bl, (%r15)
leaq 0x28(%rsp), %rsi
movl $0x1, %edx
movq %rax, %rdi
callq 0x21d0
movl 0xc(%r12), %esi
movq %rax, %rdi
callq 0x22d0
leaq 0x251b(%rip), %rsi      # 0x70a9
movl $0x1, %edx
movq %rax, %rdi
callq 0x21d0
movl $0x1, %eax
leaq 0x68(%rsp), %r12
leaq 0xa8(%rsp), %r13
movq %r14, %rdi
xorl %esi, %esi
movl %eax, %ebx
callq 0x3a34
movl %ebx, 0x4(%rsp)
cvtsi2sd %ebx, %xmm0
divsd 0x245f(%rip), %xmm0     # 0x7028
cvtsd2ss %xmm0, %xmm0
movq %r14, %rdi
callq 0x3738
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%r14), %rax
movq %rax, 0x18(%rsp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x3b18
movq %r14, %rdi
movq %r15, %rsi
callq 0x2552
movl %eax, %ebp
testb %al, %al
je 0x4c07
xorl %ebx, %ebx
jmp 0x4c2d
movq %r12, %rdi
movq %r14, %rsi
callq 0x3b18
movq %r13, %rdi
movq %r12, %rsi
callq 0x3b18
movq %r14, %rdi
movq %r13, %rsi
callq 0x2552
movl %eax, %ebx
xorb $0x1, %bl
testb %bpl, %bpl
jne 0x4c53
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x4c44
callq 0x2210
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x4c53
callq 0x2210
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x4c62
callq 0x2210
testb %bl, %bl
je 0x4c94
movq %r15, %rdi
movq %r14, %rsi
callq 0x3b18
movq %r14, %rdi
movq %r15, %rsi
callq 0x3938
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x4be7
callq 0x2210
jmp 0x4be7
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %rbp
movq %rbp, %rsi
callq 0x20f0
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2539(%rip), %rsi      # 0x71f1
callq 0x21d0
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x20f0
movq %rax, %rbx
movl $0x3, %edx
movq %rax, %rdi
leaq 0x24ee(%rip), %rsi      # 0x71c8
callq 0x21d0
imulq $0x64, 0x10(%rsp), %rax
imulq %rbp, %rbp
xorl %edx, %edx
divq %rbp
movq %rbx, %rdi
movq %rax, %rsi
callq 0x20f0
movq %rax, %rbx
movl $0x5, %edx
movq %rax, %rdi
leaq 0x26b6(%rip), %rsi      # 0x73c1
callq 0x21d0
imulq $0x64, 0x10(%r14), %rax
xorl %edx, %edx
divq %rbp
movq %rbx, %rdi
movq %rax, %rsi
callq 0x20f0
movq %rax, %rbx
movl $0x3, %edx
movq %rax, %rdi
leaq 0x2690(%rip), %rsi      # 0x73c7
callq 0x21d0
movl $0xd, %edx
movq %rbx, %rdi
leaq 0x2680(%rip), %rsi      # 0x73cb
callq 0x21d0
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x20f0
movq %rax, %rbx
movl $0xb, %edx
movq %rax, %rdi
leaq 0x266b(%rip), %rsi      # 0x73d9
callq 0x21d0
movq 0x30(%r14), %rsi
movq %rbx, %rdi
callq 0x20f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2100
movl 0x4(%rsp), %eax
incl %eax
cmpl $0x64, %eax
jne 0x4bad
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x4de4
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x4de4
callq 0x2210
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x4dfc
callq 0x2210
jmp 0x4dfc
jmp 0x4df9
jmp 0x4df9
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x4e0b
callq 0x2210
movq %rbx, %rdi
callq 0x22e0
nop