int Overlap(double a1, double a2, double b1, double b2) {
  if (a2 < a1) {
    double d;
    d = a1;
    a1 = a2;
    a2 = d;
  }
  if (b2 < b1) {
    double d;
    d = b1;
    b1 = b2;
    b2 = d;
  }
  return ((((a2) < (b2) ? (a2) : (b2)) - ((a1) < (b1) ? (b1) : (a1))) > -1e-12);
}


x86 assembly (clang, -O0):
<Overlap>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    114a <Overlap+0x4a>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    117c <Overlap+0x7c>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    119f <Overlap+0x9f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    11a9 <Overlap+0xa9>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11d6 <Overlap+0xd6>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    11e0 <Overlap+0xe0>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe0a(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Overlap>:
movapd %xmm0,%xmm4
maxsd  %xmm1,%xmm4
minsd  %xmm0,%xmm1
movapd %xmm3,%xmm0
minsd  %xmm2,%xmm0
maxsd  %xmm1,%xmm0
maxsd  %xmm3,%xmm2
minsd  %xmm2,%xmm4
subsd  %xmm0,%xmm4
xor    %eax,%eax
ucomisd 0xed2(%rip),%xmm4
seta   %al
ret

LLVM IR (-O0):
define i32 @Overlap(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%11 = load double, double* %6
%12 = load double, double* %5
%13 = fcmp olt double %11, %12
br i1 %13, label %14, label %18
14: ; preds = %4
%15 = load double, double* %5
store double %15, double* %9
%16 = load double, double* %6
store double %16, double* %5
%17 = load double, double* %9
store double %17, double* %6
br label %18
18: ; preds = %14, %4
%19 = load double, double* %8
%20 = load double, double* %7
%21 = fcmp olt double %19, %20
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load double, double* %7
store double %23, double* %10
%24 = load double, double* %8
store double %24, double* %7
%25 = load double, double* %10
store double %25, double* %8
br label %26
26: ; preds = %22, %18
%27 = load double, double* %6
%28 = load double, double* %8
%29 = fcmp olt double %27, %28
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = load double, double* %6
br label %34
32: ; preds = %26
%33 = load double, double* %8
br label %34
34: ; preds = %32, %30
%35 = phi double [ %31, %30 ], [ %33, %32 ]
%36 = load double, double* %5
%37 = load double, double* %7
%38 = fcmp olt double %36, %37
br i1 %38, label %39, label %41
39: ; preds = %34
%40 = load double, double* %7
br label %43
41: ; preds = %34
%42 = load double, double* %5
br label %43
43: ; preds = %41, %39
%44 = phi double [ %40, %39 ], [ %42, %41 ]
%45 = fsub double %35, %44
%46 = fcmp ogt double %45, 0xBD719799812DEA11
%47 = zext i1 %46 to i32
ret i32 %47
}

LLVM IR (-O2):
define i32 @Overlap(double %0, double %1, double %2, double %3) {
%5 = fcmp olt double %1, %0
%6 = select i1 %5, double %0, double %1
%7 = select i1 %5, double %1, double %0
%8 = fcmp olt double %3, %2
%9 = select i1 %8, double %3, double %2
%10 = select i1 %8, double %2, double %3
%11 = fcmp olt double %6, %10
%12 = select i1 %11, double %6, double %10
%13 = fcmp olt double %7, %9
%14 = select i1 %13, double %9, double %7
%15 = fsub double %12, %14
%16 = fcmp ogt double %15, 0xBD719799812DEA11
%17 = zext i1 %16 to i32
ret i32 %17
}