#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
double M_PI;
double cos(double);
double fabs(float);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
double sin(double);
double sinc(double);
void gentxfilt(FILE *f) {
  float coeff[16 * (1 << (4))];
  double tmul, at, t, f1, f2;
  int i, j;
  tmul = 1.0 / (1 << (4));
  for (i = 0; i < 16 * (1 << (4)); i++) {
    t = (i - 0.5 * 16 * (1 << (4))) * tmul;
    at = t * 0.4;
    f1 = 1 - 4 * at * at;
    if (fabs(f1) < 1e-10)
      f2 = M_PI * (1.0 / 8.0) * sin(M_PI * at) / at;
    else
      f2 = cos(M_PI * at) / f1;
    coeff[i] = sinc(t) * f2;
  }
  for (f1 = 0, i = 0; i < (1 << (4)); i++) {
    for (f2 = 0, j = 0; j < 16; j++)
      f2 += fabs(coeff[j * (1 << (4)) + i]);
    if (f2 > f1)
      f1 = f2;
  }
  f2 = 32767 / f1;
  fprintf(f, "/*\n  txfilt = [");
  for (i = 0;;) {
    fprintf(f, " %g ;", coeff[i]);
    if ((++i) >= 16 * (1 << (4)))
      break;
    if (i & 3)
      continue;
    fprintf(f, "\n            ");
  }
  fprintf(
      f, " ];\n  abssum = %g;\n  semilogy((0:%u)/%u,abs(fft(txfilt)))\n */\n\n",
      f1, 16 * (1 << (4)) - 1, 16 * (1 << (4)));
  fprintf(f, "static const int txfilter[%u][%u] = {", (1 << (4)), 16);
  for (i = 0;;) {
    fprintf(f, "\n\t{");
    for (j = 0;;) {
      fprintf(f, " %d", (int)(f2 * coeff[j * (1 << (4)) + i]));
      if ((++j) >= 16)
        break;
      fprintf(f, ",");
    }
    fprintf(f, " }");
    if ((++i) >= (1 << (4)))
      break;
    fprintf(f, ",");
  }
  fprintf(f, "\n};\n\n");
}


