#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 */
int M_PI;
float cosf(float);
int /*<<< orphan*/ exit(int);
int fabsf(float);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
float sinf(float);
int sqrtf(float);
int /*<<< orphan*/ stderr;
void liquid_firdes_rrcos(unsigned int _k, unsigned int _m, float _beta,
                         float _dt, float *_h) {
  if (_k < 1) {
    fprintf(stderr, "error: liquid_firdes_rrcos(): k must be greater than 0\n");
    exit(1);
  } else if (_m < 1) {
    fprintf(stderr, "error: liquid_firdes_rrcos(): m must be greater than 0\n");
    exit(1);
  } else if ((_beta < 0.0f) || (_beta > 1.0f)) {
    fprintf(stderr, "error: liquid_firdes_rrcos(): beta must be in [0,1]\n");
    exit(1);
  } else
    ;
  unsigned int n;
  float z, t1, t2, t3, t4, T = 1.0f;
  float nf, kf, mf;
  unsigned int h_len = 2 * _k * _m + 1;
  for (n = 0; n < h_len; n++) {
    nf = (float)n;
    kf = (float)_k;
    mf = (float)_m;
    z = (nf + _dt) / kf - mf;
    t1 = cosf((1 + _beta) * M_PI * z);
    t2 = sinf((1 - _beta) * M_PI * z);
    if (fabsf(z) < 1e-5) {
      _h[n] = 1 - _beta + 4 * _beta / M_PI;
    } else {
      t3 = 1 / ((4 * _beta * z));
      float g = 1 - 16 * _beta * _beta * z * z;
      g *= g;
      if (g < 1e-5) {
        float g1, g2, g3, g4;
        g1 = 1 + 2.0f / M_PI;
        g2 = sinf(0.25f * M_PI / _beta);
        g3 = 1 - 2.0f / M_PI;
        g4 = cosf(0.25f * M_PI / _beta);
        _h[n] = _beta / sqrtf(2.0f) * (g1 * g2 + g3 * g4);
      } else {
        t4 = 4 * _beta / (M_PI * sqrtf(T) * (1 - (16 * _beta * _beta * z * z)));
        _h[n] = t4 * (t1 + (t2 * t3));
      }
    }
  }
}


