// File: 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
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
addq -0x18(%rax), %rdi
callq 0x3310
testb $0x1, %al
jne 0x663c
jmp 0x6a21
xorl %eax, %eax
movl %eax, %edi
callq 0x3230
movq %rax, -0x18(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x31b0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
leaq 0x3d56(%rip), %rsi      # 0xa3bb
callq 0x3250
movq %rax, %rdi
movq -0x20(%rbp), %rax
movl 0x14(%rax), %esi
addl $0x76c, %esi            # imm = 0x76C
callq 0x33e0
movq %rax, %rdi
movl $0x2d, %esi
callq 0x32c0
movq %rax, %rdi
movq -0x20(%rbp), %rax
movl 0x10(%rax), %esi
addl $0x1, %esi
callq 0x33e0
movq %rax, %rdi
movl $0x2d, %esi
callq 0x32c0
movq %rax, %rdi
movq -0x20(%rbp), %rax
movl 0xc(%rax), %esi
callq 0x33e0
movq %rax, %rdi
leaq 0x39ed(%rip), %rsi      # 0xa0b1
callq 0x3250
movl $0x1, -0x24(%rbp)
cmpl $0x64, -0x24(%rbp)
jge 0x6a1f
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x5420
movq -0x8(%rbp), %rdi
cvtsi2ssl -0x24(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x3934(%rip), %xmm1     # 0xa030
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
callq 0x4f70
movq -0x8(%rbp), %rdi
callq 0x58e0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
callq 0x59e0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x168(%rbp)
leaq -0x78(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0x5590
movq -0x168(%rbp), %rdi
movq -0x160(%rbp), %rsi
movb $0x0, -0x109(%rbp)
movb $0x0, -0x10a(%rbp)
callq 0x38d0
movb %al, -0x151(%rbp)
jmp 0x6767
movb -0x151(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x169(%rbp)
jne 0x677c
jmp 0x67e1
movq -0x8(%rbp), %rsi
movq %rsi, -0x178(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x5590
jmp 0x6795
movb $0x1, -0x109(%rbp)
leaq -0xc8(%rbp), %rdi
leaq -0x108(%rbp), %rsi
callq 0x5590
jmp 0x67b1
movq -0x178(%rbp), %rdi
movb $0x1, -0x10a(%rbp)
leaq -0xc8(%rbp), %rsi
callq 0x38d0
movb %al, -0x179(%rbp)
jmp 0x67d3
movb -0x179(%rbp), %al
movb %al, -0x169(%rbp)
jmp 0x67e1
movb -0x169(%rbp), %al
movb %al, -0x17a(%rbp)
testb $0x1, -0x10a(%rbp)
jne 0x67f8
jmp 0x6804
leaq -0xc8(%rbp), %rdi
callq 0x5230
testb $0x1, -0x109(%rbp)
jne 0x680f
jmp 0x681b
leaq -0x108(%rbp), %rdi
callq 0x5230
leaq -0x78(%rbp), %rdi
callq 0x5230
movb -0x17a(%rbp), %al
testb $0x1, %al
jne 0x6833
jmp 0x68fe
movq -0x8(%rbp), %rsi
leaq -0x150(%rbp), %rdi
movq %rdi, -0x188(%rbp)
callq 0x5590
movq -0x188(%rbp), %rsi
movq -0x8(%rbp), %rdi
callq 0x5260
jmp 0x685c
leaq -0x150(%rbp), %rdi
callq 0x5230
jmp 0x6723
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x68d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x68b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
testb $0x1, -0x10a(%rbp)
jne 0x68a9
jmp 0x68b5
leaq -0xc8(%rbp), %rdi
callq 0x5230
jmp 0x68b7
testb $0x1, -0x109(%rbp)
jne 0x68c2
jmp 0x68ce
leaq -0x108(%rbp), %rdi
callq 0x5230
jmp 0x68d0
leaq -0x78(%rbp), %rdi
callq 0x5230
jmp 0x6a4c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x5230
jmp 0x6a4c
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
movq -0x38(%rbp), %rsi
callq 0x30a0
movq %rax, %rdi
leaq 0x38e0(%rip), %rsi      # 0xa1f9
callq 0x3250
movq %rax, %rdi
movq -0x38(%rbp), %rsi
callq 0x30a0
movq %rax, %rdi
leaq 0x389c(%rip), %rsi      # 0xa1d0
callq 0x3250
movq %rax, %rdi
imulq $0x64, -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
imulq -0x38(%rbp), %rcx
xorl %edx, %edx
divq %rcx
movq %rax, %rsi
callq 0x30a0
movq %rax, %rdi
leaq 0x3a68(%rip), %rsi      # 0xa3c9
callq 0x3250
movq %rax, -0x1a0(%rbp)
movq -0x8(%rbp), %rdi
callq 0x58e0
movq -0x1a0(%rbp), %rdi
imulq $0x64, %rax, %rax
movq -0x38(%rbp), %rcx
imulq -0x38(%rbp), %rcx
xorl %edx, %edx
divq %rcx
movq %rax, %rsi
callq 0x30a0
movq %rax, %rdi
leaq 0x3a2e(%rip), %rsi      # 0xa3cf
callq 0x3250
movq %rax, %rdi
leaq 0x3a23(%rip), %rsi      # 0xa3d3
callq 0x3250
movq %rax, -0x198(%rbp)
movq -0x8(%rbp), %rdi
callq 0x59a0
movq -0x198(%rbp), %rdi
movq %rax, %rsi
callq 0x30a0
movq %rax, %rdi
leaq 0x3a03(%rip), %rsi      # 0xa3e1
callq 0x3250
movq %rax, -0x190(%rbp)
movq -0x8(%rbp), %rdi
callq 0x59c0
movq -0x190(%rbp), %rdi
movq %rax, %rsi
callq 0x30a0
movq %rax, %rdi
movq 0x75b4(%rip), %rsi      # 0xdfc0
callq 0x3270
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x66d0
jmp 0x6a43
movq 0x75c8(%rip), %rdi      # 0xdff0
leaq 0x39be(%rip), %rsi      # 0xa3ed
callq 0x3250
movq %rax, %rdi
movq 0x7582(%rip), %rsi      # 0xdfc0
callq 0x3270
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0x33f0
nopw %cs:(%rax,%rax)
nop