#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 atan(double);
double sin(double);
double window(int, int, int, double);
void firGen(int n, int band, double fln, double fhn, int wn, double *h,
            double beta) {
  int i, n2, mid;
  double s, pi, wc1, wc2, delay, fs;
  pi = 4.0 * atan(1.0);
  if ((n % 2) == 0) {
    n2 = n / 2 + 1;
    mid = 1;
  } else {
    n2 = n / 2;
    mid = 0;
  }
  delay = n / 2.0;
  wc1 = 2.0 * pi * fln;
  if (band >= 3)
    wc2 = 2.0 * pi * fhn;
  switch (band) {
  case 1:
    for (i = 0; i <= n2; i++) {
      s = i - delay;
      h[i] = (sin(wc1 * s / fs) / (pi * s)) * window(wn, n + 1, i, beta);
      h[n - i] = h[i];
    }
    if (mid == 1)
      h[n / 2] = wc1 / pi;
    break;
  case 2:
    for (i = 0; i <= n2; i++) {
      s = i - delay;
      h[i] = (sin(pi * s) - sin(wc1 * s / fs)) / (pi * s);
      h[i] = h[i] * window(wn, n + 1, i, beta);
      h[n - i] = h[i];
    }
    if (mid == 1)
      h[n / 2] = 1.0 - wc1 / pi;
    break;
  case 3:
    for (i = 0; i < n2; i++) {
      s = i - delay;
      h[i] = (sin(wc2 * s / fs) - sin(wc1 * s / fs)) / (pi * s);
      h[i] = h[i] * window(wn, n + 1, i, beta);
      h[n - i] = h[i];
    }
    if (mid == 1)
      h[n / 2] = (wc2 - wc1) / pi;
    break;
  case 4:
    for (i = 0; i <= n2; i++) {
      s = i - delay;
      h[i] = (sin(wc1 * s / fs) + sin(pi * s) - sin(wc2 * s / fs)) / (pi * s);
      h[i] = h[i] * window(wn, n + 1, i, beta);
      h[n - i] = h[i];
    }
    if (mid == 1)
      h[n / 2] = (wc1 + pi - wc2) / pi;
    break;
  }
}


x86 assembly (clang, -O0):
<firGen>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
movsd  0xea9(%rip),%xmm0
call   1040 <atan@plt>
movaps %xmm0,%xmm1
movsd  0xe91(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11a9 <firGen+0x79>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
movl   $0x1,-0x3c(%rbp)
jmp    11be <firGen+0x8e>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xe45(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xe34(%rip),%xmm0
mulsd  -0x50(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
cmpl   $0x3,-0x8(%rbp)
jl     120c <firGen+0xdc>
movsd  0xe13(%rip),%xmm0
mulsd  -0x50(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x78(%rbp)
sub    $0x3,%eax
ja     16e6 <firGen+0x5b6>
mov    -0x78(%rbp),%rax
lea    0xdec(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x38(%rbp),%eax
jg     12da <firGen+0x1aa>
cvtsi2sdl -0x34(%rbp),%xmm0
subsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x58(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
divsd  -0x70(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x50(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x4(%rbp),%esi
add    $0x1,%esi
mov    -0x34(%rbp),%edx
movsd  -0x30(%rbp),%xmm0
call   1050 <window@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    123c <firGen+0x10c>
cmpl   $0x1,-0x3c(%rbp)
jne    1315 <firGen+0x1e5>
movsd  -0x58(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
mov    -0x28(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x88(%rbp),%rax
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    16e6 <firGen+0x5b6>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x38(%rbp),%eax
jg     1405 <firGen+0x2d5>
cvtsi2sdl -0x34(%rbp),%xmm0
subsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
divsd  -0x70(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x98(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  -0x50(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x1c(%rbp),%edi
mov    -0x4(%rbp),%esi
add    $0x1,%esi
mov    -0x34(%rbp),%edx
movsd  -0x30(%rbp),%xmm0
call   1050 <window@plt>
movaps %xmm0,%xmm1
movsd  -0x90(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1321 <firGen+0x1f1>
cmpl   $0x1,-0x3c(%rbp)
jne    144c <firGen+0x31c>
movsd  -0x58(%rbp),%xmm1
divsd  -0x50(%rbp),%xmm1
movsd  0xbe7(%rip),%xmm0
subsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xa0(%rbp),%rax
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    16e6 <firGen+0x5b6>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    1541 <firGen+0x411>
cvtsi2sdl -0x34(%rbp),%xmm0
subsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x60(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
divsd  -0x70(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
divsd  -0x70(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  -0x50(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x1c(%rbp),%edi
mov    -0x4(%rbp),%esi
add    $0x1,%esi
mov    -0x34(%rbp),%edx
movsd  -0x30(%rbp),%xmm0
call   1050 <window@plt>
movaps %xmm0,%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1458 <firGen+0x328>
cmpl   $0x1,-0x3c(%rbp)
jne    1581 <firGen+0x451>
movsd  -0x60(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
mov    -0x28(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xb8(%rbp),%rax
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    16e6 <firGen+0x5b6>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x38(%rbp),%eax
jg     169c <firGen+0x56c>
cvtsi2sdl -0x34(%rbp),%xmm0
subsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x58(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
divsd  -0x70(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xd0(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
divsd  -0x70(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0xc8(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  -0x50(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
mov    -0x1c(%rbp),%edi
mov    -0x4(%rbp),%esi
add    $0x1,%esi
mov    -0x34(%rbp),%edx
movsd  -0x30(%rbp),%xmm0
call   1050 <window@plt>
movaps %xmm0,%xmm1
movsd  -0xc0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    158d <firGen+0x45d>
cmpl   $0x1,-0x3c(%rbp)
jne    16e1 <firGen+0x5b1>
movsd  -0x58(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
subsd  -0x60(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
mov    -0x28(%rbp),%rax
mov    %rax,-0xd8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xd8(%rbp),%rax
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    16e6 <firGen+0x5b6>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<firGen>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
movsd  %xmm2,0x38(%rsp)
mov    %rcx,%r14
mov    %edx,%r12d
movsd  %xmm1,0x28(%rsp)
movsd  %xmm0,0x20(%rsp)
mov    %esi,%ebp
mov    %edi,%r15d
movsd  0xe9d(%rip),%xmm0
call   1040 <atan@plt>
add    $0xffffffff,%ebp
cmp    $0x3,%ebp
ja     1550 <firGen+0x420>
mov    %r15d,%edx
and    $0x1,%edx
mov    %r15d,%esi
shr    $0x1f,%esi
add    %r15d,%esi
sar    %esi
mov    %edx,%r13d
xor    $0x1,%r13d
add    %esi,%r13d
xorps  %xmm1,%xmm1
cvtsi2sd %r15d,%xmm1
mulsd  0xe69(%rip),%xmm1
movsd  0xe69(%rip),%xmm0
movsd  0x20(%rsp),%xmm3
mulsd  %xmm0,%xmm3
movsd  0x28(%rsp),%xmm2
mulsd  %xmm0,%xmm2
lea    0xe6e(%rip),%rax
movslq (%rax,%rbp,4),%rcx
add    %rax,%rcx
movapd %xmm3,%xmm0
movsd  %xmm1,0x30(%rsp)
movsd  %xmm3,0x20(%rsp)
mov    %esi,0x1c(%rsp)
mov    %edx,0x18(%rsp)
jmp    *%rcx
test   %r13d,%r13d
js     126c <firGen+0x13c>
movslq %r15d,%rax
add    $0x1,%r15d
add    $0x1,%r13d
lea    (%r14,%rax,8),%rbx
xor    %ebp,%ebp
nopl   (%rax)
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xdff(%rip),%xmm0
call   1030 <sin@plt>
movsd  0x8(%rsp),%xmm1
mulsd  0xdf4(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %r12d,%edi
mov    %r15d,%esi
mov    %ebp,%edx
movsd  0x38(%rsp),%xmm0
call   1050 <window@plt>
movsd  0x30(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14,%rbp,8)
movsd  %xmm0,(%rbx)
add    $0x1,%rbp
add    $0xfffffffffffffff8,%rbx
cmp    %rbp,%r13
jne    1200 <firGen+0xd0>
cmpl   $0x0,0x18(%rsp)
movsd  0x20(%rsp),%xmm1
mov    0x1c(%rsp),%eax
je     1363 <firGen+0x233>
jmp    1550 <firGen+0x420>
movsd  %xmm2,0x28(%rsp)
test   %r13d,%r13d
mov    %r12d,0x44(%rsp)
jle    1344 <firGen+0x214>
movslq %r15d,%rax
add    $0x1,%r15d
mov    %r13d,%r12d
lea    (%r14,%rax,8),%rbx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xd4f(%rip),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xd3c(%rip),%xmm0
call   1030 <sin@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
mulsd  0xd27(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  %xmm1,(%r14,%rbp,8)
mov    0x44(%rsp),%edi
mov    %r15d,%esi
mov    %ebp,%edx
movsd  0x38(%rsp),%xmm0
call   1050 <window@plt>
movsd  0x30(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14,%rbp,8)
movsd  %xmm0,(%rbx)
add    $0x1,%rbp
add    $0xfffffffffffffff8,%rbx
cmp    %rbp,%r12
jne    12b0 <firGen+0x180>
cmpl   $0x0,0x18(%rsp)
movsd  0x20(%rsp),%xmm0
mov    0x1c(%rsp),%eax
movsd  0x28(%rsp),%xmm1
jne    1550 <firGen+0x420>
subsd  %xmm0,%xmm1
divsd  0xcb5(%rip),%xmm1
jmp    1548 <firGen+0x418>
movsd  %xmm2,0x28(%rsp)
test   %r13d,%r13d
js     144d <firGen+0x31d>
mov    %r12d,%ebx
movslq %r15d,%rax
add    $0x1,%r15d
add    $0x1,%r13d
lea    (%r14,%rax,8),%r12
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xc5f(%rip),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xc4e(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1030 <sin@plt>
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xc27(%rip),%xmm0
call   1030 <sin@plt>
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
divsd  0x8(%rsp),%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  %xmm1,(%r14,%rbp,8)
mov    %ebx,%edi
mov    %r15d,%esi
mov    %ebp,%edx
movsd  0x38(%rsp),%xmm0
call   1050 <window@plt>
movsd  0x30(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%r14,%rbp,8)
movsd  %xmm0,(%r12)
add    $0x1,%rbp
add    $0xfffffffffffffff8,%r12
cmp    %rbp,%r13
jne    13a0 <firGen+0x270>
cmpl   $0x0,0x18(%rsp)
movsd  0x20(%rsp),%xmm1
mov    0x1c(%rsp),%eax
movsd  0x28(%rsp),%xmm2
jne    1550 <firGen+0x420>
movsd  0xbb0(%rip),%xmm0
addsd  %xmm0,%xmm1
subsd  %xmm2,%xmm1
divsd  %xmm0,%xmm1
jmp    1548 <firGen+0x418>
test   %r13d,%r13d
js     1527 <firGen+0x3f7>
movslq %r15d,%rax
add    $0x1,%r15d
add    $0x1,%r13d
lea    (%r14,%rax,8),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
subsd  %xmm1,%xmm0
mulsd  0xb6d(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xb4c(%rip),%xmm0
call   1030 <sin@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
divsd  0x10(%rsp),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  %xmm1,(%r14,%rbp,8)
mov    %r12d,%edi
mov    %r15d,%esi
mov    %ebp,%edx
movsd  0x38(%rsp),%xmm0
call   1050 <window@plt>
movsd  0x30(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14,%rbp,8)
movsd  %xmm0,(%rbx)
add    $0x1,%rbp
add    $0xfffffffffffffff8,%rbx
cmp    %rbp,%r13
jne    14a0 <firGen+0x370>
cmpl   $0x0,0x18(%rsp)
movsd  0x20(%rsp),%xmm1
mov    0x1c(%rsp),%eax
jne    1550 <firGen+0x420>
divsd  0xae8(%rip),%xmm1
addsd  0xab8(%rip),%xmm1
cltq
movsd  %xmm1,(%r14,%rax,8)
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @firGen(i32 %0, i32 %1, double %2, double %3, i32 %4, double* %5, double %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca double
%11 = alloca double
%12 = alloca i32
%13 = alloca double*
%14 = alloca double
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
store i32 %0, i32* %8
store i32 %1, i32* %9
store double %2, double* %10
store double %3, double* %11
store i32 %4, i32* %12
store double* %5, double** %13
store double %6, double* %14
%24 = call double @atan(double 1.000000e+00)
%25 = fmul double 4.000000e+00, %24
store double %25, double* %19
%26 = load i32, i32* %8
%27 = srem i32 %26, 2
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %33
29: ; preds = %7
%30 = load i32, i32* %8
%31 = sdiv i32 %30, 2
%32 = add nsw i32 %31, 1
store i32 %32, i32* %16
store i32 1, i32* %17
br label %36
33: ; preds = %7
%34 = load i32, i32* %8
%35 = sdiv i32 %34, 2
store i32 %35, i32* %16
store i32 0, i32* %17
br label %36
36: ; preds = %33, %29
%37 = load i32, i32* %8
%38 = sitofp i32 %37 to double
%39 = fdiv double %38, 2.000000e+00
store double %39, double* %22
%40 = load double, double* %19
%41 = fmul double 2.000000e+00, %40
%42 = load double, double* %10
%43 = fmul double %41, %42
store double %43, double* %20
%44 = load i32, i32* %9
%45 = icmp sge i32 %44, 3
br i1 %45, label %46, label %51
46: ; preds = %36
%47 = load double, double* %19
%48 = fmul double 2.000000e+00, %47
%49 = load double, double* %11
%50 = fmul double %48, %49
store double %50, double* %21
br label %51
51: ; preds = %46, %36
%52 = load i32, i32* %9
switch i32 %52, label %343 [
i32 1, label %53
i32 2, label %111
i32 3, label %184
i32 4, label %260
]
53: ; preds = %51
store i32 0, i32* %15
br label %54
54: ; preds = %95, %53
%55 = load i32, i32* %15
%56 = load i32, i32* %16
%57 = icmp sle i32 %55, %56
br i1 %57, label %58, label %98
58: ; preds = %54
%59 = load i32, i32* %15
%60 = sitofp i32 %59 to double
%61 = load double, double* %22
%62 = fsub double %60, %61
store double %62, double* %18
%63 = load double, double* %20
%64 = load double, double* %18
%65 = fmul double %63, %64
%66 = load double, double* %23
%67 = fdiv double %65, %66
%68 = call double @sin(double %67)
%69 = load double, double* %19
%70 = load double, double* %18
%71 = fmul double %69, %70
%72 = fdiv double %68, %71
%73 = load i32, i32* %12
%74 = load i32, i32* %8
%75 = add nsw i32 %74, 1
%76 = load i32, i32* %15
%77 = load double, double* %14
%78 = call double @window(i32 %73, i32 %75, i32 %76, double %77)
%79 = fmul double %72, %78
%80 = load double*, double** %13
%81 = load i32, i32* %15
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double, double* %80, i64 %82
store double %79, double* %83
%84 = load double*, double** %13
%85 = load i32, i32* %15
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds double, double* %84, i64 %86
%88 = load double, double* %87
%89 = load double*, double** %13
%90 = load i32, i32* %8
%91 = load i32, i32* %15
%92 = sub nsw i32 %90, %91
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds double, double* %89, i64 %93
store double %88, double* %94
br label %95
95: ; preds = %58
%96 = load i32, i32* %15
%97 = add nsw i32 %96, 1
store i32 %97, i32* %15
br label %54
98: ; preds = %54
%99 = load i32, i32* %17
%100 = icmp eq i32 %99, 1
br i1 %100, label %101, label %110
101: ; preds = %98
%102 = load double, double* %20
%103 = load double, double* %19
%104 = fdiv double %102, %103
%105 = load double*, double** %13
%106 = load i32, i32* %8
%107 = sdiv i32 %106, 2
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds double, double* %105, i64 %108
store double %104, double* %109
br label %110
110: ; preds = %101, %98
br label %343
111: ; preds = %51
store i32 0, i32* %15
br label %112
112: ; preds = %167, %111
%113 = load i32, i32* %15
%114 = load i32, i32* %16
%115 = icmp sle i32 %113, %114
br i1 %115, label %116, label %170
116: ; preds = %112
%117 = load i32, i32* %15
%118 = sitofp i32 %117 to double
%119 = load double, double* %22
%120 = fsub double %118, %119
store double %120, double* %18
%121 = load double, double* %19
%122 = load double, double* %18
%123 = fmul double %121, %122
%124 = call double @sin(double %123)
%125 = load double, double* %20
%126 = load double, double* %18
%127 = fmul double %125, %126
%128 = load double, double* %23
%129 = fdiv double %127, %128
%130 = call double @sin(double %129)
%131 = fsub double %124, %130
%132 = load double, double* %19
%133 = load double, double* %18
%134 = fmul double %132, %133
%135 = fdiv double %131, %134
%136 = load double*, double** %13
%137 = load i32, i32* %15
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds double, double* %136, i64 %138
store double %135, double* %139
%140 = load double*, double** %13
%141 = load i32, i32* %15
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds double, double* %140, i64 %142
%144 = load double, double* %143
%145 = load i32, i32* %12
%146 = load i32, i32* %8
%147 = add nsw i32 %146, 1
%148 = load i32, i32* %15
%149 = load double, double* %14
%150 = call double @window(i32 %145, i32 %147, i32 %148, double %149)
%151 = fmul double %144, %150
%152 = load double*, double** %13
%153 = load i32, i32* %15
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds double, double* %152, i64 %154
store double %151, double* %155
%156 = load double*, double** %13
%157 = load i32, i32* %15
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds double, double* %156, i64 %158
%160 = load double, double* %159
%161 = load double*, double** %13
%162 = load i32, i32* %8
%163 = load i32, i32* %15
%164 = sub nsw i32 %162, %163
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds double, double* %161, i64 %165
store double %160, double* %166
br label %167
167: ; preds = %116
%168 = load i32, i32* %15
%169 = add nsw i32 %168, 1
store i32 %169, i32* %15
br label %112
170: ; preds = %112
%171 = load i32, i32* %17
%172 = icmp eq i32 %171, 1
br i1 %172, label %173, label %183
173: ; preds = %170
%174 = load double, double* %20
%175 = load double, double* %19
%176 = fdiv double %174, %175
%177 = fsub double 1.000000e+00, %176
%178 = load double*, double** %13
%179 = load i32, i32* %8
%180 = sdiv i32 %179, 2
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds double, double* %178, i64 %181
store double %177, double* %182
br label %183
183: ; preds = %173, %170
br label %343
184: ; preds = %51
store i32 0, i32* %15
br label %185
185: ; preds = %242, %184
%186 = load i32, i32* %15
%187 = load i32, i32* %16
%188 = icmp slt i32 %186, %187
br i1 %188, label %189, label %245
189: ; preds = %185
%190 = load i32, i32* %15
%191 = sitofp i32 %190 to double
%192 = load double, double* %22
%193 = fsub double %191, %192
store double %193, double* %18
%194 = load double, double* %21
%195 = load double, double* %18
%196 = fmul double %194, %195
%197 = load double, double* %23
%198 = fdiv double %196, %197
%199 = call double @sin(double %198)
%200 = load double, double* %20
%201 = load double, double* %18
%202 = fmul double %200, %201
%203 = load double, double* %23
%204 = fdiv double %202, %203
%205 = call double @sin(double %204)
%206 = fsub double %199, %205
%207 = load double, double* %19
%208 = load double, double* %18
%209 = fmul double %207, %208
%210 = fdiv double %206, %209
%211 = load double*, double** %13
%212 = load i32, i32* %15
%213 = sext i32 %212 to i64
%214 = getelementptr inbounds double, double* %211, i64 %213
store double %210, double* %214
%215 = load double*, double** %13
%216 = load i32, i32* %15
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds double, double* %215, i64 %217
%219 = load double, double* %218
%220 = load i32, i32* %12
%221 = load i32, i32* %8
%222 = add nsw i32 %221, 1
%223 = load i32, i32* %15
%224 = load double, double* %14
%225 = call double @window(i32 %220, i32 %222, i32 %223, double %224)
%226 = fmul double %219, %225
%227 = load double*, double** %13
%228 = load i32, i32* %15
%229 = sext i32 %228 to i64
%230 = getelementptr inbounds double, double* %227, i64 %229
store double %226, double* %230
%231 = load double*, double** %13
%232 = load i32, i32* %15
%233 = sext i32 %232 to i64
%234 = getelementptr inbounds double, double* %231, i64 %233
%235 = load double, double* %234
%236 = load double*, double** %13
%237 = load i32, i32* %8
%238 = load i32, i32* %15
%239 = sub nsw i32 %237, %238
%240 = sext i32 %239 to i64
%241 = getelementptr inbounds double, double* %236, i64 %240
store double %235, double* %241
br label %242
242: ; preds = %189
%243 = load i32, i32* %15
%244 = add nsw i32 %243, 1
store i32 %244, i32* %15
br label %185
245: ; preds = %185
%246 = load i32, i32* %17
%247 = icmp eq i32 %246, 1
br i1 %247, label %248, label %259
248: ; preds = %245
%249 = load double, double* %21
%250 = load double, double* %20
%251 = fsub double %249, %250
%252 = load double, double* %19
%253 = fdiv double %251, %252
%254 = load double*, double** %13
%255 = load i32, i32* %8
%256 = sdiv i32 %255, 2
%257 = sext i32 %256 to i64
%258 = getelementptr inbounds double, double* %254, i64 %257
store double %253, double* %258
br label %259
259: ; preds = %248, %245
br label %343
260: ; preds = %51
store i32 0, i32* %15
br label %261
261: ; preds = %323, %260
%262 = load i32, i32* %15
%263 = load i32, i32* %16
%264 = icmp sle i32 %262, %263
br i1 %264, label %265, label %326
265: ; preds = %261
%266 = load i32, i32* %15
%267 = sitofp i32 %266 to double
%268 = load double, double* %22
%269 = fsub double %267, %268
store double %269, double* %18
%270 = load double, double* %20
%271 = load double, double* %18
%272 = fmul double %270, %271
%273 = load double, double* %23
%274 = fdiv double %272, %273
%275 = call double @sin(double %274)
%276 = load double, double* %19
%277 = load double, double* %18
%278 = fmul double %276, %277
%279 = call double @sin(double %278)
%280 = fadd double %275, %279
%281 = load double, double* %21
%282 = load double, double* %18
%283 = fmul double %281, %282
%284 = load double, double* %23
%285 = fdiv double %283, %284
%286 = call double @sin(double %285)
%287 = fsub double %280, %286
%288 = load double, double* %19
%289 = load double, double* %18
%290 = fmul double %288, %289
%291 = fdiv double %287, %290
%292 = load double*, double** %13
%293 = load i32, i32* %15
%294 = sext i32 %293 to i64
%295 = getelementptr inbounds double, double* %292, i64 %294
store double %291, double* %295
%296 = load double*, double** %13
%297 = load i32, i32* %15
%298 = sext i32 %297 to i64
%299 = getelementptr inbounds double, double* %296, i64 %298
%300 = load double, double* %299
%301 = load i32, i32* %12
%302 = load i32, i32* %8
%303 = add nsw i32 %302, 1
%304 = load i32, i32* %15
%305 = load double, double* %14
%306 = call double @window(i32 %301, i32 %303, i32 %304, double %305)
%307 = fmul double %300, %306
%308 = load double*, double** %13
%309 = load i32, i32* %15
%310 = sext i32 %309 to i64
%311 = getelementptr inbounds double, double* %308, i64 %310
store double %307, double* %311
%312 = load double*, double** %13
%313 = load i32, i32* %15
%314 = sext i32 %313 to i64
%315 = getelementptr inbounds double, double* %312, i64 %314
%316 = load double, double* %315
%317 = load double*, double** %13
%318 = load i32, i32* %8
%319 = load i32, i32* %15
%320 = sub nsw i32 %318, %319
%321 = sext i32 %320 to i64
%322 = getelementptr inbounds double, double* %317, i64 %321
store double %316, double* %322
br label %323
323: ; preds = %265
%324 = load i32, i32* %15
%325 = add nsw i32 %324, 1
store i32 %325, i32* %15
br label %261
326: ; preds = %261
%327 = load i32, i32* %17
%328 = icmp eq i32 %327, 1
br i1 %328, label %329, label %342
329: ; preds = %326
%330 = load double, double* %20
%331 = load double, double* %19
%332 = fadd double %330, %331
%333 = load double, double* %21
%334 = fsub double %332, %333
%335 = load double, double* %19
%336 = fdiv double %334, %335
%337 = load double*, double** %13
%338 = load i32, i32* %8
%339 = sdiv i32 %338, 2
%340 = sext i32 %339 to i64
%341 = getelementptr inbounds double, double* %337, i64 %340
store double %336, double* %341
br label %342
342: ; preds = %329, %326
br label %343
343: ; preds = %51, %342, %259, %183, %110
ret void
}

LLVM IR (-O2):
define void @firGen(i32 %0, i32 %1, double %2, double %3, i32 %4, double* nocapture writeonly %5, double %6) {
%8 = tail call double @atan(double 1.000000e+00)
%9 = and i32 %0, 1
%10 = icmp eq i32 %9, 0
%11 = sdiv i32 %0, 2
%12 = xor i32 %9, 1
%13 = add nsw i32 %11, %12
%14 = sitofp i32 %0 to double
%15 = fmul double %14, 5.000000e-01
%16 = fmul double %2, 0x401921FB54442D18
%17 = fmul double %3, 0x401921FB54442D18
switch i32 %1, label %134 [
i32 1, label %38
i32 2, label %31
i32 3, label %25
i32 4, label %18
]
18: ; preds = %7
%19 = icmp slt i32 %13, 0
br i1 %19, label %124, label %20
20: ; preds = %18
%21 = add nsw i32 %0, 1
%22 = sext i32 %0 to i64
%23 = add nuw nsw i32 %13, 1
%24 = zext i32 %23 to i64
br label %105
25: ; preds = %7
%26 = icmp sgt i32 %13, 0
br i1 %26, label %27, label %101
27: ; preds = %25
%28 = add nsw i32 %0, 1
%29 = sext i32 %0 to i64
%30 = zext i32 %13 to i64
br label %84
31: ; preds = %7
%32 = icmp slt i32 %13, 0
br i1 %32, label %80, label %33
33: ; preds = %31
%34 = add nsw i32 %0, 1
%35 = sext i32 %0 to i64
%36 = add nuw nsw i32 %13, 1
%37 = zext i32 %36 to i64
br label %63
38: ; preds = %7
%39 = icmp slt i32 %13, 0
br i1 %39, label %60, label %40
40: ; preds = %38
%41 = add nsw i32 %0, 1
%42 = sext i32 %0 to i64
%43 = add nuw nsw i32 %13, 1
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %40, %45
%46 = phi i64 [ 0, %40 ], [ %58, %45 ]
%47 = trunc i64 %46 to i32
%48 = sitofp i32 %47 to double
%49 = fsub double %48, %15
%50 = tail call double @sin(double 0x7FF8000000000000)
%51 = fmul double %49, 0x400921FB54442D18
%52 = fdiv double %50, %51
%53 = tail call double @window(i32 %4, i32 %41, i32 %47, double %6)
%54 = fmul double %52, %53
%55 = getelementptr inbounds double, double* %5, i64 %46
store double %54, double* %55
%56 = sub nsw i64 %42, %46
%57 = getelementptr inbounds double, double* %5, i64 %56
store double %54, double* %57
%58 = add nuw nsw i64 %46, 1
%59 = icmp eq i64 %58, %44
br i1 %59, label %60, label %45
60: ; preds = %45, %38
br i1 %10, label %61, label %134
61: ; preds = %60
%62 = fdiv double %16, 0x400921FB54442D18
br label %129
63: ; preds = %33, %63
%64 = phi i64 [ 0, %33 ], [ %78, %63 ]
%65 = trunc i64 %64 to i32
%66 = sitofp i32 %65 to double
%67 = fsub double %66, %15
%68 = fmul double %67, 0x400921FB54442D18
%69 = tail call double @sin(double %68)
%70 = tail call double @sin(double 0x7FF8000000000000)
%71 = fsub double %69, %70
%72 = fdiv double %71, %68
%73 = getelementptr inbounds double, double* %5, i64 %64
store double %72, double* %73
%74 = tail call double @window(i32 %4, i32 %34, i32 %65, double %6)
%75 = fmul double %72, %74
store double %75, double* %73
%76 = sub nsw i64 %35, %64
%77 = getelementptr inbounds double, double* %5, i64 %76
store double %75, double* %77
%78 = add nuw nsw i64 %64, 1
%79 = icmp eq i64 %78, %37
br i1 %79, label %80, label %63
80: ; preds = %63, %31
br i1 %10, label %81, label %134
81: ; preds = %80
%82 = fdiv double %16, 0x400921FB54442D18
%83 = fsub double 1.000000e+00, %82
br label %129
84: ; preds = %27, %84
%85 = phi i64 [ 0, %27 ], [ %99, %84 ]
%86 = trunc i64 %85 to i32
%87 = sitofp i32 %86 to double
%88 = fsub double %87, %15
%89 = tail call double @sin(double 0x7FF8000000000000)
%90 = tail call double @sin(double 0x7FF8000000000000)
%91 = fsub double %89, %90
%92 = fmul double %88, 0x400921FB54442D18
%93 = fdiv double %91, %92
%94 = getelementptr inbounds double, double* %5, i64 %85
store double %93, double* %94
%95 = tail call double @window(i32 %4, i32 %28, i32 %86, double %6)
%96 = fmul double %93, %95
store double %96, double* %94
%97 = sub nsw i64 %29, %85
%98 = getelementptr inbounds double, double* %5, i64 %97
store double %96, double* %98
%99 = add nuw nsw i64 %85, 1
%100 = icmp eq i64 %99, %30
br i1 %100, label %101, label %84
101: ; preds = %84, %25
br i1 %10, label %102, label %134
102: ; preds = %101
%103 = fsub double %17, %16
%104 = fdiv double %103, 0x400921FB54442D18
br label %129
105: ; preds = %20, %105
%106 = phi i64 [ 0, %20 ], [ %122, %105 ]
%107 = trunc i64 %106 to i32
%108 = sitofp i32 %107 to double
%109 = fsub double %108, %15
%110 = tail call double @sin(double 0x7FF8000000000000)
%111 = fmul double %109, 0x400921FB54442D18
%112 = tail call double @sin(double %111)
%113 = fadd double %110, %112
%114 = tail call double @sin(double 0x7FF8000000000000)
%115 = fsub double %113, %114
%116 = fdiv double %115, %111
%117 = getelementptr inbounds double, double* %5, i64 %106
store double %116, double* %117
%118 = tail call double @window(i32 %4, i32 %21, i32 %107, double %6)
%119 = fmul double %116, %118
store double %119, double* %117
%120 = sub nsw i64 %22, %106
%121 = getelementptr inbounds double, double* %5, i64 %120
store double %119, double* %121
%122 = add nuw nsw i64 %106, 1
%123 = icmp eq i64 %122, %24
br i1 %123, label %124, label %105
124: ; preds = %105, %18
br i1 %10, label %125, label %134
125: ; preds = %124
%126 = fadd double %16, 0x400921FB54442D18
%127 = fsub double %126, %17
%128 = fdiv double %127, 0x400921FB54442D18
br label %129
129: ; preds = %61, %81, %102, %125
%130 = phi double [ %128, %125 ], [ %104, %102 ], [ %83, %81 ], [ %62, %61 ]
%131 = sdiv i32 %0, 2
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds double, double* %5, i64 %132
store double %130, double* %133
br label %134
134: ; preds = %129, %124, %101, %80, %60, %7
ret void
}