#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*/ free(double *);
double *malloc(int const);
int /*<<< orphan*/ memcpy(double *, double const *, int const);
void fwt97(double *wav, const double *x, const int nx, const int ny) {
  const double a0 = -1.586134342;
  const double a1 = -0.05298011854;
  const double a2 = 0.8829110762;
  const double a3 = 0.4435068522;
  const double s0 = 0.81289306611596146;
  const double s1 = 0.61508705245700002;
  register int i, j;
  int off;
  double *tempx = malloc(nx * ny * sizeof(double));
  memcpy(tempx, x, nx * ny * sizeof(double));
  for (j = 0; j < ny; ++j) {
    off = nx * j;
    for (i = 1; i < nx - 1; i += 2) {
      tempx[i + off] += a0 * (tempx[off + i - 1] + tempx[off + i + 1]);
    }
    tempx[off + nx - 1] += 2 * a0 * tempx[off + nx - 2];
    for (i = 2; i < nx; i += 2) {
      tempx[off + i] += a1 * (tempx[off + i - 1] + tempx[off + i + 1]);
    }
    tempx[off] += 2 * a1 * tempx[off + 1];
    for (i = 1; i < nx - 1; i += 2) {
      tempx[off + i] += a2 * (tempx[off + i - 1] + tempx[off + i + 1]);
    }
    tempx[off + nx - 1] += 2 * a2 * tempx[off + nx - 2];
    for (i = 2; i < nx; i += 2) {
      tempx[off + i] += a3 * (tempx[off + i - 1] + tempx[off + i + 1]);
    }
    tempx[off] += 2 * a3 * tempx[off + 1];
  }
  for (j = 0; j < ny; ++j) {
    off = nx * j;
    for (i = 0; i < nx; ++i) {
      if (i % 2 == 0)
        wav[(i / 2) * ny + j] = s0 * tempx[off + i];
      else
        wav[(nx / 2 + i / 2) * ny + j] = s1 * tempx[off + i];
    }
  }
  free(tempx);
}


