// File: /workspace/github_c_makefile_star2_O1/j4r0g[P]Projet_Labyrinthe/fonctions/utilisateur.c
// Function: charger_lab
void charger_lab(t_lab lab[X][Y], t_fourmi fourmi[]){
	FILE * fic2;
	char tmp;
	int seen;
	int nb_ins;
	int i,j;
	fic2 = fopen("SAVED_GAME", "r");
	if(fic2 == 0){
		printf("Pas de partie sauvegardee.\n\n");
	}
	else{
		while(!feof(fic2))
		{
			for(i =0; i<X; i++){
				for(j =0; j<Y; j++){
					fscanf(fic2, "%c", &tmp);
					fscanf(fic2, "%d", &seen);
					lab[i][j].etat = tmp;
					lab[i][j].decouvert = seen;

				}
			}
			fscanf(fic2, "%i ", &nb_ins);
			printf("%i", nb_ins);
			chang_nb_ins(nb_ins);
			for(i = 0; i<nb_ins; i++){
				fscanf(fic2, "%i ", &tmp);
				fourmi[i].sexe = tmp;
				fscanf(fic2, "%i ", &tmp);
				fourmi[i].nourriture = tmp;
				fscanf(fic2, "%i ", &tmp);
				fourmi[i].age = tmp;
				fscanf(fic2, "%i ", &tmp);
				fourmi[i].x = tmp;
				fscanf(fic2, "%i ", &tmp);
				fourmi[i].y = tmp;
			}
		}
		fclose(fic2);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, 0x10(%rsp)
movq %rdi, 0x18(%rsp)
leaq 0x45d4(%rip), %rdi      # 0x65f5
leaq 0x4730(%rip), %rsi      # 0x6758
callq 0x1120
testq %rax, %rax
je 0x21e1
movq %rax, %r15
movq %rax, %rdi
callq 0x10f0
testl %eax, %eax
jne 0x21ca
addq $0x10, 0x10(%rsp)
leaq 0x46c8(%rip), %rcx      # 0x671e
xorl %edx, %edx
movq %rdx, 0x20(%rsp)
imulq $0x2d0, %rdx, %rbp      # imm = 0x2D0
addq 0x18(%rsp), %rbp
movl $0x4, %r12d
leaq 0xc(%rsp), %r13
leaq 0x7(%rsp), %r14
movq %r15, %rdi
movq %rcx, %rbx
movq %rcx, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x1060
movq %r15, %rdi
leaq 0x4137(%rip), %rsi      # 0x61cd
movq %r13, %rdx
xorl %eax, %eax
callq 0x1060
movq %rbx, %rcx
movsbl 0x7(%rsp), %eax
movl %eax, (%rbp,%r12)
movl 0xc(%rsp), %eax
movl %eax, -0x4(%rbp,%r12)
addq $0xc, %r12
cmpq $0x2d4, %r12            # imm = 0x2D4
jne 0x2079
movq 0x20(%rsp), %rdx
incq %rdx
cmpq $0x1e, %rdx
jne 0x2058
movq %r15, %rdi
leaq 0x401e(%rip), %r13      # 0x60f9
movq %r13, %rsi
leaq 0x8(%rsp), %rdx
xorl %eax, %eax
callq 0x1060
movl 0x8(%rsp), %esi
leaq 0x44ae(%rip), %rdi      # 0x65a3
xorl %eax, %eax
callq 0x10a0
movl 0x8(%rsp), %edi
callq 0x2e5b
cmpl $0x0, 0x8(%rsp)
leaq 0x7(%rsp), %r14
jle 0x21b2
movq 0x10(%rsp), %r12
xorl %ebp, %ebp
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x1060
movsbl 0x7(%rsp), %eax
movl %eax, -0x10(%r12)
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x1060
movsbl 0x7(%rsp), %eax
movl %eax, -0xc(%r12)
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x1060
movsbl 0x7(%rsp), %eax
movl %eax, -0x8(%r12)
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x1060
movsbl 0x7(%rsp), %eax
movl %eax, -0x4(%r12)
movq %r15, %rdi
movq %r13, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x1060
movsbl 0x7(%rsp), %eax
movl %eax, (%r12)
incq %rbp
movslq 0x8(%rsp), %rax
addq $0x14, %r12
cmpq %rax, %rbp
jl 0x211c
movq %r15, %rdi
callq 0x10f0
movl $0x0, %edx
testl %eax, %eax
movq %rbx, %rcx
je 0x2058
movq %r15, %rdi
callq 0x1080
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4479(%rip), %rdi      # 0x6661
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1070