// File: /workspace/github_cpp_makefile_star2_O3/Sleepwalking[P]world-octave/fft.cpp
// Function: cftmdl1(int, double*, double*)
void cftmdl1(int n, double *a, double *w) {
  int j, j0, j1, j2, j3, k, m, mh;
  double wn4r, wk1r, wk1i, wk3r, wk3i;
  double x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;

  mh = n >> 3;
  m = 2 * mh;
  j1 = m;
  j2 = j1 + m;
  j3 = j2 + m;
  x0r = a[0] + a[j2];
  x0i = a[1] + a[j2 + 1];
  x1r = a[0] - a[j2];
  x1i = a[1] - a[j2 + 1];
  x2r = a[j1] + a[j3];
  x2i = a[j1 + 1] + a[j3 + 1];
  x3r = a[j1] - a[j3];
  x3i = a[j1 + 1] - a[j3 + 1];
  a[0] = x0r + x2r;
  a[1] = x0i + x2i;
  a[j1] = x0r - x2r;
  a[j1 + 1] = x0i - x2i;
  a[j2] = x1r - x3i;
  a[j2 + 1] = x1i + x3r;
  a[j3] = x1r + x3i;
  a[j3 + 1] = x1i - x3r;
  wn4r = w[1];
  k = 0;
  for (j = 2; j < mh; j += 2) {
    k += 4;
    wk1r = w[k];
    wk1i = w[k + 1];
    wk3r = w[k + 2];
    wk3i = w[k + 3];
    j1 = j + m;
    j2 = j1 + m;
    j3 = j2 + m;
    x0r = a[j] + a[j2];
    x0i = a[j + 1] + a[j2 + 1];
    x1r = a[j] - a[j2];
    x1i = a[j + 1] - a[j2 + 1];
    x2r = a[j1] + a[j3];
    x2i = a[j1 + 1] + a[j3 + 1];
    x3r = a[j1] - a[j3];
    x3i = a[j1 + 1] - a[j3 + 1];
    a[j] = x0r + x2r;
    a[j + 1] = x0i + x2i;
    a[j1] = x0r - x2r;
    a[j1 + 1] = x0i - x2i;
    x0r = x1r - x3i;
    x0i = x1i + x3r;
    a[j2] = wk1r * x0r - wk1i * x0i;
    a[j2 + 1] = wk1r * x0i + wk1i * x0r;
    x0r = x1r + x3i;
    x0i = x1i - x3r;
    a[j3] = wk3r * x0r + wk3i * x0i;
    a[j3 + 1] = wk3r * x0i - wk3i * x0r;
    j0 = m - j;
    j1 = j0 + m;
    j2 = j1 + m;
    j3 = j2 + m;
    x0r = a[j0] + a[j2];
    x0i = a[j0 + 1] + a[j2 + 1];
    x1r = a[j0] - a[j2];
    x1i = a[j0 + 1] - a[j2 + 1];
    x2r = a[j1] + a[j3];
    x2i = a[j1 + 1] + a[j3 + 1];
    x3r = a[j1] - a[j3];
    x3i = a[j1 + 1] - a[j3 + 1];
    a[j0] = x0r + x2r;
    a[j0 + 1] = x0i + x2i;
    a[j1] = x0r - x2r;
    a[j1 + 1] = x0i - x2i;
    x0r = x1r - x3i;
    x0i = x1i + x3r;
    a[j2] = wk1i * x0r - wk1r * x0i;
    a[j2 + 1] = wk1i * x0i + wk1r * x0r;
    x0r = x1r + x3i;
    x0i = x1i - x3r;
    a[j3] = wk3i * x0r + wk3r * x0i;
    a[j3 + 1] = wk3i * x0i - wk3r * x0r;
  }
  j0 = mh;
  j1 = j0 + m;
  j2 = j1 + m;
  j3 = j2 + m;
  x0r = a[j0] + a[j2];
  x0i = a[j0 + 1] + a[j2 + 1];
  x1r = a[j0] - a[j2];
  x1i = a[j0 + 1] - a[j2 + 1];
  x2r = a[j1] + a[j3];
  x2i = a[j1 + 1] + a[j3 + 1];
  x3r = a[j1] - a[j3];
  x3i = a[j1 + 1] - a[j3 + 1];
  a[j0] = x0r + x2r;
  a[j0 + 1] = x0i + x2i;
  a[j1] = x0r - x2r;
  a[j1 + 1] = x0i - x2i;
  x0r = x1r - x3i;
  x0i = x1i + x3r;
  a[j2] = wn4r * (x0r - x0i);
  a[j2 + 1] = wn4r * (x0i + x0r);
  x0r = x1r + x3i;
  x0i = x1i - x3r;
  a[j3] = -wn4r * (x0r + x0i);
  a[j3 + 1] = -wn4r * (x0i - x0r);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
sarl $0x3, %edi
leal (%rdi,%rdi), %eax
leal (,%rdi,4), %ecx
leal (%rax,%rax,2), %r8d
movslq %ecx, %r9
movslq %eax, %rcx
movslq %r8d, %rax
movupd (%rsi), %xmm0
movupd (%rsi,%r9,8), %xmm1
movapd %xmm0, %xmm2
subpd %xmm1, %xmm2
movupd (%rsi,%rcx,8), %xmm3
movupd (%rsi,%rax,8), %xmm4
movapd %xmm3, %xmm5
subpd %xmm4, %xmm5
shufpd $0x1, %xmm5, %xmm5      # xmm5 = xmm5[1,0]
addpd %xmm1, %xmm0
addpd %xmm4, %xmm3
movapd %xmm0, %xmm1
addpd %xmm3, %xmm1
movupd %xmm1, (%rsi)
subpd %xmm3, %xmm0
movupd %xmm0, (%rsi,%rcx,8)
movapd %xmm2, %xmm0
subpd %xmm5, %xmm0
addpd %xmm2, %xmm5
movapd %xmm5, %xmm1
movsd %xmm0, %xmm1            # xmm1 = xmm0[0],xmm1[1]
movupd %xmm1, (%rsi,%r9,8)
shufpd $0x2, %xmm0, %xmm5      # xmm5 = xmm5[0],xmm0[1]
movupd %xmm5, (%rsi,%rax,8)
movsd 0x8(%rdx), %xmm0
cmpl $0x2, %edi
jle 0xca4d
movl %edi, %eax
addq $0x38, %rdx
leaq -0x2(%rcx), %r8
movq %rcx, %r9
shlq $0x4, %r9
leaq -0x10(%r9), %r10
movq %rcx, %r11
shlq $0x5, %r11
addq $-0x10, %r11
leaq (,%rcx,8), %r14
leaq (%r14,%r14,2), %rbx
addq $-0x10, %rbx
addq $0x2, %rcx
leaq (%r14,%r14,2), %r14
addq $0x10, %r14
addq $0x10, %r9
movl $0x2, %r15d
movapd 0x2831(%rip), %xmm1     # 0xf090
movupd (%rsi,%r15,8), %xmm10
movupd (%rsi,%r9), %xmm9
movapd %xmm10, %xmm11
movupd (%rsi,%rcx,8), %xmm5
addpd %xmm9, %xmm11
movupd (%rsi,%r14), %xmm12
movapd %xmm5, %xmm8
movsd -0x18(%rdx), %xmm6
addpd %xmm12, %xmm8
movsd -0x10(%rdx), %xmm3
movsd -0x8(%rdx), %xmm4
movsd (%rdx), %xmm2
movapd %xmm11, %xmm13
subpd %xmm8, %xmm11
movapd %xmm3, %xmm7
xorpd %xmm1, %xmm7
addpd %xmm8, %xmm13
movapd %xmm2, %xmm8
xorpd %xmm1, %xmm8
subpd %xmm9, %xmm10
movupd %xmm13, (%rsi,%r15,8)
subpd %xmm12, %xmm5
shufpd $0x1, %xmm5, %xmm5      # xmm5 = xmm5[1,0]
movapd %xmm10, %xmm9
movupd %xmm11, (%rsi,%rcx,8)
subpd %xmm5, %xmm9
addpd %xmm10, %xmm5
movapd %xmm5, %xmm11
movsd %xmm9, %xmm11           # xmm11 = xmm9[0],xmm11[1]
movapd %xmm5, %xmm12
unpcklpd %xmm3, %xmm7            # xmm7 = xmm7[0],xmm3[0]
movapd %xmm6, %xmm10
shufpd $0x1, %xmm9, %xmm12     # xmm12 = xmm12[1],xmm9[0]
xorpd %xmm1, %xmm10
unpcklpd %xmm6, %xmm10           # xmm10 = xmm10[0],xmm6[0]
mulpd %xmm12, %xmm7
unpcklpd %xmm6, %xmm6            # xmm6 = xmm6[0,0]
movapd %xmm9, %xmm12
movsd %xmm5, %xmm12           # xmm12 = xmm5[0],xmm12[1]
mulpd %xmm11, %xmm6
movapd %xmm2, %xmm11
unpcklpd %xmm8, %xmm11           # xmm11 = xmm11[0],xmm8[0]
shufpd $0x1, %xmm5, %xmm9      # xmm9 = xmm9[1],xmm5[0]
addpd %xmm7, %xmm6
mulpd %xmm11, %xmm9
movapd %xmm4, %xmm5
unpcklpd %xmm4, %xmm5            # xmm5 = xmm5[0],xmm4[0]
movupd %xmm6, (%rsi,%r9)
mulpd %xmm12, %xmm5
addpd %xmm9, %xmm5
movupd %xmm5, (%rsi,%r14)
movupd (%rsi,%r8,8), %xmm7
movupd (%rsi,%rbx), %xmm6
movapd %xmm7, %xmm8
movupd (%rsi,%r10), %xmm5
addpd %xmm6, %xmm8
movupd (%rsi,%r11), %xmm9
movapd %xmm5, %xmm11
addpd %xmm9, %xmm11
movapd %xmm8, %xmm12
subpd %xmm11, %xmm8
movapd %xmm4, %xmm13
xorpd %xmm1, %xmm13
addpd %xmm11, %xmm12
subpd %xmm6, %xmm7
subpd %xmm9, %xmm5
shufpd $0x1, %xmm5, %xmm5      # xmm5 = xmm5[1,0]
movupd %xmm12, (%rsi,%r8,8)
movapd %xmm7, %xmm6
subpd %xmm5, %xmm6
addpd %xmm7, %xmm5
movupd %xmm8, (%rsi,%r10)
movapd %xmm5, %xmm7
movsd %xmm6, %xmm7            # xmm7 = xmm6[0],xmm7[1]
movapd %xmm5, %xmm8
shufpd $0x1, %xmm6, %xmm8      # xmm8 = xmm8[1],xmm6[0]
mulpd %xmm8, %xmm10
unpcklpd %xmm3, %xmm3            # xmm3 = xmm3[0,0]
movapd %xmm6, %xmm8
mulpd %xmm7, %xmm3
movsd %xmm5, %xmm8            # xmm8 = xmm5[0],xmm8[1]
unpcklpd %xmm13, %xmm4           # xmm4 = xmm4[0],xmm13[0]
shufpd $0x1, %xmm5, %xmm6      # xmm6 = xmm6[1],xmm5[0]
addpd %xmm10, %xmm3
mulpd %xmm4, %xmm6
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
mulpd %xmm8, %xmm2
movupd %xmm3, (%rsi,%rbx)
addpd %xmm6, %xmm2
addq $0x2, %r15
addq $0x20, %rdx
movupd %xmm2, (%rsi,%r11)
addq $-0x2, %r8
addq $-0x10, %r10
addq $-0x10, %r11
addq $-0x10, %rbx
addq $0x2, %rcx
addq $0x10, %r14
addq $0x10, %r9
cmpq %rax, %r15
jb 0xc85f
jmp 0xca50
movslq %edi, %rax
leal (%rdi,%rdi,2), %ecx
leal (%rdi,%rdi,4), %edx
leal (,%rdi,8), %r8d
subl %edi, %r8d
movslq %edx, %rdx
movslq %ecx, %rdi
movslq %r8d, %rcx
movupd (%rsi,%rax,8), %xmm4
movupd (%rsi,%rdx,8), %xmm1
movapd %xmm4, %xmm3
addpd %xmm1, %xmm3
subpd %xmm1, %xmm4
movupd (%rsi,%rdi,8), %xmm2
movupd (%rsi,%rcx,8), %xmm6
movapd %xmm2, %xmm5
subpd %xmm6, %xmm2
movapd %xmm2, %xmm1
unpckhpd %xmm2, %xmm1            # xmm1 = xmm1[1],xmm2[1]
movapd %xmm4, %xmm7
subsd %xmm1, %xmm7
addsd %xmm4, %xmm1
unpckhpd %xmm4, %xmm4            # xmm4 = xmm4[1,1]
addpd %xmm6, %xmm5
movapd %xmm3, %xmm6
addpd %xmm5, %xmm6
movupd %xmm6, (%rsi,%rax,8)
subpd %xmm5, %xmm3
movupd %xmm3, (%rsi,%rdi,8)
movapd %xmm4, %xmm3
addsd %xmm2, %xmm3
movapd %xmm7, %xmm5
subsd %xmm3, %xmm5
mulsd %xmm0, %xmm5
movsd %xmm5, (%rsi,%rdx,8)
addsd %xmm7, %xmm3
mulsd %xmm0, %xmm3
movsd %xmm3, 0x8(%rsi,%rdx,8)
xorpd 0x259d(%rip), %xmm0     # 0xf090
subsd %xmm2, %xmm4
movapd %xmm4, %xmm2
addsd %xmm1, %xmm2
mulsd %xmm0, %xmm2
movsd %xmm2, (%rsi,%rcx,8)
subsd %xmm1, %xmm4
mulsd %xmm0, %xmm4
movsd %xmm4, 0x8(%rsi,%rcx,8)
popq %rbx
popq %r14
popq %r15
retq