#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;
float cos(double);
int fabs(float);
float sinc(double);
double raised_cosine_time(double time, double alpha) {
  float f1, f2, alphatime;
  if (fabs(alpha) < 1e-8)
    return sinc(time);
  alphatime = time * alpha;
  f1 = 1 - 4 * alphatime * alphatime;
  if (fabs(f1) < 1e-10)
    f2 = M_PI / 4.0;
  else
    f2 = cos(M_PI * alphatime) / f1;
  return sinc(time) * f2;
}


x86 assembly (clang, -O0):
<raised_cosine_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xea4(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    117e <raised_cosine_time+0x4e>
movsd  -0x10(%rbp),%xmm0
call   1040 <sinc@plt>
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1249 <raised_cosine_time+0x119>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  0xe83(%rip),%xmm0
mulss  -0x24(%rbp),%xmm0
movss  -0x24(%rbp),%xmm1
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm1,%xmm0
movss  0xe5c(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe2d(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    120a <raised_cosine_time+0xda>
mov    0x2dfc(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xe18(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
jmp    1231 <raised_cosine_time+0x101>
mov    0x2dd7(%rip),%rax
movsd  (%rax),%xmm0
movss  -0x24(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
call   1050 <cos@plt>
divss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <sinc@plt>
mulss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raised_cosine_time>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
movsd  %xmm1,(%rsp)
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
call   1030 <fabs@plt>
test   %eax,%eax
jle    11b2 <raised_cosine_time+0x82>
movsd  (%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
movss  0xe97(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm1,0x14(%rsp)
mulss  %xmm1,%xmm0
addss  0xe85(%rip),%xmm0
movss  %xmm0,(%rsp)
call   1030 <fabs@plt>
mov    0x2e58(%rip),%rcx
movsd  (%rcx),%xmm0
test   %eax,%eax
jle    11bf <raised_cosine_time+0x8f>
movss  0x14(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
call   1050 <cos@plt>
divss  (%rsp),%xmm0
jmp    11cb <raised_cosine_time+0x9b>
movsd  0x8(%rsp),%xmm0
call   1040 <sinc@plt>
jmp    11e0 <raised_cosine_time+0xb0>
mulsd  0xe41(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <sinc@plt>
mulss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @raised_cosine_time(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca float
%7 = alloca float
%8 = alloca float
store double %0, double* %4
store double %1, double* %5
%9 = load double, double* %5
%10 = fptrunc double %9 to float
%11 = call i32 @fabs(float %10)
%12 = sitofp i32 %11 to double
%13 = fcmp olt double %12, 1.000000e-08
br i1 %13, label %14, label %18
14: ; preds = %2
%15 = load double, double* %4
%16 = call float @sinc(double %15)
%17 = fpext float %16 to double
store double %17, double* %3
br label %50
18: ; preds = %2
%19 = load double, double* %4
%20 = load double, double* %5
%21 = fmul double %19, %20
%22 = fptrunc double %21 to float
store float %22, float* %8
%23 = load float, float* %8
%24 = fmul float 4.000000e+00, %23
%25 = load float, float* %8
%26 = fneg float %24
%27 = call float @llvm.fmuladd.f32(float %26, float %25, float 1.000000e+00)
store float %27, float* %6
%28 = load float, float* %6
%29 = call i32 @fabs(float %28)
%30 = sitofp i32 %29 to double
%31 = fcmp olt double %30, 1.000000e-10
br i1 %31, label %32, label %36
32: ; preds = %18
%33 = load double, double* @M_PI
%34 = fdiv double %33, 4.000000e+00
%35 = fptrunc double %34 to float
store float %35, float* %7
br label %44
36: ; preds = %18
%37 = load double, double* @M_PI
%38 = load float, float* %8
%39 = fpext float %38 to double
%40 = fmul double %37, %39
%41 = call float @cos(double %40)
%42 = load float, float* %6
%43 = fdiv float %41, %42
store float %43, float* %7
br label %44
44: ; preds = %36, %32
%45 = load double, double* %4
%46 = call float @sinc(double %45)
%47 = load float, float* %7
%48 = fmul float %46, %47
%49 = fpext float %48 to double
store double %49, double* %3
br label %50
50: ; preds = %44, %14
%51 = load double, double* %3
ret double %51
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @raised_cosine_time(double %0, double %1) {
%3 = fptrunc double %1 to float
%4 = tail call i32 @fabs(float %3)
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call float @sinc(double %0)
br label %28
8: ; preds = %2
%9 = fmul double %0, %1
%10 = fptrunc double %9 to float
%11 = fmul float %10, -4.000000e+00
%12 = tail call float @llvm.fmuladd.f32(float %11, float %10, float 1.000000e+00)
%13 = tail call i32 @fabs(float %12)
%14 = icmp slt i32 %13, 1
%15 = load double, double* @M_PI
br i1 %14, label %16, label %19
16: ; preds = %8
%17 = fmul double %15, 2.500000e-01
%18 = fptrunc double %17 to float
br label %24
19: ; preds = %8
%20 = fpext float %10 to double
%21 = fmul double %15, %20
%22 = tail call float @cos(double %21)
%23 = fdiv float %22, %12
br label %24
24: ; preds = %19, %16
%25 = phi float [ %18, %16 ], [ %23, %19 ]
%26 = tail call float @sinc(double %0)
%27 = fmul float %25, %26
br label %28
28: ; preds = %24, %6
%29 = phi float [ %7, %6 ], [ %27, %24 ]
%30 = fpext float %29 to double
ret double %30
}