// File: 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
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl -0x4(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0x4(%rax)
cmpl $0x2, -0x4(%rbp)
jle 0xd147
movl -0x4(%rbp), %eax
sarl %eax
movl %eax, -0x20(%rbp)
movsd 0xf2cf(%rip), %xmm0     # 0x1c010
callq 0x10c0
cvtsi2sdl -0x20(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
cvtsi2sdl -0x20(%rbp), %xmm1
mulsd %xmm1, %xmm0
callq 0x11a0
movsd %xmm0, -0x38(%rbp)
movq -0x18(%rbp), %rax
movsd 0xf298(%rip), %xmm0     # 0x1c010
movsd %xmm0, (%rax)
movsd -0x38(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x8(%rax)
cmpl $0x4, -0x20(%rbp)
jne 0xcdcb
movsd 0xf270(%rip), %xmm0     # 0x1c008
mulsd -0x30(%rbp), %xmm0
callq 0x11a0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x10(%rax)
movsd 0xf255(%rip), %xmm0     # 0x1c008
mulsd -0x30(%rbp), %xmm0
callq 0x1060
movq -0x18(%rbp), %rax
movsd %xmm0, 0x18(%rax)
jmp 0xcf10
cmpl $0x4, -0x20(%rbp)
jle 0xcf0e
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0xe2b0
movsd 0xf21f(%rip), %xmm0     # 0x1c008
mulsd -0x30(%rbp), %xmm0
callq 0x11a0
movaps %xmm0, %xmm1
movsd 0xf22a(%rip), %xmm0     # 0x1c028
divsd %xmm1, %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x10(%rax)
movsd 0xf49d(%rip), %xmm0     # 0x1c2b0
mulsd -0x30(%rbp), %xmm0
callq 0x11a0
movaps %xmm0, %xmm1
movsd 0xf200(%rip), %xmm0     # 0x1c028
divsd %xmm1, %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x18(%rax)
movl $0x4, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0xcf0c
movsd -0x30(%rbp), %xmm0
cvtsi2sdl -0x1c(%rbp), %xmm1
mulsd %xmm1, %xmm0
callq 0x11a0
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd -0x30(%rbp), %xmm0
cvtsi2sdl -0x1c(%rbp), %xmm1
mulsd %xmm1, %xmm0
callq 0x1060
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0xf233(%rip), %xmm0     # 0x1c0c8
mulsd -0x30(%rbp), %xmm0
cvtsi2sdl -0x1c(%rbp), %xmm1
mulsd %xmm1, %xmm0
callq 0x11a0
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0xf206(%rip), %xmm0     # 0x1c0c8
mulsd -0x30(%rbp), %xmm0
cvtsi2sdl -0x1c(%rbp), %xmm1
mulsd %xmm1, %xmm0
callq 0x1060
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x1c(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x1c(%rbp)
jmp 0xce3c
jmp 0xcf0e
jmp 0xcf10
movl $0x0, -0x24(%rbp)
cmpl $0x2, -0x20(%rbp)
jle 0xd145
movl -0x24(%rbp), %eax
addl -0x20(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x20(%rbp), %eax
sarl %eax
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movsd 0xf0ce(%rip), %xmm0     # 0x1c010
movsd %xmm0, (%rax,%rcx,8)
movsd -0x38(%rbp), %xmm0
movq -0x18(%rbp), %rax
movl -0x28(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
cmpl $0x4, -0x20(%rbp)
jne 0xcfc5
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x5, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x40(%rbp), %xmm0
movq -0x18(%rbp), %rax
movl -0x28(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd -0x48(%rbp), %xmm0
movq -0x18(%rbp), %rax
movl -0x28(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xd13a
cmpl $0x4, -0x20(%rbp)
jle 0xd138
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
addl $0x6, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x50(%rbp)
movsd 0xf023(%rip), %xmm0     # 0x1c028
divsd -0x40(%rbp), %xmm0
movq -0x18(%rbp), %rax
movl -0x28(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0xf004(%rip), %xmm0     # 0x1c028
divsd -0x50(%rbp), %xmm0
movq -0x18(%rbp), %rax
movl -0x28(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl $0x4, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0xd136
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
movl -0x1c(%rbp), %edx
shll %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
movl -0x1c(%rbp), %edx
shll %edx
addl %edx, %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
movl -0x1c(%rbp), %edx
shll %edx
addl %edx, %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
movl -0x1c(%rbp), %edx
shll %edx
addl %edx, %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x40(%rbp), %xmm0
movq -0x18(%rbp), %rax
movl -0x28(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd -0x48(%rbp), %xmm0
movq -0x18(%rbp), %rax
movl -0x28(%rbp), %ecx
addl -0x1c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd -0x50(%rbp), %xmm0
movq -0x18(%rbp), %rax
movl -0x28(%rbp), %ecx
addl -0x1c(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd -0x58(%rbp), %xmm0
movq -0x18(%rbp), %rax
movl -0x28(%rbp), %ecx
addl -0x1c(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x1c(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x1c(%rbp)
jmp 0xd042
jmp 0xd138
jmp 0xd13a
movl -0x28(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0xcf17
jmp 0xd147
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)