// File: /workspace/github_cpp_makefile_star2_O2/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), %r13
leaq 0x68(%rsp), %rbx
leaq 0xa8(%rsp), %r14
movq 0x63ff(%rip), %rbp      # 0x9fd0
movq %r13, %rdi
movq %r12, %rsi
callq 0x3592
movq %r12, %rdi
movq %r13, %rsi
callq 0x2609
testb %al, %al
je 0x3d4e
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3592
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3592
movq %r12, %rdi
movq %r14, %rsi
callq 0x2609
movl %eax, %r15d
movq %r14, %rdi
callq 0x33aa
movq %rbx, %rdi
callq 0x33aa
movq %r13, %rdi
callq 0x33aa
testb %r15b, %r15b
je 0x3d58
movq %rbp, %rdi
leaq 0x2556(%rip), %rsi      # 0x6194
callq 0x21d0
movq %rax, %rdi
callq 0x2100
movq %rax, %rdi
callq 0x2100
movq %r12, %rdi
callq 0x3820
movq %rbp, %rdi
leaq 0x2551(%rip), %rsi      # 0x61b6
callq 0x21d0
movq %rax, %rdi
imulq $0x64, 0x10(%r12), %rax
xorl %edx, %edx
divq 0x18(%rsp)
movq %rax, %rsi
callq 0x2130
movq %rax, %rdi
leaq 0x2540(%rip), %rsi      # 0x61cc
callq 0x21d0
movq %rax, %rdi
callq 0x2100
movq %rax, %rdi
leaq 0x252b(%rip), %rsi      # 0x61ce
callq 0x21d0
movq 0x8(%r12), %rsi
movq %rax, %rdi
callq 0x2130
movq %rax, %rdi
callq 0x2100
movq %rax, %rdi
leaq 0x2515(%rip), %rsi      # 0x61dc
callq 0x21d0
movq %rax, %rdi
movq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0x2130
movq %rax, %rdi
leaq 0x250b(%rip), %rsi      # 0x61f1
callq 0x21d0
movq %rax, %rdi
movq %r15, %rsi
callq 0x2130
movq %rax, %rdi
callq 0x2100
cmpq $0x1, 0x8(%r12)
jne 0x3d22
movq %rbp, %rdi
leaq 0x24e3(%rip), %rsi      # 0x61f3
callq 0x21d0
movq %rax, %rdi
callq 0x2100
callq 0x2260
movq %r13, %rdi
movq %r12, %rsi
callq 0x3592
movq %r12, %rdi
movq %r13, %rsi
callq 0x33b8
movq %r13, %rdi
callq 0x33aa
movl 0xc(%rsp), %edi
callq 0x2270
jmp 0x3bd1
leaq 0x28(%rsp), %rdi
callq 0x33aa
movq 0x6271(%rip), %rdi      # 0x9fd0
leaq 0x24c2(%rip), %rsi      # 0x6228
callq 0x21d0
movq %rax, %rdi
callq 0x2100
movq %rax, %rdi
callq 0x2100
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3592
movq %rbx, %rdi
callq 0x3820
leaq 0x28(%rsp), %rdi
callq 0x33aa
movq 0x622c(%rip), %rdi      # 0x9fd0
leaq 0x24c5(%rip), %rsi      # 0x6270
callq 0x21d0
movq 0x8(%r12), %rsi
movq %rax, %rdi
callq 0x2130
leaq 0x24ca(%rip), %rsi      # 0x628e
movq %rax, %rdi
callq 0x21d0
movq %rax, %rdi
callq 0x2100
movq 0x10(%r12), %rsi
movq 0x61f0(%rip), %rdi      # 0x9fd0
testq %rsi, %rsi
je 0x3df6
callq 0x2130
leaq 0x24e9(%rip), %rsi      # 0x62da
movq %rax, %rdi
jmp 0x3dfd
leaq 0x249f(%rip), %rsi      # 0x629c
callq 0x21d0
movq %rax, %rdi
callq 0x2100
movq 0x61bf(%rip), %rbx      # 0x9fd0
leaq 0x24df(%rip), %r14      # 0x62f7
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21d0
movq %rax, %rdi
imulq $0x64, 0x10(%r12), %rax
xorl %edx, %edx
movq 0x18(%rsp), %rbp
divq %rbp
movq %rax, %rsi
callq 0x2130
leaq 0x24ca(%rip), %r13      # 0x630f
movq %rax, %rdi
movq %r13, %rsi
callq 0x21d0
movq %rax, %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x2100
leaq 0x24b2(%rip), %rsi      # 0x6319
movq %rax, %rdi
callq 0x21d0
movq %rax, %rdi
callq 0x2100
leaq 0x24b8(%rip), %rsi      # 0x6336
movq %rbx, %rdi
callq 0x21d0
movq 0x30(%r12), %rsi
movq %rax, %rdi
callq 0x2130
leaq 0x238c(%rip), %rsi      # 0x6226
movq %rax, %rdi
callq 0x21d0
movq %rax, %rdi
callq 0x2100
leaq 0x2499(%rip), %rsi      # 0x634a
movq %rbx, %rdi
callq 0x21d0
movq %rax, %rdi
movq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0x2130
leaq 0x2321(%rip), %rsi      # 0x61f1
movq %rax, %rdi
callq 0x21d0
movq %rax, %rdi
movq %r15, %rsi
callq 0x2130
leaq 0x246c(%rip), %rsi      # 0x6356
movq %rax, %rdi
callq 0x21d0
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2130
leaq 0x246c(%rip), %rsi      # 0x6370
movq %rax, %rdi
callq 0x21d0
movq %rax, %rdi
callq 0x2100
leaq 0x245f(%rip), %rsi      # 0x637a
movq %rbx, %rdi
callq 0x21d0
movq %rax, %rdi
movq 0x20(%rsp), %r15
movq %r15, %rsi
callq 0x2130
leaq 0x2446(%rip), %rsi      # 0x6380
movq %rax, %rdi
callq 0x21d0
movq %rbp, %rsi
subq %r15, %rsi
movq %rax, %rdi
callq 0x2130
leaq 0x244c(%rip), %rsi      # 0x63a3
movq %rax, %rdi
callq 0x21d0
movq %rax, %rdi
callq 0x2100
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21d0
movq %rax, %rdi
imulq $0x64, %r15, %rax
xorl %edx, %edx
divq %rbp
movq %rax, %rsi
callq 0x2130
movq %rax, %rdi
movq %r13, %rsi
callq 0x21d0
movq %rax, %rdi
callq 0x2100
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3fd2
jmp 0x3fd2
jmp 0x3fd2
movq %rax, %rbx
jmp 0x3fc6
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x33aa
leaq 0x68(%rsp), %rdi
callq 0x33aa
jmp 0x3fd5
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x33aa
movq %rbx, %rdi
callq 0x22c0