#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 l;
typedef int k;

/* Variables and functions */
int /*<<< orphan*/ LOG_wrk(char *, int, int);
double M_PI;
double cos(double);
double sin(double);
void fft2(double *ri, int n) {
  int m, m2, df = (n > (1 << 19));
  double oAr[2 * (1 << 9)], *oAi = oAr + (1 << 9), circ = (2.0 * M_PI);
  for (m = 8, m2 = 4; m <= n;
       (void)(df && (LOG_wrk("fft2: %d/%d", m, n), 1)), m2 = m, m *= 2) {
    int mm = m2 - 1;
    double fi2, fi = circ / (double)m, o1i = sin(fi), o1r = cos(fi);
    if (m2 <= (1 << 9)) {
      int j, k, k0, l;
      double oR = 1.0, oi = 0.0;
      for (j = 0; j < m2; j++) {
        if (!(j & 63))
          fi2 = fi * (double)(j), oR = cos(fi2), oi = sin(fi2);
        oAr[j] = oR;
        oAi[j] = oi;
        double tR = oR * o1r - oi * o1i;
        oi = oi * o1r + oR * o1i;
        oR = tR;
      }
      for (j = 0; j < n; j += m) {
        for (k0 = 0; k0 < m2; k0++) {
          k = k0 + j;
          double rel = ri[2 * (l = k + m2)], iml = ri[2 * (l) + 1],
                 tr = rel * oAr[k0] - iml * oAi[k0],
                 ti = iml * oAr[k0] + rel * oAi[k0];
          ri[2 * (l)] = ri[2 * (k)] - tr;
          ri[2 * (k)] += tr;
          ri[2 * (l) + 1] = ri[2 * (k) + 1] - ti;
          ri[2 * (k) + 1] += ti;
        }
      }
    } else {
      int j, k, k0, l;
      double oR = 1.0, oi = 0.0;
      for (j = 0; j < n; j += m) {
        for (k0 = 0; k0 < m2; k0 += (1 << 9)) {
          int k1, jk0 = j + k0;
          for (k1 = 0; k1 < (1 << 9); k1++) {
            k = jk0 + k1;
            if (!(k & 63))
              fi2 = fi * (double)(k & mm), oR = cos(fi2), oi = sin(fi2);
            double rel = ri[2 * (l = k + m2)], iml = ri[2 * (l) + 1],
                   tr = rel * oR - iml * oi, ti = iml * oR + rel * oi;
            ri[2 * (l)] = ri[2 * (k)] - tr;
            ri[2 * (k)] += tr;
            ri[2 * (l) + 1] = ri[2 * (k) + 1] - ti;
            ri[2 * (k) + 1] += ti;
            double tR = oR * o1r - oi * o1i;
            oi = oi * o1r + oR * o1i;
            oR = tR;
          }
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<fft2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2100,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x80000,-0xc(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
lea    -0x2020(%rbp),%rax
add    $0x1000,%rax
mov    %rax,-0x2028(%rbp)
movsd  0xe90(%rip),%xmm0
mov    0x2e71(%rip),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x2030(%rbp)
ff
movl   $0x8,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     18d5 <fft2+0x7a5>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x2034(%rbp)
movsd  -0x2030(%rbp),%xmm0
ff
cvtsi2sdl -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x2048(%rbp)
ff
movsd  -0x2048(%rbp),%xmm0
ff
call   1040 <sin@plt>
movsd  %xmm0,-0x2050(%rbp)
ff
movsd  -0x2048(%rbp),%xmm0
ff
call   1050 <cos@plt>
movsd  %xmm0,-0x2058(%rbp)
ff
cmpl   $0x200,-0x14(%rbp)
jg     155d <fft2+0x42d>
movsd  0xe07(%rip),%xmm0
movsd  %xmm0,-0x2070(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x2078(%rbp)
ff
movl   $0x0,-0x205c(%rbp)
mov    -0x205c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1353 <fft2+0x223>
mov    -0x205c(%rbp),%eax
and    $0x3f,%eax
cmp    $0x0,%eax
jne    1285 <fft2+0x155>
movsd  -0x2048(%rbp),%xmm0
ff
cvtsi2sdl -0x205c(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x2040(%rbp)
ff
movsd  -0x2040(%rbp),%xmm0
ff
call   1050 <cos@plt>
movsd  %xmm0,-0x2070(%rbp)
ff
movsd  -0x2040(%rbp),%xmm0
ff
call   1040 <sin@plt>
movsd  %xmm0,-0x2078(%rbp)
ff
movsd  -0x2070(%rbp),%xmm0
ff
movslq -0x205c(%rbp),%rax
movsd  %xmm0,-0x2020(%rbp,%rax,8)
ff ff
movsd  -0x2078(%rbp),%xmm0
ff
mov    -0x2028(%rbp),%rax
movslq -0x205c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x2070(%rbp),%xmm0
ff
movsd  -0x2058(%rbp),%xmm2
ff
movsd  -0x2078(%rbp),%xmm1
ff
mulsd  -0x2050(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x2080(%rbp)
ff
movsd  -0x2078(%rbp),%xmm0
ff
movsd  -0x2058(%rbp),%xmm2
ff
movsd  -0x2070(%rbp),%xmm1
ff
mulsd  -0x2050(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x2078(%rbp)
ff
movsd  -0x2080(%rbp),%xmm0
ff
movsd  %xmm0,-0x2070(%rbp)
ff
mov    -0x205c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x205c(%rbp)
jmp    121e <fft2+0xee>
movl   $0x0,-0x205c(%rbp)
mov    -0x205c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1558 <fft2+0x428>
movl   $0x0,-0x2064(%rbp)
mov    -0x2064(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    153f <fft2+0x40f>
mov    -0x2064(%rbp),%eax
add    -0x205c(%rbp),%eax
mov    %eax,-0x2060(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x2060(%rbp),%ecx
add    -0x14(%rbp),%ecx
mov    %ecx,-0x2068(%rbp)
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x2088(%rbp)
ff
mov    -0x8(%rbp),%rax
mov    -0x2068(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x2090(%rbp)
ff
movsd  -0x2088(%rbp),%xmm0
ff
movslq -0x2064(%rbp),%rax
movsd  -0x2020(%rbp,%rax,8),%xmm2
ff ff
movsd  -0x2090(%rbp),%xmm1
ff
mov    -0x2028(%rbp),%rax
movslq -0x2064(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x2098(%rbp)
ff
movsd  -0x2090(%rbp),%xmm0
ff
movslq -0x2064(%rbp),%rax
movsd  -0x2020(%rbp,%rax,8),%xmm2
ff ff
movsd  -0x2088(%rbp),%xmm1
ff
mov    -0x2028(%rbp),%rax
movslq -0x2064(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20a0(%rbp)
ff
mov    -0x8(%rbp),%rax
mov    -0x2060(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x2098(%rbp),%xmm0
ff
mov    -0x8(%rbp),%rax
mov    -0x2068(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x2098(%rbp),%xmm0
ff
mov    -0x8(%rbp),%rax
mov    -0x2060(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    -0x2060(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x20a0(%rbp),%xmm0
ff
mov    -0x8(%rbp),%rax
mov    -0x2068(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x20a0(%rbp),%xmm0
ff
mov    -0x8(%rbp),%rax
mov    -0x2060(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2064(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2064(%rbp)
jmp    1376 <fft2+0x246>
jmp    1544 <fft2+0x414>
mov    -0x10(%rbp),%eax
add    -0x205c(%rbp),%eax
mov    %eax,-0x205c(%rbp)
jmp    135d <fft2+0x22d>
jmp    188a <fft2+0x75a>
movsd  0xaa3(%rip),%xmm0
movsd  %xmm0,-0x20b8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20c0(%rbp)
ff
movl   $0x0,-0x20a4(%rbp)
mov    -0x20a4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1885 <fft2+0x755>
movl   $0x0,-0x20ac(%rbp)
mov    -0x20ac(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    186c <fft2+0x73c>
mov    -0x20a4(%rbp),%eax
add    -0x20ac(%rbp),%eax
mov    %eax,-0x20c8(%rbp)
movl   $0x0,-0x20c4(%rbp)
cmpl   $0x200,-0x20c4(%rbp)
jge    1851 <fft2+0x721>
mov    -0x20c8(%rbp),%eax
add    -0x20c4(%rbp),%eax
mov    %eax,-0x20a8(%rbp)
mov    -0x20a8(%rbp),%eax
and    $0x3f,%eax
cmp    $0x0,%eax
jne    1648 <fft2+0x518>
movsd  -0x2048(%rbp),%xmm0
ff
mov    -0x20a8(%rbp),%eax
and    -0x2034(%rbp),%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x2040(%rbp)
ff
movsd  -0x2040(%rbp),%xmm0
ff
call   1050 <cos@plt>
movsd  %xmm0,-0x20b8(%rbp)
ff
movsd  -0x2040(%rbp),%xmm0
ff
call   1040 <sin@plt>
movsd  %xmm0,-0x20c0(%rbp)
ff
mov    -0x8(%rbp),%rax
mov    -0x20a8(%rbp),%ecx
add    -0x14(%rbp),%ecx
mov    %ecx,-0x20b0(%rbp)
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x20d0(%rbp)
ff
mov    -0x8(%rbp),%rax
mov    -0x20b0(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x20d8(%rbp)
ff
movsd  -0x20d0(%rbp),%xmm0
ff
movsd  -0x20b8(%rbp),%xmm2
ff
movsd  -0x20d8(%rbp),%xmm1
ff
mulsd  -0x20c0(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20e0(%rbp)
ff
movsd  -0x20d8(%rbp),%xmm0
ff
movsd  -0x20b8(%rbp),%xmm2
ff
movsd  -0x20d0(%rbp),%xmm1
ff
mulsd  -0x20c0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20e8(%rbp)
ff
mov    -0x8(%rbp),%rax
mov    -0x20a8(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x20e0(%rbp),%xmm0
ff
mov    -0x8(%rbp),%rax
mov    -0x20b0(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x20e0(%rbp),%xmm0
ff
mov    -0x8(%rbp),%rax
mov    -0x20a8(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    -0x20a8(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
subsd  -0x20e8(%rbp),%xmm0
ff
mov    -0x8(%rbp),%rax
mov    -0x20b0(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x20e8(%rbp),%xmm0
ff
mov    -0x8(%rbp),%rax
mov    -0x20a8(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x20b8(%rbp),%xmm0
ff
movsd  -0x2058(%rbp),%xmm2
ff
movsd  -0x20c0(%rbp),%xmm1
ff
mulsd  -0x2050(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20f0(%rbp)
ff
movsd  -0x20c0(%rbp),%xmm0
ff
movsd  -0x2058(%rbp),%xmm2
ff
movsd  -0x20b8(%rbp),%xmm1
ff
mulsd  -0x2050(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20c0(%rbp)
ff
movsd  -0x20f0(%rbp),%xmm0
ff
movsd  %xmm0,-0x20b8(%rbp)
ff
mov    -0x20c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20c4(%rbp)
jmp    15c6 <fft2+0x496>
jmp    1856 <fft2+0x726>
mov    -0x20ac(%rbp),%eax
add    $0x200,%eax
mov    %eax,-0x20ac(%rbp)
jmp    159b <fft2+0x46b>
jmp    1871 <fft2+0x741>
mov    -0x10(%rbp),%eax
add    -0x20a4(%rbp),%eax
mov    %eax,-0x20a4(%rbp)
jmp    1582 <fft2+0x452>
jmp    188a <fft2+0x75a>
jmp    188f <fft2+0x75f>
xor    %eax,%eax
cmpl   $0x0,-0x18(%rbp)
mov    %al,-0x20f1(%rbp)
je     18bb <fft2+0x78b>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0x762(%rip),%rdi
call   1030 <LOG_wrk@plt>
mov    $0x1,%al
mov    %al,-0x20f1(%rbp)
mov    -0x20f1(%rbp),%al
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1191 <fft2+0x61>
add    $0x2100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fft2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20c8,%rsp
cmp    $0x8,%esi
jge    1158 <fft2+0x28>
add    $0x20c8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %esi,%r15d
mov    %rdi,%rbx
mov    0x2e83(%rip),%rax
movsd  (%rax),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x58(%rsp)
mov    %esi,%eax
mov    %rax,0x70(%rsp)
mov    $0x4,%r12d
xorpd  %xmm0,%xmm0
movhpd 0xe74(%rip),%xmm0
movapd %xmm0,0xb0(%rsp)
mov    $0x8,%eax
mov    %esi,0x8(%rsp)
jmp    11ad <fft2+0x7d>
lea    0x0(%r13,%r13,1),%eax
mov    %r13d,%r12d
cmp    %r15d,%eax
jg     1146 <fft2+0x16>
mov    %eax,%r13d
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0x58(%rsp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
call   1040 <sin@plt>
movapd %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
call   1050 <cos@plt>
movapd %xmm0,%xmm8
cmp    $0x201,%r12d
jae    12c0 <fft2+0x190>
cmp    $0x2,%r12d
mov    $0x1,%r14d
cmovge %r12d,%r14d
unpcklpd %xmm8,%xmm8
movapd 0x10(%rsp),%xmm4
unpcklpd %xmm4,%xmm4
xor    %ebp,%ebp
movapd 0xb0(%rsp),%xmm0
movapd 0xdf3(%rip),%xmm3
movapd %xmm4,0x10(%rsp)
movapd %xmm8,0x20(%rsp)
jmp    126d <fft2+0x13d>
nopl   0x0(%rax)
movhpd %xmm0,0xc0(%rsp,%rbp,8)
movlpd %xmm0,0x10c0(%rsp,%rbp,8)
movapd %xmm0,%xmm1
xorpd  %xmm3,%xmm1
movapd %xmm0,%xmm2
shufpd $0x1,%xmm1,%xmm2
mulpd  %xmm4,%xmm2
mulpd  %xmm8,%xmm0
addpd  %xmm2,%xmm0
add    $0x1,%rbp
cmp    %rbp,%r14
je     1520 <fft2+0x3f0>
test   $0x3f,%bpl
jne    1230 <fft2+0x100>
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  (%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
call   1050 <cos@plt>
movapd %xmm0,0x40(%rsp)
movsd  0x30(%rsp),%xmm0
call   1040 <sin@plt>
movapd 0x20(%rsp),%xmm8
movapd 0x10(%rsp),%xmm4
movapd 0xd60(%rip),%xmm3
unpcklpd 0x40(%rsp),%xmm0
jmp    1230 <fft2+0x100>
nopl   0x0(%rax,%rax,1)
lea    -0x1(%r12),%r14d
movslq %r12d,%rax
mov    %rax,0xa0(%rsp)
movslq %r13d,%rax
mov    %rax,0x80(%rsp)
unpcklpd %xmm8,%xmm8
movapd 0x10(%rsp),%xmm6
unpcklpd %xmm6,%xmm6
lea    (%r12,%r12,1),%eax
lea    0x0(%r13,%r13,1),%ecx
mov    %rcx,0x78(%rsp)
xor    %ebp,%ebp
xor    %edx,%edx
movsd  0xcfc(%rip),%xmm7
movapd 0xd04(%rip),%xmm5
mov    %r12,0x68(%rsp)
mov    %r13,0x60(%rsp)
movapd %xmm6,0x10(%rsp)
movapd %xmm8,0x20(%rsp)
jmp    137d <fft2+0x24d>
cs nopw 0x0(%rax,%rax,1)
nop
addpd  %xmm0,%xmm1
movapd %xmm1,%xmm7
mov    0x8(%rsp),%r15d
mov    0x68(%rsp),%r12
mov    0x60(%rsp),%r13
mov    0x98(%rsp),%rax
mov    0x90(%rsp),%rbp
mov    0x88(%rsp),%rdx
add    0x80(%rsp),%rdx
mov    0x78(%rsp),%rcx
add    %rcx,%rax
add    %rcx,%rbp
cmp    0x70(%rsp),%rdx
jge    1600 <fft2+0x4d0>
test   %r12d,%r12d
jle    135f <fft2+0x22f>
mov    %rdx,0x88(%rsp)
mov    %edx,%r12d
mov    %rbp,0x90(%rsp)
mov    %rax,0x98(%rsp)
mov    %rax,%r15
xor    %eax,%eax
jmp    13e6 <fft2+0x2b6>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0xa8(%rsp),%rax
add    $0x200,%rax
add    $0x400,%r15
add    $0x400,%rbp
mov    0xc(%rsp),%r12d
add    $0x200,%r12d
cmp    0xa0(%rsp),%rax
jge    1330 <fft2+0x200>
mov    %rax,0xa8(%rsp)
mov    $0xfffffffffffffc00,%r13
mov    %r12d,0xc(%rsp)
jmp    14bf <fft2+0x38f>
nop
lea    (%r15,%r13,1),%eax
add    $0x400,%eax
movslq %eax,%rcx
movsd  (%rbx,%rcx,8),%xmm2
lea    0x401(%r15,%r13,1),%eax
cltq
movsd  (%rbx,%rax,8),%xmm1
movapd %xmm7,%xmm0
unpckhpd %xmm7,%xmm0
movapd %xmm0,%xmm3
mulsd  %xmm1,%xmm3
movapd %xmm0,%xmm4
mulsd  %xmm2,%xmm4
mulsd  %xmm7,%xmm2
subsd  %xmm3,%xmm2
mulsd  %xmm7,%xmm1
addsd  %xmm4,%xmm1
lea    0x400(%rbp,%r13,1),%edx
movslq %edx,%rdx
movsd  (%rbx,%rdx,8),%xmm3
movapd %xmm3,%xmm4
subsd  %xmm2,%xmm4
movsd  %xmm4,(%rbx,%rcx,8)
addsd  %xmm3,%xmm2
movsd  %xmm2,(%rbx,%rdx,8)
lea    0x401(%rbp,%r13,1),%ecx
movslq %ecx,%rcx
movsd  (%rbx,%rcx,8),%xmm2
movapd %xmm2,%xmm3
subsd  %xmm1,%xmm3
movsd  %xmm3,(%rbx,%rax,8)
addsd  %xmm2,%xmm1
movsd  %xmm1,(%rbx,%rcx,8)
xorpd  %xmm5,%xmm0
unpcklpd %xmm7,%xmm0
mulpd  %xmm6,%xmm0
movapd %xmm7,%xmm1
mulpd  %xmm8,%xmm1
movapd %xmm1,%xmm7
addpd  %xmm0,%xmm7
add    $0x1,%r12d
add    $0x2,%r13
je     13b0 <fft2+0x280>
test   $0x3f,%r12b
jne    1400 <fft2+0x2d0>
mov    %r14d,%eax
and    %r12d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%rsp),%xmm0
movsd  %xmm0,0x40(%rsp)
call   1050 <cos@plt>
movapd %xmm0,0x30(%rsp)
movsd  0x40(%rsp),%xmm0
call   1040 <sin@plt>
movapd 0x30(%rsp),%xmm7
movapd 0x20(%rsp),%xmm8
movapd 0x10(%rsp),%xmm6
movapd 0xafe(%rip),%xmm5
unpcklpd %xmm0,%xmm7
jmp    1400 <fft2+0x2d0>
nopl   0x0(%rax,%rax,1)
mov    %r12d,%r10d
lea    0x0(%r13,%r13,1),%r8d
lea    (%r12,%r12,1),%edx
add    %r10,%r10
xor    %esi,%esi
xor    %r9d,%r9d
jmp    1552 <fft2+0x422>
cs nopw 0x0(%rax,%rax,1)
add    %r13d,%r9d
add    %r8,%rsi
add    %r8,%rdx
cmp    %r15d,%r9d
jge    1600 <fft2+0x4d0>
test   %r12d,%r12d
jle    1540 <fft2+0x410>
xor    %ebp,%ebp
nopl   0x0(%rax)
lea    (%rdx,%rbp,1),%rcx
movslq %ecx,%rdi
movsd  (%rbx,%rdi,8),%xmm1
lea    0x1(%rdi),%ecx
movslq %ecx,%rcx
movsd  (%rbx,%rcx,8),%xmm0
movsd  0xc0(%rsp,%rbp,4),%xmm2
movsd  0x10c0(%rsp,%rbp,4),%xmm3
movapd %xmm3,%xmm4
mulsd  %xmm0,%xmm4
mulsd  %xmm1,%xmm3
mulsd  %xmm2,%xmm1
subsd  %xmm4,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
lea    (%rsi,%rbp,1),%rax
cltq
movsd  (%rbx,%rax,8),%xmm2
movapd %xmm2,%xmm3
subsd  %xmm1,%xmm3
movsd  %xmm3,(%rbx,%rdi,8)
addsd  %xmm1,%xmm2
movsd  %xmm2,(%rbx,%rax,8)
add    $0x1,%eax
cltq
movsd  (%rbx,%rax,8),%xmm1
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
movsd  %xmm2,(%rbx,%rcx,8)
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx,%rax,8)
add    $0x2,%rbp
cmp    %rbp,%r10
jne    1560 <fft2+0x430>
jmp    1540 <fft2+0x410>
nopl   0x0(%rax,%rax,1)
cmp    $0x80001,%r15d
jl     11a0 <fft2+0x70>
lea    0xa0c(%rip),%rdi
mov    %r13d,%esi
mov    %r15d,%edx
call   1030 <LOG_wrk@plt>
jmp    11a0 <fft2+0x70>

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

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
@.str = [12 x i8] c"fft2: %d/%d\00"
define void @fft2(double* nocapture %0, i32 %1) {
%3 = alloca [1024 x double]
%4 = icmp sgt i32 %1, 524288
%5 = bitcast [1024 x double]* %3 to i8*
%6 = getelementptr inbounds [1024 x double], [1024 x double]* %3, i64 0, i64 512
%7 = load double, double* @M_PI
%8 = fmul double %7, 2.000000e+00
%9 = icmp slt i32 %1, 8
br i1 %9, label %183, label %10
10: ; preds = %2
%11 = zext i32 %1 to i64
br label %12
12: ; preds = %10, %180
%13 = phi i32 [ 8, %10 ], [ %181, %180 ]
%14 = phi i32 [ 4, %10 ], [ %13, %180 ]
%15 = add nsw i32 %14, -1
%16 = sitofp i32 %13 to double
%17 = fdiv double %8, %16
%18 = tail call double @sin(double %17)
%19 = tail call double @cos(double %17)
%20 = icmp ult i32 %14, 513
br i1 %20, label %31, label %21
21: ; preds = %12
%22 = icmp sgt i32 %14, 0
%23 = sext i32 %14 to i64
%24 = sext i32 %13 to i64
%25 = insertelement <2 x double> poison, double %19, i64 0
%26 = shufflevector <2 x double> %25, <2 x double> poison, <2 x i32> zeroinitializer
%27 = insertelement <2 x double> poison, double %18, i64 0
%28 = shufflevector <2 x double> %27, <2 x double> poison, <2 x i32> zeroinitializer
%29 = insertelement <2 x double> poison, double %19, i64 0
%30 = shufflevector <2 x double> %29, <2 x double> poison, <2 x i32> zeroinitializer
br label %108
31: ; preds = %12
%32 = call i32 @llvm.smax.i32(i32 %14, i32 1)
%33 = zext i32 %32 to i64
%34 = insertelement <2 x double> poison, double %19, i64 0
%35 = shufflevector <2 x double> %34, <2 x double> poison, <2 x i32> zeroinitializer
%36 = insertelement <2 x double> poison, double %18, i64 0
%37 = shufflevector <2 x double> %36, <2 x double> poison, <2 x i32> zeroinitializer
br label %41
38: ; preds = %54
%39 = icmp sgt i32 %14, 0
%40 = zext i32 %14 to i64
br label %67
41: ; preds = %31, %54
%42 = phi i64 [ 0, %31 ], [ %65, %54 ]
%43 = phi <2 x double> [ <double 0.000000e+00, double 1.000000e+00>, %31 ], [ %64, %54 ]
%44 = trunc i64 %42 to i32
%45 = and i32 %44, 63
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %54
47: ; preds = %41
%48 = sitofp i32 %44 to double
%49 = fmul double %17, %48
%50 = tail call double @cos(double %49)
%51 = tail call double @sin(double %49)
%52 = insertelement <2 x double> poison, double %51, i64 0
%53 = insertelement <2 x double> %52, double %50, i64 1
br label %54
54: ; preds = %47, %41
%55 = phi <2 x double> [ %43, %41 ], [ %53, %47 ]
%56 = getelementptr inbounds [1024 x double], [1024 x double]* %3, i64 0, i64 %42
%57 = extractelement <2 x double> %55, i64 1
store double %57, double* %56
%58 = getelementptr inbounds double, double* %6, i64 %42
%59 = extractelement <2 x double> %55, i64 0
store double %59, double* %58
%60 = fneg double %59
%61 = insertelement <2 x double> poison, double %57, i64 0
%62 = insertelement <2 x double> %61, double %60, i64 1
%63 = fmul <2 x double> %37, %62
%64 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %55, <2 x double> %35, <2 x double> %63)
%65 = add nuw nsw i64 %42, 1
%66 = icmp eq i64 %65, %33
br i1 %66, label %38, label %41
67: ; preds = %38, %105
%68 = phi i32 [ 0, %38 ], [ %106, %105 ]
br i1 %39, label %69, label %105
69: ; preds = %67, %69
%70 = phi i64 [ %103, %69 ], [ 0, %67 ]
%71 = trunc i64 %70 to i32
%72 = add nsw i32 %68, %71
%73 = add nsw i32 %72, %14
%74 = shl nsw i32 %73, 1
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %0, i64 %75
%77 = load double, double* %76
%78 = or i32 %74, 1
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds double, double* %0, i64 %79
%81 = load double, double* %80
%82 = getelementptr inbounds [1024 x double], [1024 x double]* %3, i64 0, i64 %70
%83 = load double, double* %82
%84 = getelementptr inbounds double, double* %6, i64 %70
%85 = load double, double* %84
%86 = fneg double %81
%87 = fmul double %85, %86
%88 = tail call double @llvm.fmuladd.f64(double %77, double %83, double %87)
%89 = fmul double %77, %85
%90 = tail call double @llvm.fmuladd.f64(double %81, double %83, double %89)
%91 = shl nsw i32 %72, 1
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds double, double* %0, i64 %92
%94 = load double, double* %93
%95 = fsub double %94, %88
store double %95, double* %76
%96 = fadd double %94, %88
store double %96, double* %93
%97 = or i32 %91, 1
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds double, double* %0, i64 %98
%100 = load double, double* %99
%101 = fsub double %100, %90
store double %101, double* %80
%102 = fadd double %90, %100
store double %102, double* %99
%103 = add nuw nsw i64 %70, 1
%104 = icmp eq i64 %103, %40
br i1 %104, label %105, label %69
105: ; preds = %69, %67
%106 = add nsw i32 %68, %13
%107 = icmp slt i32 %106, %1
br i1 %107, label %67, label %177
108: ; preds = %21, %173
%109 = phi i64 [ 0, %21 ], [ %175, %173 ]
%110 = phi <2 x double> [ <double 1.000000e+00, double 0.000000e+00>, %21 ], [ %174, %173 ]
br i1 %22, label %111, label %173
111: ; preds = %108, %168
%112 = phi i64 [ %169, %168 ], [ 0, %108 ]
%113 = phi <2 x double> [ %165, %168 ], [ %110, %108 ]
%114 = add nsw i64 %112, %109
br label %115
115: ; preds = %111, %130
%116 = phi i64 [ 0, %111 ], [ %166, %130 ]
%117 = phi <2 x double> [ %113, %111 ], [ %165, %130 ]
%118 = add nsw i64 %114, %116
%119 = trunc i64 %118 to i32
%120 = and i32 %119, 63
%121 = icmp eq i32 %120, 0
br i1 %121, label %122, label %130
122: ; preds = %115
%123 = and i32 %15, %119
%124 = sitofp i32 %123 to double
%125 = fmul double %17, %124
%126 = tail call double @cos(double %125)
%127 = tail call double @sin(double %125)
%128 = insertelement <2 x double> poison, double %126, i64 0
%129 = insertelement <2 x double> %128, double %127, i64 1
br label %130
130: ; preds = %122, %115
%131 = phi <2 x double> [ %117, %115 ], [ %129, %122 ]
%132 = trunc i64 %118 to i32
%133 = add i32 %14, %132
%134 = shl nsw i32 %133, 1
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds double, double* %0, i64 %135
%137 = load double, double* %136
%138 = or i32 %134, 1
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds double, double* %0, i64 %139
%141 = load double, double* %140
%142 = fneg double %141
%143 = extractelement <2 x double> %131, i64 1
%144 = fmul double %143, %142
%145 = extractelement <2 x double> %131, i64 0
%146 = tail call double @llvm.fmuladd.f64(double %137, double %145, double %144)
%147 = fmul double %143, %137
%148 = tail call double @llvm.fmuladd.f64(double %141, double %145, double %147)
%149 = shl nsw i32 %119, 1
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds double, double* %0, i64 %150
%152 = load double, double* %151
%153 = fsub double %152, %146
store double %153, double* %136
%154 = fadd double %152, %146
store double %154, double* %151
%155 = or i32 %149, 1
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds double, double* %0, i64 %156
%158 = load double, double* %157
%159 = fsub double %158, %148
store double %159, double* %140
%160 = fadd double %148, %158
store double %160, double* %157
%161 = fneg double %143
%162 = insertelement <2 x double> poison, double %161, i64 0
%163 = shufflevector <2 x double> %162, <2 x double> %131, <2 x i32> <i32 0, i32 2>
%164 = fmul <2 x double> %28, %163
%165 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %131, <2 x double> %26, <2 x double> %164)
%166 = add nuw nsw i64 %116, 1
%167 = icmp eq i64 %166, 512
br i1 %167, label %168, label %115
168: ; preds = %130
%169 = add nuw nsw i64 %112, 512
%170 = icmp slt i64 %169, %23
br i1 %170, label %111, label %171
171: ; preds = %168
%172 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %131, <2 x double> %30, <2 x double> %164)
br label %173
173: ; preds = %171, %108
%174 = phi <2 x double> [ %110, %108 ], [ %172, %171 ]
%175 = add i64 %109, %24
%176 = icmp slt i64 %175, %11
br i1 %176, label %108, label %177
177: ; preds = %173, %105
br i1 %4, label %178, label %180
178: ; preds = %177
%179 = tail call i32 @LOG_wrk(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %1)
br label %180
180: ; preds = %178, %177
%181 = shl nsw i32 %13, 1
%182 = icmp sgt i32 %181, %1
br i1 %182, label %183, label %12
183: ; preds = %180, %2
ret void
}