// File: /workspace/github_c_makefile_star2_O0/return5[P]c_ish_one/./src/makemap.c
// Function: checkLocation
static void checkLocation(const int limit, int *const x, int *const y, const int check_limit, const int *const check_x,const int *const check_y) {
	//im sure there is a better way to do this. need to work on this part. 
	int i,j,k,change;
	i = 0;
	//while i is less than the length of x and y arrays
	while(i < limit) {
		change = 0;
		//loops through each element of check_x and check_y
		fruit(j = 0 ;j < check_limit; j++) {
			//if the elements to be compared are not the same
			if(&x[i] != &check_x[j]) {
				//check location -1, location 0, and then location +1
				fruit(k = -1; k < 2; k++) {
					//if item in x/y is to the left, at, or right of item in check_x/y
					if(x[i] == ((check_x[j]) + k) && y[i] == (check_y[j])) {
						x[i] = getRand(WIDTH-1);
						y[i] = getRand(HEIGHT-1);
						change = 1;
					}
					//if item in x/y is to the bottom, at, or above item in check_x/y
					else if(x[i] == (check_x[j]) && y[i] == ((check_y[j]) + k)) {
						x[i] = getRand(WIDTH - 1);
						y[i] = getRand(HEIGHT-1);
						change = 1;
					}
				}
			}
		}
		//if something was not changed, go to next item in x and y arrays
		if (change == 0) {
			i++;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x6151
movl $0x0, -0x40(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x613d
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq -0x28(%rbp), %rcx
movslq -0x38(%rbp), %rdx
shlq $0x2, %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
je 0x612d
movl $0xffffffff, -0x3c(%rbp) # imm = 0xFFFFFFFF
cmpl $0x2, -0x3c(%rbp)
jge 0x612b
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x28(%rbp), %rcx
movslq -0x38(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
addl -0x3c(%rbp), %ecx
cmpl %ecx, %eax
jne 0x60af
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x30(%rbp), %rcx
movslq -0x38(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jne 0x60af
movl $0x31, %edi
callq 0x5e20
movl %eax, %edx
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl $0x13, %edi
callq 0x5e20
movl %eax, %edx
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl $0x1, -0x40(%rbp)
jmp 0x611b
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x28(%rbp), %rcx
movslq -0x38(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jne 0x6119
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x30(%rbp), %rcx
movslq -0x38(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
addl -0x3c(%rbp), %ecx
cmpl %ecx, %eax
jne 0x6119
movl $0x31, %edi
callq 0x5e20
movl %eax, %edx
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl $0x13, %edi
callq 0x5e20
movl %eax, %edx
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl $0x1, -0x40(%rbp)
jmp 0x611b
jmp 0x611d
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x6039
jmp 0x612d
jmp 0x612f
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x5fff
cmpl $0x0, -0x40(%rbp)
jne 0x614c
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x5fe5
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)