x86 assembly (clang, -O0):
<fwt97>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movsd  0xeda(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xec5(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeb0(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe9b(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe86(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe71(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    14ab <fwt97+0x37b>
mov    -0x14(%rbp),%eax
imul   -0x50(%rbp),%eax
mov    %eax,-0x54(%rbp)
movl   $0x1,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    125c <fwt97+0x12c>
mov    -0x60(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x60(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    -0x4c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x60(%rbp),%rax
mov    -0x4c(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xde7(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4c(%rbp)
jmp    11ec <fwt97+0xbc>
mov    -0x60(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    -0x14(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x60(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xda2(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x2,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    130d <fwt97+0x1dd>
mov    -0x60(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x60(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    -0x4c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x60(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    -0x4c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xd2e(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4c(%rbp)
jmp    12a2 <fwt97+0x172>
mov    -0x60(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x60(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xd04(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x1,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    13b8 <fwt97+0x288>
mov    -0x60(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x60(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    -0x4c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x60(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    -0x4c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xc7b(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4c(%rbp)
jmp    1348 <fwt97+0x218>
mov    -0x60(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    -0x14(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x60(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xc56(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x2,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1469 <fwt97+0x339>
mov    -0x60(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x60(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    -0x4c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x60(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    -0x4c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xbc2(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4c(%rbp)
jmp    13fe <fwt97+0x2ce>
mov    -0x60(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x60(%rbp),%rax
movslq -0x54(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xbb8(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    11cf <fwt97+0x9f>
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    15ad <fwt97+0x47d>
mov    -0x14(%rbp),%eax
imul   -0x50(%rbp),%eax
mov    %eax,-0x54(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    159a <fwt97+0x46a>
mov    -0x4c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1536 <fwt97+0x406>
mov    -0x60(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    -0x4c(%rbp),%ecx
movslq %ecx,%rcx
movsd  0xb04(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x4c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x68(%rbp),%rax
imul   -0x18(%rbp),%ecx
add    -0x50(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    1587 <fwt97+0x457>
mov    -0x60(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    -0x4c(%rbp),%ecx
movslq %ecx,%rcx
movsd  0xab5(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x4c(%rbp),%eax
mov    $0x2,%esi
cltd
idiv   %esi
mov    %eax,%edx
mov    -0x70(%rbp),%rax
add    %edx,%ecx
imul   -0x18(%rbp),%ecx
add    -0x50(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    158c <fwt97+0x45c>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    14cf <fwt97+0x39f>
jmp    159f <fwt97+0x46f>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    14b2 <fwt97+0x382>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fwt97>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %ecx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rdx,0x8(%rsp)
mov    %edx,%r13d
imul   %ecx,%r13d
shl    $0x3,%r13d
mov    %r13d,%edi
call   1050 <malloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r13d,%edx
call   1040 <memcpy@plt>
test   %ebp,%ebp
jle    14e7 <fwt97+0x3b7>
mov    0x8(%rsp),%rcx
lea    -0x1(%rcx),%eax
movslq %eax,%rdx
movslq %ecx,%r10
mov    %ebp,%r11d
lea    -0x3(%r10),%rax
mov    %rax,0x20(%rsp)
mov    %rax,%rcx
shr    %rcx
add    $0x1,%rcx
mov    %rcx,%rax
mov    %rcx,0x18(%rsp)
and    $0xfffffffffffffffe,%rcx
mov    %rcx,0x10(%rsp)
lea    0x0(,%r10,8),%r13
xor    %eax,%eax
movsd  0xe42(%rip),%xmm0
movsd  0xe41(%rip),%xmm8
movsd  0xe40(%rip),%xmm9
movsd  0xe50(%rip),%xmm3
movsd  0xe40(%rip),%xmm4
movsd  0xe48(%rip),%xmm5
movsd  0xe28(%rip),%xmm6
movsd  0xe40(%rip),%xmm7
mov    %r12,%rbx
jmp    1260 <fwt97+0x130>
nopl   (%rax)
lea    (%r12,%rdi,8),%r9
add    $0x8,%r9
lea    (%r12,%rdi,8),%r14
movsd  0x8(%r12,%rdi,8),%xmm1
mulsd  %xmm9,%xmm1
addsd  (%r12,%rdi,8),%xmm1
movsd  %xmm1,(%r12,%rdi,8)
movsd  -0x10(%r12,%r8,8),%xmm1
mulsd  %xmm4,%xmm1
addsd  -0x8(%r12,%r8,8),%xmm1
movsd  %xmm1,-0x8(%r12,%r8,8)
movsd  (%r9),%xmm1
mulsd  %xmm7,%xmm1
addsd  (%r14),%xmm1
movsd  %xmm1,(%r14)
add    $0x1,%rax
add    %r13,%rbx
cmp    %r11,%rax
je     145f <fwt97+0x32f>
mov    %rax,%rdi
imul   %r10,%rdi
cmp    $0x3,%r10d
jl     12a3 <fwt97+0x173>
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  -0x8(%rbx,%rcx,8),%xmm1
addsd  0x8(%rbx,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rbx,%rcx,8),%xmm1
movsd  %xmm1,(%rbx,%rcx,8)
add    $0x2,%rcx
cmp    %rdx,%rcx
jl     1280 <fwt97+0x150>
lea    (%rdi,%r10,1),%r8
movsd  -0x10(%r12,%r8,8),%xmm1
mulsd  %xmm8,%xmm1
addsd  -0x8(%r12,%r8,8),%xmm1
movsd  %xmm1,-0x8(%r12,%r8,8)
cmp    $0x3,%r10d
jl     1200 <fwt97+0xd0>
mov    $0x2,%ecx
cmpq   $0x2,0x20(%rsp)
jb     132e <fwt97+0x1fe>
mov    $0x2,%ecx
mov    0x10(%rsp),%rsi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  0x8(%rbx,%rcx,8),%xmm1
movsd  -0x8(%rbx,%rcx,8),%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm6,%xmm2
addsd  (%rbx,%rcx,8),%xmm2
movsd  %xmm2,(%rbx,%rcx,8)
addsd  0x18(%rbx,%rcx,8),%xmm1
mulsd  %xmm6,%xmm1
addsd  0x10(%rbx,%rcx,8),%xmm1
movsd  %xmm1,0x10(%rbx,%rcx,8)
add    $0x4,%rcx
add    $0xfffffffffffffffe,%rsi
jne    12f0 <fwt97+0x1c0>
testb  $0x1,0x18(%rsp)
je     1356 <fwt97+0x226>
add    %rdi,%rcx
movsd  -0x8(%r12,%rcx,8),%xmm1
addsd  0x8(%r12,%rcx,8),%xmm1
mulsd  %xmm6,%xmm1
addsd  (%r12,%rcx,8),%xmm1
movsd  %xmm1,(%r12,%rcx,8)
lea    (%r12,%rdi,8),%r9
add    $0x8,%r9
lea    (%r12,%rdi,8),%r14
movsd  0x8(%r12,%rdi,8),%xmm1
mulsd  %xmm9,%xmm1
addsd  (%r12,%rdi,8),%xmm1
movsd  %xmm1,(%r12,%rdi,8)
cmpl   $0x3,0x8(%rsp)
jl     1224 <fwt97+0xf4>
mov    $0x1,%ecx
nopw   0x0(%rax,%rax,1)
movsd  -0x8(%rbx,%rcx,8),%xmm1
addsd  0x8(%rbx,%rcx,8),%xmm1
mulsd  %xmm3,%xmm1
addsd  (%rbx,%rcx,8),%xmm1
movsd  %xmm1,(%rbx,%rcx,8)
add    $0x2,%rcx
cmp    %rdx,%rcx
jl     1390 <fwt97+0x260>
movsd  -0x10(%r12,%r8,8),%xmm1
mulsd  %xmm4,%xmm1
addsd  -0x8(%r12,%r8,8),%xmm1
movsd  %xmm1,-0x8(%r12,%r8,8)
cmpl   $0x3,0x8(%rsp)
jl     123d <fwt97+0x10d>
mov    $0x2,%esi
cmpq   $0x2,0x20(%rsp)
jb     142e <fwt97+0x2fe>
mov    $0x2,%esi
mov    0x10(%rsp),%rcx
xchg   %ax,%ax
movsd  0x8(%rbx,%rsi,8),%xmm1
movsd  -0x8(%rbx,%rsi,8),%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm5,%xmm2
addsd  (%rbx,%rsi,8),%xmm2
movsd  %xmm2,(%rbx,%rsi,8)
addsd  0x18(%rbx,%rsi,8),%xmm1
mulsd  %xmm5,%xmm1
addsd  0x10(%rbx,%rsi,8),%xmm1
movsd  %xmm1,0x10(%rbx,%rsi,8)
add    $0x4,%rsi
add    $0xfffffffffffffffe,%rcx
jne    13f0 <fwt97+0x2c0>
testb  $0x1,0x18(%rsp)
je     123d <fwt97+0x10d>
add    %rdi,%rsi
movsd  -0x8(%r12,%rsi,8),%xmm1
addsd  0x8(%r12,%rsi,8),%xmm1
mulsd  %xmm5,%xmm1
addsd  (%r12,%rsi,8),%xmm1
movsd  %xmm1,(%r12,%rsi,8)
jmp    123d <fwt97+0x10d>
test   %ebp,%ebp
jle    14e7 <fwt97+0x3b7>
mov    0x8(%rsp),%rcx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
mov    %ecx,%ecx
xor    %edx,%edx
movsd  0xbc7(%rip),%xmm0
movsd  0xbb7(%rip),%xmm1
mov    %r12,%rsi
jmp    149c <fwt97+0x36c>
xchg   %ax,%ax
add    $0x1,%rdx
add    %r13,%rsi
cmp    %r11,%rdx
je     14e7 <fwt97+0x3b7>
cmpl   $0x0,0x8(%rsp)
jle    1490 <fwt97+0x360>
xor    %edi,%edi
jmp    14d2 <fwt97+0x3a2>
nopw   0x0(%rax,%rax,1)
mulsd  %xmm1,%xmm2
mov    %edi,%ebx
shr    %ebx
add    %eax,%ebx
imul   %ebp,%ebx
movslq %ebx,%rbx
add    %rdx,%rbx
movsd  %xmm2,(%r15,%rbx,8)
add    $0x1,%rdi
cmp    %rdi,%rcx
je     1490 <fwt97+0x360>
movsd  (%rsi,%rdi,8),%xmm2
test   $0x1,%dil
jne    14b0 <fwt97+0x380>
mulsd  %xmm0,%xmm2
mov    %edi,%ebx
shr    %ebx
jmp    14ba <fwt97+0x38a>
mov    %r12,%rdi
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @fwt97(double* nocapture writeonly %0, double* %1, i32 %2, i32 %3) {
%5 = shl i32 %2, 3
%6 = mul i32 %5, %3
%7 = tail call double* @malloc(i32 %6)
%8 = tail call i32 @memcpy(double* %7, double* %1, i32 %6)
%9 = icmp sgt i32 %3, 0
br i1 %9, label %10, label %226
10: ; preds = %4
%11 = add nsw i32 %2, -1
%12 = icmp sgt i32 %2, 2
%13 = sext i32 %11 to i64
%14 = sext i32 %2 to i64
%15 = zext i32 %3 to i64
%16 = add nsw i64 %14, -3
%17 = lshr i64 %16, 1
%18 = add nuw i64 %17, 1
%19 = and i64 %18, 1
%20 = icmp ult i64 %16, 2
%21 = and i64 %18, -2
%22 = icmp eq i64 %19, 0
%23 = and i64 %18, 1
%24 = icmp ult i64 %16, 2
%25 = and i64 %18, -2
%26 = icmp eq i64 %23, 0
br label %34
27: ; preds = %188
br i1 %9, label %28, label %226
28: ; preds = %27
%29 = icmp sgt i32 %2, 0
%30 = sdiv i32 %2, 2
%31 = sext i32 %2 to i64
%32 = zext i32 %3 to i64
%33 = zext i32 %2 to i64
br label %196
34: ; preds = %10, %188
%35 = phi i64 [ 0, %10 ], [ %194, %188 ]
%36 = mul nsw i64 %35, %14
br i1 %12, label %37, label %52
37: ; preds = %34, %37
%38 = phi i64 [ %50, %37 ], [ 1, %34 ]
%39 = add nsw i64 %38, %36
%40 = add nsw i64 %39, -1
%41 = getelementptr inbounds double, double* %7, i64 %40
%42 = load double, double* %41
%43 = add nsw i64 %39, 1
%44 = getelementptr inbounds double, double* %7, i64 %43
%45 = load double, double* %44
%46 = fadd double %42, %45
%47 = getelementptr inbounds double, double* %7, i64 %39
%48 = load double, double* %47
%49 = tail call double @llvm.fmuladd.f64(double %46, double 0xBFF960CE675F3D5B, double %48)
store double %49, double* %47
%50 = add nuw nsw i64 %38, 2
%51 = icmp slt i64 %50, %13
br i1 %51, label %37, label %52
52: ; preds = %37, %34
%53 = add nsw i64 %36, %14
%54 = add nsw i64 %53, -2
%55 = getelementptr inbounds double, double* %7, i64 %54
%56 = load double, double* %55
%57 = add nsw i64 %53, -1
%58 = getelementptr inbounds double, double* %7, i64 %57
%59 = load double, double* %58
%60 = tail call double @llvm.fmuladd.f64(double %56, double 0xC00960CE675F3D5B, double %59)
store double %60, double* %58
br i1 %12, label %61, label %62
61: ; preds = %52
br i1 %20, label %98, label %69
62: ; preds = %52
%63 = add nsw i64 %36, 1
%64 = getelementptr inbounds double, double* %7, i64 %63
%65 = load double, double* %64
%66 = getelementptr inbounds double, double* %7, i64 %36
%67 = load double, double* %66
%68 = tail call double @llvm.fmuladd.f64(double %65, double 0xBFBB2035C8EF5C97, double %67)
store double %68, double* %66
br label %134
69: ; preds = %61, %69
%70 = phi i64 [ %95, %69 ], [ 2, %61 ]
%71 = phi i64 [ %96, %69 ], [ 0, %61 ]
%72 = add nsw i64 %70, %36
%73 = add nsw i64 %72, -1
%74 = getelementptr inbounds double, double* %7, i64 %73
%75 = load double, double* %74
%76 = add nsw i64 %72, 1
%77 = getelementptr inbounds double, double* %7, i64 %76
%78 = load double, double* %77
%79 = fadd double %75, %78
%80 = getelementptr inbounds double, double* %7, i64 %72
%81 = load double, double* %80
%82 = tail call double @llvm.fmuladd.f64(double %79, double 0xBFAB2035C8EF5C97, double %81)
store double %82, double* %80
%83 = add nuw nsw i64 %70, 2
%84 = add nsw i64 %83, %36
%85 = add nsw i64 %84, -1
%86 = getelementptr inbounds double, double* %7, i64 %85
%87 = load double, double* %86
%88 = add nsw i64 %84, 1
%89 = getelementptr inbounds double, double* %7, i64 %88
%90 = load double, double* %89
%91 = fadd double %87, %90
%92 = getelementptr inbounds double, double* %7, i64 %84
%93 = load double, double* %92
%94 = tail call double @llvm.fmuladd.f64(double %91, double 0xBFAB2035C8EF5C97, double %93)
store double %94, double* %92
%95 = add nuw nsw i64 %70, 4
%96 = add nuw nsw i64 %71, 2
%97 = icmp eq i64 %96, %21
br i1 %97, label %98, label %69
98: ; preds = %69, %61
%99 = phi i64 [ 2, %61 ], [ %95, %69 ]
br i1 %22, label %112, label %100
100: ; preds = %98
%101 = add nsw i64 %99, %36
%102 = add nsw i64 %101, -1
%103 = getelementptr inbounds double, double* %7, i64 %102
%104 = load double, double* %103
%105 = add nsw i64 %101, 1
%106 = getelementptr inbounds double, double* %7, i64 %105
%107 = load double, double* %106
%108 = fadd double %104, %107
%109 = getelementptr inbounds double, double* %7, i64 %101
%110 = load double, double* %109
%111 = tail call double @llvm.fmuladd.f64(double %108, double 0xBFAB2035C8EF5C97, double %110)
store double %111, double* %109
br label %112
112: ; preds = %98, %100
%113 = add nsw i64 %36, 1
%114 = getelementptr inbounds double, double* %7, i64 %113
%115 = load double, double* %114
%116 = getelementptr inbounds double, double* %7, i64 %36
%117 = load double, double* %116
%118 = tail call double @llvm.fmuladd.f64(double %115, double 0xBFBB2035C8EF5C97, double %117)
store double %118, double* %116
br i1 %12, label %119, label %134
119: ; preds = %112, %119
%120 = phi i64 [ %132, %119 ], [ 1, %112 ]
%121 = add nsw i64 %120, %36
%122 = add nsw i64 %121, -1
%123 = getelementptr inbounds double, double* %7, i64 %122
%124 = load double, double* %123
%125 = add nsw i64 %121, 1
%126 = getelementptr inbounds double, double* %7, i64 %125
%127 = load double, double* %126
%128 = fadd double %124, %127
%129 = getelementptr inbounds double, double* %7, i64 %121
%130 = load double, double* %129
%131 = tail call double @llvm.fmuladd.f64(double %128, double 0x3FEC40CEBAB1C3E7, double %130)
store double %131, double* %129
%132 = add nuw nsw i64 %120, 2
%133 = icmp slt i64 %132, %13
br i1 %133, label %119, label %140
134: ; preds = %62, %112
%135 = phi double* [ %116, %112 ], [ %66, %62 ]
%136 = phi double* [ %114, %112 ], [ %64, %62 ]
%137 = load double, double* %55
%138 = load double, double* %58
%139 = tail call double @llvm.fmuladd.f64(double %137, double 0x3FFC40CEBAB1C3E7, double %138)
store double %139, double* %58
br label %188
140: ; preds = %119
%141 = load double, double* %55
%142 = load double, double* %58
%143 = tail call double @llvm.fmuladd.f64(double %141, double 0x3FFC40CEBAB1C3E7, double %142)
store double %143, double* %58
br i1 %12, label %144, label %188
144: ; preds = %140
br i1 %24, label %174, label %145
145: ; preds = %144, %145
%146 = phi i64 [ %171, %145 ], [ 2, %144 ]
%147 = phi i64 [ %172, %145 ], [ 0, %144 ]
%148 = add nsw i64 %146, %36
%149 = add nsw i64 %148, -1
%150 = getelementptr inbounds double, double* %7, i64 %149
%151 = load double, double* %150
%152 = add nsw i64 %148, 1
%153 = getelementptr inbounds double, double* %7, i64 %152
%154 = load double, double* %153
%155 = fadd double %151, %154
%156 = getelementptr inbounds double, double* %7, i64 %148
%157 = load double, double* %156
%158 = tail call double @llvm.fmuladd.f64(double %155, double 0x3FDC626A90700ED7, double %157)
store double %158, double* %156
%159 = add nuw nsw i64 %146, 2
%160 = add nsw i64 %159, %36
%161 = add nsw i64 %160, -1
%162 = getelementptr inbounds double, double* %7, i64 %161
%163 = load double, double* %162
%164 = add nsw i64 %160, 1
%165 = getelementptr inbounds double, double* %7, i64 %164
%166 = load double, double* %165
%167 = fadd double %163, %166
%168 = getelementptr inbounds double, double* %7, i64 %160
%169 = load double, double* %168
%170 = tail call double @llvm.fmuladd.f64(double %167, double 0x3FDC626A90700ED7, double %169)
store double %170, double* %168
%171 = add nuw nsw i64 %146, 4
%172 = add nuw nsw i64 %147, 2
%173 = icmp eq i64 %172, %25
br i1 %173, label %174, label %145
174: ; preds = %145, %144
%175 = phi i64 [ 2, %144 ], [ %171, %145 ]
br i1 %26, label %188, label %176
176: ; preds = %174
%177 = add nsw i64 %175, %36
%178 = add nsw i64 %177, -1
%179 = getelementptr inbounds double, double* %7, i64 %178
%180 = load double, double* %179
%181 = add nsw i64 %177, 1
%182 = getelementptr inbounds double, double* %7, i64 %181
%183 = load double, double* %182
%184 = fadd double %180, %183
%185 = getelementptr inbounds double, double* %7, i64 %177
%186 = load double, double* %185
%187 = tail call double @llvm.fmuladd.f64(double %184, double 0x3FDC626A90700ED7, double %186)
store double %187, double* %185
br label %188
188: ; preds = %176, %174, %134, %140
%189 = phi double* [ %136, %134 ], [ %114, %140 ], [ %114, %174 ], [ %114, %176 ]
%190 = phi double* [ %135, %134 ], [ %116, %140 ], [ %116, %174 ], [ %116, %176 ]
%191 = load double, double* %189
%192 = load double, double* %190
%193 = tail call double @llvm.fmuladd.f64(double %191, double 0x3FEC626A90700ED7, double %192)
store double %193, double* %190
%194 = add nuw nsw i64 %35, 1
%195 = icmp eq i64 %194, %15
br i1 %195, label %27, label %34
196: ; preds = %28, %223
%197 = phi i64 [ 0, %28 ], [ %224, %223 ]
%198 = mul nsw i64 %197, %31
br i1 %29, label %199, label %223
199: ; preds = %196, %214
%200 = phi i64 [ %221, %214 ], [ 0, %196 ]
%201 = trunc i64 %200 to i32
%202 = and i32 %201, 1
%203 = icmp eq i32 %202, 0
%204 = add nsw i64 %200, %198
%205 = getelementptr inbounds double, double* %7, i64 %204
%206 = load double, double* %205
br i1 %203, label %207, label %210
207: ; preds = %199
%208 = fmul double %206, 0x3FEA033851C39F80
%209 = lshr i32 %201, 1
br label %214
210: ; preds = %199
%211 = fmul double %206, 0x3FE3AECB0ACFDE04
%212 = lshr i32 %201, 1
%213 = add nsw i32 %212, %30
br label %214
214: ; preds = %207, %210
%215 = phi i32 [ %209, %207 ], [ %213, %210 ]
%216 = phi double [ %208, %207 ], [ %211, %210 ]
%217 = mul nsw i32 %215, %3
%218 = sext i32 %217 to i64
%219 = add nsw i64 %197, %218
%220 = getelementptr inbounds double, double* %0, i64 %219
store double %216, double* %220
%221 = add nuw nsw i64 %200, 1
%222 = icmp eq i64 %221, %33
br i1 %222, label %223, label %199
223: ; preds = %214, %196
%224 = add nuw nsw i64 %197, 1
%225 = icmp eq i64 %224, %32
br i1 %225, label %226, label %196
226: ; preds = %223, %4, %27
%227 = tail call i32 @free(double* %7)
ret void
}