// File: /workspace/github_c_makefile_star2_O2/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, %rbx
movq %rdi, 0x20(%rsp)
leaq 0x3689(%rip), %rdi      # 0x55f5
leaq 0x37e5(%rip), %rsi      # 0x5758
callq 0x1120
testq %rax, %rax
je 0x2114
movq %rax, %r15
addq $0x10, %rbx
movq %rbx, 0x18(%rsp)
leaq 0x3(%rsp), %r13
leaq 0x3234(%rip), %r14      # 0x51cd
leaq 0x14(%rsp), %rbx
movq %r15, %rdi
callq 0x10f0
testl %eax, %eax
jne 0x20fd
movq 0x20(%rsp), %r12
xorl %eax, %eax
cmpq $0x1e, %rax
je 0x2019
movq %rax, 0x8(%rsp)
pushq $0x4
popq %rbp
cmpq $0x2d4, %rbp            # imm = 0x2D4
je 0x2008
movq %r15, %rdi
leaq 0x3748(%rip), %rsi      # 0x571e
movq %r13, %rdx
xorl %eax, %eax
callq 0x1060
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1060
movsbl 0x3(%rsp), %eax
movl %eax, (%r12,%rbp)
movl 0x14(%rsp), %eax
movl %eax, -0x4(%r12,%rbp)
addq $0xc, %rbp
jmp 0x1fc3
movq 0x8(%rsp), %rax
incq %rax
addq $0x2d0, %r12            # imm = 0x2D0
jmp 0x1fb5
movq %r15, %rdi
leaq 0x30d6(%rip), %rsi      # 0x50f9
leaq 0x4(%rsp), %rdx
xorl %eax, %eax
callq 0x1060
movl 0x4(%rsp), %esi
leaq 0x3569(%rip), %rdi      # 0x55a3
xorl %eax, %eax
callq 0x10a0
movl 0x4(%rsp), %edi
callq 0x2dd3
movq 0x18(%rsp), %r12
xorl %ecx, %ecx
movslq 0x4(%rsp), %rax
cmpq %rax, %rcx
jge 0x1f9e
movq %r15, %rdi
leaq 0x3090(%rip), %rbp      # 0x50f9
movq %rbp, %rsi
movq %r13, %rdx
xorl %eax, %eax
movq %rcx, 0x8(%rsp)
callq 0x1060
movsbl 0x3(%rsp), %eax
movl %eax, -0x10(%r12)
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x1060
movsbl 0x3(%rsp), %eax
movl %eax, -0xc(%r12)
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x1060
movsbl 0x3(%rsp), %eax
movl %eax, -0x8(%r12)
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x1060
movsbl 0x3(%rsp), %eax
movl %eax, -0x4(%r12)
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x1060
movq 0x8(%rsp), %rcx
movsbl 0x3(%rsp), %eax
movl %eax, (%r12)
incq %rcx
addq $0x14, %r12
jmp 0x2051
movq %r15, %rdi
callq 0x1080
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3546(%rip), %rdi      # 0x5661
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1070