x86 assembly (clang, -O0):
<gentxfilt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xe99(%rip),%xmm0
movsd  %xmm0,-0x418(%rbp)
ff
movl   $0x0,-0x43c(%rbp)
cmpl   $0x100,-0x43c(%rbp)
jge    12ee <gentxfilt+0x19e>
cvtsi2sdl -0x43c(%rbp),%xmm0
ff
movsd  0xe97(%rip),%xmm1
subsd  %xmm1,%xmm0
mulsd  -0x418(%rbp),%xmm0
ff
movsd  %xmm0,-0x428(%rbp)
ff
movsd  0xe73(%rip),%xmm0
mulsd  -0x428(%rbp),%xmm0
ff
movsd  %xmm0,-0x420(%rbp)
ff
movsd  0xe53(%rip),%xmm0
mulsd  -0x420(%rbp),%xmm0
ff
movsd  -0x420(%rbp),%xmm1
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe18(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x430(%rbp)
ff
movsd  -0x430(%rbp),%xmm0
ff
cvtsd2ss %xmm0,%xmm0
call   1030 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xde8(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1289 <gentxfilt+0x139>
movsd  0xdfe(%rip),%xmm0
mov    0x2da7(%rip),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x448(%rbp)
ff
mov    0x2d94(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x420(%rbp),%xmm0
ff
call   1050 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x448(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
divsd  -0x420(%rbp),%xmm0
ff
movsd  %xmm0,-0x438(%rbp)
ff
jmp    12b1 <gentxfilt+0x161>
mov    0x2d58(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x420(%rbp),%xmm0
ff
call   1070 <cos@plt>
divsd  -0x430(%rbp),%xmm0
ff
movsd  %xmm0,-0x438(%rbp)
ff
movsd  -0x428(%rbp),%xmm0
ff
call   1060 <sinc@plt>
mulsd  -0x438(%rbp),%xmm0
ff
cvtsd2ss %xmm0,%xmm0
movslq -0x43c(%rbp),%rax
movss  %xmm0,-0x410(%rbp,%rax,4)
ff ff
mov    -0x43c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x43c(%rbp)
jmp    1179 <gentxfilt+0x29>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x430(%rbp)
ff
movl   $0x0,-0x43c(%rbp)
cmpl   $0x10,-0x43c(%rbp)
jge    13b4 <gentxfilt+0x264>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x438(%rbp)
ff
movl   $0x0,-0x440(%rbp)
cmpl   $0x10,-0x440(%rbp)
jge    1375 <gentxfilt+0x225>
mov    -0x440(%rbp),%eax
shl    $0x4,%eax
add    -0x43c(%rbp),%eax
cltq
movss  -0x410(%rbp,%rax,4),%xmm0
ff ff
call   1030 <fabs@plt>
addsd  -0x438(%rbp),%xmm0
ff
movsd  %xmm0,-0x438(%rbp)
ff
mov    -0x440(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x440(%rbp)
jmp    1325 <gentxfilt+0x1d5>
movsd  -0x438(%rbp),%xmm0
ff
ucomisd -0x430(%rbp),%xmm0
ff
jbe    139b <gentxfilt+0x24b>
movsd  -0x438(%rbp),%xmm0
ff
movsd  %xmm0,-0x430(%rbp)
ff
jmp    13a0 <gentxfilt+0x250>
mov    -0x43c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x43c(%rbp)
jmp    1303 <gentxfilt+0x1b3>
movsd  0xc4c(%rip),%xmm0
divsd  -0x430(%rbp),%xmm0
ff
movsd  %xmm0,-0x438(%rbp)
ff
mov    -0x8(%rbp),%rdi
lea    0xc69(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x43c(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x43c(%rbp),%rax
movss  -0x410(%rbp,%rax,4),%xmm0
ff ff
cvtss2sd %xmm0,%xmm0
lea    0xc49(%rip),%rsi
mov    $0x1,%al
call   1040 <fprintf@plt>
mov    -0x43c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x43c(%rbp)
cmp    $0x100,%eax
jl     142d <gentxfilt+0x2dd>
jmp    145b <gentxfilt+0x30b>
mov    -0x43c(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
je     1444 <gentxfilt+0x2f4>
jmp    13e8 <gentxfilt+0x298>
mov    -0x8(%rbp),%rdi
lea    0xc07(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    13e8 <gentxfilt+0x298>
mov    -0x8(%rbp),%rdi
movsd  -0x430(%rbp),%xmm0
ff
lea    0xbf6(%rip),%rsi
mov    $0xff,%edx
mov    $0x100,%ecx
mov    $0x1,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xc1a(%rip),%rsi
mov    $0x10,%ecx
mov    %ecx,%edx
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x43c(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xc1d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x440(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x438(%rbp),%xmm0
ff
mov    -0x440(%rbp),%eax
shl    $0x4,%eax
add    -0x43c(%rbp),%eax
cltq
movss  -0x410(%rbp,%rax,4),%xmm1
ff ff
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edx
lea    0xbd7(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x440(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x440(%rbp)
cmp    $0x10,%eax
jl     151b <gentxfilt+0x3cb>
jmp    1532 <gentxfilt+0x3e2>
mov    -0x8(%rbp),%rdi
lea    0xbac(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    14be <gentxfilt+0x36e>
mov    -0x8(%rbp),%rdi
lea    0xb97(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x43c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x43c(%rbp)
cmp    $0x10,%eax
jl     1561 <gentxfilt+0x411>
jmp    1578 <gentxfilt+0x428>
mov    -0x8(%rbp),%rdi
lea    0xb66(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    14a2 <gentxfilt+0x352>
mov    -0x8(%rbp),%rdi
lea    0xb54(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x450,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gentxfilt>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x428,%rsp
mov    %rdi,%r13
xor    %ebx,%ebx
mov    0x2e5b(%rip),%rbp
jmp    11d7 <gentxfilt+0x67>
nop
movsd  0x10(%rsp),%xmm0
mulsd  %xmm1,%xmm0
call   1080 <cos@plt>
divsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1070 <sinc@plt>
mulsd  0x10(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x20(%rsp,%rbx,4)
add    $0x1,%rbx
cmp    $0x100,%rbx
je     126c <gentxfilt+0xfc>
lea    -0x80(%rbx),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xe17(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
mulsd  0xe11(%rip),%xmm0
movapd %xmm0,%xmm1
mulsd  0xe0d(%rip),%xmm1
movsd  %xmm0,0x10(%rsp)
mulsd  %xmm0,%xmm1
addsd  0xe03(%rip),%xmm1
movsd  %xmm1,0x18(%rsp)
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
call   1040 <fabs@plt>
movsd  0xdf1(%rip),%xmm1
ucomisd %xmm0,%xmm1
movsd  0x0(%rbp),%xmm1
jbe    1190 <gentxfilt+0x20>
movsd  0x10(%rsp),%xmm0
mulsd  %xmm1,%xmm0
mulsd  0xdd8(%rip),%xmm1
movsd  %xmm1,0x18(%rsp)
call   1060 <sin@plt>
mulsd  0x18(%rsp),%xmm0
divsd  0x10(%rsp),%xmm0
jmp    11a5 <gentxfilt+0x35>
mov    $0xfffffffffffffff0,%r14
xorps  %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
movsd  %xmm0,0x10(%rsp)
movss  0x60(%rsp,%r14,4),%xmm0
call   1040 <fabs@plt>
addsd  0xd9e(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movss  0xa0(%rsp,%r14,4),%xmm0
call   1040 <fabs@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movss  0xe0(%rsp,%r14,4),%xmm0
call   1040 <fabs@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movss  0x120(%rsp,%r14,4),%xmm0
call   1040 <fabs@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movss  0x160(%rsp,%r14,4),%xmm0
call   1040 <fabs@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movss  0x1a0(%rsp,%r14,4),%xmm0
call   1040 <fabs@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movss  0x1e0(%rsp,%r14,4),%xmm0
call   1040 <fabs@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movss  0x220(%rsp,%r14,4),%xmm0
call   1040 <fabs@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movss  0x260(%rsp,%r14,4),%xmm0
call   1040 <fabs@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movss  0x2a0(%rsp,%r14,4),%xmm0
call   1040 <fabs@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movss  0x2e0(%rsp,%r14,4),%xmm0
call   1040 <fabs@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movss  0x320(%rsp,%r14,4),%xmm0
call   1040 <fabs@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movss  0x360(%rsp,%r14,4),%xmm0
call   1040 <fabs@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movss  0x3a0(%rsp,%r14,4),%xmm0
call   1040 <fabs@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movss  0x3e0(%rsp,%r14,4),%xmm0
call   1040 <fabs@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movss  0x420(%rsp,%r14,4),%xmm0
call   1040 <fabs@plt>
addsd  0x8(%rsp),%xmm0
maxsd  0x10(%rsp),%xmm0
inc    %r14
jne    1280 <gentxfilt+0x110>
movsd  %xmm0,0x8(%rsp)
lea    0xbf5(%rip),%rdi
mov    $0x1,%ebx
mov    $0xf,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1090 <fwrite@plt>
movss  0x20(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xbdd(%rip),%r14
mov    %r13,%rdi
mov    %r14,%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
lea    0xbcf(%rip),%r15
jmp    14b4 <gentxfilt+0x344>
nopl   0x0(%rax)
movss  0x20(%rsp,%rbx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r13,%rdi
mov    %r14,%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
add    $0x1,%rbx
cmp    $0x100,%rbx
je     14d0 <gentxfilt+0x360>
test   $0x3,%bl
jne    1490 <gentxfilt+0x320>
mov    $0xd,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %r13,%rcx
call   1090 <fwrite@plt>
jmp    1490 <gentxfilt+0x320>
movsd  0xb58(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
lea    0xb75(%rip),%rsi
mov    %r13,%rdi
mov    $0xff,%edx
mov    $0x100,%ecx
mov    $0x1,%al
call   1050 <fprintf@plt>
lea    0xb9a(%rip),%rsi
mov    %r13,%rdi
mov    $0x10,%edx
mov    $0x10,%ecx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0x20(%rsp),%rbx
lea    0xba4(%rip),%r15
lea    0xba1(%rip),%r12
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x3,%esi
mov    $0x1,%edx
lea    0xb79(%rip),%rdi
mov    %r13,%rcx
call   1090 <fwrite@plt>
movss  0x20(%rsp,%rbp,4),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0x10(%rsp),%xmm0
cvttsd2si %xmm0,%edx
mov    %r13,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x40,%r14d
mov    $0x2c,%edi
mov    %r13,%rsi
call   1030 <fputc@plt>
movss  (%rbx,%r14,1),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0x10(%rsp),%xmm0
cvttsd2si %xmm0,%edx
mov    %r13,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
add    $0x40,%r14
cmp    $0x400,%r14
jne    1580 <gentxfilt+0x410>
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rdi
mov    %r13,%rcx
call   1090 <fwrite@plt>
cmp    $0xf,%rbp
je     15f0 <gentxfilt+0x480>
add    $0x1,%rbp
mov    $0x2c,%edi
mov    %r13,%rsi
call   1030 <fputc@plt>
add    $0x4,%rbx
jmp    1540 <gentxfilt+0x3d0>
lea    0xade(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
mov    %r13,%rcx
add    $0x428,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1090 <fwrite@plt>

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
@.str = [16 x i8] c"/*\0A txfilt = [\00"
@.str.1 = [6 x i8] c" %g ;\00"
@.str.2 = [14 x i8] c"\0A \00"
@.str.3 = [64 x i8] c" ];\0A abssum = %g;\0A semilogy((0:%u)/%u,abs(fft(txfilt)))\0A */\0A\0A\00"
@.str.4 = [38 x i8] c"static const int txfilter[%u][%u] = {\00"
@.str.5 = [4 x i8] c"\0A\09{\00"
@.str.6 = [4 x i8] c" %d\00"
@.str.7 = [2 x i8] c",\00"
@.str.8 = [3 x i8] c" }\00"
@.str.9 = [6 x i8] c"\0A};\0A\0A\00"
define void @gentxfilt(i32* %0) {
%2 = alloca i32*
%3 = alloca [256 x float]
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %2
store double 6.250000e-02, double* %4
store i32 0, i32* %9
br label %11
11: ; preds = %57, %1
%12 = load i32, i32* %9
%13 = icmp slt i32 %12, 256
br i1 %13, label %14, label %60
14: ; preds = %11
%15 = load i32, i32* %9
%16 = sitofp i32 %15 to double
%17 = fsub double %16, 1.280000e+02
%18 = load double, double* %4
%19 = fmul double %17, %18
store double %19, double* %6
%20 = load double, double* %6
%21 = fmul double %20, 4.000000e-01
store double %21, double* %5
%22 = load double, double* %5
%23 = fmul double 4.000000e+00, %22
%24 = load double, double* %5
%25 = fneg double %23
%26 = call double @llvm.fmuladd.f64(double %25, double %24, double 1.000000e+00)
store double %26, double* %7
%27 = load double, double* %7
%28 = fptrunc double %27 to float
%29 = call double @fabs(float %28)
%30 = fcmp olt double %29, 1.000000e-10
br i1 %30, label %31, label %41
31: ; preds = %14
%32 = load double, double* @M_PI
%33 = fmul double %32, 1.250000e-01
%34 = load double, double* @M_PI
%35 = load double, double* %5
%36 = fmul double %34, %35
%37 = call double @sin(double %36)
%38 = fmul double %33, %37
%39 = load double, double* %5
%40 = fdiv double %38, %39
store double %40, double* %8
br label %48
41: ; preds = %14
%42 = load double, double* @M_PI
%43 = load double, double* %5
%44 = fmul double %42, %43
%45 = call double @cos(double %44)
%46 = load double, double* %7
%47 = fdiv double %45, %46
store double %47, double* %8
br label %48
48: ; preds = %41, %31
%49 = load double, double* %6
%50 = call double @sinc(double %49)
%51 = load double, double* %8
%52 = fmul double %50, %51
%53 = fptrunc double %52 to float
%54 = load i32, i32* %9
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %55
store float %53, float* %56
br label %57
57: ; preds = %48
%58 = load i32, i32* %9
%59 = add nsw i32 %58, 1
store i32 %59, i32* %9
br label %11
60: ; preds = %11
store double 0.000000e+00, double* %7
store i32 0, i32* %9
br label %61
61: ; preds = %89, %60
%62 = load i32, i32* %9
%63 = icmp slt i32 %62, 16
br i1 %63, label %64, label %92
64: ; preds = %61
store double 0.000000e+00, double* %8
store i32 0, i32* %10
br label %65
65: ; preds = %79, %64
%66 = load i32, i32* %10
%67 = icmp slt i32 %66, 16
br i1 %67, label %68, label %82
68: ; preds = %65
%69 = load i32, i32* %10
%70 = mul nsw i32 %69, 16
%71 = load i32, i32* %9
%72 = add nsw i32 %70, %71
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %73
%75 = load float, float* %74
%76 = call double @fabs(float %75)
%77 = load double, double* %8
%78 = fadd double %77, %76
store double %78, double* %8
br label %79
79: ; preds = %68
%80 = load i32, i32* %10
%81 = add nsw i32 %80, 1
store i32 %81, i32* %10
br label %65
82: ; preds = %65
%83 = load double, double* %8
%84 = load double, double* %7
%85 = fcmp ogt double %83, %84
br i1 %85, label %86, label %88
86: ; preds = %82
%87 = load double, double* %8
store double %87, double* %7
br label %88
88: ; preds = %86, %82
br label %89
89: ; preds = %88
%90 = load i32, i32* %9
%91 = add nsw i32 %90, 1
store i32 %91, i32* %9
br label %61
92: ; preds = %61
%93 = load double, double* %7
%94 = fdiv double 3.276700e+04, %93
store double %94, double* %8
%95 = load i32*, i32** %2
%96 = call i32 (i32*, i8*, ...) @fprintf(i32* %95, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %9
br label %97
97: ; preds = %114, %113, %92
%98 = load i32*, i32** %2
%99 = load i32, i32* %9
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %100
%102 = load float, float* %101
%103 = fpext float %102 to double
%104 = call i32 (i32*, i8*, ...) @fprintf(i32* %98, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %103)
%105 = load i32, i32* %9
%106 = add nsw i32 %105, 1
store i32 %106, i32* %9
%107 = icmp sge i32 %106, 256
br i1 %107, label %108, label %109
108: ; preds = %97
br label %117
109: ; preds = %97
%110 = load i32, i32* %9
%111 = and i32 %110, 3
%112 = icmp ne i32 %111, 0
br i1 %112, label %113, label %114
113: ; preds = %109
br label %97
114: ; preds = %109
%115 = load i32*, i32** %2
%116 = call i32 (i32*, i8*, ...) @fprintf(i32* %115, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %97
117: ; preds = %108
%118 = load i32*, i32** %2
%119 = load double, double* %7
%120 = call i32 (i32*, i8*, ...) @fprintf(i32* %118, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0), double %119, i32 255, i32 256)
%121 = load i32*, i32** %2
%122 = call i32 (i32*, i8*, ...) @fprintf(i32* %121, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i32 16, i32 16)
store i32 0, i32* %9
br label %123
123: ; preds = %154, %117
%124 = load i32*, i32** %2
%125 = call i32 (i32*, i8*, ...) @fprintf(i32* %124, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %10
br label %126
126: ; preds = %144, %123
%127 = load i32*, i32** %2
%128 = load double, double* %8
%129 = load i32, i32* %10
%130 = mul nsw i32 %129, 16
%131 = load i32, i32* %9
%132 = add nsw i32 %130, %131
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds [256 x float], [256 x float]* %3, i64 0, i64 %133
%135 = load float, float* %134
%136 = fpext float %135 to double
%137 = fmul double %128, %136
%138 = fptosi double %137 to i32
%139 = call i32 (i32*, i8*, ...) @fprintf(i32* %127, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %138)
%140 = load i32, i32* %10
%141 = add nsw i32 %140, 1
store i32 %141, i32* %10
%142 = icmp sge i32 %141, 16
br i1 %142, label %143, label %144
143: ; preds = %126
br label %147
144: ; preds = %126
%145 = load i32*, i32** %2
%146 = call i32 (i32*, i8*, ...) @fprintf(i32* %145, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %126
147: ; preds = %143
%148 = load i32*, i32** %2
%149 = call i32 (i32*, i8*, ...) @fprintf(i32* %148, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%150 = load i32, i32* %9
%151 = add nsw i32 %150, 1
store i32 %151, i32* %9
%152 = icmp sge i32 %151, 16
br i1 %152, label %153, label %154
153: ; preds = %147
br label %157
154: ; preds = %147
%155 = load i32*, i32** %2
%156 = call i32 (i32*, i8*, ...) @fprintf(i32* %155, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %123
157: ; preds = %153
%158 = load i32*, i32** %2
%159 = call i32 (i32*, i8*, ...) @fprintf(i32* %158, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
@.str = [16 x i8] c"/*\0A txfilt = [\00"
@.str.1 = [6 x i8] c" %g ;\00"
@.str.2 = [14 x i8] c"\0A \00"
@.str.3 = [64 x i8] c" ];\0A abssum = %g;\0A semilogy((0:%u)/%u,abs(fft(txfilt)))\0A */\0A\0A\00"
@.str.4 = [38 x i8] c"static const int txfilter[%u][%u] = {\00"
@.str.5 = [4 x i8] c"\0A\09{\00"
@.str.6 = [4 x i8] c" %d\00"
@.str.8 = [3 x i8] c" }\00"
@.str.9 = [6 x i8] c"\0A};\0A\0A\00"
define void @gentxfilt(i32* nocapture %0) {
%2 = alloca [256 x float]
%3 = bitcast [256 x float]* %2 to i8*
br label %4
4: ; preds = %1, %27
%5 = phi i64 [ 0, %1 ], [ %33, %27 ]
%6 = trunc i64 %5 to i32
%7 = add i32 %6, -128
%8 = sitofp i32 %7 to double
%9 = fmul double %8, 6.250000e-02
%10 = fmul double %9, 4.000000e-01
%11 = fmul double %10, -4.000000e+00
%12 = tail call double @llvm.fmuladd.f64(double %11, double %10, double 1.000000e+00)
%13 = fptrunc double %12 to float
%14 = tail call double @fabs(float %13)
%15 = fcmp olt double %14, 1.000000e-10
%16 = load double, double* @M_PI
br i1 %15, label %17, label %23
17: ; preds = %4
%18 = fmul double %16, 1.250000e-01
%19 = fmul double %10, %16
%20 = tail call double @sin(double %19)
%21 = fmul double %18, %20
%22 = fdiv double %21, %10
br label %27
23: ; preds = %4
%24 = fmul double %10, %16
%25 = tail call double @cos(double %24)
%26 = fdiv double %25, %12
br label %27
27: ; preds = %23, %17
%28 = phi double [ %22, %17 ], [ %26, %23 ]
%29 = tail call double @sinc(double %9)
%30 = fmul double %28, %29
%31 = fptrunc double %30 to float
%32 = getelementptr inbounds [256 x float], [256 x float]* %2, i64 0, i64 %5
store float %31, float* %32
%33 = add nuw nsw i64 %5, 1
%34 = icmp eq i64 %33, 256
br i1 %34, label %35, label %4
35: ; preds = %27, %35
%36 = phi i64 [ %119, %35 ], [ 0, %27 ]
%37 = phi double [ %118, %35 ], [ 0.000000e+00, %27 ]
%38 = getelementptr inbounds [256 x float], [256 x float]* %2, i64 0, i64 %36
%39 = load float, float* %38
%40 = tail call double @fabs(float %39)
%41 = fadd double %40, 0.000000e+00
%42 = add nuw nsw i64 %36, 16
%43 = getelementptr inbounds [256 x float], [256 x float]* %2, i64 0, i64 %42
%44 = load float, float* %43
%45 = tail call double @fabs(float %44)
%46 = fadd double %41, %45
%47 = add nuw nsw i64 %36, 32
%48 = getelementptr inbounds [256 x float], [256 x float]* %2, i64 0, i64 %47
%49 = load float, float* %48
%50 = tail call double @fabs(float %49)
%51 = fadd double %46, %50
%52 = add nuw nsw i64 %36, 48
%53 = getelementptr inbounds [256 x float], [256 x float]* %2, i64 0, i64 %52
%54 = load float, float* %53
%55 = tail call double @fabs(float %54)
%56 = fadd double %51, %55
%57 = add nuw nsw i64 %36, 64
%58 = getelementptr inbounds [256 x float], [256 x float]* %2, i64 0, i64 %57
%59 = load float, float* %58
%60 = tail call double @fabs(float %59)
%61 = fadd double %56, %60
%62 = add nuw nsw i64 %36, 80
%63 = getelementptr inbounds [256 x float], [256 x float]* %2, i64 0, i64 %62
%64 = load float, float* %63
%65 = tail call double @fabs(float %64)
%66 = fadd double %61, %65
%67 = add nuw nsw i64 %36, 96
%68 = getelementptr inbounds [256 x float], [256 x float]* %2, i64 0, i64 %67
%69 = load float, float* %68
%70 = tail call double @fabs(float %69)
%71 = fadd double %66, %70
%72 = add nuw nsw i64 %36, 112
%73 = getelementptr inbounds [256 x float], [256 x float]* %2, i64 0, i64 %72
%74 = load float, float* %73
%75 = tail call double @fabs(float %74)
%76 = fadd double %71, %75
%77 = add nuw nsw i64 %36, 128
%78 = getelementptr inbounds [256 x float], [256 x float]* %2, i64 0, i64 %77
%79 = load float, float* %78
%80 = tail call double @fabs(float %79)
%81 = fadd double %76, %80
%82 = add nuw nsw i64 %36, 144
%83 = getelementptr inbounds [256 x float], [256 x float]* %2, i64 0, i64 %82
%84 = load float, float* %83
%85 = tail call double @fabs(float %84)
%86 = fadd double %81, %85
%87 = add nuw nsw i64 %36, 160
%88 = getelementptr inbounds [256 x float], [256 x float]* %2, i64 0, i64 %87
%89 = load float, float* %88
%90 = tail call double @fabs(float %89)
%91 = fadd double %86, %90
%92 = add nuw nsw i64 %36, 176
%93 = getelementptr inbounds [256 x float], [256 x float]* %2, i64 0, i64 %92
%94 = load float, float* %93
%95 = tail call double @fabs(float %94)
%96 = fadd double %91, %95
%97 = add nuw nsw i64 %36, 192
%98 = getelementptr inbounds [256 x float], [256 x float]* %2, i64 0, i64 %97
%99 = load float, float* %98
%100 = tail call double @fabs(float %99)
%101 = fadd double %96, %100
%102 = add nuw nsw i64 %36, 208
%103 = getelementptr inbounds [256 x float], [256 x float]* %2, i64 0, i64 %102
%104 = load float, float* %103
%105 = tail call double @fabs(float %104)
%106 = fadd double %101, %105
%107 = add nuw nsw i64 %36, 224
%108 = getelementptr inbounds [256 x float], [256 x float]* %2, i64 0, i64 %107
%109 = load float, float* %108
%110 = tail call double @fabs(float %109)
%111 = fadd double %106, %110
%112 = add nuw nsw i64 %36, 240
%113 = getelementptr inbounds [256 x float], [256 x float]* %2, i64 0, i64 %112
%114 = load float, float* %113
%115 = tail call double @fabs(float %114)
%116 = fadd double %111, %115
%117 = fcmp ogt double %116, %37
%118 = select i1 %117, double %116, double %37
%119 = add nuw nsw i64 %36, 1
%120 = icmp eq i64 %119, 16
br i1 %120, label %121, label %35
121: ; preds = %35
%122 = tail call i64 @fwrite(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 15, i64 1, i32* %0)
%123 = getelementptr inbounds [256 x float], [256 x float]* %2, i64 0, i64 0
%124 = load float, float* %123
%125 = fpext float %124 to double
%126 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %125)
br label %127
127: ; preds = %121, %133
%128 = phi i64 [ 1, %121 ], [ %138, %133 ]
%129 = and i64 %128, 3
%130 = icmp eq i64 %129, 0
br i1 %130, label %131, label %133
131: ; preds = %127
%132 = tail call i64 @fwrite(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i64 13, i64 1, i32* %0)
br label %133
133: ; preds = %131, %127
%134 = getelementptr inbounds [256 x float], [256 x float]* %2, i64 0, i64 %128
%135 = load float, float* %134
%136 = fpext float %135 to double
%137 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %136)
%138 = add nuw nsw i64 %128, 1
%139 = icmp eq i64 %138, 256
br i1 %139, label %140, label %127
140: ; preds = %133
%141 = fdiv double 3.276700e+04, %118
%142 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0), double %118, i32 255, i32 256)
%143 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i32 16, i32 16)
br label %144
144: ; preds = %169, %140
%145 = phi i64 [ %170, %169 ], [ 0, %140 ]
%146 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i64 3, i64 1, i32* %0)
%147 = getelementptr inbounds [256 x float], [256 x float]* %2, i64 0, i64 %145
%148 = load float, float* %147
%149 = fpext float %148 to double
%150 = fmul double %141, %149
%151 = fptosi double %150 to i32
%152 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %151)
br label %153
153: ; preds = %144, %153
%154 = phi i64 [ 0, %144 ], [ %155, %153 ]
%155 = add nuw nsw i64 %154, 1
%156 = tail call i32 @fputc(i32 44, i32* %0)
%157 = shl nsw i64 %155, 4
%158 = add nuw nsw i64 %157, %145
%159 = getelementptr inbounds [256 x float], [256 x float]* %2, i64 0, i64 %158
%160 = load float, float* %159
%161 = fpext float %160 to double
%162 = fmul double %141, %161
%163 = fptosi double %162 to i32
%164 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %163)
%165 = icmp eq i64 %155, 15
br i1 %165, label %166, label %153
166: ; preds = %153
%167 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i64 2, i64 1, i32* %0)
%168 = icmp eq i64 %145, 15
br i1 %168, label %172, label %169
169: ; preds = %166
%170 = add nuw nsw i64 %145, 1
%171 = tail call i32 @fputc(i32 44, i32* %0)
br label %144
172: ; preds = %166
%173 = tail call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i64 5, i64 1, i32* %0)
ret void
}