#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 /*<<< orphan*/ abort();
double atan(double);
double bessel_i0(double);
double floor(double);
int /*<<< orphan*/ free(double *);
double *malloc(int);
double sinc(double);
double sqrt(double);
void lfr_filter_calculate_s16(short *data, int nsamp, int nfilt, double offset,
                              double cutoff, double beta) {
  double x, x0, t, y, z, xscale, yscale, err;
  int i, j;
  double *a, sum, fac, scale;
  a = malloc(nsamp * sizeof(double));
  if (!a)
    abort();
  if (nsamp <= 8)
    scale = 31500;
  else
    scale = 32767;
  yscale = 2.0 * cutoff / bessel_i0(beta);
  xscale = (8.0 * atan(1.0)) * cutoff;
  for (i = 0; i < nfilt; ++i) {
    x0 = (nsamp - 1) / 2 + offset * i;
    sum = 0.0;
    for (j = 0; j < nsamp; ++j) {
      x = j - x0;
      t = x * (2.0 / (nsamp - 2));
      if (t <= -1.0 || t >= 1.0) {
        y = 0.0;
      } else {
        y = yscale * bessel_i0(beta * sqrt(1.0 - t * t)) * sinc(xscale * x);
      }
      a[j] = y;
      sum += y;
    }
    fac = scale / sum;
    err = 0.0;
    for (j = 0; j < nsamp; ++j) {
      y = a[j] * fac + err;
      z = floor(y + 0.5);
      err = z - y;
      data[i * nsamp + j] = (short)z;
    }
  }
  free(a);
}


