// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: wallfront
int wallfront(int l1, int l2)
{
	walltype *wal;
	int x11, y11, x21, y21, x12, y12, x22, y22, dx, dy, t1, t2;

	wal = &wall[thewall[l1]]; x11 = wal->x; y11 = wal->y;
	wal = &wall[wal->point2]; x21 = wal->x; y21 = wal->y;
	wal = &wall[thewall[l2]]; x12 = wal->x; y12 = wal->y;
	wal = &wall[wal->point2]; x22 = wal->x; y22 = wal->y;

	dx = x21-x11; dy = y21-y11;
	t1 = dmulscale2(x12-x11,dy,-dx,y12-y11); //p1(l2) vs. l1
	t2 = dmulscale2(x22-x11,dy,-dx,y22-y11); //p2(l2) vs. l1
	if (t1 == 0) { t1 = t2; if (t1 == 0) return(-1); }
	if (t2 == 0) t2 = t1;
	if ((t1^t2) >= 0)
	{
		t2 = dmulscale2(globalposx-x11,dy,-dx,globalposy-y11); //pos vs. l1
		return((t2^t1) >= 0);
	}

	dx = x22-x12; dy = y22-y12;
	t1 = dmulscale2(x11-x12,dy,-dx,y11-y12); //p1(l1) vs. l2
	t2 = dmulscale2(x21-x12,dy,-dx,y21-y12); //p2(l1) vs. l2
	if (t1 == 0) { t1 = t2; if (t1 == 0) return(-1); }
	if (t2 == 0) t2 = t1;
	if ((t1^t2) >= 0)
	{
		t2 = dmulscale2(globalposx-x12,dy,-dx,globalposy-y12); //pos vs. l2
		return((t2^t1) < 0);
	}
	return(-2);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movslq %edi, %rax
leaq 0x21059b(%rip), %rcx    # 0x231a50
movswq (%rcx,%rax,2), %rax
shlq $0x5, %rax
leaq 0x19058b(%rip), %r11    # 0x1b1a50
movslq (%rax,%r11), %r10
movslq 0x4(%rax,%r11), %r9
movswq 0x8(%rax,%r11), %rax
shlq $0x5, %rax
movl (%rax,%r11), %r8d
movl 0x4(%rax,%r11), %edi
movslq %esi, %rax
movswq (%rcx,%rax,2), %rax
shlq $0x5, %rax
movslq (%rax,%r11), %rdx
movslq 0x4(%rax,%r11), %rcx
movswq 0x8(%rax,%r11), %rax
shlq $0x5, %rax
movl (%rax,%r11), %ebx
movl 0x4(%rax,%r11), %esi
movl %ebx, %eax
subl %r10d, %eax
movl %r10d, %ebp
subl %r8d, %ebp
movl %edi, %r14d
subl %r9d, %r14d
movq %rdx, %r12
subq %r10, %r12
movq %rcx, %r11
subq %r9, %r11
movslq %r14d, %r14
imulq %r14, %r12
movslq %ebp, %r15
imulq %r15, %r11
addq %r12, %r11
shrq $0x2, %r11
movl %esi, %ebp
subl %r9d, %ebp
cltq
imulq %r14, %rax
movslq %ebp, %r12
imulq %r15, %r12
addq %rax, %r12
shrq $0x2, %r12
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %r11d, %r11d
jne 0x2156a
movl %r12d, %r11d
testl %r12d, %r12d
je 0x21632
testl %r12d, %r12d
cmovel %r11d, %r12d
xorl %r11d, %r12d
js 0x215ab
movslq 0x2124d3(%rip), %rax    # 0x233a50
subq %r10, %rax
movslq 0x2124cd(%rip), %rcx    # 0x233a54
subq %r9, %rcx
imulq %r14, %rax
imulq %r15, %rcx
addq %rax, %rcx
shrq $0x2, %rcx
xorl %ecx, %r11d
notl %r11d
shrl $0x1f, %r11d
movl %r11d, %eax
jmp 0x21632
movl %edx, %r11d
subl %ebx, %r11d
subl %ecx, %esi
subl %edx, %r10d
subl %ecx, %r9d
movslq %r10d, %rbx
movslq %esi, %r10
imulq %r10, %rbx
movslq %r11d, %r11
movslq %r9d, %rsi
imulq %r11, %rsi
addq %rbx, %rsi
shrq $0x2, %rsi
subl %edx, %r8d
subl %ecx, %edi
movslq %r8d, %r8
imulq %r10, %r8
movslq %edi, %rdi
imulq %r11, %rdi
addq %r8, %rdi
shrq $0x2, %rdi
testl %esi, %esi
jne 0x215f8
movl %edi, %esi
testl %edi, %edi
je 0x21632
testl %edi, %edi
cmovel %esi, %edi
xorl %esi, %edi
js 0x2162d
movslq 0x212448(%rip), %rax    # 0x233a50
subq %rdx, %rax
movslq 0x212442(%rip), %rdx    # 0x233a54
subq %rcx, %rdx
imulq %r10, %rax
imulq %r11, %rdx
addq %rax, %rdx
shrq $0x2, %rdx
xorl %edx, %esi
shrl $0x1f, %esi
movl %esi, %eax
jmp 0x21632
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq