#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 area_arc(double, double, double, double, double);
double area_triangle(double, double, double, double, double, double);
double sqrt(double);
double circoverlap_core(double xmin, double ymin, double xmax, double ymax,
                        double r) {
  double a, b, x1, x2, y1, y2, r2, xmin2, ymin2, xmax2, ymax2;
  xmin2 = xmin * xmin;
  ymin2 = ymin * ymin;
  r2 = r * r;
  if (xmin2 + ymin2 > r2)
    return 0.;
  xmax2 = xmax * xmax;
  ymax2 = ymax * ymax;
  if (xmax2 + ymax2 < r2)
    return (xmax - xmin) * (ymax - ymin);
  a = xmax2 + ymin2;
  b = xmin2 + ymax2;
  if (a < r2 && b < r2) {
    x1 = sqrt(r2 - ymax2);
    y1 = ymax;
    x2 = xmax;
    y2 = sqrt(r2 - xmax2);
    return ((xmax - xmin) * (ymax - ymin) -
            area_triangle(x1, y1, x2, y2, xmax, ymax) +
            area_arc(x1, y1, x2, y2, r));
  }
  if (a < r2) {
    x1 = xmin;
    y1 = sqrt(r2 - xmin2);
    x2 = xmax;
    y2 = sqrt(r2 - xmax2);
    return (area_arc(x1, y1, x2, y2, r) +
            area_triangle(x1, y1, x1, ymin, xmax, ymin) +
            area_triangle(x1, y1, x2, ymin, x2, y2));
  }
  if (b < r2) {
    x1 = sqrt(r2 - ymin2);
    y1 = ymin;
    x2 = sqrt(r2 - ymax2);
    y2 = ymax;
    return (area_arc(x1, y1, x2, y2, r) +
            area_triangle(x1, y1, xmin, y1, xmin, ymax) +
            area_triangle(x1, y1, xmin, y2, x2, y2));
  }
  x1 = sqrt(r2 - ymin2);
  y1 = ymin;
  x2 = xmin;
  y2 = sqrt(r2 - xmin2);
  return (area_arc(x1, y1, x2, y2, r) +
          area_triangle(x1, y1, x2, y2, xmin, ymin));
}


x86 assembly (clang, -O0):
<circoverlap_core>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x70(%rbp),%xmm0
addsd  -0x78(%rbp),%xmm0
ucomisd -0x68(%rbp),%xmm0
jbe    11a3 <circoverlap_core+0x73>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    15b6 <circoverlap_core+0x486>
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x80(%rbp),%xmm1
addsd  -0x88(%rbp),%xmm1
ff
movsd  -0x68(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1202 <circoverlap_core+0xd2>
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    15b6 <circoverlap_core+0x486>
movsd  -0x80(%rbp),%xmm0
addsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x70(%rbp),%xmm0
addsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1342 <circoverlap_core+0x212>
movsd  -0x40(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1342 <circoverlap_core+0x212>
movsd  -0x68(%rbp),%xmm0
subsd  -0x88(%rbp),%xmm0
ff
call   1050 <sqrt@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x68(%rbp),%xmm0
subsd  -0x80(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm5
call   1030 <area_triangle@plt>
movsd  -0xa0(%rbp),%xmm2
ff
movaps %xmm0,%xmm1
movsd  -0x98(%rbp),%xmm0
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm4
call   1040 <area_arc@plt>
movaps %xmm0,%xmm1
movsd  -0x90(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    15b6 <circoverlap_core+0x486>
movsd  -0x38(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    142e <circoverlap_core+0x2fe>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x68(%rbp),%xmm0
subsd  -0x70(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x68(%rbp),%xmm0
subsd  -0x80(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm4
call   1040 <area_arc@plt>
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm4
movsd  -0x18(%rbp),%xmm5
call   1030 <area_triangle@plt>
movaps %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
movsd  -0x50(%rbp),%xmm4
movsd  -0x60(%rbp),%xmm5
call   1030 <area_triangle@plt>
movaps %xmm0,%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    15b6 <circoverlap_core+0x486>
movsd  -0x40(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    151d <circoverlap_core+0x3ed>
movsd  -0x68(%rbp),%xmm0
subsd  -0x78(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x68(%rbp),%xmm0
subsd  -0x88(%rbp),%xmm0
ff
call   1050 <sqrt@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm4
call   1040 <area_arc@plt>
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm3
movsd  -0x10(%rbp),%xmm4
movsd  -0x28(%rbp),%xmm5
call   1030 <area_triangle@plt>
movaps %xmm0,%xmm1
movsd  -0xc0(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
movsd  -0x50(%rbp),%xmm4
movsd  -0x60(%rbp),%xmm5
call   1030 <area_triangle@plt>
movaps %xmm0,%xmm1
movsd  -0xb8(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    15b6 <circoverlap_core+0x486>
movsd  -0x68(%rbp),%xmm0
subsd  -0x78(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x68(%rbp),%xmm0
subsd  -0x70(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm4
call   1040 <area_arc@plt>
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x48(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm3
movsd  -0x10(%rbp),%xmm4
movsd  -0x18(%rbp),%xmm5
call   1030 <area_triangle@plt>
movaps %xmm0,%xmm1
movsd  -0xc8(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circoverlap_core>:
sub    $0x48,%rsp
movapd %xmm0,%xmm8
movapd %xmm0,%xmm5
mulsd  %xmm0,%xmm5
movapd %xmm1,%xmm6
mulsd  %xmm1,%xmm6
movapd %xmm4,%xmm9
mulsd  %xmm4,%xmm9
movapd %xmm5,%xmm7
addsd  %xmm6,%xmm7
xorpd  %xmm0,%xmm0
ucomisd %xmm9,%xmm7
jbe    116b <circoverlap_core+0x3b>
add    $0x48,%rsp
ret
movapd %xmm2,%xmm10
mulsd  %xmm2,%xmm10
movapd %xmm3,%xmm7
mulsd  %xmm3,%xmm7
movapd %xmm10,%xmm0
addsd  %xmm7,%xmm0
ucomisd %xmm0,%xmm9
jbe    11a3 <circoverlap_core+0x73>
subsd  %xmm8,%xmm2
subsd  %xmm1,%xmm3
mulsd  %xmm2,%xmm3
movapd %xmm3,%xmm0
add    $0x48,%rsp
ret
movapd %xmm6,%xmm0
addsd  %xmm10,%xmm0
movapd %xmm5,%xmm11
addsd  %xmm7,%xmm11
ucomisd %xmm0,%xmm9
movsd  %xmm1,0x28(%rsp)
movsd  %xmm8,0x18(%rsp)
movsd  %xmm4,(%rsp)
jbe    11fb <circoverlap_core+0xcb>
ucomisd %xmm11,%xmm9
jbe    11fb <circoverlap_core+0xcb>
movapd %xmm9,%xmm0
subsd  %xmm7,%xmm0
xorpd  %xmm5,%xmm5
ucomisd %xmm5,%xmm0
movsd  %xmm3,0x8(%rsp)
movsd  %xmm2,0x10(%rsp)
jb     124e <circoverlap_core+0x11e>
sqrtsd %xmm0,%xmm0
jmp    1273 <circoverlap_core+0x143>
ucomisd %xmm0,%xmm9
jbe    1228 <circoverlap_core+0xf8>
movapd %xmm9,%xmm0
subsd  %xmm5,%xmm0
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm0
movsd  %xmm2,0x10(%rsp)
jb     1325 <circoverlap_core+0x1f5>
sqrtsd %xmm0,%xmm0
jmp    134a <circoverlap_core+0x21a>
movapd %xmm9,%xmm0
subsd  %xmm6,%xmm0
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
movsd  %xmm3,0x8(%rsp)
jb     1366 <circoverlap_core+0x236>
sqrtsd %xmm0,%xmm0
jmp    139f <circoverlap_core+0x26f>
movsd  %xmm9,0x30(%rsp)
movsd  %xmm10,0x38(%rsp)
call   1050 <sqrt@plt>
xorpd  %xmm5,%xmm5
movsd  0x38(%rsp),%xmm10
movsd  0x30(%rsp),%xmm9
movsd  %xmm0,0x20(%rsp)
subsd  %xmm10,%xmm9
ucomisd %xmm5,%xmm9
jb     128f <circoverlap_core+0x15f>
xorps  %xmm3,%xmm3
sqrtsd %xmm9,%xmm3
jmp    129d <circoverlap_core+0x16d>
movapd %xmm9,%xmm0
call   1050 <sqrt@plt>
movapd %xmm0,%xmm3
movsd  0x28(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x8(%rsp),%xmm5
movsd  0x10(%rsp),%xmm4
movapd %xmm4,%xmm0
subsd  %xmm2,%xmm0
movapd %xmm5,%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x18(%rsp)
movsd  0x20(%rsp),%xmm0
movapd %xmm5,%xmm1
movapd %xmm4,%xmm2
movsd  %xmm3,0x30(%rsp)
call   1030 <area_triangle@plt>
movsd  0x18(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0x20(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
movsd  0x30(%rsp),%xmm3
movsd  (%rsp),%xmm4
call   1040 <area_arc@plt>
addsd  0x18(%rsp),%xmm0
add    $0x48,%rsp
ret
movsd  %xmm9,0x30(%rsp)
movsd  %xmm10,0x38(%rsp)
call   1050 <sqrt@plt>
xorpd  %xmm3,%xmm3
movsd  0x38(%rsp),%xmm10
movsd  0x30(%rsp),%xmm9
movsd  %xmm0,0x8(%rsp)
subsd  %xmm10,%xmm9
ucomisd %xmm3,%xmm9
jb     13d1 <circoverlap_core+0x2a1>
xorps  %xmm3,%xmm3
sqrtsd %xmm9,%xmm3
jmp    13df <circoverlap_core+0x2af>
movsd  %xmm9,0x30(%rsp)
movsd  %xmm5,0x20(%rsp)
movsd  %xmm7,0x38(%rsp)
movsd  %xmm11,0x40(%rsp)
call   1050 <sqrt@plt>
movsd  0x40(%rsp),%xmm11
movsd  0x38(%rsp),%xmm7
movsd  0x20(%rsp),%xmm5
movsd  0x30(%rsp),%xmm9
movsd  %xmm0,0x10(%rsp)
ucomisd %xmm11,%xmm9
jbe    145a <circoverlap_core+0x32a>
subsd  %xmm7,%xmm9
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm9
jb     147b <circoverlap_core+0x34b>
xorps  %xmm2,%xmm2
sqrtsd %xmm9,%xmm2
jmp    1489 <circoverlap_core+0x359>
movapd %xmm9,%xmm0
call   1050 <sqrt@plt>
movapd %xmm0,%xmm3
movsd  0x18(%rsp),%xmm0
movsd  (%rsp),%xmm4
movsd  0x10(%rsp),%xmm2
movsd  0x8(%rsp),%xmm1
movsd  %xmm3,0x20(%rsp)
call   1040 <area_arc@plt>
movsd  %xmm0,(%rsp)
movsd  0x18(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movapd %xmm0,%xmm2
movsd  0x28(%rsp),%xmm3
movsd  0x10(%rsp),%xmm4
movaps %xmm3,%xmm5
call   1030 <area_triangle@plt>
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x18(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
movsd  0x28(%rsp),%xmm3
movaps %xmm2,%xmm4
movsd  0x20(%rsp),%xmm5
jmp    14fe <circoverlap_core+0x3ce>
subsd  %xmm5,%xmm9
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm9
jb     150d <circoverlap_core+0x3dd>
xorps  %xmm3,%xmm3
sqrtsd %xmm9,%xmm3
jmp    151b <circoverlap_core+0x3eb>
movapd %xmm9,%xmm0
call   1050 <sqrt@plt>
movapd %xmm0,%xmm2
movsd  0x28(%rsp),%xmm1
movsd  (%rsp),%xmm4
movsd  0x8(%rsp),%xmm3
movsd  0x10(%rsp),%xmm0
movsd  %xmm2,0x20(%rsp)
call   1040 <area_arc@plt>
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movaps %xmm1,%xmm3
movaps %xmm2,%xmm4
movsd  0x8(%rsp),%xmm5
call   1030 <area_triangle@plt>
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x8(%rsp),%xmm3
movsd  0x20(%rsp),%xmm4
movaps %xmm3,%xmm5
call   1030 <area_triangle@plt>
addsd  (%rsp),%xmm0
add    $0x48,%rsp
ret
movapd %xmm9,%xmm0
call   1050 <sqrt@plt>
movapd %xmm0,%xmm3
movsd  0x28(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  (%rsp),%xmm4
movsd  0x10(%rsp),%xmm0
movsd  %xmm3,0x20(%rsp)
call   1040 <area_arc@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
movsd  0x20(%rsp),%xmm3
movaps %xmm2,%xmm4
movaps %xmm1,%xmm5
call   1030 <area_triangle@plt>
addsd  0x8(%rsp),%xmm0
add    $0x48,%rsp
ret

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

LLVM IR (-O2):
define double @circoverlap_core(double %0, double %1, double %2, double %3, double %4) {
%6 = fmul double %0, %0
%7 = fmul double %1, %1
%8 = fmul double %4, %4
%9 = fadd double %6, %7
%10 = fcmp ogt double %9, %8
br i1 %10, label %66, label %11
11: ; preds = %5
%12 = fmul double %2, %2
%13 = fmul double %3, %3
%14 = fadd double %12, %13
%15 = fcmp olt double %14, %8
br i1 %15, label %16, label %20
16: ; preds = %11
%17 = fsub double %2, %0
%18 = fsub double %3, %1
%19 = fmul double %17, %18
br label %66
20: ; preds = %11
%21 = fadd double %7, %12
%22 = fadd double %6, %13
%23 = fcmp olt double %21, %8
%24 = fcmp olt double %22, %8
%25 = and i1 %23, %24
br i1 %25, label %26, label %38
26: ; preds = %20
%27 = fsub double %8, %13
%28 = tail call double @sqrt(double %27)
%29 = fsub double %8, %12
%30 = tail call double @sqrt(double %29)
%31 = fsub double %2, %0
%32 = fsub double %3, %1
%33 = tail call double @area_triangle(double %28, double %3, double %2, double %30, double %2, double %3)
%34 = fneg double %33
%35 = tail call double @llvm.fmuladd.f64(double %31, double %32, double %34)
%36 = tail call double @area_arc(double %28, double %3, double %2, double %30, double %4)
%37 = fadd double %35, %36
br label %66
38: ; preds = %20
br i1 %23, label %39, label %49
39: ; preds = %38
%40 = fsub double %8, %6
%41 = tail call double @sqrt(double %40)
%42 = fsub double %8, %12
%43 = tail call double @sqrt(double %42)
%44 = tail call double @area_arc(double %0, double %41, double %2, double %43, double %4)
%45 = tail call double @area_triangle(double %0, double %41, double %0, double %1, double %2, double %1)
%46 = fadd double %44, %45
%47 = tail call double @area_triangle(double %0, double %41, double %2, double %1, double %2, double %43)
%48 = fadd double %46, %47
br label %66
49: ; preds = %38
%50 = fsub double %8, %7
%51 = tail call double @sqrt(double %50)
br i1 %24, label %52, label %60
52: ; preds = %49
%53 = fsub double %8, %13
%54 = tail call double @sqrt(double %53)
%55 = tail call double @area_arc(double %51, double %1, double %54, double %3, double %4)
%56 = tail call double @area_triangle(double %51, double %1, double %0, double %1, double %0, double %3)
%57 = fadd double %55, %56
%58 = tail call double @area_triangle(double %51, double %1, double %0, double %3, double %54, double %3)
%59 = fadd double %57, %58
br label %66
60: ; preds = %49
%61 = fsub double %8, %6
%62 = tail call double @sqrt(double %61)
%63 = tail call double @area_arc(double %51, double %1, double %0, double %62, double %4)
%64 = tail call double @area_triangle(double %51, double %1, double %0, double %62, double %0, double %1)
%65 = fadd double %63, %64
br label %66
66: ; preds = %5, %60, %52, %39, %26, %16
%67 = phi double [ %19, %16 ], [ %37, %26 ], [ %48, %39 ], [ %59, %52 ], [ %65, %60 ], [ 0.000000e+00, %5 ]
ret double %67
}