#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double fabs(double);
int get_line_intersection(double p0_x, double p0_y, double p1_x, double p1_y,
                          double p2_x, double p2_y, double p3_x, double p3_y,
                          double *i_x, double *i_y) {
  double case1, case2, case3, case4;
  case1 = fabs(p0_x - p2_x) + fabs(p0_y - p2_y);
  case2 = fabs(p0_x - p3_x) + fabs(p0_y - p3_y);
  case3 = fabs(p1_x - p2_x) + fabs(p1_y - p2_y);
  case4 = fabs(p1_x - p3_x) + fabs(p1_y - p3_y);
  if (case1 < 2 * 0.0000000001 || case2 < 2 * 0.0000000001) {
    if (i_x != NULL)
      *i_x = p0_x;
    if (i_y != NULL)
      *i_y = p0_y;
    return -1;
  }
  if (case3 < 2 * 0.0000000001 || case4 < 2 * 0.0000000001) {
    if (i_x != NULL)
      *i_x = p1_x;
    if (i_y != NULL)
      *i_y = p1_y;
    return -1;
  }
  double s1_x, s1_y, s2_x, s2_y;
  s1_x = p1_x - p0_x;
  s1_y = p1_y - p0_y;
  s2_x = p3_x - p2_x;
  s2_y = p3_y - p2_y;
  double s, t;
  s = (-s1_y * (p0_x - p2_x) + s1_x * (p0_y - p2_y)) /
      (-s2_x * s1_y + s1_x * s2_y);
  t = (s2_x * (p0_y - p2_y) - s2_y * (p0_x - p2_x)) /
      (-s2_x * s1_y + s1_x * s2_y);
  if (s >= 0 && s <= 1 && t >= 0 && t <= 1) {
    double temp_x = p0_x + (t * s1_x);
    double temp_y = p0_y + (t * s1_y);
    if (i_x != NULL)
      *i_x = temp_x;
    if (i_y != NULL)
      *i_y = temp_y;
    if (fabs(temp_x - p0_x) < 0.0000000001 &&
        fabs(temp_y - p0_y) < 0.0000000001)
      return -1;
    if (fabs(temp_x - p1_x) < 0.0000000001 &&
        fabs(temp_y - p1_y) < 0.0000000001)
      return -1;
    if (fabs(temp_x - p2_x) < 0.0000000001 &&
        fabs(temp_y - p2_y) < 0.0000000001)
      return -1;
    if (fabs(temp_x - p3_x) < 0.0000000001 &&
        fabs(temp_y - p3_y) < 0.0000000001)
      return -1;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_line_intersection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x38,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  %xmm5,-0x38(%rbp)
movsd  %xmm6,-0x40(%rbp)
movsd  %xmm7,-0x48(%rbp)
mov    %rdi,-0x50(%rbp)
mov    %rsi,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movaps 0xed7(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x38(%rbp),%xmm1
movaps 0xec2(%rip),%xmm2
pand   %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
movaps 0xea4(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x48(%rbp),%xmm1
movaps 0xe8f(%rip),%xmm2
pand   %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movaps 0xe71(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x38(%rbp),%xmm1
movaps 0xe5c(%rip),%xmm2
pand   %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
movaps 0xe3e(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x48(%rbp),%xmm1
movaps 0xe29(%rip),%xmm2
pand   %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xdf4(%rip),%xmm0
ucomisd -0x60(%rbp),%xmm0
ja     122a <get_line_intersection+0x12a>
movsd  0xde1(%rip),%xmm0
ucomisd -0x68(%rbp),%xmm0
jbe    1266 <get_line_intersection+0x166>
cmpq   $0x0,-0x50(%rbp)
je     1242 <get_line_intersection+0x142>
movsd  -0x10(%rbp),%xmm0
mov    -0x50(%rbp),%rax
movsd  %xmm0,(%rax)
cmpq   $0x0,-0x58(%rbp)
je     125a <get_line_intersection+0x15a>
movsd  -0x18(%rbp),%xmm0
mov    -0x58(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    168e <get_line_intersection+0x58e>
movsd  0xd92(%rip),%xmm0
ucomisd -0x70(%rbp),%xmm0
ja     128c <get_line_intersection+0x18c>
movsd  0xd7f(%rip),%xmm0
ucomisd -0x78(%rbp),%xmm0
jbe    12c8 <get_line_intersection+0x1c8>
cmpq   $0x0,-0x50(%rbp)
je     12a4 <get_line_intersection+0x1a4>
movsd  -0x20(%rbp),%xmm0
mov    -0x50(%rbp),%rax
movsd  %xmm0,(%rax)
cmpq   $0x0,-0x58(%rbp)
je     12bc <get_line_intersection+0x1bc>
movsd  -0x28(%rbp),%xmm0
mov    -0x58(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    168e <get_line_intersection+0x58e>
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x30(%rbp),%xmm2
movsd  -0x80(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm3
subsd  -0x38(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x90(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  -0x88(%rbp),%xmm3
ff
movsd  -0x80(%rbp),%xmm2
mulsd  -0x98(%rbp),%xmm2
ff
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x18(%rbp),%xmm2
subsd  -0x38(%rbp),%xmm2
movsd  -0x98(%rbp),%xmm1
ff
movsd  -0x10(%rbp),%xmm3
subsd  -0x30(%rbp),%xmm3
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x90(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  -0x88(%rbp),%xmm3
ff
movsd  -0x80(%rbp),%xmm2
mulsd  -0x98(%rbp),%xmm2
ff
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1687 <get_line_intersection+0x587>
movsd  0xbc3(%rip),%xmm0
ucomisd -0xa0(%rbp),%xmm0
ff
jb     1687 <get_line_intersection+0x587>
movsd  -0xa8(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1687 <get_line_intersection+0x587>
movsd  0xb98(%rip),%xmm0
ucomisd -0xa8(%rbp),%xmm0
ff
jb     1687 <get_line_intersection+0x587>
movsd  -0x10(%rbp),%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
movsd  -0x80(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x18(%rbp),%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
movsd  -0x88(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
cmpq   $0x0,-0x50(%rbp)
je     14e0 <get_line_intersection+0x3e0>
movsd  -0xb0(%rbp),%xmm0
ff
mov    -0x50(%rbp),%rax
movsd  %xmm0,(%rax)
cmpq   $0x0,-0x58(%rbp)
je     14fb <get_line_intersection+0x3fb>
movsd  -0xb8(%rbp),%xmm0
ff
mov    -0x58(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0xb0(%rbp),%xmm1
ff
subsd  -0x10(%rbp),%xmm1
movaps 0xb11(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xaf5(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    155b <get_line_intersection+0x45b>
movsd  -0xb8(%rbp),%xmm1
ff
subsd  -0x18(%rbp),%xmm1
movaps 0xae7(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xacb(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    155b <get_line_intersection+0x45b>
movl   $0xffffffff,-0x4(%rbp)
jmp    168e <get_line_intersection+0x58e>
movsd  -0xb0(%rbp),%xmm1
ff
subsd  -0x20(%rbp),%xmm1
movaps 0xab1(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xa95(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    15bb <get_line_intersection+0x4bb>
movsd  -0xb8(%rbp),%xmm1
ff
subsd  -0x28(%rbp),%xmm1
movaps 0xa87(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xa6b(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    15bb <get_line_intersection+0x4bb>
movl   $0xffffffff,-0x4(%rbp)
jmp    168e <get_line_intersection+0x58e>
movsd  -0xb0(%rbp),%xmm1
ff
subsd  -0x30(%rbp),%xmm1
movaps 0xa51(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xa35(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    161b <get_line_intersection+0x51b>
movsd  -0xb8(%rbp),%xmm1
ff
subsd  -0x38(%rbp),%xmm1
movaps 0xa27(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xa0b(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    161b <get_line_intersection+0x51b>
movl   $0xffffffff,-0x4(%rbp)
jmp    168e <get_line_intersection+0x58e>
movsd  -0xb0(%rbp),%xmm1
ff
subsd  -0x40(%rbp),%xmm1
movaps 0x9f1(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0x9d5(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    167b <get_line_intersection+0x57b>
movsd  -0xb8(%rbp),%xmm1
ff
subsd  -0x48(%rbp),%xmm1
movaps 0x9c7(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0x9ab(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    167b <get_line_intersection+0x57b>
movl   $0xffffffff,-0x4(%rbp)
jmp    168e <get_line_intersection+0x58e>
movl   $0x1,-0x4(%rbp)
jmp    168e <get_line_intersection+0x58e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x38,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_line_intersection>:
movapd %xmm0,%xmm11
subsd  %xmm4,%xmm11
movapd 0xeed(%rip),%xmm8
movapd %xmm11,%xmm9
andpd  %xmm8,%xmm9
movapd %xmm1,%xmm10
subsd  %xmm5,%xmm10
movapd %xmm10,%xmm12
andpd  %xmm8,%xmm12
addsd  %xmm9,%xmm12
movsd  0xef1(%rip),%xmm9
ucomisd %xmm12,%xmm9
ja     13c5 <get_line_intersection+0x2c5>
movapd %xmm0,%xmm13
unpcklpd %xmm1,%xmm13
movapd %xmm6,%xmm12
unpcklpd %xmm7,%xmm12
subpd  %xmm12,%xmm13
andpd  %xmm8,%xmm13
pshufd $0xee,%xmm13,%xmm14
addsd  %xmm13,%xmm14
ucomisd %xmm14,%xmm9
ja     13c5 <get_line_intersection+0x2c5>
movapd %xmm2,%xmm13
unpcklpd %xmm3,%xmm13
movapd %xmm4,%xmm14
unpcklpd %xmm5,%xmm14
movapd %xmm13,%xmm15
subpd  %xmm14,%xmm15
andpd  %xmm8,%xmm15
pshufd $0xee,%xmm15,%xmm14
addsd  %xmm15,%xmm14
ucomisd %xmm14,%xmm9
ja     13dd <get_line_intersection+0x2dd>
subpd  %xmm12,%xmm13
andpd  %xmm8,%xmm13
pshufd $0xee,%xmm13,%xmm8
addsd  %xmm13,%xmm8
ucomisd %xmm8,%xmm9
ja     13dd <get_line_intersection+0x2dd>
movapd %xmm2,%xmm9
subsd  %xmm0,%xmm9
movapd %xmm3,-0x38(%rsp)
subsd  %xmm1,%xmm3
movapd %xmm6,-0x28(%rsp)
movapd %xmm6,%xmm12
subsd  %xmm4,%xmm12
movapd %xmm7,-0x18(%rsp)
movapd %xmm7,%xmm13
subsd  %xmm5,%xmm13
movapd %xmm9,%xmm14
mulsd  %xmm10,%xmm14
movapd %xmm3,%xmm15
mulsd  %xmm11,%xmm15
subsd  %xmm15,%xmm14
movapd 0xde3(%rip),%xmm15
movapd %xmm12,%xmm8
xorpd  %xmm15,%xmm8
xorpd  %xmm13,%xmm15
unpcklpd %xmm13,%xmm15
unpcklpd %xmm9,%xmm11
mulpd  %xmm11,%xmm15
unpcklpd %xmm8,%xmm12
unpcklpd %xmm3,%xmm10
mulpd  %xmm12,%xmm10
addpd  %xmm15,%xmm10
movapd %xmm10,%xmm11
unpcklpd %xmm14,%xmm11
unpckhpd %xmm10,%xmm10
divpd  %xmm10,%xmm11
movapd %xmm11,%xmm7
unpckhpd %xmm11,%xmm7
xor    %eax,%eax
xorpd  %xmm6,%xmm6
ucomisd %xmm6,%xmm7
jb     13c4 <get_line_intersection+0x2c4>
movapd %xmm11,%xmm6
cmplepd 0xd85(%rip),%xmm6
movmskpd %xmm6,%ecx
mov    %ecx,%edx
shr    %dl
je     13c4 <get_line_intersection+0x2c4>
xorpd  %xmm6,%xmm6
ucomisd %xmm6,%xmm11
jb     13c4 <get_line_intersection+0x2c4>
test   $0x1,%cl
movapd -0x18(%rsp),%xmm7
je     13c4 <get_line_intersection+0x2c4>
mulsd  %xmm11,%xmm9
addsd  %xmm0,%xmm9
mulsd  %xmm11,%xmm3
test   %rdi,%rdi
je     12e0 <get_line_intersection+0x1e0>
movsd  %xmm9,(%rdi)
addsd  %xmm1,%xmm3
test   %rsi,%rsi
je     12ed <get_line_intersection+0x1ed>
movsd  %xmm3,(%rsi)
movapd %xmm9,%xmm6
subsd  %xmm0,%xmm6
andpd  0xd02(%rip),%xmm6
movsd  0xd32(%rip),%xmm0
ucomisd %xmm6,%xmm0
jbe    132b <get_line_intersection+0x22b>
movapd %xmm3,%xmm6
subsd  %xmm1,%xmm6
andpd  0xce4(%rip),%xmm6
mov    $0xffffffff,%eax
ucomisd %xmm6,%xmm0
ja     13c4 <get_line_intersection+0x2c4>
movapd %xmm9,%xmm1
subsd  %xmm2,%xmm1
andpd  0xcc4(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    135f <get_line_intersection+0x25f>
movapd %xmm3,%xmm1
subsd  -0x38(%rsp),%xmm1
andpd  0xcac(%rip),%xmm1
mov    $0xffffffff,%eax
ucomisd %xmm1,%xmm0
ja     13c4 <get_line_intersection+0x2c4>
movapd %xmm9,%xmm1
subsd  %xmm4,%xmm1
andpd  0xc90(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1391 <get_line_intersection+0x291>
movapd %xmm3,%xmm1
subsd  %xmm5,%xmm1
andpd  0xc7a(%rip),%xmm1
mov    $0xffffffff,%eax
ucomisd %xmm1,%xmm0
ja     13c4 <get_line_intersection+0x2c4>
subsd  -0x28(%rsp),%xmm9
andpd  0xc5f(%rip),%xmm9
ucomisd %xmm9,%xmm0
jbe    13bf <get_line_intersection+0x2bf>
subsd  %xmm7,%xmm3
andpd  0xc4c(%rip),%xmm3
mov    $0xffffffff,%eax
ucomisd %xmm3,%xmm0
ja     13c4 <get_line_intersection+0x2c4>
mov    $0x1,%eax
ret
test   %rdi,%rdi
je     13ce <get_line_intersection+0x2ce>
movsd  %xmm0,(%rdi)
mov    $0xffffffff,%eax
test   %rsi,%rsi
je     13c4 <get_line_intersection+0x2c4>
movsd  %xmm1,(%rsi)
ret
test   %rdi,%rdi
je     13e6 <get_line_intersection+0x2e6>
movsd  %xmm2,(%rdi)
mov    $0xffffffff,%eax
test   %rsi,%rsi
je     13c4 <get_line_intersection+0x2c4>
movsd  %xmm3,(%rsi)
ret

LLVM IR (-O0):
define i32 @get_line_intersection(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double* %8, double* %9) {
%11 = alloca i32
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double*
%21 = alloca double*
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca double
store double %0, double* %12
store double %1, double* %13
store double %2, double* %14
store double %3, double* %15
store double %4, double* %16
store double %5, double* %17
store double %6, double* %18
store double %7, double* %19
store double* %8, double** %20
store double* %9, double** %21
%34 = load double, double* %12
%35 = load double, double* %16
%36 = fsub double %34, %35
%37 = call double @llvm.fabs.f64(double %36)
%38 = load double, double* %13
%39 = load double, double* %17
%40 = fsub double %38, %39
%41 = call double @llvm.fabs.f64(double %40)
%42 = fadd double %37, %41
store double %42, double* %22
%43 = load double, double* %12
%44 = load double, double* %18
%45 = fsub double %43, %44
%46 = call double @llvm.fabs.f64(double %45)
%47 = load double, double* %13
%48 = load double, double* %19
%49 = fsub double %47, %48
%50 = call double @llvm.fabs.f64(double %49)
%51 = fadd double %46, %50
store double %51, double* %23
%52 = load double, double* %14
%53 = load double, double* %16
%54 = fsub double %52, %53
%55 = call double @llvm.fabs.f64(double %54)
%56 = load double, double* %15
%57 = load double, double* %17
%58 = fsub double %56, %57
%59 = call double @llvm.fabs.f64(double %58)
%60 = fadd double %55, %59
store double %60, double* %24
%61 = load double, double* %14
%62 = load double, double* %18
%63 = fsub double %61, %62
%64 = call double @llvm.fabs.f64(double %63)
%65 = load double, double* %15
%66 = load double, double* %19
%67 = fsub double %65, %66
%68 = call double @llvm.fabs.f64(double %67)
%69 = fadd double %64, %68
store double %69, double* %25
%70 = load double, double* %22
%71 = fcmp olt double %70, 2.000000e-10
br i1 %71, label %75, label %72
72: ; preds = %10
%73 = load double, double* %23
%74 = fcmp olt double %73, 2.000000e-10
br i1 %74, label %75, label %88
75: ; preds = %72, %10
%76 = load double*, double** %20
%77 = icmp ne double* %76, null
br i1 %77, label %78, label %81
78: ; preds = %75
%79 = load double, double* %12
%80 = load double*, double** %20
store double %79, double* %80
br label %81
81: ; preds = %78, %75
%82 = load double*, double** %21
%83 = icmp ne double* %82, null
br i1 %83, label %84, label %87
84: ; preds = %81
%85 = load double, double* %13
%86 = load double*, double** %21
store double %85, double* %86
br label %87
87: ; preds = %84, %81
store i32 -1, i32* %11
br label %243
88: ; preds = %72
%89 = load double, double* %24
%90 = fcmp olt double %89, 2.000000e-10
br i1 %90, label %94, label %91
91: ; preds = %88
%92 = load double, double* %25
%93 = fcmp olt double %92, 2.000000e-10
br i1 %93, label %94, label %107
94: ; preds = %91, %88
%95 = load double*, double** %20
%96 = icmp ne double* %95, null
br i1 %96, label %97, label %100
97: ; preds = %94
%98 = load double, double* %14
%99 = load double*, double** %20
store double %98, double* %99
br label %100
100: ; preds = %97, %94
%101 = load double*, double** %21
%102 = icmp ne double* %101, null
br i1 %102, label %103, label %106
103: ; preds = %100
%104 = load double, double* %15
%105 = load double*, double** %21
store double %104, double* %105
br label %106
106: ; preds = %103, %100
store i32 -1, i32* %11
br label %243
107: ; preds = %91
%108 = load double, double* %14
%109 = load double, double* %12
%110 = fsub double %108, %109
store double %110, double* %26
%111 = load double, double* %15
%112 = load double, double* %13
%113 = fsub double %111, %112
store double %113, double* %27
%114 = load double, double* %18
%115 = load double, double* %16
%116 = fsub double %114, %115
store double %116, double* %28
%117 = load double, double* %19
%118 = load double, double* %17
%119 = fsub double %117, %118
store double %119, double* %29
%120 = load double, double* %27
%121 = fneg double %120
%122 = load double, double* %12
%123 = load double, double* %16
%124 = fsub double %122, %123
%125 = load double, double* %26
%126 = load double, double* %13
%127 = load double, double* %17
%128 = fsub double %126, %127
%129 = fmul double %125, %128
%130 = call double @llvm.fmuladd.f64(double %121, double %124, double %129)
%131 = load double, double* %28
%132 = fneg double %131
%133 = load double, double* %27
%134 = load double, double* %26
%135 = load double, double* %29
%136 = fmul double %134, %135
%137 = call double @llvm.fmuladd.f64(double %132, double %133, double %136)
%138 = fdiv double %130, %137
store double %138, double* %30
%139 = load double, double* %28
%140 = load double, double* %13
%141 = load double, double* %17
%142 = fsub double %140, %141
%143 = load double, double* %29
%144 = load double, double* %12
%145 = load double, double* %16
%146 = fsub double %144, %145
%147 = fmul double %143, %146
%148 = fneg double %147
%149 = call double @llvm.fmuladd.f64(double %139, double %142, double %148)
%150 = load double, double* %28
%151 = fneg double %150
%152 = load double, double* %27
%153 = load double, double* %26
%154 = load double, double* %29
%155 = fmul double %153, %154
%156 = call double @llvm.fmuladd.f64(double %151, double %152, double %155)
%157 = fdiv double %149, %156
store double %157, double* %31
%158 = load double, double* %30
%159 = fcmp oge double %158, 0.000000e+00
br i1 %159, label %160, label %242
160: ; preds = %107
%161 = load double, double* %30
%162 = fcmp ole double %161, 1.000000e+00
br i1 %162, label %163, label %242
163: ; preds = %160
%164 = load double, double* %31
%165 = fcmp oge double %164, 0.000000e+00
br i1 %165, label %166, label %242
166: ; preds = %163
%167 = load double, double* %31
%168 = fcmp ole double %167, 1.000000e+00
br i1 %168, label %169, label %242
169: ; preds = %166
%170 = load double, double* %12
%171 = load double, double* %31
%172 = load double, double* %26
%173 = call double @llvm.fmuladd.f64(double %171, double %172, double %170)
store double %173, double* %32
%174 = load double, double* %13
%175 = load double, double* %31
%176 = load double, double* %27
%177 = call double @llvm.fmuladd.f64(double %175, double %176, double %174)
store double %177, double* %33
%178 = load double*, double** %20
%179 = icmp ne double* %178, null
br i1 %179, label %180, label %183
180: ; preds = %169
%181 = load double, double* %32
%182 = load double*, double** %20
store double %181, double* %182
br label %183
183: ; preds = %180, %169
%184 = load double*, double** %21
%185 = icmp ne double* %184, null
br i1 %185, label %186, label %189
186: ; preds = %183
%187 = load double, double* %33
%188 = load double*, double** %21
store double %187, double* %188
br label %189
189: ; preds = %186, %183
%190 = load double, double* %32
%191 = load double, double* %12
%192 = fsub double %190, %191
%193 = call double @llvm.fabs.f64(double %192)
%194 = fcmp olt double %193, 1.000000e-10
br i1 %194, label %195, label %202
195: ; preds = %189
%196 = load double, double* %33
%197 = load double, double* %13
%198 = fsub double %196, %197
%199 = call double @llvm.fabs.f64(double %198)
%200 = fcmp olt double %199, 1.000000e-10
br i1 %200, label %201, label %202
201: ; preds = %195
store i32 -1, i32* %11
br label %243
202: ; preds = %195, %189
%203 = load double, double* %32
%204 = load double, double* %14
%205 = fsub double %203, %204
%206 = call double @llvm.fabs.f64(double %205)
%207 = fcmp olt double %206, 1.000000e-10
br i1 %207, label %208, label %215
208: ; preds = %202
%209 = load double, double* %33
%210 = load double, double* %15
%211 = fsub double %209, %210
%212 = call double @llvm.fabs.f64(double %211)
%213 = fcmp olt double %212, 1.000000e-10
br i1 %213, label %214, label %215
214: ; preds = %208
store i32 -1, i32* %11
br label %243
215: ; preds = %208, %202
%216 = load double, double* %32
%217 = load double, double* %16
%218 = fsub double %216, %217
%219 = call double @llvm.fabs.f64(double %218)
%220 = fcmp olt double %219, 1.000000e-10
br i1 %220, label %221, label %228
221: ; preds = %215
%222 = load double, double* %33
%223 = load double, double* %17
%224 = fsub double %222, %223
%225 = call double @llvm.fabs.f64(double %224)
%226 = fcmp olt double %225, 1.000000e-10
br i1 %226, label %227, label %228
227: ; preds = %221
store i32 -1, i32* %11
br label %243
228: ; preds = %221, %215
%229 = load double, double* %32
%230 = load double, double* %18
%231 = fsub double %229, %230
%232 = call double @llvm.fabs.f64(double %231)
%233 = fcmp olt double %232, 1.000000e-10
br i1 %233, label %234, label %241
234: ; preds = %228
%235 = load double, double* %33
%236 = load double, double* %19
%237 = fsub double %235, %236
%238 = call double @llvm.fabs.f64(double %237)
%239 = fcmp olt double %238, 1.000000e-10
br i1 %239, label %240, label %241
240: ; preds = %234
store i32 -1, i32* %11
br label %243
241: ; preds = %234, %228
store i32 1, i32* %11
br label %243
242: ; preds = %166, %163, %160, %107
store i32 0, i32* %11
br label %243
243: ; preds = %242, %241, %240, %227, %214, %201, %106, %87
%244 = load i32, i32* %11
ret i32 %244
}

LLVM IR (-O2):
define i32 @get_line_intersection(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double* writeonly %8, double* writeonly %9) {
%11 = fsub double %0, %4
%12 = tail call double @llvm.fabs.f64(double %11)
%13 = fsub double %1, %5
%14 = tail call double @llvm.fabs.f64(double %13)
%15 = fadd double %12, %14
%16 = insertelement <2 x double> poison, double %0, i64 0
%17 = insertelement <2 x double> %16, double %1, i64 1
%18 = insertelement <2 x double> poison, double %6, i64 0
%19 = insertelement <2 x double> %18, double %7, i64 1
%20 = fsub <2 x double> %17, %19
%21 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %20)
%22 = shufflevector <2 x double> %21, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%23 = fadd <2 x double> %21, %22
%24 = extractelement <2 x double> %23, i64 0
%25 = fcmp olt double %15, 2.000000e-10
%26 = fcmp olt double %24, 2.000000e-10
%27 = select i1 %25, i1 true, i1 %26
br i1 %27, label %28, label %34
28: ; preds = %10
%29 = icmp eq double* %8, null
br i1 %29, label %31, label %30
30: ; preds = %28
store double %0, double* %8
br label %31
31: ; preds = %30, %28
%32 = icmp eq double* %9, null
br i1 %32, label %132, label %33
33: ; preds = %31
store double %1, double* %9
br label %132
34: ; preds = %10
%35 = insertelement <2 x double> poison, double %2, i64 0
%36 = insertelement <2 x double> %35, double %3, i64 1
%37 = fsub <2 x double> %36, %19
%38 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %37)
%39 = shufflevector <2 x double> %38, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%40 = fadd <2 x double> %38, %39
%41 = extractelement <2 x double> %40, i64 0
%42 = insertelement <2 x double> poison, double %4, i64 0
%43 = insertelement <2 x double> %42, double %5, i64 1
%44 = fsub <2 x double> %36, %43
%45 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %44)
%46 = shufflevector <2 x double> %45, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%47 = fadd <2 x double> %45, %46
%48 = extractelement <2 x double> %47, i64 0
%49 = fcmp olt double %48, 2.000000e-10
%50 = fcmp olt double %41, 2.000000e-10
%51 = select i1 %49, i1 true, i1 %50
br i1 %51, label %52, label %58
52: ; preds = %34
%53 = icmp eq double* %8, null
br i1 %53, label %55, label %54
54: ; preds = %52
store double %2, double* %8
br label %55
55: ; preds = %54, %52
%56 = icmp eq double* %9, null
br i1 %56, label %132, label %57
57: ; preds = %55
store double %3, double* %9
br label %132
58: ; preds = %34
%59 = fsub double %2, %0
%60 = fsub double %3, %1
%61 = fsub double %6, %4
%62 = fsub double %7, %5
%63 = fneg double %60
%64 = fmul double %59, %13
%65 = tail call double @llvm.fmuladd.f64(double %63, double %11, double %64)
%66 = fneg double %61
%67 = fneg double %62
%68 = insertelement <2 x double> poison, double %11, i64 0
%69 = insertelement <2 x double> %68, double %59, i64 1
%70 = insertelement <2 x double> poison, double %67, i64 0
%71 = insertelement <2 x double> %70, double %62, i64 1
%72 = fmul <2 x double> %69, %71
%73 = insertelement <2 x double> poison, double %61, i64 0
%74 = insertelement <2 x double> %73, double %66, i64 1
%75 = insertelement <2 x double> poison, double %13, i64 0
%76 = insertelement <2 x double> %75, double %60, i64 1
%77 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %74, <2 x double> %76, <2 x double> %72)
%78 = insertelement <2 x double> %77, double %65, i64 1
%79 = shufflevector <2 x double> %77, <2 x double> undef, <2 x i32> <i32 1, i32 1>
%80 = fdiv <2 x double> %78, %79
%81 = extractelement <2 x double> %80, i64 1
%82 = fcmp oge double %81, 0.000000e+00
%83 = fcmp ole <2 x double> %80, <double 1.000000e+00, double 1.000000e+00>
%84 = extractelement <2 x i1> %83, i64 1
%85 = and i1 %82, %84
%86 = extractelement <2 x double> %80, i64 0
%87 = fcmp oge double %86, 0.000000e+00
%88 = select i1 %85, i1 %87, i1 false
%89 = extractelement <2 x i1> %83, i64 0
%90 = select i1 %88, i1 %89, i1 false
br i1 %90, label %91, label %132
91: ; preds = %58
%92 = tail call double @llvm.fmuladd.f64(double %86, double %59, double %0)
%93 = tail call double @llvm.fmuladd.f64(double %86, double %60, double %1)
%94 = icmp eq double* %8, null
br i1 %94, label %96, label %95
95: ; preds = %91
store double %92, double* %8
br label %96
96: ; preds = %95, %91
%97 = icmp eq double* %9, null
br i1 %97, label %99, label %98
98: ; preds = %96
store double %93, double* %9
br label %99
99: ; preds = %98, %96
%100 = fsub double %92, %0
%101 = tail call double @llvm.fabs.f64(double %100)
%102 = fcmp olt double %101, 1.000000e-10
br i1 %102, label %103, label %107
103: ; preds = %99
%104 = fsub double %93, %1
%105 = tail call double @llvm.fabs.f64(double %104)
%106 = fcmp olt double %105, 1.000000e-10
br i1 %106, label %132, label %107
107: ; preds = %103, %99
%108 = fsub double %92, %2
%109 = tail call double @llvm.fabs.f64(double %108)
%110 = fcmp olt double %109, 1.000000e-10
br i1 %110, label %111, label %115
111: ; preds = %107
%112 = fsub double %93, %3
%113 = tail call double @llvm.fabs.f64(double %112)
%114 = fcmp olt double %113, 1.000000e-10
br i1 %114, label %132, label %115
115: ; preds = %111, %107
%116 = fsub double %92, %4
%117 = tail call double @llvm.fabs.f64(double %116)
%118 = fcmp olt double %117, 1.000000e-10
br i1 %118, label %119, label %123
119: ; preds = %115
%120 = fsub double %93, %5
%121 = tail call double @llvm.fabs.f64(double %120)
%122 = fcmp olt double %121, 1.000000e-10
br i1 %122, label %132, label %123
123: ; preds = %119, %115
%124 = fsub double %92, %6
%125 = tail call double @llvm.fabs.f64(double %124)
%126 = fcmp olt double %125, 1.000000e-10
br i1 %126, label %127, label %131
127: ; preds = %123
%128 = fsub double %93, %7
%129 = tail call double @llvm.fabs.f64(double %128)
%130 = fcmp olt double %129, 1.000000e-10
br i1 %130, label %132, label %131
131: ; preds = %127, %123
br label %132
132: ; preds = %127, %119, %111, %103, %131, %58, %55, %57, %31, %33
%133 = phi i32 [ -1, %33 ], [ -1, %31 ], [ -1, %57 ], [ -1, %55 ], [ 1, %131 ], [ -1, %103 ], [ -1, %111 ], [ -1, %119 ], [ -1, %127 ], [ 0, %58 ]
ret i32 %133
}