x86 assembly (clang, -O0):
<liquid_firdes_rrcos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x1,-0x4(%rbp)
jae    11a5 <liquid_firdes_rrcos+0x45>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
lea    0xe8a(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
cmpl   $0x1,-0x8(%rbp)
jae    11ce <liquid_firdes_rrcos+0x6e>
mov    0x2e22(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
ja     11f1 <liquid_firdes_rrcos+0x91>
movss  -0xc(%rbp),%xmm0
movss  0xe18(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1210 <liquid_firdes_rrcos+0xb0>
mov    0x2de0(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
jmp    1215 <liquid_firdes_rrcos+0xb5>
jmp    121a <liquid_firdes_rrcos+0xba>
jmp    121f <liquid_firdes_rrcos+0xbf>
movss  0xdd9(%rip),%xmm0
movss  %xmm0,-0x34(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
imul   -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x44(%rbp),%eax
jae    1582 <liquid_firdes_rrcos+0x422>
mov    -0x1c(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x38(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x3c(%rbp)
mov    -0x8(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x38(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
divss  -0x3c(%rbp),%xmm0
subss  -0x40(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  0xd69(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
mov    0x2d45(%rip),%rax
cvtsi2ssl (%rax),%xmm1
mulss  %xmm1,%xmm0
mulss  -0x20(%rbp),%xmm0
call   1050 <cosf@plt>
movss  %xmm0,-0x24(%rbp)
movss  0xd3e(%rip),%xmm0
subss  -0xc(%rbp),%xmm0
mov    0x2d1a(%rip),%rax
cvtsi2ssl (%rax),%xmm1
mulss  %xmm1,%xmm0
mulss  -0x20(%rbp),%xmm0
call   1040 <sinf@plt>
movss  %xmm0,-0x28(%rbp)
movss  -0x20(%rbp),%xmm0
call   1030 <fabsf@plt>
cvtsi2sd %eax,%xmm1
movsd  0xd1d(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1343 <liquid_firdes_rrcos+0x1e3>
movss  0xcf3(%rip),%xmm0
subss  -0xc(%rbp),%xmm0
movss  0xcee(%rip),%xmm1
mulss  -0xc(%rbp),%xmm1
mov    0x2cc2(%rip),%rax
cvtsi2ssl (%rax),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movss  %xmm0,(%rax,%rcx,4)
jmp    156f <liquid_firdes_rrcos+0x40f>
movss  0xcbd(%rip),%xmm1
mulss  -0xc(%rbp),%xmm1
mulss  -0x20(%rbp),%xmm1
movss  0xca3(%rip),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  0xc96(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
mulss  -0x20(%rbp),%xmm0
movss  -0x20(%rbp),%xmm1
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm1,%xmm0
movss  0xc65(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x48(%rbp)
movss  -0x48(%rbp),%xmm0
mulss  -0x48(%rbp),%xmm0
movss  %xmm0,-0x48(%rbp)
movss  -0x48(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xc54(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    14bf <liquid_firdes_rrcos+0x35f>
mov    0x2c13(%rip),%rax
cvtsi2ssl (%rax),%xmm0
movss  0xc2b(%rip),%xmm1
divss  %xmm0,%xmm1
movss  0xc13(%rip),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4c(%rbp)
mov    0x2beb(%rip),%rax
cvtsi2ssl (%rax),%xmm1
movss  0xc07(%rip),%xmm0
mulss  %xmm1,%xmm0
divss  -0xc(%rbp),%xmm0
call   1040 <sinf@plt>
movss  %xmm0,-0x50(%rbp)
mov    0x2bc5(%rip),%rax
cvtsi2ssl (%rax),%xmm0
movss  0xbdd(%rip),%xmm1
divss  %xmm0,%xmm1
movss  0xbc5(%rip),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x54(%rbp)
mov    0x2b9d(%rip),%rax
cvtsi2ssl (%rax),%xmm1
movss  0xbb9(%rip),%xmm0
mulss  %xmm1,%xmm0
divss  -0xc(%rbp),%xmm0
call   1050 <cosf@plt>
movss  %xmm0,-0x58(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x5c(%rbp)
movss  0xb90(%rip),%xmm0
call   1070 <sqrtf@plt>
movss  -0x5c(%rbp),%xmm0
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
movss  -0x4c(%rbp),%xmm1
movss  -0x50(%rbp),%xmm3
movss  -0x54(%rbp),%xmm2
mulss  -0x58(%rbp),%xmm2
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movss  %xmm0,(%rax,%rcx,4)
jmp    156a <liquid_firdes_rrcos+0x40a>
movss  0xb41(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x64(%rbp)
mov    0x2b10(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x60(%rbp)
movss  -0x34(%rbp),%xmm0
call   1070 <sqrtf@plt>
movss  -0x64(%rbp),%xmm0
mov    %eax,%ecx
mov    -0x60(%rbp),%eax
imul   %ecx,%eax
cvtsi2ss %eax,%xmm1
movss  0xb04(%rip),%xmm2
mulss  -0xc(%rbp),%xmm2
mulss  -0xc(%rbp),%xmm2
mulss  -0x20(%rbp),%xmm2
movss  -0x20(%rbp),%xmm3
movd   %xmm2,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
mulss  %xmm3,%xmm2
movss  0xad3(%rip),%xmm3
addss  %xmm3,%xmm2
mulss  %xmm2,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x30(%rbp),%xmm0
movss  -0x24(%rbp),%xmm2
movss  -0x28(%rbp),%xmm1
movss  -0x2c(%rbp),%xmm3
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movss  %xmm0,(%rax,%rcx,4)
jmp    156f <liquid_firdes_rrcos+0x40f>
jmp    1574 <liquid_firdes_rrcos+0x414>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1243 <liquid_firdes_rrcos+0xe3>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<liquid_firdes_rrcos>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x30,%rsp
movss  %xmm1,0x2c(%rsp)
test   %edi,%edi
je     1439 <liquid_firdes_rrcos+0x2d9>
movss  %xmm0,0x4(%rsp)
test   %esi,%esi
je     144b <liquid_firdes_rrcos+0x2eb>
xorps  %xmm0,%xmm0
movss  0x4(%rsp),%xmm1
ucomiss %xmm1,%xmm0
ja     145d <liquid_firdes_rrcos+0x2fd>
movaps %xmm1,%xmm0
ucomiss 0xe5c(%rip),%xmm1
ja     145d <liquid_firdes_rrcos+0x2fd>
mov    %rdx,%r14
mov    %edi,%eax
imul   %esi,%edi
lea    (%rdi,%rdi,1),%r15d
add    $0x1,%r15d
xorps  %xmm1,%xmm1
cvtsi2ss %rax,%xmm1
movss  %xmm1,0x28(%rsp)
mov    %esi,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %rax,%xmm1
movss  %xmm1,0x24(%rsp)
movss  0xe20(%rip),%xmm1
movaps %xmm0,%xmm2
addss  %xmm1,%xmm2
movss  %xmm2,0x20(%rsp)
subss  %xmm0,%xmm1
movss  %xmm1,0x18(%rsp)
movss  0xe05(%rip),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
movss  0xdf7(%rip),%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x1c(%rsp)
xor    %ebx,%ebx
mov    0x2dc0(%rip),%r12
jmp    125c <liquid_firdes_rrcos+0xfc>
nopw   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2ssl (%r12),%xmm0
movss  0xc(%rsp),%xmm1
divss  %xmm0,%xmm1
addss  0x18(%rsp),%xmm1
movss  %xmm1,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
je     142c <liquid_firdes_rrcos+0x2cc>
mov    %ebx,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %rax,%xmm1
addss  0x2c(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2ssl (%r12),%xmm0
divss  0x28(%rsp),%xmm1
subss  0x24(%rsp),%xmm1
movss  %xmm1,(%rsp)
mulss  0x20(%rsp),%xmm0
mulss  %xmm1,%xmm0
call   1050 <cosf@plt>
xorps  %xmm1,%xmm1
cvtsi2ssl (%r12),%xmm1
movss  %xmm0,0x10(%rsp)
mulss  0x18(%rsp),%xmm1
mulss  (%rsp),%xmm1
movaps %xmm1,%xmm0
call   1040 <sinf@plt>
movss  %xmm0,0x14(%rsp)
movss  (%rsp),%xmm0
call   1030 <fabsf@plt>
test   %eax,%eax
jle    1230 <liquid_firdes_rrcos+0xd0>
movss  0x1c(%rsp),%xmm4
movss  (%rsp),%xmm3
mulss  %xmm3,%xmm4
mulss  %xmm3,%xmm4
movss  0xd16(%rip),%xmm1
addss  %xmm1,%xmm4
movaps %xmm4,%xmm0
mulss  %xmm4,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd17(%rip),%xmm2
ucomisd %xmm0,%xmm2
jbe    13d0 <liquid_firdes_rrcos+0x270>
xorps  %xmm0,%xmm0
cvtsi2ssl (%r12),%xmm0
movss  0xcf0(%rip),%xmm2
divss  %xmm0,%xmm2
addss  %xmm1,%xmm2
movss  %xmm2,(%rsp)
movss  0xcdf(%rip),%xmm1
mulss  %xmm1,%xmm0
divss  0x4(%rsp),%xmm0
call   1040 <sinf@plt>
movss  %xmm0,0x14(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ssl (%r12),%xmm0
movss  0xcb5(%rip),%xmm1
divss  %xmm0,%xmm1
movss  0xc9d(%rip),%xmm2
subss  %xmm1,%xmm2
movss  %xmm2,0x10(%rsp)
mulss  0xc9b(%rip),%xmm0
divss  0x4(%rsp),%xmm0
call   1050 <cosf@plt>
movss  %xmm0,0x8(%rsp)
movss  0xc7e(%rip),%xmm0
call   1070 <sqrtf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  0x4(%rsp),%xmm1
divss  %xmm0,%xmm1
movss  0x8(%rsp),%xmm2
mulss  0x10(%rsp),%xmm2
movss  0x14(%rsp),%xmm0
mulss  (%rsp),%xmm0
addss  %xmm2,%xmm0
mulss  %xmm1,%xmm0
movaps %xmm0,%xmm1
jmp    1249 <liquid_firdes_rrcos+0xe9>
nopl   0x0(%rax,%rax,1)
mulss  0xc(%rsp),%xmm3
movaps %xmm1,%xmm0
divss  %xmm3,%xmm0
movss  %xmm0,(%rsp)
mov    (%r12),%ebp
movaps %xmm1,%xmm0
movss  %xmm4,0x8(%rsp)
call   1070 <sqrtf@plt>
imul   %ebp,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  0x8(%rsp),%xmm1
mulss  %xmm0,%xmm1
movss  0xc(%rsp),%xmm0
divss  %xmm1,%xmm0
movss  0x14(%rsp),%xmm1
mulss  (%rsp),%xmm1
addss  0x10(%rsp),%xmm1
mulss  %xmm0,%xmm1
jmp    1249 <liquid_firdes_rrcos+0xe9>
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b98(%rip),%rax
mov    (%rax),%edi
lea    0xbd7(%rip),%rsi
jmp    146d <liquid_firdes_rrcos+0x30d>
mov    0x2b86(%rip),%rax
mov    (%rax),%edi
lea    0xbfd(%rip),%rsi
jmp    146d <liquid_firdes_rrcos+0x30d>
mov    0x2b74(%rip),%rax
mov    (%rax),%edi
lea    0xc23(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c"error: liquid_firdes_rrcos(): k must be greater than 0\0A\00"
@.str.1 = [56 x i8] c"error: liquid_firdes_rrcos(): m must be greater than 0\0A\00"
@.str.2 = [53 x i8] c"error: liquid_firdes_rrcos(): beta must be in [0,1]\0A\00"
@M_PI = global i32 0
define void @liquid_firdes_rrcos(i32 %0, i32 %1, float %2, float %3, float* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca float*
%11 = alloca i32
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca float
%21 = alloca i32
%22 = alloca float
%23 = alloca float
%24 = alloca float
%25 = alloca float
%26 = alloca float
store i32 %0, i32* %6
store i32 %1, i32* %7
store float %2, float* %8
store float %3, float* %9
store float* %4, float** %10
%27 = load i32, i32* %6
%28 = icmp ult i32 %27, 1
br i1 %28, label %29, label %33
29: ; preds = %5
%30 = load i32, i32* @stderr
%31 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%32 = call i32 @exit(i32 1)
unreachable
33: ; preds = %5
%34 = load i32, i32* %7
%35 = icmp ult i32 %34, 1
br i1 %35, label %36, label %40
36: ; preds = %33
%37 = load i32, i32* @stderr
%38 = call i32 @fprintf(i32 %37, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%39 = call i32 @exit(i32 1)
unreachable
40: ; preds = %33
%41 = load float, float* %8
%42 = fcmp olt float %41, 0.000000e+00
br i1 %42, label %46, label %43
43: ; preds = %40
%44 = load float, float* %8
%45 = fcmp ogt float %44, 1.000000e+00
br i1 %45, label %46, label %50
46: ; preds = %43, %40
%47 = load i32, i32* @stderr
%48 = call i32 @fprintf(i32 %47, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%49 = call i32 @exit(i32 1)
unreachable
50: ; preds = %43
br label %51
51: ; preds = %50
br label %52
52: ; preds = %51
br label %53
53: ; preds = %52
store float 1.000000e+00, float* %17
%54 = load i32, i32* %6
%55 = mul i32 2, %54
%56 = load i32, i32* %7
%57 = mul i32 %55, %56
%58 = add i32 %57, 1
store i32 %58, i32* %21
store i32 0, i32* %11
br label %59
59: ; preds = %198, %53
%60 = load i32, i32* %11
%61 = load i32, i32* %21
%62 = icmp ult i32 %60, %61
br i1 %62, label %63, label %201
63: ; preds = %59
%64 = load i32, i32* %11
%65 = uitofp i32 %64 to float
store float %65, float* %18
%66 = load i32, i32* %6
%67 = uitofp i32 %66 to float
store float %67, float* %19
%68 = load i32, i32* %7
%69 = uitofp i32 %68 to float
store float %69, float* %20
%70 = load float, float* %18
%71 = load float, float* %9
%72 = fadd float %70, %71
%73 = load float, float* %19
%74 = fdiv float %72, %73
%75 = load float, float* %20
%76 = fsub float %74, %75
store float %76, float* %12
%77 = load float, float* %8
%78 = fadd float 1.000000e+00, %77
%79 = load i32, i32* @M_PI
%80 = sitofp i32 %79 to float
%81 = fmul float %78, %80
%82 = load float, float* %12
%83 = fmul float %81, %82
%84 = call float @cosf(float %83)
store float %84, float* %13
%85 = load float, float* %8
%86 = fsub float 1.000000e+00, %85
%87 = load i32, i32* @M_PI
%88 = sitofp i32 %87 to float
%89 = fmul float %86, %88
%90 = load float, float* %12
%91 = fmul float %89, %90
%92 = call float @sinf(float %91)
store float %92, float* %14
%93 = load float, float* %12
%94 = call i32 @fabsf(float %93)
%95 = sitofp i32 %94 to double
%96 = fcmp olt double %95, 1.000000e-05
br i1 %96, label %97, label %110
97: ; preds = %63
%98 = load float, float* %8
%99 = fsub float 1.000000e+00, %98
%100 = load float, float* %8
%101 = fmul float 4.000000e+00, %100
%102 = load i32, i32* @M_PI
%103 = sitofp i32 %102 to float
%104 = fdiv float %101, %103
%105 = fadd float %99, %104
%106 = load float*, float** %10
%107 = load i32, i32* %11
%108 = zext i32 %107 to i64
%109 = getelementptr inbounds float, float* %106, i64 %108
store float %105, float* %109
br label %197
110: ; preds = %63
%111 = load float, float* %8
%112 = fmul float 4.000000e+00, %111
%113 = load float, float* %12
%114 = fmul float %112, %113
%115 = fdiv float 1.000000e+00, %114
store float %115, float* %15
%116 = load float, float* %8
%117 = fmul float 1.600000e+01, %116
%118 = load float, float* %8
%119 = fmul float %117, %118
%120 = load float, float* %12
%121 = fmul float %119, %120
%122 = load float, float* %12
%123 = fneg float %121
%124 = call float @llvm.fmuladd.f32(float %123, float %122, float 1.000000e+00)
store float %124, float* %22
%125 = load float, float* %22
%126 = load float, float* %22
%127 = fmul float %126, %125
store float %127, float* %22
%128 = load float, float* %22
%129 = fpext float %128 to double
%130 = fcmp olt double %129, 1.000000e-05
br i1 %130, label %131, label %167
131: ; preds = %110
%132 = load i32, i32* @M_PI
%133 = sitofp i32 %132 to float
%134 = fdiv float 2.000000e+00, %133
%135 = fadd float 1.000000e+00, %134
store float %135, float* %23
%136 = load i32, i32* @M_PI
%137 = sitofp i32 %136 to float
%138 = fmul float 2.500000e-01, %137
%139 = load float, float* %8
%140 = fdiv float %138, %139
%141 = call float @sinf(float %140)
store float %141, float* %24
%142 = load i32, i32* @M_PI
%143 = sitofp i32 %142 to float
%144 = fdiv float 2.000000e+00, %143
%145 = fsub float 1.000000e+00, %144
store float %145, float* %25
%146 = load i32, i32* @M_PI
%147 = sitofp i32 %146 to float
%148 = fmul float 2.500000e-01, %147
%149 = load float, float* %8
%150 = fdiv float %148, %149
%151 = call float @cosf(float %150)
store float %151, float* %26
%152 = load float, float* %8
%153 = call i32 @sqrtf(float 2.000000e+00)
%154 = sitofp i32 %153 to float
%155 = fdiv float %152, %154
%156 = load float, float* %23
%157 = load float, float* %24
%158 = load float, float* %25
%159 = load float, float* %26
%160 = fmul float %158, %159
%161 = call float @llvm.fmuladd.f32(float %156, float %157, float %160)
%162 = fmul float %155, %161
%163 = load float*, float** %10
%164 = load i32, i32* %11
%165 = zext i32 %164 to i64
%166 = getelementptr inbounds float, float* %163, i64 %165
store float %162, float* %166
br label %196
167: ; preds = %110
%168 = load float, float* %8
%169 = fmul float 4.000000e+00, %168
%170 = load i32, i32* @M_PI
%171 = load float, float* %17
%172 = call i32 @sqrtf(float %171)
%173 = mul nsw i32 %170, %172
%174 = sitofp i32 %173 to float
%175 = load float, float* %8
%176 = fmul float 1.600000e+01, %175
%177 = load float, float* %8
%178 = fmul float %176, %177
%179 = load float, float* %12
%180 = fmul float %178, %179
%181 = load float, float* %12
%182 = fneg float %180
%183 = call float @llvm.fmuladd.f32(float %182, float %181, float 1.000000e+00)
%184 = fmul float %174, %183
%185 = fdiv float %169, %184
store float %185, float* %16
%186 = load float, float* %16
%187 = load float, float* %13
%188 = load float, float* %14
%189 = load float, float* %15
%190 = call float @llvm.fmuladd.f32(float %188, float %189, float %187)
%191 = fmul float %186, %190
%192 = load float*, float** %10
%193 = load i32, i32* %11
%194 = zext i32 %193 to i64
%195 = getelementptr inbounds float, float* %192, i64 %194
store float %191, float* %195
br label %196
196: ; preds = %167, %131
br label %197
197: ; preds = %196, %97
br label %198
198: ; preds = %197
%199 = load i32, i32* %11
%200 = add i32 %199, 1
store i32 %200, i32* %11
br label %59
201: ; preds = %59
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c"error: liquid_firdes_rrcos(): k must be greater than 0\0A\00"
@.str.1 = [56 x i8] c"error: liquid_firdes_rrcos(): m must be greater than 0\0A\00"
@.str.2 = [53 x i8] c"error: liquid_firdes_rrcos(): beta must be in [0,1]\0A\00"
@M_PI = global i32 0
define void @liquid_firdes_rrcos(i32 %0, i32 %1, float %2, float %3, float* nocapture writeonly %4) {
%6 = icmp eq i32 %0, 0
br i1 %6, label %7, label %11
7: ; preds = %5
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %5
%12 = icmp eq i32 %1, 0
br i1 %12, label %13, label %17
13: ; preds = %11
%14 = load i32, i32* @stderr
%15 = tail call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%16 = tail call i32 @exit(i32 1)
unreachable
17: ; preds = %11
%18 = fcmp olt float %2, 0.000000e+00
%19 = fcmp ogt float %2, 1.000000e+00
%20 = or i1 %18, %19
br i1 %20, label %21, label %25
21: ; preds = %17
%22 = load i32, i32* @stderr
%23 = tail call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%24 = tail call i32 @exit(i32 1)
unreachable
25: ; preds = %17
%26 = shl i32 %0, 1
%27 = mul i32 %26, %1
%28 = or i32 %27, 1
%29 = uitofp i32 %0 to float
%30 = uitofp i32 %1 to float
%31 = fadd float %2, 1.000000e+00
%32 = fsub float 1.000000e+00, %2
%33 = fmul float %2, 4.000000e+00
%34 = fmul float %2, -1.600000e+01
%35 = fmul float %34, %2
%36 = zext i32 %28 to i64
br label %37
37: ; preds = %25, %99
%38 = phi i64 [ 0, %25 ], [ %102, %99 ]
%39 = trunc i64 %38 to i32
%40 = uitofp i32 %39 to float
%41 = fadd float %40, %3
%42 = fdiv float %41, %29
%43 = fsub float %42, %30
%44 = load i32, i32* @M_PI
%45 = sitofp i32 %44 to float
%46 = fmul float %31, %45
%47 = fmul float %43, %46
%48 = tail call float @cosf(float %47)
%49 = load i32, i32* @M_PI
%50 = sitofp i32 %49 to float
%51 = fmul float %32, %50
%52 = fmul float %43, %51
%53 = tail call float @sinf(float %52)
%54 = tail call i32 @fabsf(float %43)
%55 = icmp slt i32 %54, 1
br i1 %55, label %56, label %61
56: ; preds = %37
%57 = load i32, i32* @M_PI
%58 = sitofp i32 %57 to float
%59 = fdiv float %33, %58
%60 = fadd float %32, %59
br label %99
61: ; preds = %37
%62 = fmul float %35, %43
%63 = tail call float @llvm.fmuladd.f32(float %62, float %43, float 1.000000e+00)
%64 = fmul float %63, %63
%65 = fpext float %64 to double
%66 = fcmp olt double %65, 1.000000e-05
br i1 %66, label %67, label %88
67: ; preds = %61
%68 = load i32, i32* @M_PI
%69 = sitofp i32 %68 to float
%70 = fdiv float 2.000000e+00, %69
%71 = fadd float %70, 1.000000e+00
%72 = fmul float %69, 2.500000e-01
%73 = fdiv float %72, %2
%74 = tail call float @sinf(float %73)
%75 = load i32, i32* @M_PI
%76 = sitofp i32 %75 to float
%77 = fdiv float 2.000000e+00, %76
%78 = fsub float 1.000000e+00, %77
%79 = fmul float %76, 2.500000e-01
%80 = fdiv float %79, %2
%81 = tail call float @cosf(float %80)
%82 = tail call i32 @sqrtf(float 2.000000e+00)
%83 = sitofp i32 %82 to float
%84 = fdiv float %2, %83
%85 = fmul float %81, %78
%86 = tail call float @llvm.fmuladd.f32(float %71, float %74, float %85)
%87 = fmul float %84, %86
br label %99
88: ; preds = %61
%89 = fmul float %33, %43
%90 = fdiv float 1.000000e+00, %89
%91 = load i32, i32* @M_PI
%92 = tail call i32 @sqrtf(float 1.000000e+00)
%93 = mul nsw i32 %92, %91
%94 = sitofp i32 %93 to float
%95 = fmul float %63, %94
%96 = fdiv float %33, %95
%97 = tail call float @llvm.fmuladd.f32(float %53, float %90, float %48)
%98 = fmul float %97, %96
br label %99
99: ; preds = %67, %88, %56
%100 = phi float [ %87, %67 ], [ %98, %88 ], [ %60, %56 ]
%101 = getelementptr inbounds float, float* %4, i64 %38
store float %100, float* %101
%102 = add nuw nsw i64 %38, 1
%103 = icmp eq i64 %102, %36
br i1 %103, label %104, label %37
104: ; preds = %99
ret void
}