// File: /workspace/github_cpp_makefile_star2_O2/massykezzoul[P]jeu-de-la-vie/population/population.cpp
// Function: Population::Population(int, char const**)
Population::Population(int argc,const char** argv)
	:T(new Cellule[1]),generation(1),alive(0),alloc(1),probability(0.25),dimension(10),graine(0),speed(100000) {
	Option_tab tableau;
	int i = 1;
	int j = -1;
	float proba = -1;
	int dimension = -1;
	int speed = -1;
	string config = "";

	while (i < argc) {
		j = -1;
		if (tableau.is_nom(argv[i])) {
			// Est une option avec son nom long spécifié
			j = tableau.get_option(tableau.cherche(&argv[i][2]));
		} else if (tableau.is_raccourci(argv[i])) {
			// Est une option avec son raccourci spécifié
			j = tableau.get_option(tableau.cherche(argv[i][1]));
		}

		switch (j) {
			case 0:
				/* help */
				affiche_help();
				exit(0);
				break;
			case 1:
				/* version */
				affiche_version();
				exit(0);
				break;
			case 2:
				/* dimension */
				if ( (i + 1 < argc)  &&  (argv[i+1][0] != '-') ) {
					++i; // passe à l'argument de l'option
					dimension = strtod(argv[i],NULL); // recupere l'entier
				} else {
					cerr << "Argument manquant pour '" << argv[i] <<"'"
						<< endl;
				}	
				break;
			case 3:
				/* config */
				if ((i + 1 < argc)  &&  (argv[i+1][0] != '-')) {
					++i; // passe à l'argument de l'option
					config = argv[i]; // recupere la chaine
				} else {
					cerr << "Argument manquant pour '" << argv[i] <<"'"
						<< endl;
				}	
				break;
			case 4:
				/* probability */
				if ((i + 1 < argc)  &&  (argv[i+1][0] != '-')) {
					++i; // passe à l'argument de l'option
					proba = strtod(argv[i],NULL); // recupere l'entier
				} else {
					cerr << "Argument manquant pour '" << argv[i] <<"'"
						<< endl;
				}	
				break;
			case 5:
				/* speed */
				if ((i + 1 < argc)  &&  (argv[i+1][0] != '-')) {
					++i; // passe à l'argument de l'option
					speed = strtod(argv[i],NULL); // recupere l'entier
				} else {
					cerr << "Argument manquant pour '" << argv[i] <<"'"
						<< endl;
				}	
				break;
			default:
				cerr << "L'option \"" << argv[i] 
					<< "\" n'existe pas" << endl;
				break;
			}
			++i;
	}

	if (config != "") {
		// Initialisation avec un fichier de configuration
		string ligne,cle,valeur;
		ifstream file(config.c_str());
		if(file) {
			while (getline(file,ligne))
				if ( extraire_cle_valeur(ligne,cle,valeur) )
					set_cle_valeur(*this,cle,valeur);
		} else
			cerr << "Lecture du fichier de configuration impossible" << endl;
	}

	if (proba != -1) set_probability(proba);
	if (dimension != -1) set_dimension(dimension);
	if (speed != -1) set_speed(speed);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x688, %rsp            # imm = 0x688
movq %rdx, 0x10(%rsp)
movl %esi, 0xc(%rsp)
movq %rdi, %rbx
pushq $0x20
popq %rdi
callq 0x2030
movq %rax, %r15
movq %rax, %rdi
callq 0x4462
movq %r15, (%rbx)
pushq $0x1
popq %rax
movq %rax, 0x8(%rbx)
andq $0x0, 0x10(%rbx)
movq %rax, 0x18(%rbx)
movl $0x3e800000, 0x20(%rbx) # imm = 0x3E800000
movq $0xa, 0x28(%rbx)
andq $0x0, 0x30(%rbx)
movq %rbx, 0x30(%rsp)
movl $0x186a0, 0x38(%rbx)    # imm = 0x186A0
leaq 0x360(%rsp), %rdi
callq 0x4fe8
leaq 0x342f(%rip), %rsi      # 0x60aa
leaq 0x38(%rsp), %rdi
leaq 0x158(%rsp), %rdx
callq 0x42a2
pushq $-0x1
popq %rax
movss 0x336c(%rip), %xmm0     # 0x6004
movss %xmm0, 0x1c(%rsp)
pushq $0x1
popq %r15
leaq 0x158(%rsp), %r12
leaq 0x360(%rsp), %r13
leaq 0x118(%rsp), %r14
movl %eax, 0x18(%rsp)
movl %eax, 0x2c(%rsp)
cmpl 0xc(%rsp), %r15d
jge 0x2f00
movq %r15, %rax
movq %r13, %rbp
movslq %eax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x20(%rsp)
movq (%rax,%rcx,8), %rsi
movq %r12, %rdx
leaq 0x138(%rsp), %r13
movq %r13, %rdi
callq 0x42a2
movq %rbp, %rdi
movq %r13, %rsi
callq 0x563e
movl %eax, %ebx
movq %r13, %rdi
callq 0x20e0
testb %bl, %bl
je 0x2d53
movq 0x10(%rsp), %rax
movq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
addq $0x2, %rsi
movq %r12, %rdi
leaq 0x78(%rsp), %rdx
callq 0x42a2
movq %rbp, %r13
movq %rbp, %rdi
movq %r12, %rsi
callq 0x55b2
movq %r13, %rdi
movl %eax, %esi
callq 0x554c
movl %eax, %ebx
movq %r12, %rdi
callq 0x20e0
jmp 0x2dae
movq 0x10(%rsp), %rax
movq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
movq %r14, %rdi
movq %r12, %rdx
callq 0x42a2
movq %rbp, %r13
movq %rbp, %rdi
movq %r14, %rsi
callq 0x56aa
movl %eax, %ebx
movq %r14, %rdi
callq 0x20e0
testb %bl, %bl
je 0x2dfc
movq 0x10(%rsp), %rax
movq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %esi
movq %r13, %rdi
callq 0x561c
movq %r13, %rdi
movl %eax, %esi
callq 0x554c
movl %eax, %ebx
cmpl $0x5, %ebx
ja 0x2dfc
movl %ebx, %eax
leaq 0x3254(%rip), %rcx      # 0x6010
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leal 0x1(%r15), %ebx
cmpl 0xc(%rsp), %ebx
jge 0x2ea9
movslq %ebx, %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
cmpb $0x2d, (%rdi)
je 0x2ea9
xorl %esi, %esi
callq 0x2170
cvttsd2si %xmm0, %eax
movl %eax, 0x18(%rsp)
jmp 0x2e89
movq 0x71ed(%rip), %rdi      # 0x9ff0
leaq 0x32ba(%rip), %rsi      # 0x60c4
callq 0x21d0
movq 0x10(%rsp), %rcx
movq 0x20(%rsp), %rdx
movq (%rcx,%rdx,8), %rsi
movq %rax, %rdi
callq 0x21d0
leaq 0x32a3(%rip), %rsi      # 0x60cf
jmp 0x2ed9
leal 0x1(%r15), %ebx
cmpl 0xc(%rsp), %ebx
jge 0x2ea9
movslq %ebx, %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
cmpb $0x2d, (%rdi)
je 0x2ea9
xorl %esi, %esi
callq 0x2170
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x1c(%rsp)
jmp 0x2e89
leal 0x1(%r15), %ebx
cmpl 0xc(%rsp), %ebx
jge 0x2ea9
movslq %ebx, %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
cmpb $0x2d, (%rdi)
je 0x2ea9
xorl %esi, %esi
callq 0x2170
cvttsd2si %xmm0, %eax
movl %eax, 0x2c(%rsp)
movl %ebx, %r15d
jmp 0x2ee9
leal 0x1(%r15), %ebx
cmpl 0xc(%rsp), %ebx
jge 0x2ea9
movslq %ebx, %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x2ef1
movq 0x7140(%rip), %rdi      # 0x9ff0
leaq 0x31f4(%rip), %rsi      # 0x60ab
callq 0x21d0
movq 0x10(%rsp), %rcx
movq 0x20(%rsp), %rdx
movq (%rcx,%rdx,8), %rsi
movq %rax, %rdi
callq 0x21d0
leaq 0x31e9(%rip), %rsi      # 0x60c2
movq %rax, %rdi
callq 0x21d0
movq %rax, %rdi
callq 0x2100
incl %r15d
jmp 0x2cc2
leaq 0x38(%rsp), %rdi
callq 0x22f0
movl %ebx, %r15d
jmp 0x2ee9
leaq 0x31a3(%rip), %rsi      # 0x60aa
leaq 0x38(%rsp), %rdi
callq 0x42dd
testb %al, %al
je 0x2fc9
leaq 0x88(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
leaq 0x68(%rsp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
leaq 0xa8(%rsp), %rsi
movq %rsi, -0x10(%rsi)
andq $0x0, -0x8(%rsi)
movb %cl, (%rax)
movb %cl, (%rdx)
movb %cl, (%rsi)
movq 0x38(%rsp), %rsi
leaq 0x158(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x22e0
movq 0x158(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x178(%rsp,%rax)
je 0x3039
movq 0x7069(%rip), %rdi      # 0x9ff0
leaq 0x3150(%rip), %rsi      # 0x60de
callq 0x21d0
movq %rax, %rdi
callq 0x2100
leaq 0x158(%rsp), %rdi
callq 0x2070
leaq 0x98(%rsp), %rdi
callq 0x20e0
leaq 0x58(%rsp), %rdi
callq 0x20e0
leaq 0x78(%rsp), %rdi
callq 0x20e0
movss 0x1c(%rsp), %xmm0
ucomiss 0x302e(%rip), %xmm0     # 0x6004
jne 0x2fda
jnp 0x2fea
movq 0x30(%rsp), %rdi
movss 0x1c(%rsp), %xmm0
callq 0x3224
cmpl $-0x1, 0x18(%rsp)
je 0x3000
movslq 0x18(%rsp), %rsi
movq 0x30(%rsp), %rdi
callq 0x3280
movl 0x2c(%rsp), %ecx
testl %ecx, %ecx
js 0x3010
movq 0x30(%rsp), %rax
movl %ecx, 0x38(%rax)
leaq 0x38(%rsp), %rdi
callq 0x20e0
leaq 0x360(%rsp), %rdi
callq 0x42e8
addq $0x688, %rsp            # imm = 0x688
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x78(%rsp), %r14
leaq 0xf8(%rsp), %r15
leaq 0x98(%rsp), %r13
leaq 0xd8(%rsp), %rbp
leaq 0xb8(%rsp), %rbx
leaq 0x158(%rsp), %rdi
movq %r14, %rsi
callq 0x2040
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2f9b
movq %r15, %rdi
movq %r14, %rsi
callq 0x2250
movq %r15, %rdi
leaq 0x58(%rsp), %rsi
movq %r13, %rdx
callq 0x48dc
movl %eax, %r12d
movq %r15, %rdi
callq 0x20e0
testb %r12b, %r12b
je 0x305e
movq %rbp, %rdi
leaq 0x58(%rsp), %rsi
callq 0x2250
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2250
movq 0x30(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x4ad7
movq %rbx, %rdi
callq 0x20e0
movq %rbp, %rdi
callq 0x20e0
jmp 0x305e
callq 0x31d2
jmp 0x30f4
callq 0x3206
xorl %edi, %edi
callq 0x2200
movq %rax, %rbx
jmp 0x3160
jmp 0x3150
movq %rax, %rbx
jmp 0x31bd
movq %rax, %rbx
pushq $0x20
popq %rsi
movq %r15, %rdi
callq 0x2300
jmp 0x31ca
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x20e0
jmp 0x3132
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
jmp 0x3147
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x20e0
jmp 0x3153
jmp 0x31b0
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
callq 0x2070
leaq 0x98(%rsp), %rdi
callq 0x20e0
leaq 0x58(%rsp), %rdi
callq 0x20e0
leaq 0x78(%rsp), %rdi
jmp 0x31a7
jmp 0x31b0
jmp 0x31b0
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
jmp 0x31a7
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
jmp 0x31a7
movq %rax, %rbx
leaq 0x138(%rsp), %rdi
callq 0x20e0
jmp 0x31b3
jmp 0x31b0
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x20e0
leaq 0x360(%rsp), %rdi
callq 0x42e8
movq %rbx, %rdi
callq 0x22c0