// File: /workspace/github_c_makefile_star2_O0/j4r0g[P]Projet_Labyrinthe/fonctions/utilisateur.c
// Function: action_user
int action_user(t_lab lab[X][Y], int bouffe, int dureevie, t_fourmi fourmi[]){
  int choix, i, j;
  char reponse='\0';
  do {
    printf(" 1 - Ajouter de la nourriture\n");
    printf(" 2 - Ajouter un insecte\n");
    printf(" 3 - Passer\n");
    printf(" 4 - Abandonner la partie\n");
    printf(" 5 - Sauvegarder la partie\n");
    printf(" 6 - Charger la partie\n");
    printf("Votre choix : ");
    scanf("%i%*c", &choix);

    switch(choix) {
		case 1 : ajout_nourriture(lab) ; break;
		case 2 : ajout_insecte(lab, bouffe, dureevie, fourmi) ; break;
		case 3 : break;
		case 4 : {  printf("Souhaitez vous vraiment abandonner la partie ? (y/n) : ");
					scanf("%c%*c", &reponse);
					if(reponse!='y' || reponse!='n') {
						while(reponse!='y' && reponse!='n') {
							printf("Souhaitez vous vraiment abandonner la partie ? (y/n) : ");
							scanf("%c%*c", &reponse);
						}
						if(reponse=='n')
							choix=7;
						}
				 } ; break;
		case 5 :{
					sauver_lab(lab, fourmi);
				}  ; break;
		case 6 :{
					charger_lab(lab, fourmi);
				} ; break;
		case 666 : decouvrir_lab(lab); break;
    default : printf("\nErreur retentez\n\n"); choix=7; break;

    }
  }
  while(choix==7);
  if(choix==4)
    return 0;
  else
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movb $0x0, -0x2d(%rbp)
leaq 0x6a93(%rip), %rdi      # 0x9644
xorl %eax, %eax
movb %al, -0x35(%rbp)
callq 0x1080
movb -0x35(%rbp), %al
leaq 0x6a9e(%rip), %rdi      # 0x9663
callq 0x1080
movb -0x35(%rbp), %al
leaq 0x6aa8(%rip), %rdi      # 0x967c
callq 0x1080
movb -0x35(%rbp), %al
leaq 0x6aa6(%rip), %rdi      # 0x9689
callq 0x1080
movb -0x35(%rbp), %al
leaq 0x6ab2(%rip), %rdi      # 0x96a4
callq 0x1080
movb -0x35(%rbp), %al
leaq 0x6abf(%rip), %rdi      # 0x96c0
callq 0x1080
movb -0x35(%rbp), %al
leaq 0x68d2(%rip), %rdi      # 0x94e2
callq 0x1080
movb -0x35(%rbp), %al
leaq 0x6ab9(%rip), %rdi      # 0x96d8
leaq -0x24(%rbp), %rsi
callq 0x1110
movl -0x24(%rbp), %eax
movl %eax, -0x34(%rbp)
subl $0x1, %eax
je 0x2c82
jmp 0x2c35
movl -0x34(%rbp), %eax
subl $0x2, %eax
je 0x2c90
jmp 0x2c3f
movl -0x34(%rbp), %eax
subl $0x3, %eax
je 0x2ca8
jmp 0x2c49
movl -0x34(%rbp), %eax
subl $0x4, %eax
je 0x2cad
jmp 0x2c53
movl -0x34(%rbp), %eax
subl $0x5, %eax
je 0x2d3b
jmp 0x2c61
movl -0x34(%rbp), %eax
subl $0x6, %eax
je 0x2d4a
jmp 0x2c6f
movl -0x34(%rbp), %eax
subl $0x29a, %eax            # imm = 0x29A
je 0x2d59
jmp 0x2d64
movq -0x10(%rbp), %rdi
callq 0x26c0
jmp 0x2d79
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
movq -0x20(%rbp), %rcx
callq 0x49e0
jmp 0x2d79
jmp 0x2d79
leaq 0x6a2a(%rip), %rdi      # 0x96de
movb $0x0, %al
callq 0x1080
leaq 0x6a54(%rip), %rdi      # 0x9716
leaq -0x2d(%rbp), %rsi
movb $0x0, %al
callq 0x1110
movsbl -0x2d(%rbp), %eax
cmpl $0x79, %eax
jne 0x2cdf
movsbl -0x2d(%rbp), %eax
cmpl $0x6e, %eax
je 0x2d39
jmp 0x2ce1
movsbl -0x2d(%rbp), %ecx
xorl %eax, %eax
cmpl $0x79, %ecx
movb %al, -0x36(%rbp)
je 0x2cfc
movsbl -0x2d(%rbp), %eax
cmpl $0x6e, %eax
setne %al
movb %al, -0x36(%rbp)
movb -0x36(%rbp), %al
testb $0x1, %al
jne 0x2d05
jmp 0x2d27
leaq 0x69d2(%rip), %rdi      # 0x96de
movb $0x0, %al
callq 0x1080
leaq 0x69fc(%rip), %rdi      # 0x9716
leaq -0x2d(%rbp), %rsi
movb $0x0, %al
callq 0x1110
jmp 0x2ce1
movsbl -0x2d(%rbp), %eax
cmpl $0x6e, %eax
jne 0x2d37
movl $0x7, -0x24(%rbp)
jmp 0x2d39
jmp 0x2d79
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x2840
jmp 0x2d79
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x2940
jmp 0x2d79
movq -0x10(%rbp), %rdi
callq 0x2190
jmp 0x2d79
leaq 0x69b1(%rip), %rdi      # 0x971c
movb $0x0, %al
callq 0x1080
movl $0x7, -0x24(%rbp)
jmp 0x2d7b
cmpl $0x7, -0x24(%rbp)
je 0x2baa
cmpl $0x4, -0x24(%rbp)
jne 0x2d94
movl $0x0, -0x4(%rbp)
jmp 0x2d9b
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop