#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 cos(double);
int /*<<< orphan*/ modf(double, double *);
void create_ana_filter(double new_filter[32 / 4][32]) {
  register int i, j;
  double t;
  for (i = 0; i < 32 / 4; i++) {
    for (j = 0; j <= 16; j++) {
      t = 1e9 * cos(3.14159265358979 / 64 * (double)((2 * i + 1) * (16 - j)));
      if (t >= 0)
        modf(t + 0.5, &t);
      else
        modf(t - 0.5, &t);
      new_filter[i][j] = t * 1e-9;
    }
    for (j = 17; j < 32; j++) {
      t = 1e9 * cos(3.14159265358979 / 64 * (double)((2 * i + 1) * j));
      if (t >= 0)
        modf(t + 0.5, &t);
      else
        modf(t - 0.5, &t);
      new_filter[i][j] = t * 1e-9;
    }
  }
}


x86 assembly (clang, -O0):
<create_ana_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    12db <create_ana_filter+0x1bb>
movl   $0x0,-0x10(%rbp)
cmpl   $0x10,-0x10(%rbp)
jg     1206 <create_ana_filter+0xe6>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
mov    $0x10,%ecx
sub    -0x10(%rbp),%ecx
imul   %ecx,%eax
cvtsi2sd %eax,%xmm1
movsd  0xe9a(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <cos@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe7d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11b9 <create_ana_filter+0x99>
movsd  0xe6a(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
lea    -0x18(%rbp),%rdi
call   1030 <modf@plt>
jmp    11d3 <create_ana_filter+0xb3>
movsd  -0x18(%rbp),%xmm0
movsd  0xe4a(%rip),%xmm1
subsd  %xmm1,%xmm0
lea    -0x18(%rbp),%rdi
call   1030 <modf@plt>
movsd  0xe3d(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x8,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1144 <create_ana_filter+0x24>
movl   $0x11,-0x10(%rbp)
cmpl   $0x20,-0x10(%rbp)
jge    12c8 <create_ana_filter+0x1a8>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
imul   -0x10(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  0xdd8(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <cos@plt>
cvtsi2sd %eax,%xmm1
movsd  0xdbb(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     127b <create_ana_filter+0x15b>
movsd  0xda8(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
lea    -0x18(%rbp),%rdi
call   1030 <modf@plt>
jmp    1295 <create_ana_filter+0x175>
movsd  -0x18(%rbp),%xmm0
movsd  0xd88(%rip),%xmm1
subsd  %xmm1,%xmm0
lea    -0x18(%rbp),%rdi
call   1030 <modf@plt>
movsd  0xd7b(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x8,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    120d <create_ana_filter+0xed>
jmp    12cd <create_ana_filter+0x1ad>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <create_ana_filter+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_ana_filter>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%r14
mov    $0x10,%ebp
mov    $0xffffffff,%ecx
mov    $0x11,%edx
mov    $0x1,%ebx
xor    %eax,%eax
movsd  0xeb1(%rip),%xmm1
lea    0xeca(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,0x14(%rsp)
mov    %rax,0x20(%rsp)
mov    %edx,0x4(%rsp)
mov    %ebp,0x1c(%rsp)
xor    %ebx,%ebx
lea    0x8(%rsp),%r13
mov    %ecx,%r12d
nopl   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  %xmm1,%xmm0
call   1040 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xe69(%rip),%xmm0
xor    %eax,%eax
ucomisd 0xe6f(%rip),%xmm0
setb   %al
movsd  %xmm0,0x8(%rsp)
addsd  (%r15,%rax,8),%xmm0
mov    %r13,%rdi
call   1030 <modf@plt>
movsd  0xe48(%rip),%xmm2
movsd  0xe30(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  %xmm2,%xmm0
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
add    %r12d,%ebp
cmp    $0x11,%rbx
jne    1180 <create_ana_filter+0x60>
mov    %r12d,0x18(%rsp)
mov    %r15,%r12
mov    $0x11,%r15d
mov    0x4(%rsp),%ebp
mov    0x14(%rsp),%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  %xmm1,%xmm0
call   1040 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xdd9(%rip),%xmm0
xor    %eax,%eax
ucomisd 0xddf(%rip),%xmm0
setb   %al
movsd  %xmm0,0x8(%rsp)
addsd  (%r12,%rax,8),%xmm0
mov    %r13,%rdi
call   1030 <modf@plt>
movsd  0xdb8(%rip),%xmm2
movsd  0xda0(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  %xmm2,%xmm0
movsd  %xmm0,(%r14,%r15,8)
add    $0x1,%r15
add    %ebx,%ebp
cmp    $0x20,%r15
jne    1210 <create_ana_filter+0xf0>
mov    0x20(%rsp),%rax
add    $0x1,%rax
mov    0x1c(%rsp),%ebp
add    $0x20,%ebp
mov    0x18(%rsp),%ecx
add    $0xfffffffe,%ecx
add    $0x100,%r14
mov    0x4(%rsp),%edx
add    $0x22,%edx
add    $0x2,%ebx
cmp    $0x8,%rax
mov    %r12,%r15
jne    1160 <create_ana_filter+0x40>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @create_ana_filter([32 x double]* %0) {
%2 = alloca [32 x double]*
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store [32 x double]* %0, [32 x double]** %2
store i32 0, i32* %3
br label %6
6: ; preds = %87, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 8
br i1 %8, label %9, label %90
9: ; preds = %6
store i32 0, i32* %4
br label %10
10: ; preds = %45, %9
%11 = load i32, i32* %4
%12 = icmp sle i32 %11, 16
br i1 %12, label %13, label %48
13: ; preds = %10
%14 = load i32, i32* %3
%15 = mul nsw i32 2, %14
%16 = add nsw i32 %15, 1
%17 = load i32, i32* %4
%18 = sub nsw i32 16, %17
%19 = mul nsw i32 %16, %18
%20 = sitofp i32 %19 to double
%21 = fmul double 0x3FA921FB54442D11, %20
%22 = call i32 @cos(double %21)
%23 = sitofp i32 %22 to double
%24 = fmul double 1.000000e+09, %23
store double %24, double* %5
%25 = load double, double* %5
%26 = fcmp oge double %25, 0.000000e+00
br i1 %26, label %27, label %31
27: ; preds = %13
%28 = load double, double* %5
%29 = fadd double %28, 5.000000e-01
%30 = call i32 @modf(double %29, double* %5)
br label %35
31: ; preds = %13
%32 = load double, double* %5
%33 = fsub double %32, 5.000000e-01
%34 = call i32 @modf(double %33, double* %5)
br label %35
35: ; preds = %31, %27
%36 = load double, double* %5
%37 = fmul double %36, 1.000000e-09
%38 = load [32 x double]*, [32 x double]** %2
%39 = load i32, i32* %3
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [32 x double], [32 x double]* %38, i64 %40
%42 = load i32, i32* %4
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [32 x double], [32 x double]* %41, i64 0, i64 %43
store double %37, double* %44
br label %45
45: ; preds = %35
%46 = load i32, i32* %4
%47 = add nsw i32 %46, 1
store i32 %47, i32* %4
br label %10
48: ; preds = %10
store i32 17, i32* %4
br label %49
49: ; preds = %83, %48
%50 = load i32, i32* %4
%51 = icmp slt i32 %50, 32
br i1 %51, label %52, label %86
52: ; preds = %49
%53 = load i32, i32* %3
%54 = mul nsw i32 2, %53
%55 = add nsw i32 %54, 1
%56 = load i32, i32* %4
%57 = mul nsw i32 %55, %56
%58 = sitofp i32 %57 to double
%59 = fmul double 0x3FA921FB54442D11, %58
%60 = call i32 @cos(double %59)
%61 = sitofp i32 %60 to double
%62 = fmul double 1.000000e+09, %61
store double %62, double* %5
%63 = load double, double* %5
%64 = fcmp oge double %63, 0.000000e+00
br i1 %64, label %65, label %69
65: ; preds = %52
%66 = load double, double* %5
%67 = fadd double %66, 5.000000e-01
%68 = call i32 @modf(double %67, double* %5)
br label %73
69: ; preds = %52
%70 = load double, double* %5
%71 = fsub double %70, 5.000000e-01
%72 = call i32 @modf(double %71, double* %5)
br label %73
73: ; preds = %69, %65
%74 = load double, double* %5
%75 = fmul double %74, 1.000000e-09
%76 = load [32 x double]*, [32 x double]** %2
%77 = load i32, i32* %3
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [32 x double], [32 x double]* %76, i64 %78
%80 = load i32, i32* %4
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds [32 x double], [32 x double]* %79, i64 0, i64 %81
store double %75, double* %82
br label %83
83: ; preds = %73
%84 = load i32, i32* %4
%85 = add nsw i32 %84, 1
store i32 %85, i32* %4
br label %49
86: ; preds = %49
br label %87
87: ; preds = %86
%88 = load i32, i32* %3
%89 = add nsw i32 %88, 1
store i32 %89, i32* %3
br label %6
90: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @create_ana_filter([32 x double]* nocapture writeonly %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
br label %4
4: ; preds = %1, %45
%5 = phi i64 [ 0, %1 ], [ %46, %45 ]
%6 = shl nuw nsw i64 %5, 1
%7 = or i64 %6, 1
br label %8
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %25, %8 ]
%10 = sub nuw nsw i64 16, %9
%11 = mul nuw nsw i64 %10, %7
%12 = trunc i64 %11 to i32
%13 = sitofp i32 %12 to double
%14 = fmul double %13, 0x3FA921FB54442D11
%15 = tail call i32 @cos(double %14)
%16 = sitofp i32 %15 to double
%17 = fmul double %16, 1.000000e+09
store double %17, double* %2
%18 = fcmp ult double %17, 0.000000e+00
%19 = select i1 %18, double -5.000000e-01, double 5.000000e-01
%20 = fadd double %17, %19
%21 = call i32 @modf(double %20, double* %2)
%22 = load double, double* %2
%23 = fmul double %22, 1.000000e-09
%24 = getelementptr inbounds [32 x double], [32 x double]* %0, i64 %5, i64 %9
store double %23, double* %24
%25 = add nuw nsw i64 %9, 1
%26 = icmp eq i64 %25, 17
br i1 %26, label %27, label %8
27: ; preds = %8, %27
%28 = phi i64 [ %43, %27 ], [ 17, %8 ]
%29 = mul nuw nsw i64 %28, %7
%30 = trunc i64 %29 to i32
%31 = sitofp i32 %30 to double
%32 = fmul double %31, 0x3FA921FB54442D11
%33 = tail call i32 @cos(double %32)
%34 = sitofp i32 %33 to double
%35 = fmul double %34, 1.000000e+09
store double %35, double* %2
%36 = fcmp ult double %35, 0.000000e+00
%37 = select i1 %36, double -5.000000e-01, double 5.000000e-01
%38 = fadd double %35, %37
%39 = call i32 @modf(double %38, double* %2)
%40 = load double, double* %2
%41 = fmul double %40, 1.000000e-09
%42 = getelementptr inbounds [32 x double], [32 x double]* %0, i64 %5, i64 %28
store double %41, double* %42
%43 = add nuw nsw i64 %28, 1
%44 = icmp eq i64 %43, 32
br i1 %44, label %45, label %27
45: ; preds = %27
%46 = add nuw nsw i64 %5, 1
%47 = icmp eq i64 %46, 8
br i1 %47, label %48, label %4
48: ; preds = %45
ret void
}