// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: lintersect
static int lintersect(int x1, int y1, int z1, int x2, int y2, int z2, int x3,
		  int y3, int x4, int y4, int *intx, int *inty, int *intz)
{     //p1 to p2 is a line segment
	int x21, y21, x34, y34, x31, y31, bot, topt, topu, t;

	x21 = x2-x1; x34 = x3-x4;
	y21 = y2-y1; y34 = y3-y4;
	bot = x21*y34 - y21*x34;
	if (bot >= 0)
	{
		if (bot == 0) return(0);
		x31 = x3-x1; y31 = y3-y1;
		topt = x31*y34 - y31*x34; if ((topt < 0) || (topt >= bot)) return(0);
		topu = x21*y31 - y21*x31; if ((topu < 0) || (topu >= bot)) return(0);
	}
	else
	{
		x31 = x3-x1; y31 = y3-y1;
		topt = x31*y34 - y31*x34; if ((topt > 0) || (topt <= bot)) return(0);
		topu = x21*y31 - y21*x31; if ((topu > 0) || (topu <= bot)) return(0);
	}
	t = divscale24(topt,bot);
	*intx = x1 + mulscale24(x21,t);
	*inty = y1 + mulscale24(y21,t);
	*intz = z1 + mulscale24(z2-z1,t);
	return(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq 0x40(%rbp), %rax
movq 0x38(%rbp), %rax
movq 0x30(%rbp), %rax
movl 0x28(%rbp), %eax
movl 0x20(%rbp), %eax
movl 0x18(%rbp), %eax
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 -0x14(%rbp), %eax
subl -0x8(%rbp), %eax
movl %eax, -0x20(%rbp)
movl 0x10(%rbp), %eax
subl 0x20(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x18(%rbp), %eax
subl -0xc(%rbp), %eax
movl %eax, -0x24(%rbp)
movl 0x18(%rbp), %eax
subl 0x28(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x20(%rbp), %eax
imull -0x2c(%rbp), %eax
movl -0x24(%rbp), %ecx
imull -0x28(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
jl 0x52795
cmpl $0x0, -0x38(%rbp)
jne 0x52727
movl $0x0, -0x4(%rbp)
jmp 0x5286c
movl 0x10(%rbp), %eax
subl -0x8(%rbp), %eax
movl %eax, -0x30(%rbp)
movl 0x18(%rbp), %eax
subl -0xc(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x30(%rbp), %eax
imull -0x2c(%rbp), %eax
movl -0x34(%rbp), %ecx
imull -0x28(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jl 0x5275a
movl -0x3c(%rbp), %eax
cmpl -0x38(%rbp), %eax
jl 0x52766
movl $0x0, -0x4(%rbp)
jmp 0x5286c
movl -0x20(%rbp), %eax
imull -0x34(%rbp), %eax
movl -0x24(%rbp), %ecx
imull -0x30(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
jl 0x52787
movl -0x40(%rbp), %eax
cmpl -0x38(%rbp), %eax
jl 0x52793
movl $0x0, -0x4(%rbp)
jmp 0x5286c
jmp 0x52800
movl 0x10(%rbp), %eax
subl -0x8(%rbp), %eax
movl %eax, -0x30(%rbp)
movl 0x18(%rbp), %eax
subl -0xc(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x30(%rbp), %eax
imull -0x2c(%rbp), %eax
movl -0x34(%rbp), %ecx
imull -0x28(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jg 0x527c8
movl -0x3c(%rbp), %eax
cmpl -0x38(%rbp), %eax
jg 0x527d4
movl $0x0, -0x4(%rbp)
jmp 0x5286c
movl -0x20(%rbp), %eax
imull -0x34(%rbp), %eax
movl -0x24(%rbp), %ecx
imull -0x30(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
jg 0x527f5
movl -0x40(%rbp), %eax
cmpl -0x38(%rbp), %eax
jg 0x527fe
movl $0x0, -0x4(%rbp)
jmp 0x5286c
jmp 0x52800
movl -0x3c(%rbp), %edi
movl -0x38(%rbp), %esi
callq 0x50170
movl %eax, -0x44(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x20(%rbp), %edi
movl -0x44(%rbp), %esi
callq 0x3c8b0
movl -0x50(%rbp), %ecx
addl %eax, %ecx
movq 0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0xc(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x24(%rbp), %edi
movl -0x44(%rbp), %esi
callq 0x3c8b0
movl -0x4c(%rbp), %ecx
addl %eax, %ecx
movq 0x38(%rbp), %rax
movl %ecx, (%rax)
movl -0x10(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x1c(%rbp), %edi
subl -0x10(%rbp), %edi
movl -0x44(%rbp), %esi
callq 0x3c8b0
movl -0x48(%rbp), %ecx
addl %eax, %ecx
movq 0x40(%rbp), %rax
movl %ecx, (%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)