// File: /workspace/github_cpp_makefile_star2_O3/massykezzoul[P]jeu-de-la-vie/population/population.cpp
// Function: simulation(Population&)
void simulation(Population &popu) {
	size_t vivant_debut = popu.get_vivante();
	size_t dimension = popu.get_dimension();
	int temps_pose = popu.get_speed();
	while ( (popu != popu.next()) && (popu != popu.next().next()) )  {
		cout << "Voici La population de Départ : " << endl << endl;
		popu.affiche_matrice();

		cout << "Pourcentage de vie : " << popu.get_vivante()*100 / (dimension*dimension) <<"%" << endl
			<< "Generation : " << popu.get_generation() << endl
			<< "Matrice de taille : " << dimension << "x" << dimension << endl;
		
		if (popu.get_generation() == 1) {
			cout << "Qliquer sur Entrée pour commencer la Simulation ..." << endl;
			getchar();
		}
		

		popu = popu.next();

		usleep(temps_pose);
	}

	cout << "########################## END OF SIMULATION ##########################" << endl << endl;

	popu.next().affiche_matrice();

	cout << "Fin de la simuation après : " << popu.get_generation() << " Generations."<<endl;
	if (popu.get_vivante() == 0) 
		cout << "Les cellules sont toutes Morte à la fin de cette simulation." << endl;
	else 
		cout << popu.get_vivante() << " Cellule vivantes à la fin." << endl;
	cout << "Soit un Taux d'environ " << (popu.get_vivante()*100) / (dimension*dimension) << "% de vie." << endl;
	cout << endl << "Au Debut de la simulation : " << endl;
 	cout << "La Graine étais : " << popu.get_graine() <<"."<< endl;
	cout << "Matrice de "<<dimension<<"x"<<dimension<<" cases, Soit un total de "<< dimension*dimension<<" Cellules" << endl;
	cout << "Avec "<< vivant_debut <<" Cellule vivante au debut, Contre " << (dimension*dimension) - vivant_debut << " Cellule Morte." << endl;
	cout << "Soit un Taux d'environ " << (vivant_debut*100) / (dimension*dimension) << "% de vie." << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rdi, %r12
movq 0x10(%rdi), %rax
movq %rax, 0x20(%rsp)
movq 0x28(%rdi), %rax
movl 0x38(%rdi), %ecx
movl %ecx, 0xc(%rsp)
movq %rax, 0x10(%rsp)
imulq %rax, %rax
movq %rax, 0x18(%rsp)
leaq 0x28(%rsp), %rbx
movq 0x6c58(%rip), %r13      # 0xafd0
leaq 0xa8(%rsp), %r15
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3b4e
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2552
testb %al, %al
leaq 0x68(%rsp), %r14
je 0x43a4
xorl %r14d, %r14d
jmp 0x43f0
movq %r14, %rdi
movq %r12, %rsi
callq 0x3b4e
movq %r15, %rbp
movq %r15, %rdi
movq %r14, %rsi
callq 0x3b4e
movq %r12, %rdi
movq %rbp, %rsi
callq 0x2552
movl %eax, %r14d
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x43dd
callq 0x2210
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x43ec
callq 0x2210
xorb $0x1, %r14b
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x43ff
callq 0x2210
testb %r14b, %r14b
je 0x461d
movl $0x21, %edx
movq %r13, %rdi
leaq 0x2d7d(%rip), %rsi      # 0x7194
callq 0x21d0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r13, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2100
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2100
movq %r12, %rdi
callq 0x3e44
movl $0x15, %edx
movq %r13, %rdi
leaq 0x2d31(%rip), %rsi      # 0x71b6
callq 0x21d0
imulq $0x64, 0x10(%r12), %rax
xorl %edx, %edx
divq 0x18(%rsp)
movq %r13, %rdi
movq %rax, %rsi
callq 0x20f0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2d18(%rip), %rsi      # 0x71cc
callq 0x21d0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2100
movq %rax, %r14
movl $0xd, %edx
movq %rax, %rdi
leaq 0x2cdc(%rip), %rsi      # 0x71ce
callq 0x21d0
movq 0x8(%r12), %rsi
movq %r14, %rdi
callq 0x20f0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2100
movq %rax, %r14
movl $0x14, %edx
movq %rax, %rdi
leaq 0x2c9c(%rip), %rsi      # 0x71dc
callq 0x21d0
movq %r14, %rdi
movq 0x10(%rsp), %rbp
movq %rbp, %rsi
callq 0x20f0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2c8a(%rip), %rsi      # 0x71f1
callq 0x21d0
movq %r14, %rdi
movq %rbp, %rsi
callq 0x20f0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2100
cmpq $0x1, 0x8(%r12)
jne 0x45ea
movl $0x34, %edx
movq %r13, %rdi
leaq 0x2c3b(%rip), %rsi      # 0x71f3
callq 0x21d0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r13, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2100
callq 0x2230
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3b4e
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3970
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x460f
callq 0x2210
movl 0xc(%rsp), %edi
callq 0x2240
jmp 0x4380
leaq 0x2c04(%rip), %rsi      # 0x7228
movl $0x47, %edx
movq %r13, %rdi
callq 0x21d0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r13, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2100
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
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3b4e
movq %rbx, %rdi
callq 0x3e44
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x46aa
callq 0x2210
movq 0x691f(%rip), %r13      # 0xafd0
leaq 0x2bb8(%rip), %rsi      # 0x7270
movl $0x1d, %edx
movq %r13, %rdi
callq 0x21d0
movq 0x8(%r12), %rsi
movq %r13, %rdi
callq 0x20f0
movq %rax, %rbx
leaq 0x2bb2(%rip), %rsi      # 0x728e
movl $0xd, %edx
movq %rax, %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
callq 0x2100
movq 0x10(%r12), %rsi
testq %rsi, %rsi
je 0x473f
movq 0x68af(%rip), %rdi      # 0xafd0
callq 0x20f0
movq %rax, %rbx
leaq 0x2baa(%rip), %rsi      # 0x72da
movl $0x1c, %edx
movq %rax, %rdi
callq 0x21d0
jmp 0x4756
leaq 0x2b56(%rip), %rsi      # 0x729c
movl $0x3d, %edx
movq %r13, %rdi
callq 0x21d0
movq %r13, %rbx
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
callq 0x2100
leaq 0x2b73(%rip), %rsi      # 0x72f7
movl $0x17, %edx
movq %r13, %rdi
callq 0x21d0
imulq $0x64, 0x10(%r12), %rax
xorl %edx, %edx
movq 0x18(%rsp), %rbx
divq %rbx
movq %r13, %rdi
movq %rax, %rsi
callq 0x20f0
movq %rax, %rbp
leaq 0x2b59(%rip), %r14      # 0x730f
movl $0x9, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbp, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2100
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r13, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2100
movq %rax, %rbp
leaq 0x2af9(%rip), %rsi      # 0x7319
movl $0x1c, %edx
movq %rax, %rdi
callq 0x21d0
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbp, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2100
leaq 0x2ada(%rip), %rsi      # 0x7336
movl $0x13, %edx
movq %r13, %rdi
callq 0x21d0
movq 0x30(%r12), %rsi
movq %r13, %rdi
callq 0x20f0
movq %rax, %r12
leaq 0x29a6(%rip), %rsi      # 0x7226
movl $0x1, %edx
movq %rax, %rdi
callq 0x21d0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r12, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2100
leaq 0x2a8e(%rip), %rsi      # 0x734a
movl $0xb, %edx
movq %r13, %rdi
callq 0x21d0
movq %r13, %rdi
movq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0x20f0
movq %rax, %r12
leaq 0x290e(%rip), %rsi      # 0x71f1
movl $0x1, %edx
movq %rax, %rdi
callq 0x21d0
movq %r12, %rdi
movq %r15, %rsi
callq 0x20f0
movq %rax, %r15
leaq 0x2a51(%rip), %rsi      # 0x7356
movl $0x19, %edx
movq %rax, %rdi
callq 0x21d0
movq %r15, %rdi
movq %rbx, %rsi
callq 0x20f0
movq %rax, %r15
leaq 0x2a49(%rip), %rsi      # 0x7370
movl $0x9, %edx
movq %rax, %rdi
callq 0x21d0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2100
leaq 0x2a18(%rip), %rsi      # 0x737a
movl $0x5, %edx
movq %r13, %rdi
callq 0x21d0
movq %r13, %rdi
movq 0x20(%rsp), %r12
movq %r12, %rsi
callq 0x20f0
movq %rax, %r15
leaq 0x29f7(%rip), %rsi      # 0x7380
movl $0x22, %edx
movq %rax, %rdi
callq 0x21d0
movq %rbx, %rsi
subq %r12, %rsi
movq %r15, %rdi
callq 0x20f0
movq %rax, %r15
leaq 0x29f5(%rip), %rsi      # 0x73a3
movl $0xf, %edx
movq %rax, %rdi
callq 0x21d0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2100
movl $0x17, %edx
movq %r13, %rdi
leaq 0x2906(%rip), %rsi      # 0x72f7
callq 0x21d0
imulq $0x64, %r12, %rax
xorl %edx, %edx
divq %rbx
movq %r13, %rdi
movq %rax, %rsi
callq 0x20f0
movq %rax, %rbx
movl $0x9, %edx
movq %rax, %rdi
movq %r14, %rsi
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
callq 0x2100
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4a87
movq %rax, %rbx
jmp 0x4a74
jmp 0x4a87
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0x4a74
callq 0x2210
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x4a8a
callq 0x2210
jmp 0x4a8a
jmp 0x4a87
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x4a99
callq 0x2210
movq %rbx, %rdi
callq 0x22e0