// File: /workspace/github_c_makefile_star2_O0/j4r0g[P]Projet_Labyrinthe/fonctions/insecte.c
// Function: modif_pos
int modif_pos(t_lab lab[X][Y], t_fourmi fourmi[], int x, int y, int a, int b, int bouffe, int dureevie){
		int indice=lab[x][y].insecte;
		// On vérifie si on va sur une case de nourriture
		if(lab[a][b].etat==food)
			fourmi[indice].nourriture=bouffe;

		if(fourmi[indice].nourriture>0 && fourmi[indice].age>0) {
			// On décrémente la nourriture de l'insecte
			fourmi[indice].nourriture=fourmi[indice].nourriture-1;
			fourmi[indice].age=fourmi[indice].age-1;
			// modif de l'état de la case
			lab[a][b].etat=insecte;
			lab[x][y].etat=vide;
			// modif de l'indice de l'insecte dans la case
			lab[a][b].insecte=indice;
			lab[x][y].insecte=-1;
			// maj de la position de l'insecte
			fourmi[indice].x=a;
			fourmi[indice].y=b;
		}
		else {
			delete_insecte(lab, fourmi, x, y);
		}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movl %r9d, -0x20(%rbp)
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
imulq $0x2d0, %rcx, %rcx      # imm = 0x2D0
addq %rcx, %rax
movslq -0x18(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x2d0, %rcx, %rcx      # imm = 0x2D0
addq %rcx, %rax
movslq -0x20(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
cmpl $0x2a, 0x4(%rax)
jne 0x4dbf
movl 0x10(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x4(%rax)
jle 0x4efa
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x8(%rax)
jle 0x4efa
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
subl $0x1, %ecx
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
subl $0x1, %ecx
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x2d0, %rcx, %rcx      # imm = 0x2D0
addq %rcx, %rax
movslq -0x20(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl $0x25, 0x4(%rax)
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
imulq $0x2d0, %rcx, %rcx      # imm = 0x2D0
addq %rcx, %rax
movslq -0x18(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl $0x20, 0x4(%rax)
movl -0x24(%rbp), %ecx
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rdx
imulq $0x2d0, %rdx, %rdx      # imm = 0x2D0
addq %rdx, %rax
movslq -0x20(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
imulq $0x2d0, %rcx, %rcx      # imm = 0x2D0
addq %rcx, %rax
movslq -0x18(%rbp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movl -0x20(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x10(%rax)
jmp 0x4f0d
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x4b60
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop