// File: /workspace/github_c_makefile_star2_O0/j4r0g[P]Projet_Labyrinthe/./main.c
// Function: lancement
int lancement() {
	int i, vic, res=5;
	int bouffe=10;
	int dureevie=30;
	int nb_ins;
	int posx;
	int posy;


	init_lab_rand(lab);							//Initialise le labyrinthe

	gene_ins_deb(bouffe, dureevie, lab, fourmi);//Génération des insectes de départ

	gene_nour(lab); 							//Génération de chaque case de nourriture

	decouvrir(lab);								//Cette fonction actualise la découverte du labyrinthe

	afficher_stats(lab, fourmi);
	afficher_lab(lab, fourmi);					//Cette fonction affiche le labyrinthe


	vic=verif_victoire(lab);						//Cette fonction vérifie si on est en situation de victoire (labyrinthe découvert)

	while(vic==0){
		res=action_user(lab, bouffe, dureevie, fourmi);
		if(res==0) return 1;
		nb_ins=nb_insecte();

		for(i=nb_ins-1; i>=0; i--) {					//Cette boucle gère le déplacement des insectes
			posx=fourmi[i].x;
			posy=fourmi[i].y;
			if(posx>=0 && posx<X && posy>=0 && posy<Y && lab[posx][posy].etat==insecte) {
				deplacement(lab, posx, posy, fourmi, bouffe, dureevie);
				decouvrir(lab);
			}
		}
		afficher_stats(lab, fourmi);
		afficher_lab(lab, fourmi);
		vic=verif_victoire(lab);
	}

	if(vic==1)
	printf("Vous avez gagné\n");
	else if(vic==2)
	printf("Vous avez perdu\n");
	else
	printf("Erreur au niveau du lancement\n");
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x5, -0x10(%rbp)
movl $0xa, -0x14(%rbp)
movl $0x1e, -0x18(%rbp)
leaq 0xbcfc(%rip), %rdi      # 0xe0e0
callq 0x1700
movl -0x14(%rbp), %edi
movl -0x18(%rbp), %esi
leaq 0xbcea(%rip), %rdx      # 0xe0e0
leaq 0x11143(%rip), %rcx     # 0x13540
callq 0x47c0
leaq 0xbcd7(%rip), %rdi      # 0xe0e0
callq 0x2090
leaq 0xbccb(%rip), %rdi      # 0xe0e0
callq 0x3120
leaq 0xbcbf(%rip), %rdi      # 0xe0e0
leaq 0x11118(%rip), %rsi     # 0x13540
callq 0x1270
leaq 0xbcac(%rip), %rdi      # 0xe0e0
leaq 0x11105(%rip), %rsi     # 0x13540
callq 0x1b40
leaq 0xbc99(%rip), %rdi      # 0xe0e0
callq 0x21f0
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x2589
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
leaq 0xbc7a(%rip), %rdi      # 0xe0e0
leaq 0x110d3(%rip), %rcx     # 0x13540
callq 0x2b90
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jne 0x2487
movl $0x1, -0x4(%rbp)
jmp 0x25cc
movb $0x0, %al
callq 0x4590
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
jl 0x254f
movslq -0x8(%rbp), %rcx
leaq 0x11091(%rip), %rax     # 0x13540
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, -0x20(%rbp)
movslq -0x8(%rbp), %rcx
leaq 0x11079(%rip), %rax     # 0x13540
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x20(%rbp)
jl 0x253f
cmpl $0x1e, -0x20(%rbp)
jge 0x253f
cmpl $0x0, -0x24(%rbp)
jl 0x253f
cmpl $0x3c, -0x24(%rbp)
jge 0x253f
movslq -0x20(%rbp), %rcx
leaq 0xbbe9(%rip), %rax      # 0xe0e0
imulq $0x2d0, %rcx, %rcx      # imm = 0x2D0
addq %rcx, %rax
movslq -0x24(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
cmpl $0x25, 0x4(%rax)
jne 0x253f
movl -0x20(%rbp), %esi
movl -0x24(%rbp), %edx
movl -0x14(%rbp), %r8d
movl -0x18(%rbp), %r9d
leaq 0xbbb9(%rip), %rdi      # 0xe0e0
leaq 0x11012(%rip), %rcx     # 0x13540
callq 0x3a40
leaq 0xbba6(%rip), %rdi      # 0xe0e0
callq 0x3120
jmp 0x2541
movl -0x8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x249a
leaq 0xbb8a(%rip), %rdi      # 0xe0e0
leaq 0x10fe3(%rip), %rsi     # 0x13540
callq 0x1270
leaq 0xbb77(%rip), %rdi      # 0xe0e0
leaq 0x10fd0(%rip), %rsi     # 0x13540
callq 0x1b40
leaq 0xbb64(%rip), %rdi      # 0xe0e0
callq 0x21f0
movl %eax, -0xc(%rbp)
jmp 0x244f
cmpl $0x1, -0xc(%rbp)
jne 0x259f
leaq 0x6ebd(%rip), %rdi      # 0x9453
movb $0x0, %al
callq 0x1080
jmp 0x25c5
cmpl $0x2, -0xc(%rbp)
jne 0x25b5
leaq 0x6eb9(%rip), %rdi      # 0x9465
movb $0x0, %al
callq 0x1080
jmp 0x25c3
leaq 0x6eba(%rip), %rdi      # 0x9476
movb $0x0, %al
callq 0x1080
jmp 0x25c5
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)