user: Converte this assembly snippet into its equivalent C code:

```asm
<makewt>:
  endbr64
  mov    %edi,(%rsi)
  movl   $0x1,0x4(%rsi)
  cmp    $0x2,%edi
  jg     L42
  ret
  nopl   0x0(%rax,%rax,1)
L42:
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  push   %rbx
  mov    %rdx,%rbx
  sar    %ebp
  sub    $0x10,%rsp
  mov    D43(%rip),%rax
  movq   %rax,%xmm0
  call   <atan@plt>
  pxor   %xmm7,%xmm7
  pxor   %xmm0,%xmm0
  cltd
  cvtsi2sd %ebp,%xmm0
  idiv   %ebp
  cvtsi2sd %eax,%xmm7
  mulsd  %xmm7,%xmm0
  movsd  %xmm7,(%rsp)
  cvttsd2si %xmm0,%edi
  call   <cos@plt>
  mov    D43(%rip),%rax
  movq   %xmm0,%r14
  movsd  %xmm0,0x8(%rbx)
  mov    %rax,(%rbx)
  cmp    $0x3,%ebp
  jg     L25
L2:
  cmp    $0x2,%ebp
  jg     L69
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L25:
  movsd  (%rsp),%xmm7
  movapd %xmm7,%xmm0
  addsd  %xmm7,%xmm0
  cvttsd2si %xmm0,%edi
  call   <cos@plt>
  movsd  D35(%rip),%xmm2
  divsd  %xmm0,%xmm2
  movsd  (%rsp),%xmm0
  mulsd  D10(%rip),%xmm0
  cvttsd2si %xmm0,%edi
  movsd  %xmm2,0x10(%rbx)
  call   <cos@plt>
  movapd %xmm0,%xmm1
  movsd  D35(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,0x18(%rbx)
  cmp    $0x4,%ebp
  jle    L2
  mov    $0x4,%r12d
  nopl   (%rax)
L57:
  pxor   %xmm1,%xmm1
  movsd  (%rsp),%xmm0
  cvtsi2sd %r12d,%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm1,0x8(%rsp)
  cvttsd2si %xmm0,%r13d
  mov    %r13d,%edi
  call   <cos@plt>
  mov    %r13d,%edi
  movsd  %xmm0,(%rbx,%r12,8)
  call   <sin@plt>
  movsd  D76(%rip),%xmm5
  mulsd  (%rsp),%xmm5
  movsd  0x8(%rsp),%xmm1
  movsd  %xmm0,0x8(%rbx,%r12,8)
  movapd %xmm5,%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%r13d
  mov    %r13d,%edi
  call   <cos@plt>
  mov    %r13d,%edi
  movsd  %xmm0,0x10(%rbx,%r12,8)
  call   <sin@plt>
  movsd  %xmm0,0x18(%rbx,%r12,8)
  add    $0x4,%r12
  cmp    %r12d,%ebp
  jg     L57
L69:
  movapd D35(%rip),%xmm2
  xor    %r9d,%r9d
L116:
  lea    (%r9,%rbp,1),%edi
  mov    D43(%rip),%rcx
  mov    %ebp,%r8d
  movslq %edi,%rax
  sar    %r8d
  lea    0x0(,%rax,8),%rdx
  mov    %rcx,(%rbx,%rax,8)
  mov    %r14,0x8(%rbx,%rdx,1)
  cmp    $0x3,%r8d
  jle    L26
  movslq %r9d,%rax
  movapd %xmm2,%xmm1
  movsd  0x20(%rbx,%rax,8),%xmm0
  movhpd 0x30(%rbx,%rax,8),%xmm0
  divpd  %xmm0,%xmm1
  movups %xmm1,0x10(%rbx,%rdx,1)
  cmp    $0x4,%r8d
  je     L23
  lea    -0x5(%r8),%edx
  mov    %edx,%r10d
  shr    $0x2,%r10d
  cmp    $0x3,%edx
  jbe    L18
  movslq %ebp,%rbp
  lea    0x40(%rbx,%rax,8),%rsi
  xor    %edx,%edx
  lea    0x4(%rax,%rbp,1),%rax
  lea    (%rbx,%rax,8),%rcx
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L24:
  movupd 0x10(%rsi,%rax,2),%xmm0
  movupd (%rsi,%rax,2),%xmm3
  add    $0x1,%edx
  movups %xmm3,(%rcx,%rax,1)
  movups %xmm0,0x10(%rcx,%rax,1)
  add    $0x20,%rax
  cmp    %r10d,%edx
  jb     L24
  lea    0x4(,%r10,4),%eax
L55:
  lea    (%r9,%rax,2),%edx
  add    %edi,%eax
  movslq %edx,%rdx
  cltq
  lea    (%rbx,%rdx,8),%rdx
  lea    (%rbx,%rax,8),%rax
  movupd (%rdx),%xmm1
  movupd 0x10(%rdx),%xmm0
  movups %xmm1,(%rax)
  movups %xmm0,0x10(%rax)
L23:
  mov    %edi,%r9d
  mov    %r8d,%ebp
  jmp    L116
  cs nopw 0x0(%rax,%rax,1)
L26:
  je     L23
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L18:
  mov    $0x4,%eax
  jmp    L55
```

tool_calls: name: disassemble_data
arguments: data_label: D43
data_type: f64
name: disassemble_data
arguments: data_label: D35
data_type: f64[2]
name: disassemble_data
arguments: data_label: D10
data_type: byte[8]
name: disassemble_data
arguments: data_label: D76
data_type: byte[8]

tool: D43: 1

tool: {"D35": [0.5,0.5]}

tool: {"D10": [0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x40]}

tool: {"D76": [0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x40]}

assistant: ```c
void makewt(int nw, int *ip, double *w) {
  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] = 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];
        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;
    }
  }
}
```