#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 */
scalar_t__ point_between(double, double, double, double, double, double);
double sqrt(double);
int circle_line_segment_intersection(double x1, double y1, double x2, double y2,
                                     double cx, double cy, double r,
                                     double *ix1, double *iy1, double *ix2,
                                     double *iy2) {
  double line_seg_length;
  double dx, dy, ex, ey, LEC, t, dt, r2;
  double da, db;
  int first_point_inside = 0;
  int second_point_inside = 0;
  r2 = r * r;
  da = (cx - x1) * (cx - x1) + (cy - y1) * (cy - y1);
  if (da <= r2)
    first_point_inside = 1;
  db = (cx - x2) * (cx - x2) + (cy - y2) * (cy - y2);
  if (db <= r2)
    second_point_inside = 1;
  if (first_point_inside && second_point_inside) {
    *ix1 = x1;
    *iy1 = y1;
    *ix2 = x2;
    *iy2 = y2;
    return 0;
  }
  line_seg_length = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
  dx = (x2 - x1) / line_seg_length;
  dy = (y2 - y1) / line_seg_length;
  t = dx * (cx - x1) + dy * (cy - y1);
  ex = t * dx + x1;
  ey = t * dy + y1;
  LEC = sqrt((ex - cx) * (ex - cx) + (ey - cy) * (ey - cy));
  if (LEC >= r)
    return -1;
  dt = sqrt(r2 - LEC * LEC);
  *ix1 = (t - dt) * dx + x1;
  *iy1 = (t - dt) * dy + y1;
  *ix2 = (t + dt) * dx + x1;
  *iy2 = (t + dt) * dy + y1;
  if (first_point_inside) {
    if (point_between(x1, y1, *ix1, *iy1, x2, y2)) {
      *ix2 = x1;
      *iy2 = y1;
    } else {
      *ix1 = *ix2;
      *iy1 = *iy2;
      *ix2 = x1;
      *iy2 = y1;
    }
    return 1;
  }
  if (second_point_inside) {
    if (point_between(x1, y1, *ix1, *iy1, x2, y2)) {
      *ix1 = *ix2;
      *iy1 = *iy2;
      *ix2 = x2;
      *iy2 = y2;
    } else {
      *ix2 = x2;
      *iy2 = y2;
    }
    return 1;
  }
  if (point_between(x1, y1, *ix1, *iy1, x2, y2))
    return 2;
  return -1;
}


x86 assembly (clang, -O0):
<circle_line_segment_intersection>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%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)
mov    %rdi,-0x48(%rbp)
mov    %rsi,-0x50(%rbp)
mov    %rdx,-0x58(%rbp)
mov    %rcx,-0x60(%rbp)
movl   $0x0,-0xbc(%rbp)
movl   $0x0,-0xc0(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm3
subsd  -0x18(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm1
ff
movsd  -0xa8(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jb     11e4 <circle_line_segment_intersection+0xc4>
movl   $0x1,-0xbc(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
subsd  -0x20(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
subsd  -0x28(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm3
subsd  -0x28(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm1
ff
movsd  -0xa8(%rbp),%xmm0
ff
ucomisd %xmm1,%xmm0
jb     1244 <circle_line_segment_intersection+0x124>
movl   $0x1,-0xc0(%rbp)
cmpl   $0x0,-0xbc(%rbp)
je     129e <circle_line_segment_intersection+0x17e>
cmpl   $0x0,-0xc0(%rbp)
je     129e <circle_line_segment_intersection+0x17e>
movsd  -0x10(%rbp),%xmm0
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x50(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x58(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x60(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1659 <circle_line_segment_intersection+0x539>
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm3
subsd  -0x18(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
divsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
divsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
movsd  -0x78(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm3
subsd  -0x18(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0x70(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0x78(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm2
subsd  -0x30(%rbp),%xmm2
movsd  -0x88(%rbp),%xmm1
ff
subsd  -0x38(%rbp),%xmm1
movsd  -0x88(%rbp),%xmm3
ff
subsd  -0x38(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
ucomisd -0x40(%rbp),%xmm0
jb     13dd <circle_line_segment_intersection+0x2bd>
movl   $0xffffffff,-0x4(%rbp)
jmp    1659 <circle_line_segment_intersection+0x539>
movsd  -0xa8(%rbp),%xmm1
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm2
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
subsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x70(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x98(%rbp),%xmm0
ff
subsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x78(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x50(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x98(%rbp),%xmm0
ff
addsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x70(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x58(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x98(%rbp),%xmm0
ff
addsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x78(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x60(%rbp),%rax
movsd  %xmm0,(%rax)
cmpl   $0x0,-0xbc(%rbp)
je     156e <circle_line_segment_intersection+0x44e>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x48(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x50(%rbp),%rax
movsd  (%rax),%xmm3
movsd  -0x20(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm5
call   1030 <point_between@plt>
cmp    $0x0,%rax
je     1528 <circle_line_segment_intersection+0x408>
movsd  -0x10(%rbp),%xmm0
mov    -0x58(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x60(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1562 <circle_line_segment_intersection+0x442>
mov    -0x58(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x60(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x50(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x58(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x60(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1659 <circle_line_segment_intersection+0x539>
cmpl   $0x0,-0xc0(%rbp)
je     1613 <circle_line_segment_intersection+0x4f3>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x48(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x50(%rbp),%rax
movsd  (%rax),%xmm3
movsd  -0x20(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm5
call   1030 <point_between@plt>
cmp    $0x0,%rax
je     15ed <circle_line_segment_intersection+0x4cd>
mov    -0x58(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x60(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x50(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x58(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x60(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1607 <circle_line_segment_intersection+0x4e7>
movsd  -0x20(%rbp),%xmm0
mov    -0x58(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x60(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1659 <circle_line_segment_intersection+0x539>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x48(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x50(%rbp),%rax
movsd  (%rax),%xmm3
movsd  -0x20(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm5
call   1030 <point_between@plt>
cmp    $0x0,%rax
je     1652 <circle_line_segment_intersection+0x532>
movl   $0x2,-0x4(%rbp)
jmp    1659 <circle_line_segment_intersection+0x539>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circle_line_segment_intersection>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
movapd %xmm0,%xmm8
movapd %xmm6,%xmm9
mulsd  %xmm6,%xmm9
movapd %xmm4,%xmm11
subsd  %xmm0,%xmm11
movapd %xmm5,%xmm13
subsd  %xmm1,%xmm13
movapd %xmm13,%xmm0
mulsd  %xmm13,%xmm0
movapd %xmm11,%xmm12
mulsd  %xmm11,%xmm12
addsd  %xmm0,%xmm12
ucomisd %xmm12,%xmm9
movapd %xmm4,%xmm7
subsd  %xmm2,%xmm7
movapd %xmm5,%xmm0
subsd  %xmm3,%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm7,%xmm7
addsd  %xmm0,%xmm7
jb     11b9 <circle_line_segment_intersection+0x99>
ucomisd %xmm7,%xmm9
jb     11b9 <circle_line_segment_intersection+0x99>
movsd  %xmm8,(%rbx)
movsd  %xmm1,(%r12)
movsd  %xmm2,(%r15)
movsd  %xmm3,(%r14)
xor    %eax,%eax
jmp    144c <circle_line_segment_intersection+0x32c>
movsd  %xmm6,0x70(%rsp)
movsd  %xmm9,0x40(%rsp)
movapd %xmm2,%xmm9
subsd  %xmm8,%xmm9
movapd %xmm3,%xmm10
subsd  %xmm1,%xmm10
movapd %xmm10,%xmm6
mulsd  %xmm10,%xmm6
movapd %xmm9,%xmm0
mulsd  %xmm9,%xmm0
addsd  %xmm6,%xmm0
xorpd  %xmm6,%xmm6
ucomisd %xmm6,%xmm0
movsd  %xmm1,0x10(%rsp)
movsd  %xmm8,0x8(%rsp)
movsd  %xmm3,0x38(%rsp)
movsd  %xmm2,0x30(%rsp)
movsd  %xmm12,0x68(%rsp)
movsd  %xmm7,0x60(%rsp)
jb     1228 <circle_line_segment_intersection+0x108>
sqrtsd %xmm0,%xmm0
jmp    128e <circle_line_segment_intersection+0x16e>
movsd  %xmm11,0x28(%rsp)
movsd  %xmm9,0x20(%rsp)
movsd  %xmm10,0x18(%rsp)
movsd  %xmm5,0x58(%rsp)
movsd  %xmm4,0x50(%rsp)
movsd  %xmm13,0x48(%rsp)
call   1040 <sqrt@plt>
xorpd  %xmm6,%xmm6
movsd  0x48(%rsp),%xmm13
movsd  0x50(%rsp),%xmm4
movsd  0x58(%rsp),%xmm5
movsd  0x18(%rsp),%xmm10
movsd  0x20(%rsp),%xmm9
movsd  0x28(%rsp),%xmm11
movsd  0x8(%rsp),%xmm8
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm9
divsd  %xmm0,%xmm10
mulsd  %xmm10,%xmm13
mulsd  %xmm9,%xmm11
addsd  %xmm13,%xmm11
movapd %xmm11,%xmm0
mulsd  %xmm9,%xmm0
addsd  %xmm8,%xmm0
movapd %xmm11,%xmm2
mulsd  %xmm10,%xmm2
addsd  %xmm1,%xmm2
subsd  %xmm4,%xmm0
subsd  %xmm5,%xmm2
mulsd  %xmm2,%xmm2
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
ucomisd %xmm6,%xmm0
movsd  %xmm11,0x28(%rsp)
movsd  %xmm9,0x20(%rsp)
movsd  %xmm10,0x18(%rsp)
jb     12f9 <circle_line_segment_intersection+0x1d9>
sqrtsd %xmm0,%xmm0
jmp    12fe <circle_line_segment_intersection+0x1de>
call   1040 <sqrt@plt>
movsd  0x40(%rsp),%xmm1
mov    $0xffffffff,%eax
ucomisd 0x70(%rsp),%xmm0
jae    144c <circle_line_segment_intersection+0x32c>
mulsd  %xmm0,%xmm0
subsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     1330 <circle_line_segment_intersection+0x210>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    1339 <circle_line_segment_intersection+0x219>
movapd %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  0x38(%rsp),%xmm8
movsd  0x30(%rsp),%xmm9
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm6
movsd  0x28(%rsp),%xmm7
movsd  0x20(%rsp),%xmm5
movsd  0x18(%rsp),%xmm4
movapd %xmm7,%xmm3
subsd  %xmm0,%xmm3
movapd %xmm3,%xmm2
mulsd  %xmm5,%xmm2
addsd  %xmm6,%xmm2
movsd  %xmm2,(%rbx)
mulsd  %xmm4,%xmm3
addsd  %xmm1,%xmm3
movsd  %xmm3,(%r12)
addsd  %xmm0,%xmm7
mulsd  %xmm7,%xmm5
addsd  %xmm6,%xmm5
movsd  %xmm5,(%r15)
mulsd  %xmm4,%xmm7
addsd  %xmm1,%xmm7
movsd  %xmm7,(%r14)
movsd  (%rbx),%xmm2
movsd  (%r12),%xmm3
movapd %xmm6,%xmm0
movapd %xmm9,%xmm4
movapd %xmm8,%xmm5
call   1030 <point_between@plt>
movsd  0x40(%rsp),%xmm0
ucomisd 0x68(%rsp),%xmm0
jae    13f3 <circle_line_segment_intersection+0x2d3>
movsd  0x30(%rsp),%xmm2
movsd  0x38(%rsp),%xmm1
ucomisd 0x60(%rsp),%xmm0
jae    1424 <circle_line_segment_intersection+0x304>
cmp    $0x1,%rax
sbb    %eax,%eax
or     $0x2,%eax
jmp    144c <circle_line_segment_intersection+0x32c>
test   %rax,%rax
jne    140c <circle_line_segment_intersection+0x2ec>
movsd  (%r15),%xmm0
movsd  %xmm0,(%rbx)
movsd  (%r14),%xmm0
movsd  %xmm0,(%r12)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r15)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%r14)
jmp    1447 <circle_line_segment_intersection+0x327>
test   %rax,%rax
je     143d <circle_line_segment_intersection+0x31d>
movsd  (%r15),%xmm0
movsd  %xmm0,(%rbx)
movsd  (%r14),%xmm0
movsd  %xmm0,(%r12)
movsd  %xmm2,(%r15)
movsd  %xmm1,(%r14)
mov    $0x1,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @circle_line_segment_intersection(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double* nocapture %7, double* nocapture %8, double* nocapture %9, double* nocapture %10) {
%12 = fmul double %6, %6
%13 = fsub double %4, %0
%14 = fsub double %5, %1
%15 = fmul double %14, %14
%16 = tail call double @llvm.fmuladd.f64(double %13, double %13, double %15)
%17 = fcmp ugt double %16, %12
%18 = fsub double %4, %2
%19 = fsub double %5, %3
%20 = fmul double %19, %19
%21 = tail call double @llvm.fmuladd.f64(double %18, double %18, double %20)
%22 = fcmp ugt double %21, %12
%23 = select i1 %17, i1 true, i1 %22
br i1 %23, label %25, label %24
24: ; preds = %11
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
br label %70
25: ; preds = %11
%26 = fsub double %2, %0
%27 = fsub double %3, %1
%28 = fmul double %27, %27
%29 = tail call double @llvm.fmuladd.f64(double %26, double %26, double %28)
%30 = tail call double @sqrt(double %29)
%31 = fdiv double %26, %30
%32 = fdiv double %27, %30
%33 = fmul double %14, %32
%34 = tail call double @llvm.fmuladd.f64(double %31, double %13, double %33)
%35 = tail call double @llvm.fmuladd.f64(double %34, double %31, double %0)
%36 = tail call double @llvm.fmuladd.f64(double %34, double %32, double %1)
%37 = fsub double %35, %4
%38 = fsub double %36, %5
%39 = fmul double %38, %38
%40 = tail call double @llvm.fmuladd.f64(double %37, double %37, double %39)
%41 = tail call double @sqrt(double %40)
%42 = fcmp ult double %41, %6
br i1 %42, label %43, label %70
43: ; preds = %25
%44 = fneg double %41
%45 = tail call double @llvm.fmuladd.f64(double %44, double %41, double %12)
%46 = tail call double @sqrt(double %45)
%47 = fsub double %34, %46
%48 = tail call double @llvm.fmuladd.f64(double %47, double %31, double %0)
store double %48, double* %7
%49 = tail call double @llvm.fmuladd.f64(double %47, double %32, double %1)
store double %49, double* %8
%50 = fadd double %34, %46
%51 = tail call double @llvm.fmuladd.f64(double %50, double %31, double %0)
store double %51, double* %9
%52 = tail call double @llvm.fmuladd.f64(double %50, double %32, double %1)
store double %52, double* %10
%53 = load double, double* %7
%54 = load double, double* %8
%55 = tail call i64 @point_between(double %0, double %1, double %53, double %54, double %2, double %3)
%56 = icmp eq i64 %55, 0
br i1 %17, label %62, label %57
57: ; preds = %43
br i1 %56, label %58, label %61
58: ; preds = %57
%59 = load double, double* %9
store double %59, double* %7
%60 = load double, double* %10
store double %60, double* %8
br label %61
61: ; preds = %57, %58
store double %0, double* %9
store double %1, double* %10
br label %70
62: ; preds = %43
br i1 %22, label %68, label %63
63: ; preds = %62
br i1 %56, label %67, label %64
64: ; preds = %63
%65 = load double, double* %9
store double %65, double* %7
%66 = load double, double* %10
store double %66, double* %8
br label %67
67: ; preds = %63, %64
store double %2, double* %9
store double %3, double* %10
br label %70
68: ; preds = %62
%69 = select i1 %56, i32 -1, i32 2
br label %70
70: ; preds = %68, %25, %67, %61, %24
%71 = phi i32 [ 0, %24 ], [ 1, %61 ], [ 1, %67 ], [ -1, %25 ], [ %69, %68 ]
ret i32 %71
}