// File: 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
movq %rsp, %rbp
subq $0x1f0, %rsp            # imm = 0x1F0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x58e0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x59e0
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x5a20
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x190(%rbp)
leaq -0x60(%rbp), %rdi
movq %rdi, -0x188(%rbp)
callq 0x5590
movq -0x190(%rbp), %rdi
movq -0x188(%rbp), %rsi
movb $0x0, -0xf1(%rbp)
movb $0x0, -0xf2(%rbp)
callq 0x38d0
movb %al, -0x179(%rbp)
jmp 0x5fb9
movb -0x179(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x191(%rbp)
jne 0x5fce
jmp 0x6033
movq -0x8(%rbp), %rsi
movq %rsi, -0x1a0(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x5590
jmp 0x5fe7
movb $0x1, -0xf1(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x5590
jmp 0x6003
movq -0x1a0(%rbp), %rdi
movb $0x1, -0xf2(%rbp)
leaq -0xb0(%rbp), %rsi
callq 0x38d0
movb %al, -0x1a1(%rbp)
jmp 0x6025
movb -0x1a1(%rbp), %al
movb %al, -0x191(%rbp)
jmp 0x6033
movb -0x191(%rbp), %al
movb %al, -0x1a2(%rbp)
testb $0x1, -0xf2(%rbp)
jne 0x604a
jmp 0x6056
leaq -0xb0(%rbp), %rdi
callq 0x5230
testb $0x1, -0xf1(%rbp)
jne 0x6061
jmp 0x606d
leaq -0xf0(%rbp), %rdi
callq 0x5230
leaq -0x60(%rbp), %rdi
callq 0x5230
movb -0x1a2(%rbp), %al
testb $0x1, %al
jne 0x6085
jmp 0x62a6
movq 0x7f44(%rip), %rdi      # 0xdfd0
leaq 0x4109(%rip), %rsi      # 0xa19c
callq 0x3250
movq %rax, %rdi
movq 0x7f1e(%rip), %rsi      # 0xdfc0
callq 0x3270
movq %rax, %rdi
movq 0x7f0f(%rip), %rsi      # 0xdfc0
callq 0x3270
movq -0x8(%rbp), %rdi
callq 0x5a90
movq 0x7f0a(%rip), %rdi      # 0xdfd0
leaq 0x40f1(%rip), %rsi      # 0xa1be
callq 0x3250
movq %rax, -0x1b8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x58e0
movq -0x1b8(%rbp), %rdi
imulq $0x64, %rax, %rax
movq -0x18(%rbp), %rcx
imulq -0x18(%rbp), %rcx
xorl %edx, %edx
divq %rcx
movq %rax, %rsi
callq 0x30a0
movq %rax, %rdi
leaq 0x40c7(%rip), %rsi      # 0xa1d4
callq 0x3250
movq %rax, %rdi
movq 0x7ea4(%rip), %rsi      # 0xdfc0
callq 0x3270
movq %rax, %rdi
leaq 0x40ab(%rip), %rsi      # 0xa1d6
callq 0x3250
movq %rax, -0x1b0(%rbp)
movq -0x8(%rbp), %rdi
callq 0x59a0
movq -0x1b0(%rbp), %rdi
movq %rax, %rsi
callq 0x30a0
movq %rax, %rdi
movq 0x7e67(%rip), %rsi      # 0xdfc0
callq 0x3270
movq %rax, %rdi
leaq 0x407c(%rip), %rsi      # 0xa1e4
callq 0x3250
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x30a0
movq %rax, %rdi
leaq 0x4076(%rip), %rsi      # 0xa1f9
callq 0x3250
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x30a0
movq %rax, %rdi
movq 0x7e22(%rip), %rsi      # 0xdfc0
callq 0x3270
movq -0x8(%rbp), %rdi
callq 0x59a0
cmpq $0x1, %rax
jne 0x6247
movq 0x7e13(%rip), %rdi      # 0xdfd0
leaq 0x4037(%rip), %rsi      # 0xa1fb
callq 0x3250
movq %rax, %rdi
movq 0x7ded(%rip), %rsi      # 0xdfc0
callq 0x3270
callq 0x3360
jmp 0x6247
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x6239
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x6220
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
testb $0x1, -0xf2(%rbp)
jne 0x6212
jmp 0x621e
leaq -0xb0(%rbp), %rdi
callq 0x5230
jmp 0x6220
testb $0x1, -0xf1(%rbp)
jne 0x622b
jmp 0x6237
leaq -0xf0(%rbp), %rdi
callq 0x5230
jmp 0x6239
leaq -0x60(%rbp), %rdi
callq 0x5230
jmp 0x65f9
movq -0x8(%rbp), %rsi
leaq -0x138(%rbp), %rdi
movq %rdi, -0x1c0(%rbp)
callq 0x5590
movq -0x1c0(%rbp), %rsi
movq -0x8(%rbp), %rdi
callq 0x5260
jmp 0x6270
leaq -0x138(%rbp), %rdi
callq 0x5230
movl -0x1c(%rbp), %edi
callq 0x3370
jmp 0x5f75
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x5230
jmp 0x65f9
movq 0x7d23(%rip), %rdi      # 0xdfd0
leaq 0x3f7c(%rip), %rsi      # 0xa230
callq 0x3250
movq %rax, %rdi
movq 0x7cfd(%rip), %rsi      # 0xdfc0
movq %rsi, -0x1d0(%rbp)
callq 0x3270
movq -0x1d0(%rbp), %rsi
movq %rax, %rdi
callq 0x3270
movq -0x8(%rbp), %rsi
leaq -0x178(%rbp), %rdi
movq %rdi, -0x1c8(%rbp)
callq 0x5590
movq -0x1c8(%rbp), %rdi
callq 0x5a90
jmp 0x6303
leaq -0x178(%rbp), %rdi
callq 0x5230
movq 0x7cba(%rip), %rdi      # 0xdfd0
leaq 0x3f5b(%rip), %rsi      # 0xa278
callq 0x3250
movq %rax, -0x1d8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x59a0
movq -0x1d8(%rbp), %rdi
movq %rax, %rsi
callq 0x30a0
movq %rax, %rdi
leaq 0x3f4b(%rip), %rsi      # 0xa296
callq 0x3250
movq %rax, %rdi
movq 0x7c66(%rip), %rsi      # 0xdfc0
callq 0x3270
movq -0x8(%rbp), %rdi
callq 0x58e0
cmpq $0x0, %rax
jne 0x63af
movq 0x7c5b(%rip), %rdi      # 0xdfd0
leaq 0x3f28(%rip), %rsi      # 0xa2a4
callq 0x3250
movq %rax, %rdi
movq 0x7c35(%rip), %rsi      # 0xdfc0
callq 0x3270
jmp 0x63e5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x5230
jmp 0x65f9
movq -0x8(%rbp), %rdi
callq 0x58e0
movq %rax, %rsi
movq 0x7c0e(%rip), %rdi      # 0xdfd0
callq 0x30a0
movq %rax, %rdi
leaq 0x3f11(%rip), %rsi      # 0xa2e2
callq 0x3250
movq %rax, %rdi
movq 0x7be0(%rip), %rsi      # 0xdfc0
callq 0x3270
movq 0x7be4(%rip), %rdi      # 0xdfd0
leaq 0x3f0c(%rip), %rsi      # 0xa2ff
callq 0x3250
movq %rax, -0x1e8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x58e0
movq -0x1e8(%rbp), %rdi
imulq $0x64, %rax, %rax
movq -0x18(%rbp), %rcx
imulq -0x18(%rbp), %rcx
xorl %edx, %edx
divq %rcx
movq %rax, %rsi
callq 0x30a0
movq %rax, %rdi
leaq 0x3ee4(%rip), %rsi      # 0xa317
callq 0x3250
movq %rax, %rdi
movq 0x7b7e(%rip), %rsi      # 0xdfc0
callq 0x3270
movq 0x7b82(%rip), %rdi      # 0xdfd0
movq 0x7b6b(%rip), %rsi      # 0xdfc0
callq 0x3270
movq %rax, %rdi
leaq 0x3ebd(%rip), %rsi      # 0xa321
callq 0x3250
movq %rax, %rdi
movq 0x7b4d(%rip), %rsi      # 0xdfc0
callq 0x3270
movq 0x7b51(%rip), %rdi      # 0xdfd0
leaq 0x3eb8(%rip), %rsi      # 0xa33e
callq 0x3250
movq %rax, -0x1e0(%rbp)
movq -0x8(%rbp), %rdi
callq 0x59c0
movq -0x1e0(%rbp), %rdi
movq %rax, %rsi
callq 0x30a0
movq %rax, %rdi
leaq 0x3d7a(%rip), %rsi      # 0xa22e
callq 0x3250
movq %rax, %rdi
movq 0x7afd(%rip), %rsi      # 0xdfc0
callq 0x3270
movq 0x7b01(%rip), %rdi      # 0xdfd0
leaq 0x3e7c(%rip), %rsi      # 0xa352
callq 0x3250
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x30a0
movq %rax, %rdi
leaq 0x3d08(%rip), %rsi      # 0xa1f9
callq 0x3250
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0x30a0
movq %rax, %rdi
leaq 0x3e52(%rip), %rsi      # 0xa35e
callq 0x3250
movq %rax, %rdi
movq -0x18(%rbp), %rsi
imulq -0x18(%rbp), %rsi
callq 0x30a0
movq %rax, %rdi
leaq 0x3e4c(%rip), %rsi      # 0xa378
callq 0x3250
movq %rax, %rdi
movq 0x7a85(%rip), %rsi      # 0xdfc0
callq 0x3270
movq 0x7a89(%rip), %rdi      # 0xdfd0
leaq 0x3e34(%rip), %rsi      # 0xa382
callq 0x3250
movq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0x30a0
movq %rax, %rdi
leaq 0x3e1f(%rip), %rsi      # 0xa388
callq 0x3250
movq %rax, %rdi
movq -0x18(%rbp), %rsi
imulq -0x18(%rbp), %rsi
subq -0x10(%rbp), %rsi
callq 0x30a0
movq %rax, %rdi
leaq 0x3e1e(%rip), %rsi      # 0xa3ab
callq 0x3250
movq %rax, %rdi
movq 0x7a24(%rip), %rsi      # 0xdfc0
callq 0x3270
movq 0x7a28(%rip), %rdi      # 0xdfd0
leaq 0x3d50(%rip), %rsi      # 0xa2ff
callq 0x3250
movq %rax, %rdi
imulq $0x64, -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
imulq -0x18(%rbp), %rcx
xorl %edx, %edx
divq %rcx
movq %rax, %rsi
callq 0x30a0
movq %rax, %rdi
leaq 0x3d3b(%rip), %rsi      # 0xa317
callq 0x3250
movq %rax, %rdi
movq 0x79d5(%rip), %rsi      # 0xdfc0
callq 0x3270
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x33f0
nopw %cs:(%rax,%rax)