#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);
double Psi_reg(double x, double c) {
  if (fabs(x) > c)
    return (0.0);
  else
    return (x / c * (1.0 - (x / c) * (x / c)) * (1.0 - (x / c) * (x / c)));
}


x86 assembly (clang, -O0):
<Psi_reg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps 0xee6(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1136 <Psi_reg+0x36>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11c3 <Psi_reg+0xc3>
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
divsd  -0x18(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe99(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
divsd  -0x18(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe5a(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Psi_reg>:
movapd 0xef8(%rip),%xmm3
andpd  %xmm0,%xmm3
xorpd  %xmm2,%xmm2
ucomisd %xmm1,%xmm3
ja     113a <Psi_reg+0x3a>
divsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xee6(%rip),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm0
movapd %xmm0,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @Psi_reg(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = call double @llvm.fabs.f64(double %6)
%8 = load double, double* %5
%9 = fcmp ogt double %7, %8
br i1 %9, label %10, label %11
10: ; preds = %2
store double 0.000000e+00, double* %3
br label %33
11: ; preds = %2
%12 = load double, double* %4
%13 = load double, double* %5
%14 = fdiv double %12, %13
%15 = load double, double* %4
%16 = load double, double* %5
%17 = fdiv double %15, %16
%18 = load double, double* %4
%19 = load double, double* %5
%20 = fdiv double %18, %19
%21 = fneg double %17
%22 = call double @llvm.fmuladd.f64(double %21, double %20, double 1.000000e+00)
%23 = fmul double %14, %22
%24 = load double, double* %4
%25 = load double, double* %5
%26 = fdiv double %24, %25
%27 = load double, double* %4
%28 = load double, double* %5
%29 = fdiv double %27, %28
%30 = fneg double %26
%31 = call double @llvm.fmuladd.f64(double %30, double %29, double 1.000000e+00)
%32 = fmul double %23, %31
store double %32, double* %3
br label %33
33: ; preds = %11, %10
%34 = load double, double* %3
ret double %34
}

LLVM IR (-O2):
define double @Psi_reg(double %0, double %1) {
%3 = tail call double @llvm.fabs.f64(double %0)
%4 = fcmp ogt double %3, %1
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = fdiv double %0, %1
%7 = fneg double %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double %6, double 1.000000e+00)
%9 = fmul double %6, %8
%10 = fmul double %8, %9
br label %11
11: ; preds = %2, %5
%12 = phi double [ %10, %5 ], [ 0.000000e+00, %2 ]
ret double %12
}