// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: clipinsideboxline
int clipinsideboxline(int x, int y, int x1, int y1, int x2, int y2, int walldist)
{
	int r;

	r = (walldist<<1);

	x1 += walldist-x; x2 += walldist-x;
	if ((x1 < 0) && (x2 < 0)) return(0);
	if ((x1 >= r) && (x2 >= r)) return(0);

	y1 += walldist-y; y2 += walldist-y;
	if ((y1 < 0) && (y2 < 0)) return(0);
	if ((y1 >= r) && (y2 >= r)) return(0);

	x2 -= x1; y2 -= y1;
	if (x2*(walldist-y1) >= y2*(walldist-x1))  //Front
	{
		if (x2 > 0) x2 *= (0-y1); else x2 *= (r-y1);
		if (y2 > 0) y2 *= (r-x1); else y2 *= (0-x1);
		return(x2 < y2);
	}
	if (x2 > 0) x2 *= (r-y1); else x2 *= (0-y1);
	if (y2 > 0) y2 *= (0-x1); else y2 *= (r-x1);
	return((x2 >= y2)<<1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x10(%rbp), %eax
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
movl %r9d, -0x1c(%rbp)
movl 0x10(%rbp), %eax
shll %eax
movl %eax, -0x20(%rbp)
movl 0x10(%rbp), %eax
subl -0x8(%rbp), %eax
addl -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
movl 0x10(%rbp), %eax
subl -0x8(%rbp), %eax
addl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x10(%rbp)
jge 0x4ed23
cmpl $0x0, -0x18(%rbp)
jge 0x4ed23
movl $0x0, -0x4(%rbp)
jmp 0x4ee67
movl -0x10(%rbp), %eax
cmpl -0x20(%rbp), %eax
jl 0x4ed3f
movl -0x18(%rbp), %eax
cmpl -0x20(%rbp), %eax
jl 0x4ed3f
movl $0x0, -0x4(%rbp)
jmp 0x4ee67
movl 0x10(%rbp), %eax
subl -0xc(%rbp), %eax
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movl 0x10(%rbp), %eax
subl -0xc(%rbp), %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0x4ed6f
cmpl $0x0, -0x1c(%rbp)
jge 0x4ed6f
movl $0x0, -0x4(%rbp)
jmp 0x4ee67
movl -0x14(%rbp), %eax
cmpl -0x20(%rbp), %eax
jl 0x4ed8b
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jl 0x4ed8b
movl $0x0, -0x4(%rbp)
jmp 0x4ee67
movl -0x10(%rbp), %ecx
movl -0x18(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %ecx
movl -0x1c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %eax
movl 0x10(%rbp), %ecx
subl -0x14(%rbp), %ecx
imull %ecx, %eax
movl -0x1c(%rbp), %ecx
movl 0x10(%rbp), %edx
subl -0x10(%rbp), %edx
imull %edx, %ecx
cmpl %ecx, %eax
jl 0x4ee12
cmpl $0x0, -0x18(%rbp)
jle 0x4edd1
xorl %eax, %eax
subl -0x14(%rbp), %eax
imull -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
jmp 0x4edde
movl -0x20(%rbp), %eax
subl -0x14(%rbp), %eax
imull -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x1c(%rbp)
jle 0x4edf3
movl -0x20(%rbp), %eax
subl -0x10(%rbp), %eax
imull -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x4edff
xorl %eax, %eax
subl -0x10(%rbp), %eax
imull -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x1c(%rbp), %eax
setl %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x4(%rbp)
jmp 0x4ee67
cmpl $0x0, -0x18(%rbp)
jle 0x4ee27
movl -0x20(%rbp), %eax
subl -0x14(%rbp), %eax
imull -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
jmp 0x4ee33
xorl %eax, %eax
subl -0x14(%rbp), %eax
imull -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x1c(%rbp)
jle 0x4ee47
xorl %eax, %eax
subl -0x10(%rbp), %eax
imull -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x4ee54
movl -0x20(%rbp), %eax
subl -0x10(%rbp), %eax
imull -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x1c(%rbp), %eax
setge %al
andb $0x1, %al
movzbl %al, %eax
shll %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)