// File: /workspace/github_c_makefile_star2_O0/j4r0g[P]Projet_Labyrinthe/fonctions/insecte.c
// Function: delete_insecte
void delete_insecte(t_lab lab[X][Y], t_fourmi fourmi[], int x, int y) {
	int i, a, b;
	int indice=lab[x][y].insecte;
	for(i=indice; i<nb_ins-1; i++) {
		// Mise à jour du labyrinthe
		a=fourmi[i+1].x;
		b=fourmi[i+1].y;
		lab[a][b].insecte=i;
		// Mise à jour des cases du tableau de fourmi
		fourmi[i].sexe=fourmi[i+1].sexe;
		fourmi[i].nourriture=fourmi[i+1].nourriture;
		fourmi[i].age=fourmi[i+1].age;
		fourmi[i].x=fourmi[i+1].x;
		fourmi[i].y=fourmi[i+1].y;
	}
	lab[x][y].etat=food;
	lab[x][y].insecte=-1;
	nb_ins--;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%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, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl 0xecbc(%rip), %ecx      # 0x13860
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x4cdf
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, -0x24(%rbp)
movl -0x1c(%rbp), %ecx
movq -0x8(%rbp), %rax
movslq -0x20(%rbp), %rdx
imulq $0x2d0, %rdx, %rdx      # imm = 0x2D0
addq %rdx, %rax
movslq -0x24(%rbp), %rdx
imulq $0xc, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %ecx
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %ecx
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x10(%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x4b9b
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 $0x2a, 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 $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movl 0xeb33(%rip), %eax      # 0x13860
addl $-0x1, %eax
movl %eax, 0xeb2a(%rip)      # 0x13860
popq %rbp
retq
nopl (%rax,%rax)