// File: /workspace/github_c_makefile_star2_O3/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 0x2148fb(%rip), %rcx    # 0x238a50
movswq (%rcx,%rax,2), %rax
shlq $0x5, %rax
leaq 0x1948eb(%rip), %rbx    # 0x1b8a50
movslq (%rax,%rbx), %r10
movslq 0x4(%rax,%rbx), %r9
movswq 0x8(%rax,%rbx), %rax
shlq $0x5, %rax
movl (%rax,%rbx), %r8d
movl 0x4(%rax,%rbx), %edi
movslq %esi, %rax
movswq (%rcx,%rax,2), %rax
shlq $0x5, %rax
movslq (%rax,%rbx), %rdx
movslq 0x4(%rax,%rbx), %rcx
movswq 0x8(%rax,%rbx), %rax
shlq $0x5, %rax
movl (%rax,%rbx), %r11d
movl 0x4(%rax,%rbx), %esi
movl %r11d, %ebp
subl %r10d, %ebp
movl %r10d, %r14d
subl %r8d, %r14d
movl %edi, %ebx
subl %r9d, %ebx
movq %rdx, %r15
subq %r10, %r15
movq %rcx, %rax
subq %r9, %rax
movslq %ebx, %rbx
imulq %rbx, %r15
movslq %r14d, %r14
imulq %r14, %rax
addq %r15, %rax
shrq $0x2, %rax
movl %esi, %r15d
subl %r9d, %r15d
movslq %ebp, %r12
imulq %rbx, %r12
movslq %r15d, %r15
imulq %r14, %r15
addq %r12, %r15
shrq $0x2, %r15
testl %eax, %eax
jne 0x24204
movl %r15d, %eax
testl %r15d, %r15d
je 0x242b8
testl %r15d, %r15d
cmovel %eax, %r15d
xorl %eax, %r15d
js 0x24239
movslq 0x216839(%rip), %rcx    # 0x23aa50
subq %r10, %rcx
movslq 0x216833(%rip), %rdx    # 0x23aa54
subq %r9, %rdx
imulq %rbx, %rcx
imulq %r14, %rdx
addq %rcx, %rdx
shrq $0x2, %rdx
xorl %edx, %eax
notl %eax
jmp 0x242b3
movl %edx, %eax
subl %r11d, %eax
subl %ecx, %esi
subl %edx, %r10d
subl %ecx, %r9d
movslq %r10d, %r11
movslq %esi, %rsi
imulq %rsi, %r11
movslq %eax, %r10
movslq %r9d, %rax
imulq %r10, %rax
addq %r11, %rax
shrq $0x2, %rax
subl %edx, %r8d
subl %ecx, %edi
movslq %r8d, %r8
imulq %rsi, %r8
movslq %edi, %rdi
imulq %r10, %rdi
addq %r8, %rdi
shrq $0x2, %rdi
testl %eax, %eax
jne 0x24285
movl %edi, %eax
testl %edi, %edi
je 0x242b8
testl %edi, %edi
cmovel %eax, %edi
xorl %eax, %edi
js 0x242bf
movslq 0x2167bb(%rip), %rdi    # 0x23aa50
subq %rdx, %rdi
movslq 0x2167b5(%rip), %rdx    # 0x23aa54
subq %rcx, %rdx
imulq %rsi, %rdi
imulq %r10, %rdx
addq %rdi, %rdx
shrq $0x2, %rdx
xorl %edx, %eax
shrl $0x1f, %eax
jmp 0x242c4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x242c4
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq