// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/build.c
// Function: getlinehighlight
int getlinehighlight(int xplc, int yplc)
{
	int i, dst, dist, closest, x1, y1, x2, y2, nx, ny;

	if (numwalls == 0)
		return(-1);
	dist = 0x7fffffff;
	closest = numwalls-1;
	for(i=0;i<numwalls;i++)
	{
		getclosestpointonwall(xplc,yplc,i,&nx,&ny);
		dst = klabs(xplc-nx)+klabs(yplc-ny);
		if (dst <= dist)
			dist = dst, closest = i;
	}

	if (wall[closest].nextwall >= 0)
	{    //if red line, allow highlighting of both sides
		x1 = wall[closest].x;
		y1 = wall[closest].y;
		x2 = wall[wall[closest].point2].x;
		y2 = wall[wall[closest].point2].y;
		if (dmulscale32(xplc-x1,y2-y1,-(x2-x1),yplc-y1) >= 0)
			closest = wall[closest].nextwall;
	}

	return(closest);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
leaq 0x42c013(%rip), %rax    # 0x4519c8
movswl (%rax), %eax
cmpl $0x0, %eax
jne 0x259c9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x25b3c
movl $0x7fffffff, -0x18(%rbp) # imm = 0x7FFFFFFF
leaq 0x42bff1(%rip), %rax    # 0x4519c8
movswl (%rax), %eax
subl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
leaq 0x42bfd7(%rip), %rcx    # 0x4519c8
movswl (%rcx), %ecx
cmpl %ecx, %eax
jge 0x25a52
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
leaq -0x30(%rbp), %rcx
leaq -0x34(%rbp), %r8
callq 0x27d10
movl -0x8(%rbp), %edi
subl -0x30(%rbp), %edi
callq 0x2b7f0
movl %eax, -0x38(%rbp)
movl -0xc(%rbp), %edi
subl -0x34(%rbp), %edi
callq 0x2b7f0
movl %eax, %ecx
movl -0x38(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jg 0x25a45
movl -0x14(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x25a47
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x259e7
movslq -0x1c(%rbp), %rcx
leaq 0x1cfb53(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movswl 0xa(%rax), %eax
cmpl $0x0, %eax
jl 0x25b36
movslq -0x1c(%rbp), %rcx
leaq 0x1cfb34(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x20(%rbp)
movslq -0x1c(%rbp), %rcx
leaq 0x1cfb1d(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x24(%rbp)
movslq -0x1c(%rbp), %rcx
leaq 0x1cfb05(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movswq 0x8(%rax), %rcx
leaq 0x1cfaf2(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x28(%rbp)
movslq -0x1c(%rbp), %rcx
leaq 0x1cfadb(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movswq 0x8(%rax), %rcx
leaq 0x1cfac8(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x2c(%rbp)
movl -0x8(%rbp), %edi
subl -0x20(%rbp), %edi
movl -0x2c(%rbp), %esi
subl -0x24(%rbp), %esi
movl -0x28(%rbp), %eax
subl -0x20(%rbp), %eax
xorl %edx, %edx
subl %eax, %edx
movl -0xc(%rbp), %ecx
subl -0x24(%rbp), %ecx
callq 0x2b820
cmpl $0x0, %eax
jl 0x25b34
movslq -0x1c(%rbp), %rcx
leaq 0x1cfa8a(%rip), %rax    # 0x1f55b0
shlq $0x5, %rcx
addq %rcx, %rax
movswl 0xa(%rax), %eax
movl %eax, -0x1c(%rbp)
jmp 0x25b36
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)