// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edi, (%rsi)
movl $0x1, 0x4(%rsi)
cmpl $0x3, %edi
jl 0x72c4
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
movl %edi, %r15d
shrl %r15d
cvtsi2sd %r15d, %xmm0
movsd 0x63d1(%rip), %xmm1     # 0xd490
divsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
mulsd %xmm1, %xmm0
callq 0x11b0
movapd %xmm0, %xmm3
movabsq $0x3ff0000000000000, %r12 # imm = 0x3FF0000000000000
movq %r12, (%rbx)
movsd %xmm0, 0x8(%rbx)
cmpl $0x4, %r15d
jne 0x7125
movsd (%rsp), %xmm0
addsd %xmm0, %xmm0
movsd %xmm0, (%rsp)
movsd %xmm3, 0x8(%rsp)
callq 0x11b0
movsd %xmm0, 0x10(%rbx)
movsd (%rsp), %xmm0
callq 0x1060
movsd 0x8(%rsp), %xmm3
xorl %eax, %eax
movq %rbx, %rcx
jmp 0x7229
xorl %r13d, %r13d
cmpl $0xa, %ebp
jb 0x7231
movsd %xmm3, 0x8(%rsp)
pushq $0x4
popq %r12
movl %ebp, %edi
movq %r14, %rsi
callq 0x7c77
movsd (%rsp), %xmm0
addsd %xmm0, %xmm0
callq 0x11b0
movsd 0x5f65(%rip), %xmm1     # 0xd0c0
divsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rbx)
movsd 0x632c(%rip), %xmm0     # 0xd498
mulsd (%rsp), %xmm0
callq 0x11b0
movsd 0x5f42(%rip), %xmm1     # 0xd0c0
divsd %xmm0, %xmm1
movsd %xmm1, 0x18(%rbx)
movsd 0x5f59(%rip), %xmm0     # 0xd0e8
mulsd (%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movl %r15d, %r14d
cmpq %r14, %r12
jae 0x7217
cvtsi2sd %r12d, %xmm1
movsd %xmm1, 0x10(%rsp)
movsd (%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rsp)
callq 0x11b0
movsd %xmm0, (%rbx,%r12,8)
movsd 0x20(%rsp), %xmm0
callq 0x1060
movsd %xmm0, 0x8(%rbx,%r12,8)
movsd 0x10(%rsp), %xmm0
mulsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
callq 0x11b0
movsd %xmm0, 0x10(%rbx,%r12,8)
movsd 0x10(%rsp), %xmm0
callq 0x1060
xorpd 0x5e56(%rip), %xmm0     # 0xd060
movlpd %xmm0, 0x18(%rbx,%r12,8)
addq $0x4, %r12
jmp 0x719d
movsd 0x8(%rsp), %xmm3
movabsq $0x3ff0000000000000, %r12 # imm = 0x3FF0000000000000
jmp 0x7231
movsd %xmm0, 0x18(%rcx)
movl %eax, %r13d
leaq 0x50(%rbx), %rcx
movapd 0x6263(%rip), %xmm0     # 0xd4a0
pushq $0x4
popq %rdx
movl %r15d, %esi
cmpl $0x3, %esi
jb 0x72c4
leal (%rsi,%r13), %eax
movl %esi, %r15d
shrl %r15d
movq %r12, (%rbx,%rax,8)
movsd %xmm3, 0x8(%rbx,%rax,8)
movl %r13d, %edi
cmpl $0x4, %r15d
je 0x72d3
movl %eax, %r13d
cmpl $0xa, %esi
movl %r15d, %esi
jb 0x7243
movsd 0x20(%rbx,%rdi,8), %xmm1
movhpd 0x30(%rbx,%rdi,8), %xmm1 # xmm1 = xmm1[0],mem[0]
movapd %xmm0, %xmm2
divpd %xmm1, %xmm2
leaq (%rbx,%rax,8), %rsi
movupd %xmm2, 0x10(%rsi)
movl %r15d, %r8d
leaq (%rcx,%rdi,8), %rdi
movq %rdx, %r9
cmpq %r8, %r9
jae 0x72bc
movupd -0x10(%rdi), %xmm1
movupd (%rdi), %xmm2
movupd %xmm1, (%rsi,%r9,8)
movupd %xmm2, 0x10(%rsi,%r9,8)
addq $0x4, %r9
addq $0x40, %rdi
jmp 0x7297
movl %eax, %r13d
jmp 0x7240
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq (%rbx,%rax,8), %rcx
movsd 0x20(%rbx,%rdi,8), %xmm1
movsd 0x28(%rbx,%rdi,8), %xmm0
movsd %xmm1, 0x10(%rcx)
jmp 0x7229