#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 M_PI;
double cos(double);
double fabs(double);
double sin(double);
double sqrt(double);
double _rrc(double x, double b, double t) {
  double r;
  if (x == 0) {
    r = (1.0 / t) * (1.0 + b * (4.0 / M_PI - 1));
  } else if (fabs(x) == t / (4.0 * b)) {
    r = b / (t * sqrt(2.0)) *
        ((1.0 + 2.0 / M_PI) * sin(M_PI / (4.0 * b)) +
         (1.0 - 2.0 / M_PI) * cos(M_PI / (4.0 * b)));
  } else {
    double t1 = (4.0 * b * (x / t));
    double t2 = (sin(M_PI * (x / t) * (1.0 - b)) +
                 4.0 * b * (x / t) * cos(M_PI * (x / t) * (1.0 + b)));
    double t3 = (M_PI * (x / t) * (1.0 - t1 * t1));
    r = (1.0 / t) * (t2 / t3);
  }
  return (r);
}


x86 assembly (clang, -O0):
<_rrc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11b1 <_rrc+0x81>
jp     11b1 <_rrc+0x81>
movsd  0xe9e(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xe84(%rip),%xmm2
mov    0x2e65(%rip),%rax
divsd  (%rax),%xmm2
movsd  0xe79(%rip),%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe69(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1417 <_rrc+0x2e7>
movsd  -0x8(%rbp),%xmm0
movaps 0xe63(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xe32(%rip),%xmm2
mulsd  -0x10(%rbp),%xmm2
divsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jne    12e2 <_rrc+0x1b2>
jp     12e2 <_rrc+0x1b2>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xe0d(%rip),%xmm0
call   1050 <sqrt@plt>
movsd  -0x68(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xde6(%rip),%xmm1
mov    0x2db7(%rip),%rax
divsd  (%rax),%xmm1
movsd  0xdcb(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    0x2d9b(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xda7(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  0xd9c(%rip),%xmm1
mov    0x2d6d(%rip),%rax
divsd  (%rax),%xmm1
movsd  0xd81(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    0x2d51(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xd5d(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1040 <cos@plt>
movsd  -0x58(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm3
movaps %xmm0,%xmm4
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm4,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1412 <_rrc+0x2e2>
movsd  0xd16(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    0x2cdf(%rip),%rax
movsd  (%rax),%xmm0
movsd  -0x8(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xce5(%rip),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  0xcc2(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    0x2c8b(%rip),%rax
movsd  (%rax),%xmm0
movsd  -0x8(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc91(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <cos@plt>
movsd  -0x78(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x70(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    0x2c42(%rip),%rax
movsd  (%rax),%xmm0
movsd  -0x8(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xc23(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xc0e(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
divsd  -0x38(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1417 <_rrc+0x2e7>
movsd  -0x20(%rbp),%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_rrc>:
push   %rbx
sub    $0x40,%rsp
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm0
jne    1169 <_rrc+0x49>
jp     1169 <_rrc+0x49>
movsd  0xeef(%rip),%xmm3
mov    0x2ea8(%rip),%rax
movsd  0xed8(%rip),%xmm0
divsd  (%rax),%xmm0
addsd  0xeec(%rip),%xmm0
mulsd  %xmm0,%xmm1
addsd  %xmm3,%xmm1
divsd  %xmm2,%xmm3
mulsd  %xmm1,%xmm3
jmp    1234 <_rrc+0x114>
movapd 0xe8f(%rip),%xmm5
andpd  %xmm0,%xmm5
movsd  0xea3(%rip),%xmm4
mulsd  %xmm1,%xmm4
movapd %xmm2,%xmm3
divsd  %xmm4,%xmm3
ucomisd %xmm3,%xmm5
jne    123e <_rrc+0x11e>
jp     123e <_rrc+0x11e>
mulsd  0xe8f(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  %xmm1,0x8(%rsp)
mov    0x2e36(%rip),%rbx
movsd  (%rbx),%xmm0
movsd  0xe7a(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0xe5e(%rip),%xmm2
movsd  %xmm2,0x10(%rsp)
addsd  %xmm2,%xmm1
movsd  %xmm1,0x30(%rsp)
divsd  %xmm4,%xmm0
movsd  %xmm4,(%rsp)
call   1030 <sin@plt>
movapd %xmm0,0x20(%rsp)
movsd  (%rbx),%xmm0
movsd  0xe3e(%rip),%xmm2
divsd  %xmm0,%xmm2
movsd  0x10(%rsp),%xmm1
subsd  %xmm2,%xmm1
movsd  %xmm1,0x10(%rsp)
divsd  (%rsp),%xmm0
call   1040 <cos@plt>
movapd 0x20(%rsp),%xmm3
mulsd  0x10(%rsp),%xmm0
mulsd  0x30(%rsp),%xmm3
addsd  %xmm0,%xmm3
mulsd  0x8(%rsp),%xmm3
movapd %xmm3,%xmm0
add    $0x40,%rsp
pop    %rbx
ret
divsd  %xmm2,%xmm0
movapd %xmm0,0x10(%rsp)
mulsd  %xmm0,%xmm4
movsd  %xmm4,(%rsp)
mov    0x2d90(%rip),%rbx
movsd  (%rbx),%xmm3
mulsd  %xmm0,%xmm3
movsd  0xdc0(%rip),%xmm0
subsd  %xmm1,%xmm0
mulsd  %xmm3,%xmm0
movsd  %xmm1,0x8(%rsp)
movapd %xmm2,0x30(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,0x20(%rsp)
movsd  (%rbx),%xmm0
mulsd  0x10(%rsp),%xmm0
movsd  0xd8f(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
call   1040 <cos@plt>
movsd  (%rsp),%xmm1
mulsd  %xmm1,%xmm0
addsd  0x20(%rsp),%xmm0
movapd 0x10(%rsp),%xmm2
mulsd  (%rbx),%xmm2
mulsd  %xmm1,%xmm1
movapd %xmm1,%xmm3
movsd  0xd4f(%rip),%xmm1
subsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm1
movapd %xmm1,%xmm2
movapd 0xd23(%rip),%xmm1
unpcklpd %xmm0,%xmm1
movapd 0x30(%rsp),%xmm0
unpcklpd %xmm2,%xmm0
divpd  %xmm0,%xmm1
movapd %xmm1,%xmm3
unpckhpd %xmm1,%xmm3
jmp    1160 <_rrc+0x40>

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @_rrc(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%11 = load double, double* %4
%12 = fcmp oeq double %11, 0.000000e+00
br i1 %12, label %13, label %22
13: ; preds = %3
%14 = load double, double* %6
%15 = fdiv double 1.000000e+00, %14
%16 = load double, double* %5
%17 = load double, double* @M_PI
%18 = fdiv double 4.000000e+00, %17
%19 = fsub double %18, 1.000000e+00
%20 = call double @llvm.fmuladd.f64(double %16, double %19, double 1.000000e+00)
%21 = fmul double %15, %20
store double %21, double* %7
br label %104
22: ; preds = %3
%23 = load double, double* %4
%24 = call double @llvm.fabs.f64(double %23)
%25 = load double, double* %6
%26 = load double, double* %5
%27 = fmul double 4.000000e+00, %26
%28 = fdiv double %25, %27
%29 = fcmp oeq double %24, %28
br i1 %29, label %30, label %55
30: ; preds = %22
%31 = load double, double* %5
%32 = load double, double* %6
%33 = call double @sqrt(double 2.000000e+00)
%34 = fmul double %32, %33
%35 = fdiv double %31, %34
%36 = load double, double* @M_PI
%37 = fdiv double 2.000000e+00, %36
%38 = fadd double 1.000000e+00, %37
%39 = load double, double* @M_PI
%40 = load double, double* %5
%41 = fmul double 4.000000e+00, %40
%42 = fdiv double %39, %41
%43 = call double @sin(double %42)
%44 = load double, double* @M_PI
%45 = fdiv double 2.000000e+00, %44
%46 = fsub double 1.000000e+00, %45
%47 = load double, double* @M_PI
%48 = load double, double* %5
%49 = fmul double 4.000000e+00, %48
%50 = fdiv double %47, %49
%51 = call double @cos(double %50)
%52 = fmul double %46, %51
%53 = call double @llvm.fmuladd.f64(double %38, double %43, double %52)
%54 = fmul double %35, %53
store double %54, double* %7
br label %103
55: ; preds = %22
%56 = load double, double* %5
%57 = fmul double 4.000000e+00, %56
%58 = load double, double* %4
%59 = load double, double* %6
%60 = fdiv double %58, %59
%61 = fmul double %57, %60
store double %61, double* %8
%62 = load double, double* @M_PI
%63 = load double, double* %4
%64 = load double, double* %6
%65 = fdiv double %63, %64
%66 = fmul double %62, %65
%67 = load double, double* %5
%68 = fsub double 1.000000e+00, %67
%69 = fmul double %66, %68
%70 = call double @sin(double %69)
%71 = load double, double* %5
%72 = fmul double 4.000000e+00, %71
%73 = load double, double* %4
%74 = load double, double* %6
%75 = fdiv double %73, %74
%76 = fmul double %72, %75
%77 = load double, double* @M_PI
%78 = load double, double* %4
%79 = load double, double* %6
%80 = fdiv double %78, %79
%81 = fmul double %77, %80
%82 = load double, double* %5
%83 = fadd double 1.000000e+00, %82
%84 = fmul double %81, %83
%85 = call double @cos(double %84)
%86 = call double @llvm.fmuladd.f64(double %76, double %85, double %70)
store double %86, double* %9
%87 = load double, double* @M_PI
%88 = load double, double* %4
%89 = load double, double* %6
%90 = fdiv double %88, %89
%91 = fmul double %87, %90
%92 = load double, double* %8
%93 = load double, double* %8
%94 = fneg double %92
%95 = call double @llvm.fmuladd.f64(double %94, double %93, double 1.000000e+00)
%96 = fmul double %91, %95
store double %96, double* %10
%97 = load double, double* %6
%98 = fdiv double 1.000000e+00, %97
%99 = load double, double* %9
%100 = load double, double* %10
%101 = fdiv double %99, %100
%102 = fmul double %98, %101
store double %102, double* %7
br label %103
103: ; preds = %55, %30
br label %104
104: ; preds = %103, %13
%105 = load double, double* %7
ret double %105
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @_rrc(double %0, double %1, double %2) {
%4 = fcmp oeq double %0, 0.000000e+00
br i1 %4, label %5, label %12
5: ; preds = %3
%6 = fdiv double 1.000000e+00, %2
%7 = load double, double* @M_PI
%8 = fdiv double 4.000000e+00, %7
%9 = fadd double %8, -1.000000e+00
%10 = tail call double @llvm.fmuladd.f64(double %1, double %9, double 1.000000e+00)
%11 = fmul double %6, %10
br label %59
12: ; preds = %3
%13 = tail call double @llvm.fabs.f64(double %0)
%14 = fmul double %1, 4.000000e+00
%15 = fdiv double %2, %14
%16 = fcmp oeq double %13, %15
br i1 %16, label %17, label %33
17: ; preds = %12
%18 = fmul double %2, 0x3FF6A09E667F3BCD
%19 = fdiv double %1, %18
%20 = load double, double* @M_PI
%21 = fdiv double 2.000000e+00, %20
%22 = fadd double %21, 1.000000e+00
%23 = fdiv double %20, %14
%24 = tail call double @sin(double %23)
%25 = load double, double* @M_PI
%26 = fdiv double 2.000000e+00, %25
%27 = fsub double 1.000000e+00, %26
%28 = fdiv double %25, %14
%29 = tail call double @cos(double %28)
%30 = fmul double %29, %27
%31 = tail call double @llvm.fmuladd.f64(double %22, double %24, double %30)
%32 = fmul double %19, %31
br label %59
33: ; preds = %12
%34 = fdiv double %0, %2
%35 = fmul double %14, %34
%36 = load double, double* @M_PI
%37 = fmul double %34, %36
%38 = fsub double 1.000000e+00, %1
%39 = fmul double %38, %37
%40 = tail call double @sin(double %39)
%41 = load double, double* @M_PI
%42 = fmul double %34, %41
%43 = fadd double %1, 1.000000e+00
%44 = fmul double %43, %42
%45 = tail call double @cos(double %44)
%46 = tail call double @llvm.fmuladd.f64(double %35, double %45, double %40)
%47 = load double, double* @M_PI
%48 = fmul double %34, %47
%49 = fneg double %35
%50 = tail call double @llvm.fmuladd.f64(double %49, double %35, double 1.000000e+00)
%51 = fmul double %50, %48
%52 = insertelement <2 x double> <double 1.000000e+00, double poison>, double %46, i64 1
%53 = insertelement <2 x double> poison, double %2, i64 0
%54 = insertelement <2 x double> %53, double %51, i64 1
%55 = fdiv <2 x double> %52, %54
%56 = shufflevector <2 x double> %55, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%57 = fmul <2 x double> %55, %56
%58 = extractelement <2 x double> %57, i64 0
br label %59
59: ; preds = %17, %33, %5
%60 = phi double [ %11, %5 ], [ %32, %17 ], [ %58, %33 ]
ret double %60
}