#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 SincKaiser(double, double);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
void Sinc4GenerateTables(void) {
  static double filter[(1 << (12))][4];
  int i;
  for (i = 0; i < (1 << (12)); i++) {
    double mu = (double)i / (1 << (12));
    filter[i][0] = SincKaiser(2.0, mu - -1.0);
    filter[i][1] = SincKaiser(2.0, mu - 0.0);
    filter[i][2] = SincKaiser(2.0, mu - 1.0);
    filter[i][3] = SincKaiser(2.0, mu - 2.0);
  }
  fprintf(stdout, "static const float sinc4Tab[%d][4] =\n{\n", (1 << (12)));
  for (i = 0; i < (1 << (12)); i++)
    fprintf(stdout, "    { %+14.9ef, %+14.9ef, %+14.9ef, %+14.9ef },\n",
            filter[i][0], filter[i][1], filter[i][2], filter[i][3]);
  fprintf(stdout, "};\n\n");
}


x86 assembly (clang, -O0):
<Sinc4GenerateTables>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x1000,-0x4(%rbp)
jge    122e <Sinc4GenerateTables+0x10e>
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  0xeb1(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe95(%rip),%xmm0
call   1030 <SincKaiser@plt>
movslq -0x4(%rbp),%rcx
lea    0x2ec5(%rip),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm1
xorps  %xmm0,%xmm0
subsd  %xmm0,%xmm1
movsd  0xe66(%rip),%xmm0
call   1030 <SincKaiser@plt>
movslq -0x4(%rbp),%rcx
lea    0x2e96(%rip),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x10(%rbp),%xmm1
movsd  0xe45(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe31(%rip),%xmm0
call   1030 <SincKaiser@plt>
movslq -0x4(%rbp),%rcx
lea    0x2e61(%rip),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movsd  %xmm0,0x10(%rax)
movsd  -0x10(%rbp),%xmm1
movsd  0xe08(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xdfc(%rip),%xmm0
call   1030 <SincKaiser@plt>
movslq -0x4(%rbp),%rcx
lea    0x2e2c(%rip),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movsd  %xmm0,0x18(%rax)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <Sinc4GenerateTables+0xf>
mov    0x2dab(%rip),%rax
mov    (%rax),%edi
lea    0xde2(%rip),%rsi
mov    $0x1000,%edx
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x1000,-0x4(%rbp)
jge    12de <Sinc4GenerateTables+0x1be>
mov    0x2d7b(%rip),%rax
mov    (%rax),%edi
movslq -0x4(%rbp),%rcx
lea    0x2dce(%rip),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movsd  (%rax),%xmm0
movslq -0x4(%rbp),%rcx
lea    0x2db8(%rip),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movsd  0x8(%rax),%xmm1
movslq -0x4(%rbp),%rcx
lea    0x2da1(%rip),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movsd  0x10(%rax),%xmm2
movslq -0x4(%rbp),%rcx
lea    0x2d8a(%rip),%rax
shl    $0x5,%rcx
add    %rcx,%rax
movsd  0x18(%rax),%xmm3
lea    0xd7f(%rip),%rsi
mov    $0x4,%al
call   1040 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1251 <Sinc4GenerateTables+0x131>
mov    0x2cfb(%rip),%rax
mov    (%rax),%edi
lea    0xd8b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sinc4GenerateTables>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0x2f29(%rip),%rbx
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xorps  %xmm1,%xmm1
cvtsi2sd %r14d,%xmm1
mulsd  0xeb0(%rip),%xmm1
movsd  %xmm1,(%rsp)
addsd  0xeab(%rip),%xmm1
movsd  0xeab(%rip),%xmm0
call   1030 <SincKaiser@plt>
movsd  %xmm0,-0x18(%rbx)
movsd  0xe99(%rip),%xmm0
movsd  (%rsp),%xmm1
call   1030 <SincKaiser@plt>
movsd  %xmm0,-0x10(%rbx)
movsd  (%rsp),%xmm1
addsd  0xe85(%rip),%xmm1
movsd  0xe75(%rip),%xmm0
call   1030 <SincKaiser@plt>
movsd  %xmm0,-0x8(%rbx)
movsd  (%rsp),%xmm1
addsd  0xe6e(%rip),%xmm1
movsd  0xe56(%rip),%xmm0
call   1030 <SincKaiser@plt>
movsd  %xmm0,(%rbx)
add    $0x1,%r14
add    $0x20,%rbx
cmp    $0x1000,%r14
jne    1140 <Sinc4GenerateTables+0x20>
mov    0x2e01(%rip),%r14
mov    (%r14),%edi
lea    0xe3f(%rip),%rsi
xor    %ebx,%ebx
mov    $0x1000,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0x2e42(%rip),%r12
lea    0xe4b(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14),%edi
movsd  (%rbx,%r12,1),%xmm0
movsd  0x8(%rbx,%r12,1),%xmm1
movsd  0x10(%rbx,%r12,1),%xmm2
movsd  0x18(%rbx,%r12,1),%xmm3
mov    %r15,%rsi
mov    $0x4,%al
call   1040 <fprintf@plt>
add    $0x20,%rbx
cmp    $0x20000,%rbx
jne    1210 <Sinc4GenerateTables+0xf0>
mov    (%r14),%edi
lea    0xe32(%rip),%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@Sinc4GenerateTables.filter = internal global [4096 x [4 x double]] zeroinitializer
@stdout = global i32 0
@.str = [40 x i8] c"static const float sinc4Tab[%d][4] =\0A{\0A\00"
@.str.1 = [49 x i8] c" { %+14.9ef, %+14.9ef, %+14.9ef, %+14.9ef },\0A\00"
@.str.2 = [5 x i8] c"};\0A\0A\00"
define void @Sinc4GenerateTables() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
br label %3
3: ; preds = %38, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 4096
br i1 %5, label %6, label %41
6: ; preds = %3
%7 = load i32, i32* %1
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 4.096000e+03
store double %9, double* %2
%10 = load double, double* %2
%11 = fsub double %10, -1.000000e+00
%12 = call double @SincKaiser(double 2.000000e+00, double %11)
%13 = load i32, i32* %1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [4096 x [4 x double]], [4096 x [4 x double]]* @Sinc4GenerateTables.filter, i64 0, i64 %14
%16 = getelementptr inbounds [4 x double], [4 x double]* %15, i64 0, i64 0
store double %12, double* %16
%17 = load double, double* %2
%18 = fsub double %17, 0.000000e+00
%19 = call double @SincKaiser(double 2.000000e+00, double %18)
%20 = load i32, i32* %1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [4096 x [4 x double]], [4096 x [4 x double]]* @Sinc4GenerateTables.filter, i64 0, i64 %21
%23 = getelementptr inbounds [4 x double], [4 x double]* %22, i64 0, i64 1
store double %19, double* %23
%24 = load double, double* %2
%25 = fsub double %24, 1.000000e+00
%26 = call double @SincKaiser(double 2.000000e+00, double %25)
%27 = load i32, i32* %1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [4096 x [4 x double]], [4096 x [4 x double]]* @Sinc4GenerateTables.filter, i64 0, i64 %28
%30 = getelementptr inbounds [4 x double], [4 x double]* %29, i64 0, i64 2
store double %26, double* %30
%31 = load double, double* %2
%32 = fsub double %31, 2.000000e+00
%33 = call double @SincKaiser(double 2.000000e+00, double %32)
%34 = load i32, i32* %1
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [4096 x [4 x double]], [4096 x [4 x double]]* @Sinc4GenerateTables.filter, i64 0, i64 %35
%37 = getelementptr inbounds [4 x double], [4 x double]* %36, i64 0, i64 3
store double %33, double* %37
br label %38
38: ; preds = %6
%39 = load i32, i32* %1
%40 = add nsw i32 %39, 1
store i32 %40, i32* %1
br label %3
41: ; preds = %3
%42 = load i32, i32* @stdout
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 4096)
store i32 0, i32* %1
br label %44
44: ; preds = %70, %41
%45 = load i32, i32* %1
%46 = icmp slt i32 %45, 4096
br i1 %46, label %47, label %73
47: ; preds = %44
%48 = load i32, i32* @stdout
%49 = load i32, i32* %1
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [4096 x [4 x double]], [4096 x [4 x double]]* @Sinc4GenerateTables.filter, i64 0, i64 %50
%52 = getelementptr inbounds [4 x double], [4 x double]* %51, i64 0, i64 0
%53 = load double, double* %52
%54 = load i32, i32* %1
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [4096 x [4 x double]], [4096 x [4 x double]]* @Sinc4GenerateTables.filter, i64 0, i64 %55
%57 = getelementptr inbounds [4 x double], [4 x double]* %56, i64 0, i64 1
%58 = load double, double* %57
%59 = load i32, i32* %1
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [4096 x [4 x double]], [4096 x [4 x double]]* @Sinc4GenerateTables.filter, i64 0, i64 %60
%62 = getelementptr inbounds [4 x double], [4 x double]* %61, i64 0, i64 2
%63 = load double, double* %62
%64 = load i32, i32* %1
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [4096 x [4 x double]], [4096 x [4 x double]]* @Sinc4GenerateTables.filter, i64 0, i64 %65
%67 = getelementptr inbounds [4 x double], [4 x double]* %66, i64 0, i64 3
%68 = load double, double* %67
%69 = call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), double %53, double %58, double %63, double %68)
br label %70
70: ; preds = %47
%71 = load i32, i32* %1
%72 = add nsw i32 %71, 1
store i32 %72, i32* %1
br label %44
73: ; preds = %44
%74 = load i32, i32* @stdout
%75 = call i32 (i32, i8*, ...) @fprintf(i32 %74, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@Sinc4GenerateTables.filter = internal unnamed_addr global [4096 x [4 x double]] zeroinitializer
@stdout = global i32 0
@.str = [40 x i8] c"static const float sinc4Tab[%d][4] =\0A{\0A\00"
@.str.1 = [49 x i8] c" { %+14.9ef, %+14.9ef, %+14.9ef, %+14.9ef },\0A\00"
@.str.2 = [5 x i8] c"};\0A\0A\00"
define void @Sinc4GenerateTables() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 0, %0 ], [ %17, %1 ]
%3 = trunc i64 %2 to i32
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 0x3F30000000000000
%6 = fadd double %5, 1.000000e+00
%7 = tail call double @SincKaiser(double 2.000000e+00, double %6)
%8 = getelementptr inbounds [4096 x [4 x double]], [4096 x [4 x double]]* @Sinc4GenerateTables.filter, i64 0, i64 %2, i64 0
store double %7, double* %8
%9 = tail call double @SincKaiser(double 2.000000e+00, double %5)
%10 = getelementptr inbounds [4096 x [4 x double]], [4096 x [4 x double]]* @Sinc4GenerateTables.filter, i64 0, i64 %2, i64 1
store double %9, double* %10
%11 = fadd double %5, -1.000000e+00
%12 = tail call double @SincKaiser(double 2.000000e+00, double %11)
%13 = getelementptr inbounds [4096 x [4 x double]], [4096 x [4 x double]]* @Sinc4GenerateTables.filter, i64 0, i64 %2, i64 2
store double %12, double* %13
%14 = fadd double %5, -2.000000e+00
%15 = tail call double @SincKaiser(double 2.000000e+00, double %14)
%16 = getelementptr inbounds [4096 x [4 x double]], [4096 x [4 x double]]* @Sinc4GenerateTables.filter, i64 0, i64 %2, i64 3
store double %15, double* %16
%17 = add nuw nsw i64 %2, 1
%18 = icmp eq i64 %17, 4096
br i1 %18, label %19, label %1
19: ; preds = %1
%20 = load i32, i32* @stdout
%21 = tail call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 4096)
br label %22
22: ; preds = %19, %22
%23 = phi i64 [ 0, %19 ], [ %34, %22 ]
%24 = load i32, i32* @stdout
%25 = getelementptr inbounds [4096 x [4 x double]], [4096 x [4 x double]]* @Sinc4GenerateTables.filter, i64 0, i64 %23, i64 0
%26 = load double, double* %25
%27 = getelementptr inbounds [4096 x [4 x double]], [4096 x [4 x double]]* @Sinc4GenerateTables.filter, i64 0, i64 %23, i64 1
%28 = load double, double* %27
%29 = getelementptr inbounds [4096 x [4 x double]], [4096 x [4 x double]]* @Sinc4GenerateTables.filter, i64 0, i64 %23, i64 2
%30 = load double, double* %29
%31 = getelementptr inbounds [4096 x [4 x double]], [4096 x [4 x double]]* @Sinc4GenerateTables.filter, i64 0, i64 %23, i64 3
%32 = load double, double* %31
%33 = tail call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), double %26, double %28, double %30, double %32)
%34 = add nuw nsw i64 %23, 1
%35 = icmp eq i64 %34, 4096
br i1 %35, label %36, label %22
36: ; preds = %22
%37 = load i32, i32* @stdout
%38 = tail call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret void
}