#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);
scalar_t__ sqrt(double);
double CDelta_delta(double x) {
  double abs_x = fabs(x);
  double root = -4. * x * x;
  double phi = -2. * abs_x;
  if (abs_x >= 2.0)
    return 0.;
  if (abs_x >= 1.0) {
    root += 12. * abs_x - 7.;
    phi += 5.;
    phi -= sqrt(root);
  } else {
    root += 4. * abs_x + 1;
    phi += 3.;
    phi += sqrt(root);
  }
  return 0.125 * phi;
}


x86 assembly (clang, -O0):
<CDelta_delta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps 0xf27(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xed6(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeb7(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe98(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     117f <CDelta_delta+0x6f>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1255 <CDelta_delta+0x145>
movsd  -0x18(%rbp),%xmm0
movsd  0xe8c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11f1 <CDelta_delta+0xe1>
movsd  -0x18(%rbp),%xmm0
movsd  0xe95(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe91(%rip),%xmm1
addsd  %xmm1,%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe6b(%rip),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <sqrt@plt>
cvtsi2sd %rax,%xmm1
movsd  -0x28(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1243 <CDelta_delta+0x133>
movsd  -0x18(%rbp),%xmm0
movsd  0xe2a(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe0e(%rip),%xmm1
addsd  %xmm1,%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe00(%rip),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <sqrt@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xdfd(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CDelta_delta>:
sub    $0x18,%rsp
movapd %xmm0,%xmm1
movapd 0xee0(%rip),%xmm2
andpd  %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd 0xef0(%rip),%xmm2
jae    11dc <CDelta_delta+0xcc>
movsd  0xed2(%rip),%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm2,%xmm3
mulsd  0xeca(%rip),%xmm3
mulsd  %xmm1,%xmm0
ucomisd 0xece(%rip),%xmm2
jae    1199 <CDelta_delta+0x89>
movsd  0xee4(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xeb8(%rip),%xmm1
addsd  %xmm1,%xmm0
addsd  0xed4(%rip),%xmm3
movapd %xmm3,(%rsp)
call   1030 <sqrt@plt>
movapd (%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
addsd  %xmm1,%xmm0
jmp    11d4 <CDelta_delta+0xc4>
movsd  0xe8f(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe8b(%rip),%xmm1
addsd  %xmm1,%xmm0
addsd  0xe87(%rip),%xmm3
movapd %xmm3,(%rsp)
call   1030 <sqrt@plt>
movapd (%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
mulsd  0xe7c(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @CDelta_delta(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
%7 = load double, double* %3
%8 = call double @llvm.fabs.f64(double %7)
store double %8, double* %4
%9 = load double, double* %3
%10 = fmul double -4.000000e+00, %9
%11 = load double, double* %3
%12 = fmul double %10, %11
store double %12, double* %5
%13 = load double, double* %4
%14 = fmul double -2.000000e+00, %13
store double %14, double* %6
%15 = load double, double* %4
%16 = fcmp oge double %15, 2.000000e+00
br i1 %16, label %17, label %18
17: ; preds = %1
store double 0.000000e+00, double* %2
br label %48
18: ; preds = %1
%19 = load double, double* %4
%20 = fcmp oge double %19, 1.000000e+00
br i1 %20, label %21, label %33
21: ; preds = %18
%22 = load double, double* %4
%23 = call double @llvm.fmuladd.f64(double 1.200000e+01, double %22, double -7.000000e+00)
%24 = load double, double* %5
%25 = fadd double %24, %23
store double %25, double* %5
%26 = load double, double* %6
%27 = fadd double %26, 5.000000e+00
store double %27, double* %6
%28 = load double, double* %5
%29 = call i64 @sqrt(double %28)
%30 = sitofp i64 %29 to double
%31 = load double, double* %6
%32 = fsub double %31, %30
store double %32, double* %6
br label %45
33: ; preds = %18
%34 = load double, double* %4
%35 = call double @llvm.fmuladd.f64(double 4.000000e+00, double %34, double 1.000000e+00)
%36 = load double, double* %5
%37 = fadd double %36, %35
store double %37, double* %5
%38 = load double, double* %6
%39 = fadd double %38, 3.000000e+00
store double %39, double* %6
%40 = load double, double* %5
%41 = call i64 @sqrt(double %40)
%42 = sitofp i64 %41 to double
%43 = load double, double* %6
%44 = fadd double %43, %42
store double %44, double* %6
br label %45
45: ; preds = %33, %21
%46 = load double, double* %6
%47 = fmul double 1.250000e-01, %46
store double %47, double* %2
br label %48
48: ; preds = %45, %17
%49 = load double, double* %2
ret double %49
}

LLVM IR (-O2):
define double @CDelta_delta(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = fmul double %0, -4.000000e+00
%4 = fmul double %3, %0
%5 = fmul double %2, -2.000000e+00
%6 = fcmp ult double %2, 2.000000e+00
br i1 %6, label %7, label %26
7: ; preds = %1
%8 = fcmp ult double %2, 1.000000e+00
br i1 %8, label %16, label %9
9: ; preds = %7
%10 = tail call double @llvm.fmuladd.f64(double %2, double 1.200000e+01, double -7.000000e+00)
%11 = fadd double %4, %10
%12 = fadd double %5, 5.000000e+00
%13 = tail call i64 @sqrt(double %11)
%14 = sitofp i64 %13 to double
%15 = fsub double %12, %14
br label %23
16: ; preds = %7
%17 = tail call double @llvm.fmuladd.f64(double %2, double 4.000000e+00, double 1.000000e+00)
%18 = fadd double %4, %17
%19 = fadd double %5, 3.000000e+00
%20 = tail call i64 @sqrt(double %18)
%21 = sitofp i64 %20 to double
%22 = fadd double %19, %21
br label %23
23: ; preds = %16, %9
%24 = phi double [ %15, %9 ], [ %22, %16 ]
%25 = fmul double %24, 1.250000e-01
br label %26
26: ; preds = %1, %23
%27 = phi double [ %25, %23 ], [ 0.000000e+00, %1 ]
ret double %27
}