// File: /workspace/github_cpp_makefile_star2_O2/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 %r14
pushq %rbx
sarl $0x3, %edi
leal (%rdi,%rdi), %eax
leal (,%rdi,4), %ecx
imull $0x6, %edi, %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
movslq %edi, %rax
leaq 0x2(%rcx), %rdi
imulq $0x18, %rcx, %r8
leaq 0x10(%r8), %r9
movq %rcx, %r10
shlq $0x4, %r10
leaq 0x10(%r10), %r11
leaq -0x2(%rcx), %rbx
addq $-0x10, %r10
shlq $0x5, %rcx
addq $-0x10, %rcx
addq $-0x10, %r8
addq $0x38, %rdx
movabsq $0x2, %r14
movapd 0x1f70(%rip), %xmm1     # 0xd060
cmpq %rax, %r14
jge 0xb2dd
movupd (%rsi,%r14,8), %xmm10
movupd (%rsi,%r11), %xmm8
movapd %xmm10, %xmm7
addpd %xmm8, %xmm7
movupd (%rsi,%rdi,8), %xmm5
movupd (%rsi,%r9), %xmm11
movapd %xmm5, %xmm9
addpd %xmm11, %xmm9
movapd %xmm7, %xmm12
addpd %xmm9, %xmm12
movsd -0x18(%rdx), %xmm6
movsd -0x10(%rdx), %xmm4
movsd -0x8(%rdx), %xmm3
movsd (%rdx), %xmm2
movupd %xmm12, (%rsi,%r14,8)
subpd %xmm9, %xmm7
movupd %xmm7, (%rsi,%rdi,8)
movapd %xmm4, %xmm9
xorpd %xmm1, %xmm9
movapd %xmm2, %xmm7
xorpd %xmm1, %xmm7
subpd %xmm8, %xmm10
subpd %xmm11, %xmm5
shufpd $0x1, %xmm5, %xmm5      # xmm5 = xmm5[1,0]
movapd %xmm10, %xmm8
subpd %xmm5, %xmm8
addpd %xmm10, %xmm5
movapd %xmm5, %xmm11
movsd %xmm8, %xmm11           # xmm11 = xmm8[0],xmm11[1]
movapd %xmm5, %xmm10
shufpd $0x1, %xmm8, %xmm10     # xmm10 = xmm10[1],xmm8[0]
unpcklpd %xmm4, %xmm9            # xmm9 = xmm9[0],xmm4[0]
mulpd %xmm10, %xmm9
movapd %xmm6, %xmm10
xorpd %xmm1, %xmm10
unpcklpd %xmm6, %xmm10           # xmm10 = xmm10[0],xmm6[0]
unpcklpd %xmm6, %xmm6            # xmm6 = xmm6[0,0]
mulpd %xmm11, %xmm6
addpd %xmm9, %xmm6
movupd %xmm6, (%rsi,%r11)
movapd %xmm8, %xmm6
movsd %xmm5, %xmm6            # xmm6 = xmm5[0],xmm6[1]
movapd %xmm2, %xmm9
unpcklpd %xmm7, %xmm9            # xmm9 = xmm9[0],xmm7[0]
shufpd $0x1, %xmm5, %xmm8      # xmm8 = xmm8[1],xmm5[0]
mulpd %xmm9, %xmm8
movapd %xmm3, %xmm5
unpcklpd %xmm3, %xmm5            # xmm5 = xmm5[0],xmm3[0]
mulpd %xmm6, %xmm5
addpd %xmm8, %xmm5
movupd %xmm5, (%rsi,%r9)
movupd (%rsi,%rbx,8), %xmm6
movupd (%rsi,%r8), %xmm7
movapd %xmm6, %xmm8
addpd %xmm7, %xmm8
movupd (%rsi,%r10), %xmm5
movupd (%rsi,%rcx), %xmm9
movapd %xmm5, %xmm11
addpd %xmm9, %xmm11
movapd %xmm8, %xmm12
addpd %xmm11, %xmm12
movupd %xmm12, (%rsi,%rbx,8)
subpd %xmm11, %xmm8
movupd %xmm8, (%rsi,%r10)
movapd %xmm3, %xmm8
xorpd %xmm1, %xmm8
subpd %xmm7, %xmm6
subpd %xmm9, %xmm5
shufpd $0x1, %xmm5, %xmm5      # xmm5 = xmm5[1,0]
movapd %xmm6, %xmm7
subpd %xmm5, %xmm7
addpd %xmm6, %xmm5
movapd %xmm5, %xmm6
movsd %xmm7, %xmm6            # xmm6 = xmm7[0],xmm6[1]
movapd %xmm5, %xmm9
shufpd $0x1, %xmm7, %xmm9      # xmm9 = xmm9[1],xmm7[0]
mulpd %xmm9, %xmm10
unpcklpd %xmm4, %xmm4            # xmm4 = xmm4[0,0]
mulpd %xmm6, %xmm4
addpd %xmm10, %xmm4
movupd %xmm4, (%rsi,%r8)
movapd %xmm7, %xmm4
movsd %xmm5, %xmm4            # xmm4 = xmm5[0],xmm4[1]
unpcklpd %xmm8, %xmm3            # xmm3 = xmm3[0],xmm8[0]
shufpd $0x1, %xmm5, %xmm7      # xmm7 = xmm7[1],xmm5[0]
mulpd %xmm3, %xmm7
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
mulpd %xmm4, %xmm2
addpd %xmm7, %xmm2
movupd %xmm2, (%rsi,%rcx)
addq $0x2, %r14
addq $0x2, %rdi
addq $0x10, %r9
addq $0x10, %r11
addq $-0x2, %rbx
addq $-0x10, %r10
addq $-0x10, %rcx
addq $-0x10, %r8
addq $0x20, %rdx
jmp 0xb0f0
leal (%rax,%rax,2), %ecx
leal (%rax,%rax,4), %edx
imull $0x7, %eax, %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 0x1ce7(%rip), %xmm0     # 0xd060
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
retq