// File: /workspace/github_cpp_makefile_star2_O1/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), %r9d
movslq %ecx, %rcx
movsd (%rsi,%rcx,8), %xmm2
movsd (%rsi), %xmm1
movsd 0x8(%rsi), %xmm0
movapd %xmm1, %xmm3
addsd %xmm2, %xmm3
leal 0x1(,%rdi,4), %r8d
movslq %r8d, %r8
movsd (%rsi,%r8,8), %xmm5
movapd %xmm0, %xmm4
addsd %xmm5, %xmm4
subsd %xmm2, %xmm1
subsd %xmm5, %xmm0
movslq %eax, %r11
movsd (%rsi,%r11,8), %xmm2
movslq %r9d, %r9
movsd (%rsi,%r9,8), %xmm5
movapd %xmm2, %xmm6
addsd %xmm5, %xmm6
leal 0x1(%rdi,%rdi), %r10d
movslq %r10d, %rbx
movsd (%rsi,%rbx,8), %xmm7
leal 0x1(%rax,%rax,2), %r10d
movslq %r10d, %r10
movsd (%rsi,%r10,8), %xmm8
movapd %xmm7, %xmm9
addsd %xmm8, %xmm9
subsd %xmm5, %xmm2
subsd %xmm8, %xmm7
movapd %xmm3, %xmm5
addsd %xmm6, %xmm5
movsd %xmm5, (%rsi)
movapd %xmm4, %xmm5
addsd %xmm9, %xmm5
movsd %xmm5, 0x8(%rsi)
subsd %xmm6, %xmm3
movsd %xmm3, (%rsi,%r11,8)
subsd %xmm9, %xmm4
movsd %xmm4, (%rsi,%rbx,8)
movapd %xmm1, %xmm3
subsd %xmm7, %xmm3
movsd %xmm3, (%rsi,%rcx,8)
movapd %xmm0, %xmm3
addsd %xmm2, %xmm3
movsd %xmm3, (%rsi,%r8,8)
addsd %xmm1, %xmm7
movsd %xmm7, (%rsi,%r9,8)
subsd %xmm2, %xmm0
movsd %xmm0, (%rsi,%r10,8)
movsd 0x8(%rdx), %xmm0
cmpl $0x3, %edi
jl 0xca3f
movl %eax, %eax
movl %edi, %ecx
addq $0x38, %rdx
leaq -0x1(%rax), %r8
movq %rax, %r9
shlq $0x4, %r9
leaq -0x8(%r9), %r10
leaq (,%rax,8), %r14
leaq (%r14,%r14,2), %r11
addq $-0x8, %r11
movq %rax, %rbx
shlq $0x5, %rbx
addq $-0x8, %rbx
addq $0x3, %rax
addq $0x18, %r9
leaq (%r14,%r14,2), %r14
addq $0x18, %r14
movl $0x2, %r15d
movsd -0x18(%rdx), %xmm3
movsd -0x10(%rdx), %xmm4
movsd -0x8(%rdx), %xmm2
movsd (%rdx), %xmm1
movsd (%rsi,%r15,8), %xmm7
movsd 0x8(%rsi,%r15,8), %xmm5
movsd -0x8(%rsi,%r9), %xmm6
movsd (%rsi,%r9), %xmm11
movapd %xmm7, %xmm10
movapd %xmm5, %xmm9
subsd %xmm6, %xmm7
subsd %xmm11, %xmm5
movsd -0x8(%rsi,%rax,8), %xmm8
addsd %xmm6, %xmm10
movsd (%rsi,%rax,8), %xmm6
movsd -0x8(%rsi,%r14), %xmm12
movsd (%rsi,%r14), %xmm13
addsd %xmm11, %xmm9
movapd %xmm8, %xmm11
addsd %xmm12, %xmm11
movapd %xmm6, %xmm14
addsd %xmm13, %xmm14
subsd %xmm12, %xmm8
subsd %xmm13, %xmm6
movapd %xmm10, %xmm12
addsd %xmm11, %xmm12
movapd %xmm9, %xmm13
addsd %xmm14, %xmm13
subsd %xmm11, %xmm10
movsd %xmm12, (%rsi,%r15,8)
subsd %xmm14, %xmm9
movapd %xmm7, %xmm11
subsd %xmm6, %xmm11
movsd %xmm13, 0x8(%rsi,%r15,8)
movapd %xmm5, %xmm12
addsd %xmm8, %xmm12
movapd %xmm3, %xmm13
movsd %xmm10, -0x8(%rsi,%rax,8)
mulsd %xmm12, %xmm13
mulsd %xmm4, %xmm12
movapd %xmm3, %xmm10
movsd %xmm9, (%rsi,%rax,8)
mulsd %xmm11, %xmm10
subsd %xmm12, %xmm10
mulsd %xmm4, %xmm11
addsd %xmm13, %xmm11
addsd %xmm7, %xmm6
subsd %xmm8, %xmm5
movapd %xmm1, %xmm7
movsd %xmm10, -0x8(%rsi,%r9)
mulsd %xmm5, %xmm7
movapd %xmm2, %xmm8
mulsd %xmm6, %xmm8
movsd %xmm11, (%rsi,%r9)
addsd %xmm7, %xmm8
mulsd %xmm1, %xmm6
mulsd %xmm2, %xmm5
movsd %xmm8, -0x8(%rsi,%r14)
subsd %xmm6, %xmm5
movsd %xmm5, (%rsi,%r14)
movsd -0x8(%rsi,%r8,8), %xmm7
movsd (%rsi,%r8,8), %xmm5
movsd -0x8(%rsi,%r11), %xmm6
movsd (%rsi,%r11), %xmm11
movapd %xmm7, %xmm10
movapd %xmm5, %xmm9
subsd %xmm6, %xmm7
subsd %xmm11, %xmm5
movsd -0x8(%rsi,%r10), %xmm8
addsd %xmm6, %xmm10
movsd (%rsi,%r10), %xmm6
movsd -0x8(%rsi,%rbx), %xmm12
movsd (%rsi,%rbx), %xmm13
addsd %xmm11, %xmm9
movapd %xmm8, %xmm11
addsd %xmm12, %xmm11
movapd %xmm6, %xmm14
addsd %xmm13, %xmm14
subsd %xmm12, %xmm8
subsd %xmm13, %xmm6
movapd %xmm10, %xmm12
addsd %xmm11, %xmm12
movsd %xmm12, -0x8(%rsi,%r8,8)
movapd %xmm9, %xmm12
addsd %xmm14, %xmm12
movsd %xmm12, (%rsi,%r8,8)
subsd %xmm11, %xmm10
subsd %xmm14, %xmm9
movapd %xmm7, %xmm11
movsd %xmm10, -0x8(%rsi,%r10)
subsd %xmm6, %xmm11
movapd %xmm5, %xmm10
addsd %xmm8, %xmm10
movsd %xmm9, (%rsi,%r10)
movapd %xmm10, %xmm9
mulsd %xmm4, %xmm10
mulsd %xmm3, %xmm9
mulsd %xmm11, %xmm4
subsd %xmm9, %xmm4
mulsd %xmm3, %xmm11
addsd %xmm11, %xmm10
addsd %xmm7, %xmm6
subsd %xmm8, %xmm5
movapd %xmm1, %xmm3
movsd %xmm4, -0x8(%rsi,%r11)
mulsd %xmm6, %xmm3
mulsd %xmm2, %xmm6
movsd %xmm10, (%rsi,%r11)
mulsd %xmm5, %xmm2
addsd %xmm2, %xmm3
mulsd %xmm1, %xmm5
movsd %xmm3, -0x8(%rsi,%rbx)
subsd %xmm6, %xmm5
addq $0x2, %r15
addq $0x20, %rdx
movsd %xmm5, (%rsi,%rbx)
addq $-0x2, %r8
addq $-0x10, %r10
addq $-0x10, %r11
addq $-0x10, %rbx
addq $0x2, %rax
addq $0x10, %r9
addq $0x10, %r14
cmpq %rcx, %r15
jb 0xc7bc
leal (%rdi,%rdi,2), %eax
leal (%rdi,%rdi,4), %ecx
leal (,%rdi,8), %r8d
subl %edi, %r8d
movslq %edi, %rdx
movslq %ecx, %rcx
movsd (%rsi,%rdx,8), %xmm2
movsd 0x8(%rsi,%rdx,8), %xmm1
movsd (%rsi,%rcx,8), %xmm3
movsd 0x8(%rsi,%rcx,8), %xmm4
movapd %xmm2, %xmm5
addsd %xmm3, %xmm5
movapd %xmm1, %xmm6
addsd %xmm4, %xmm6
subsd %xmm3, %xmm2
subsd %xmm4, %xmm1
movslq %eax, %rdi
movslq %r8d, %rax
movsd (%rsi,%rdi,8), %xmm4
movsd 0x8(%rsi,%rdi,8), %xmm3
movsd (%rsi,%rax,8), %xmm7
movsd 0x8(%rsi,%rax,8), %xmm8
movapd %xmm4, %xmm9
addsd %xmm7, %xmm9
movapd %xmm3, %xmm10
addsd %xmm8, %xmm10
subsd %xmm7, %xmm4
subsd %xmm8, %xmm3
movapd %xmm5, %xmm7
addsd %xmm9, %xmm7
movsd %xmm7, (%rsi,%rdx,8)
movapd %xmm6, %xmm7
addsd %xmm10, %xmm7
movsd %xmm7, 0x8(%rsi,%rdx,8)
subsd %xmm9, %xmm5
movsd %xmm5, (%rsi,%rdi,8)
subsd %xmm10, %xmm6
movsd %xmm6, 0x8(%rsi,%rdi,8)
movapd %xmm2, %xmm5
subsd %xmm3, %xmm5
movapd %xmm1, %xmm6
addsd %xmm4, %xmm6
movapd %xmm5, %xmm7
subsd %xmm6, %xmm7
mulsd %xmm0, %xmm7
movsd %xmm7, (%rsi,%rcx,8)
addsd %xmm5, %xmm6
mulsd %xmm0, %xmm6
movsd %xmm6, 0x8(%rsi,%rcx,8)
addsd %xmm2, %xmm3
xorpd 0x2545(%rip), %xmm0     # 0xf070
subsd %xmm4, %xmm1
movapd %xmm1, %xmm2
addsd %xmm3, %xmm2
mulsd %xmm0, %xmm2
movsd %xmm2, (%rsi,%rax,8)
subsd %xmm3, %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsi,%rax,8)
popq %rbx
popq %r14
popq %r15
retq