x86 assembly (clang, -O0):
<lfr_filter_calculate_s16>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x78(%rbp)
cmpq   $0x0,-0x78(%rbp)
jne    11c9 <lfr_filter_calculate_s16+0x49>
mov    $0x0,%al
call   1040 <abort@plt>
cmpl   $0x8,-0xc(%rbp)
jg     11e8 <lfr_filter_calculate_s16+0x68>
movsd  0xe2d(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
jmp    11f8 <lfr_filter_calculate_s16+0x78>
movsd  0xe10(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xe20(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1080 <bessel_i0@plt>
movaps %xmm0,%xmm1
movsd  -0x98(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xde5(%rip),%xmm0
call   1050 <atan@plt>
movaps %xmm0,%xmm1
movsd  0xdcd(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    14a6 <lfr_filter_calculate_s16+0x326>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm1
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0x6c(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x0,-0x70(%rbp)
mov    -0x70(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    13df <lfr_filter_calculate_s16+0x25f>
cvtsi2sdl -0x70(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
cvtsi2sd %eax,%xmm2
movsd  0xd52(%rip),%xmm1
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xd4d(%rip),%xmm0
ucomisd -0x40(%rbp),%xmm0
jae    1305 <lfr_filter_calculate_s16+0x185>
movsd  -0x40(%rbp),%xmm0
movsd  0xd1d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1312 <lfr_filter_calculate_s16+0x192>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    13b0 <lfr_filter_calculate_s16+0x230>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x40(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xcbf(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1090 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
call   1080 <bessel_i0@plt>
movaps %xmm0,%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1060 <sinc@plt>
movaps %xmm0,%xmm1
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
mov    -0x78(%rbp),%rax
movslq -0x70(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
addsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    129c <lfr_filter_calculate_s16+0x11c>
movsd  -0x90(%rbp),%xmm0
ff
divsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movl   $0x0,-0x70(%rbp)
mov    -0x70(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1493 <lfr_filter_calculate_s16+0x313>
mov    -0x78(%rbp),%rax
movslq -0x70(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0x68(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xbe5(%rip),%xmm1
addsd  %xmm1,%xmm0
call   10a0 <floor@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x50(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %ax,%dx
mov    -0x8(%rbp),%rax
mov    -0x6c(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    -0x70(%rbp),%ecx
movslq %ecx,%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
jmp    1403 <lfr_filter_calculate_s16+0x283>
jmp    1498 <lfr_filter_calculate_s16+0x318>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    1258 <lfr_filter_calculate_s16+0xd8>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lfr_filter_calculate_s16>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x20(%rsp)
movsd  %xmm0,0x58(%rsp)
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,0x30(%rsp)
lea    0x0(,%rbp,8),%edi
call   1070 <malloc@plt>
test   %rax,%rax
je     14f3 <lfr_filter_calculate_s16+0x373>
mov    %rax,%rbx
xor    %r12d,%r12d
mov    %rbp,0x10(%rsp)
cmp    $0x9,%ebp
setl   %r15b
movsd  0x18(%rsp),%xmm0
call   1080 <bessel_i0@plt>
movsd  %xmm0,0x28(%rsp)
movsd  0xe23(%rip),%xmm0
call   1050 <atan@plt>
movsd  0xe16(%rip),%xmm2
test   %r14d,%r14d
jle    14da <lfr_filter_calculate_s16+0x35a>
mov    %r15b,%r12b
lea    0xdf3(%rip),%rax
movsd  (%rax,%r12,8),%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0x20(%rsp),%xmm0
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
mulsd  0xde9(%rip),%xmm0
movsd  %xmm0,0x20(%rsp)
mov    0x10(%rsp),%rcx
lea    -0x1(%rcx),%eax
shr    $0x1f,%eax
add    %ecx,%eax
add    $0xffffffff,%eax
sar    %eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x50(%rsp)
divsd  0x28(%rsp),%xmm1
movsd  %xmm1,0x70(%rsp)
lea    -0x2(%rcx),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xdae(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x28(%rsp)
movslq %ecx,%rdx
mov    %r14d,%eax
mov    %rax,0x68(%rsp)
mov    %ecx,%r14d
mov    %r14d,%ebp
and    $0xfffffffe,%ebp
mov    0x30(%rsp),%rax
lea    0x2(%rax),%r12
mov    %rdx,0x38(%rsp)
lea    (%rdx,%rdx,1),%rax
mov    %rax,0x60(%rsp)
xor    %r13d,%r13d
mov    %rbp,0x48(%rsp)
jmp    12d4 <lfr_filter_calculate_s16+0x154>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r13
add    0x60(%rsp),%r12
cmp    0x68(%rsp),%r13
je     14da <lfr_filter_calculate_s16+0x35a>
cmpl   $0x0,0x10(%rsp)
jle    12c0 <lfr_filter_calculate_s16+0x140>
xorps  %xmm4,%xmm4
cvtsi2sd %r13d,%xmm4
mulsd  0x58(%rsp),%xmm4
addsd  0x50(%rsp),%xmm4
xorpd  %xmm3,%xmm3
xor    %ebp,%ebp
movsd  %xmm4,0x78(%rsp)
jmp    1362 <lfr_filter_calculate_s16+0x1e2>
nopl   (%rax)
call   1090 <sqrt@plt>
movsd  0x18(%rsp),%xmm1
mulsd  %xmm1,%xmm0
call   1080 <bessel_i0@plt>
mulsd  0x70(%rsp),%xmm0
movsd  %xmm0,0x80(%rsp)
movsd  (%rsp),%xmm0
mulsd  0x20(%rsp),%xmm0
call   1060 <sinc@plt>
mulsd  0x80(%rsp),%xmm0
movsd  0xccc(%rip),%xmm2
movsd  0x8(%rsp),%xmm3
movsd  0x78(%rsp),%xmm4
movsd  %xmm0,(%rbx,%rbp,8)
addsd  %xmm0,%xmm3
add    $0x1,%rbp
cmp    %rbp,%r14
je     13d0 <lfr_filter_calculate_s16+0x250>
xorps  %xmm5,%xmm5
cvtsi2sd %ebp,%xmm5
subsd  %xmm4,%xmm5
movsd  0x28(%rsp),%xmm1
mulsd  %xmm5,%xmm1
movsd  0xca9(%rip),%xmm0
ucomisd %xmm1,%xmm0
xorpd  %xmm0,%xmm0
jae    1350 <lfr_filter_calculate_s16+0x1d0>
ucomisd %xmm2,%xmm1
xorpd  %xmm0,%xmm0
jae    1350 <lfr_filter_calculate_s16+0x1d0>
movsd  %xmm5,(%rsp)
movsd  %xmm3,0x8(%rsp)
mulsd  %xmm1,%xmm1
movapd %xmm2,%xmm0
subsd  %xmm1,%xmm0
ucomisd 0xc86(%rip),%xmm0
jb     1300 <lfr_filter_calculate_s16+0x180>
sqrtsd %xmm0,%xmm0
jmp    1305 <lfr_filter_calculate_s16+0x185>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp),%rax
test   %eax,%eax
mov    0x48(%rsp),%rbp
movsd  0xc4c(%rip),%xmm1
jle    12c0 <lfr_filter_calculate_s16+0x140>
movsd  0x40(%rsp),%xmm4
divsd  %xmm3,%xmm4
xorpd  %xmm0,%xmm0
xor    %r15d,%r15d
cmp    $0x1,%eax
je     148b <lfr_filter_calculate_s16+0x30b>
movsd  %xmm4,0x8(%rsp)
nopw   0x0(%rax,%rax,1)
movsd  (%rbx,%r15,8),%xmm2
mulsd  %xmm4,%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,(%rsp)
movapd %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   10a0 <floor@plt>
cvttsd2si %xmm0,%eax
subsd  (%rsp),%xmm0
mov    %ax,-0x2(%r12,%r15,2)
movsd  0x8(%rbx,%r15,8),%xmm1
mulsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movapd %xmm1,%xmm0
addsd  0xbcf(%rip),%xmm0
call   10a0 <floor@plt>
movsd  0x8(%rsp),%xmm4
movsd  0xbbc(%rip),%xmm1
cvttsd2si %xmm0,%eax
subsd  (%rsp),%xmm0
mov    %ax,(%r12,%r15,2)
add    $0x2,%r15
cmp    %r15,%rbp
jne    1410 <lfr_filter_calculate_s16+0x290>
test   $0x1,%r14b
movsd  0xb79(%rip),%xmm2
je     12c0 <lfr_filter_calculate_s16+0x140>
mov    %r13,%rbp
imul   0x38(%rsp),%rbp
mulsd  (%rbx,%r15,8),%xmm4
addsd  %xmm0,%xmm4
addsd  %xmm1,%xmm4
movapd %xmm4,%xmm0
call   10a0 <floor@plt>
movsd  0xb4b(%rip),%xmm2
cvttsd2si %xmm0,%eax
add    %r15,%rbp
mov    0x30(%rsp),%rcx
mov    %ax,(%rcx,%rbp,2)
jmp    12c0 <lfr_filter_calculate_s16+0x140>
mov    %rbx,%rdi
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @lfr_filter_calculate_s16(i16* %0, i32 %1, i32 %2, double %3, double %4, double %5) {
%7 = alloca i16*
%8 = alloca i32
%9 = alloca i32
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca i32
%22 = alloca i32
%23 = alloca double*
%24 = alloca double
%25 = alloca double
%26 = alloca double
store i16* %0, i16** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%27 = load i32, i32* %8
%28 = sext i32 %27 to i64
%29 = mul i64 %28, 8
%30 = trunc i64 %29 to i32
%31 = call double* @malloc(i32 %30)
store double* %31, double** %23
%32 = load double*, double** %23
%33 = icmp ne double* %32, null
br i1 %33, label %36, label %34
34: ; preds = %6
%35 = call i32 (...) @abort()
unreachable
36: ; preds = %6
%37 = load i32, i32* %8
%38 = icmp sle i32 %37, 8
br i1 %38, label %39, label %40
39: ; preds = %36
store double 3.150000e+04, double* %26
br label %41
40: ; preds = %36
store double 3.276700e+04, double* %26
br label %41
41: ; preds = %40, %39
%42 = load double, double* %11
%43 = fmul double 2.000000e+00, %42
%44 = load double, double* %12
%45 = call double @bessel_i0(double %44)
%46 = fdiv double %43, %45
store double %46, double* %19
%47 = call double @atan(double 1.000000e+00)
%48 = fmul double 8.000000e+00, %47
%49 = load double, double* %11
%50 = fmul double %48, %49
store double %50, double* %18
store i32 0, i32* %21
br label %51
51: ; preds = %150, %41
%52 = load i32, i32* %21
%53 = load i32, i32* %9
%54 = icmp slt i32 %52, %53
br i1 %54, label %55, label %153
55: ; preds = %51
%56 = load i32, i32* %8
%57 = sub nsw i32 %56, 1
%58 = sdiv i32 %57, 2
%59 = sitofp i32 %58 to double
%60 = load double, double* %10
%61 = load i32, i32* %21
%62 = sitofp i32 %61 to double
%63 = call double @llvm.fmuladd.f64(double %60, double %62, double %59)
store double %63, double* %14
store double 0.000000e+00, double* %24
store i32 0, i32* %22
br label %64
64: ; preds = %110, %55
%65 = load i32, i32* %22
%66 = load i32, i32* %8
%67 = icmp slt i32 %65, %66
br i1 %67, label %68, label %113
68: ; preds = %64
%69 = load i32, i32* %22
%70 = sitofp i32 %69 to double
%71 = load double, double* %14
%72 = fsub double %70, %71
store double %72, double* %13
%73 = load double, double* %13
%74 = load i32, i32* %8
%75 = sub nsw i32 %74, 2
%76 = sitofp i32 %75 to double
%77 = fdiv double 2.000000e+00, %76
%78 = fmul double %73, %77
store double %78, double* %15
%79 = load double, double* %15
%80 = fcmp ole double %79, -1.000000e+00
br i1 %80, label %84, label %81
81: ; preds = %68
%82 = load double, double* %15
%83 = fcmp oge double %82, 1.000000e+00
br i1 %83, label %84, label %85
84: ; preds = %81, %68
store double 0.000000e+00, double* %16
br label %101
85: ; preds = %81
%86 = load double, double* %19
%87 = load double, double* %12
%88 = load double, double* %15
%89 = load double, double* %15
%90 = fneg double %88
%91 = call double @llvm.fmuladd.f64(double %90, double %89, double 1.000000e+00)
%92 = call double @sqrt(double %91)
%93 = fmul double %87, %92
%94 = call double @bessel_i0(double %93)
%95 = fmul double %86, %94
%96 = load double, double* %18
%97 = load double, double* %13
%98 = fmul double %96, %97
%99 = call double @sinc(double %98)
%100 = fmul double %95, %99
store double %100, double* %16
br label %101
101: ; preds = %85, %84
%102 = load double, double* %16
%103 = load double*, double** %23
%104 = load i32, i32* %22
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds double, double* %103, i64 %105
store double %102, double* %106
%107 = load double, double* %16
%108 = load double, double* %24
%109 = fadd double %108, %107
store double %109, double* %24
br label %110
110: ; preds = %101
%111 = load i32, i32* %22
%112 = add nsw i32 %111, 1
store i32 %112, i32* %22
br label %64
113: ; preds = %64
%114 = load double, double* %26
%115 = load double, double* %24
%116 = fdiv double %114, %115
store double %116, double* %25
store double 0.000000e+00, double* %20
store i32 0, i32* %22
br label %117
117: ; preds = %146, %113
%118 = load i32, i32* %22
%119 = load i32, i32* %8
%120 = icmp slt i32 %118, %119
br i1 %120, label %121, label %149
121: ; preds = %117
%122 = load double*, double** %23
%123 = load i32, i32* %22
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds double, double* %122, i64 %124
%126 = load double, double* %125
%127 = load double, double* %25
%128 = load double, double* %20
%129 = call double @llvm.fmuladd.f64(double %126, double %127, double %128)
store double %129, double* %16
%130 = load double, double* %16
%131 = fadd double %130, 5.000000e-01
%132 = call double @llvm.floor.f64(double %131)
store double %132, double* %17
%133 = load double, double* %17
%134 = load double, double* %16
%135 = fsub double %133, %134
store double %135, double* %20
%136 = load double, double* %17
%137 = fptosi double %136 to i16
%138 = load i16*, i16** %7
%139 = load i32, i32* %21
%140 = load i32, i32* %8
%141 = mul nsw i32 %139, %140
%142 = load i32, i32* %22
%143 = add nsw i32 %141, %142
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds i16, i16* %138, i64 %144
store i16 %137, i16* %145
br label %146
146: ; preds = %121
%147 = load i32, i32* %22
%148 = add nsw i32 %147, 1
store i32 %148, i32* %22
br label %117
149: ; preds = %117
br label %150
150: ; preds = %149
%151 = load i32, i32* %21
%152 = add nsw i32 %151, 1
store i32 %152, i32* %21
br label %51
153: ; preds = %51
%154 = load double*, double** %23
%155 = call i32 @free(double* %154)
ret void
}

LLVM IR (-O2):
define void @lfr_filter_calculate_s16(i16* nocapture writeonly %0, i32 %1, i32 %2, double %3, double %4, double %5) {
%7 = shl i32 %1, 3
%8 = tail call double* @malloc(i32 %7)
%9 = icmp eq double* %8, null
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %6
%13 = icmp slt i32 %1, 9
%14 = select i1 %13, double 3.150000e+04, double 3.276700e+04
%15 = fmul double %4, 2.000000e+00
%16 = tail call double @bessel_i0(double %5)
%17 = fdiv double %15, %16
%18 = tail call double @atan(double 1.000000e+00)
%19 = fmul double %4, 0x401921FB54442D18
%20 = icmp sgt i32 %2, 0
br i1 %20, label %21, label %112
21: ; preds = %12
%22 = add nsw i32 %1, -1
%23 = sdiv i32 %22, 2
%24 = sitofp i32 %23 to double
%25 = icmp sgt i32 %1, 0
%26 = add nsw i32 %1, -2
%27 = sitofp i32 %26 to double
%28 = fdiv double 2.000000e+00, %27
%29 = sext i32 %1 to i64
%30 = zext i32 %2 to i64
%31 = zext i32 %1 to i64
%32 = and i64 %31, 1
%33 = icmp eq i32 %1, 1
%34 = and i64 %31, 4294967294
%35 = icmp eq i64 %32, 0
br label %36
36: ; preds = %21, %109
%37 = phi i64 [ 0, %21 ], [ %110, %109 ]
%38 = trunc i64 %37 to i32
%39 = sitofp i32 %38 to double
%40 = tail call double @llvm.fmuladd.f64(double %3, double %39, double %24)
br i1 %25, label %41, label %109
41: ; preds = %36, %61
%42 = phi i64 [ %65, %61 ], [ 0, %36 ]
%43 = phi double [ %64, %61 ], [ 0.000000e+00, %36 ]
%44 = trunc i64 %42 to i32
%45 = sitofp i32 %44 to double
%46 = fsub double %45, %40
%47 = fmul double %28, %46
%48 = fcmp ole double %47, -1.000000e+00
%49 = fcmp oge double %47, 1.000000e+00
%50 = or i1 %48, %49
br i1 %50, label %61, label %51
51: ; preds = %41
%52 = fneg double %47
%53 = tail call double @llvm.fmuladd.f64(double %52, double %47, double 1.000000e+00)
%54 = tail call double @sqrt(double %53)
%55 = fmul double %54, %5
%56 = tail call double @bessel_i0(double %55)
%57 = fmul double %17, %56
%58 = fmul double %19, %46
%59 = tail call double @sinc(double %58)
%60 = fmul double %57, %59
br label %61
61: ; preds = %41, %51
%62 = phi double [ %60, %51 ], [ 0.000000e+00, %41 ]
%63 = getelementptr inbounds double, double* %8, i64 %42
store double %62, double* %63
%64 = fadd double %43, %62
%65 = add nuw nsw i64 %42, 1
%66 = icmp eq i64 %65, %31
br i1 %66, label %67, label %41
67: ; preds = %61
%68 = fdiv double %14, %64
br i1 %25, label %69, label %109
69: ; preds = %67
%70 = mul nsw i64 %37, %29
br i1 %33, label %97, label %71
71: ; preds = %69, %71
%72 = phi i64 [ %94, %71 ], [ 0, %69 ]
%73 = phi double [ %90, %71 ], [ 0.000000e+00, %69 ]
%74 = phi i64 [ %95, %71 ], [ 0, %69 ]
%75 = getelementptr inbounds double, double* %8, i64 %72
%76 = load double, double* %75
%77 = tail call double @llvm.fmuladd.f64(double %76, double %68, double %73)
%78 = fadd double %77, 5.000000e-01
%79 = tail call double @llvm.floor.f64(double %78)
%80 = fsub double %79, %77
%81 = fptosi double %79 to i16
%82 = add nsw i64 %72, %70
%83 = getelementptr inbounds i16, i16* %0, i64 %82
store i16 %81, i16* %83
%84 = or i64 %72, 1
%85 = getelementptr inbounds double, double* %8, i64 %84
%86 = load double, double* %85
%87 = tail call double @llvm.fmuladd.f64(double %86, double %68, double %80)
%88 = fadd double %87, 5.000000e-01
%89 = tail call double @llvm.floor.f64(double %88)
%90 = fsub double %89, %87
%91 = fptosi double %89 to i16
%92 = add nsw i64 %84, %70
%93 = getelementptr inbounds i16, i16* %0, i64 %92
store i16 %91, i16* %93
%94 = add nuw nsw i64 %72, 2
%95 = add i64 %74, 2
%96 = icmp eq i64 %95, %34
br i1 %96, label %97, label %71
97: ; preds = %71, %69
%98 = phi i64 [ 0, %69 ], [ %94, %71 ]
%99 = phi double [ 0.000000e+00, %69 ], [ %90, %71 ]
br i1 %35, label %109, label %100
100: ; preds = %97
%101 = getelementptr inbounds double, double* %8, i64 %98
%102 = load double, double* %101
%103 = tail call double @llvm.fmuladd.f64(double %102, double %68, double %99)
%104 = fadd double %103, 5.000000e-01
%105 = tail call double @llvm.floor.f64(double %104)
%106 = fptosi double %105 to i16
%107 = add nsw i64 %98, %70
%108 = getelementptr inbounds i16, i16* %0, i64 %107
store i16 %106, i16* %108
br label %109
109: ; preds = %100, %97, %36, %67
%110 = add nuw nsw i64 %37, 1
%111 = icmp eq i64 %110, %30
br i1 %111, label %112, label %36
112: ; preds = %109, %12
%113 = tail call i32 @free(double* %8)
ret void
}