// File: /workspace/github_cpp_makefile_star2_O1/Sleepwalking[P]world-octave/fft.cpp
// Function: makewt(int, int*, double*)
void makewt(int nw, int *ip, double *w) {
  void makeipt(int nw, int *ip);
  int j, nwh, nw0, nw1;
  double delta, wn4r, wk1r, wk1i, wk3r, wk3i;

  ip[0] = nw;
  ip[1] = 1;
  if (nw > 2) {
    nwh = nw >> 1;
    delta = atan(1.0) / nwh;
    wn4r = cos(delta * nwh);
    w[0] = 1;
    w[1] = wn4r;
    if (nwh == 4) {
      w[2] = cos(delta * 2);
      w[3] = sin(delta * 2);
    } else if (nwh > 4) {
      makeipt(nw, ip);
      w[2] = 0.5 / cos(delta * 2);
      w[3] = 0.5 / cos(delta * 6);
      for (j = 4; j < nwh; j += 4) {
        w[j] = cos(delta * j);
        w[j + 1] = sin(delta * j);
        w[j + 2] = cos(3 * delta * j);
        w[j + 3] = -sin(3 * delta * j);
      }
    }
    nw0 = 0;
    while (nwh > 2) {
      nw1 = nw0 + nwh;
      nwh >>= 1;
      w[nw1] = 1;
      w[nw1 + 1] = wn4r;
      if (nwh == 4) {
        wk1r = w[nw0 + 4];
        wk1i = w[nw0 + 5];
        w[nw1 + 2] = wk1r;
        w[nw1 + 3] = wk1i;
      } else if (nwh > 4) {
        wk1r = w[nw0 + 4];
        wk3r = w[nw0 + 6];
        w[nw1 + 2] = 0.5 / wk1r;
        w[nw1 + 3] = 0.5 / wk3r;
        for (j = 4; j < nwh; j += 4) {
          wk1r = w[nw0 + 2 * j];
          wk1i = w[nw0 + 2 * j + 1];
          wk3r = w[nw0 + 2 * j + 2];
          wk3i = w[nw0 + 2 * j + 3];
          w[nw1 + j] = wk1r;
          w[nw1 + j + 1] = wk1i;
          w[nw1 + j + 2] = wk3r;
          w[nw1 + j + 3] = wk3i;
        }
      }
      nw0 = nw1;
    }
  }
}

// Assembly:
movl %edi, (%rsi)
movl $0x1, 0x4(%rsi)
cmpl $0x3, %edi
jl 0x7c86
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
movl %edi, %r15d
shrl %r15d
cvtsi2sd %r15d, %xmm0
movsd 0x799e(%rip), %xmm1     # 0xf420
divsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
mulsd %xmm1, %xmm0
callq 0x11b0
movabsq $0x3ff0000000000000, %r12 # imm = 0x3FF0000000000000
movq %r12, (%rbx)
movsd %xmm0, 0x10(%rsp)
movsd %xmm0, 0x8(%rbx)
cmpl $0x4, %r15d
jne 0x7ade
movsd (%rsp), %xmm0
addsd %xmm0, %xmm0
movsd %xmm0, (%rsp)
callq 0x11b0
movsd %xmm0, 0x10(%rbx)
movsd (%rsp), %xmm0
callq 0x1060
movsd %xmm0, 0x18(%rbx)
jmp 0x7bca
cmpl $0xa, %ebp
jb 0x7bca
movl %ebp, %edi
movq %r14, %rsi
callq 0x87fc
movsd (%rsp), %xmm0
addsd %xmm0, %xmm0
callq 0x11b0
movsd 0x7581(%rip), %xmm1     # 0xf088
divsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rbx)
movsd 0x7910(%rip), %xmm0     # 0xf428
mulsd (%rsp), %xmm0
callq 0x11b0
movsd 0x755e(%rip), %xmm1     # 0xf088
divsd %xmm0, %xmm1
movsd %xmm1, 0x18(%rbx)
movsd 0x756d(%rip), %xmm0     # 0xf0a8
mulsd (%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movl %r15d, %r14d
movl $0x4, %r13d
xorps %xmm1, %xmm1
cvtsi2sd %r13d, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd (%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rsp)
callq 0x11b0
movsd %xmm0, (%rbx,%r13,8)
movsd 0x20(%rsp), %xmm0
callq 0x1060
movsd %xmm0, 0x8(%rbx,%r13,8)
movsd 0x8(%rsp), %xmm0
mulsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
callq 0x11b0
movsd %xmm0, 0x10(%rbx,%r13,8)
movsd 0x8(%rsp), %xmm0
callq 0x1060
xorpd 0x74b6(%rip), %xmm0     # 0xf070
movlpd %xmm0, 0x18(%rbx,%r13,8)
addq $0x4, %r13
cmpq %r14, %r13
jb 0x7b4f
cmpl $0x6, %ebp
movsd 0x10(%rsp), %xmm3
jb 0x7c78
leaq 0x58(%rbx), %rax
xorl %ecx, %ecx
movsd 0x74a1(%rip), %xmm0     # 0xf088
movl %ecx, %esi
movl %r15d, %edx
leal (%rdx,%rsi), %ecx
shrl %r15d
movq %r12, (%rbx,%rcx,8)
movsd %xmm3, 0x8(%rbx,%rcx,8)
cmpl $0x4, %r15d
jne 0x7c12
movl %esi, %esi
movupd 0x20(%rbx,%rsi,8), %xmm1
movupd %xmm1, 0x10(%rbx,%rcx,8)
jmp 0x7c6f
cmpl $0xa, %edx
jb 0x7c6f
movl %esi, %r8d
movapd %xmm0, %xmm1
divsd 0x20(%rbx,%r8,8), %xmm1
leaq (%rbx,%rcx,8), %rsi
movapd %xmm0, %xmm2
divsd 0x30(%rbx,%r8,8), %xmm2
movsd %xmm1, 0x10(%rsi)
movsd %xmm2, 0x18(%rsi)
movl %r15d, %edi
leaq (%rax,%r8,8), %r8
movl $0x4, %r9d
movupd -0x18(%r8), %xmm1
movups -0x8(%r8), %xmm2
movupd %xmm1, (%rsi,%r9,8)
movups %xmm2, 0x10(%rsi,%r9,8)
addq $0x4, %r9
addq $0x40, %r8
cmpq %rdi, %r9
jb 0x7c4b
cmpl $0x5, %edx
ja 0x7be7
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq