user: 请从给定的汇编指令推导出C源代码:

```asm
<TorusNoise>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xc0,%rsp
  movsd  %xmm0,-0xa8(%rbp)
  movsd  %xmm1,-0xb0(%rbp)
  movsd  %xmm2,-0xb8(%rbp)
  movss  %xmm3,-0xbc(%rbp)
  movss  %xmm4,-0xc0(%rbp)
  movsd  -0xa8(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L24
  movsd  -0xa8(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  jmp    L66
L24:
  movsd  -0xa8(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  sub    $0x1,%eax
L66:
  mov    %eax,-0x88(%rbp)
  movsd  -0xb8(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L65
  movsd  -0xb8(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  jmp    L38
L65:
  movsd  -0xb8(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  sub    $0x1,%eax
L38:
  mov    %eax,-0x84(%rbp)
  movsd  -0xb0(%rbp),%xmm0
  movsd  %xmm0,-0x78(%rbp)
  movss  D43(%rip),%xmm0
  movss  %xmm0,-0x94(%rbp)
  movl   $0xffffffff,-0x90(%rbp)
  jmp    L1
L19:
  movl   $0xffffffff,-0x8c(%rbp)
  jmp    L49
L58:
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x88(%rbp),%xmm1
  movsd  -0xa8(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x90(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x70(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x84(%rbp),%xmm1
  movsd  -0xb8(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x8c(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x68(%rbp)
  movsd  -0x70(%rbp),%xmm0
  movsd  D1(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  movsd  -0x68(%rbp),%xmm0
  movsd  D1(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x58(%rbp)
  mov    -0x88(%rbp),%edx
  mov    -0x90(%rbp),%eax
  add    %edx,%eax
  imul   $0xd5fff,%eax,%eax
  mov    -0x84(%rbp),%ecx
  mov    -0x8c(%rbp),%edx
  add    %ecx,%edx
  add    %edx,%eax
  mov    %eax,-0x80(%rbp)
  mov    -0x80(%rbp),%eax
  mov    %eax,%edi
  call   <noise1u@plt>
  movapd %xmm0,%xmm1
  addsd  %xmm0,%xmm1
  movsd  D19(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x50(%rbp)
  mov    -0x80(%rbp),%eax
  add    $0x181cd,%eax
  mov    %eax,%edi
  call   <noise1u@plt>
  movsd  D1(%rip),%xmm1
  mulsd  %xmm0,%xmm1
  movsd  D19(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x48(%rbp)
  mov    -0x48(%rbp),%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x40(%rbp)
  mov    -0x50(%rbp),%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  movsd  -0x40(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x50(%rbp),%rax
  movq   %rax,%xmm0
  call   <sin@plt>
  movsd  -0x40(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  mov    -0x48(%rbp),%rax
  movq   %rax,%xmm0
  call   <sin@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x28(%rbp)
  movsd  -0x60(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x38(%rbp),%xmm1
  movsd  -0x78(%rbp),%xmm0
  mulsd  -0x30(%rbp),%xmm0
  addsd  %xmm0,%xmm1
  movsd  -0x58(%rbp),%xmm0
  mulsd  -0x28(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x60(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  %xmm0,%xmm1
  movsd  -0x78(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  movsd  -0x58(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x20(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  %xmm0,%xmm1
  movsd  -0x18(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  cvtss2sd %xmm0,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  pxor   %xmm1,%xmm1
  cvtss2sd -0xc0(%rbp),%xmm1
  movsd  -0x10(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x8(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  %xmm0,%xmm1
  movsd  -0x20(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movd   %xmm0,%eax
  movd   %eax,%xmm0
  subss  -0xbc(%rbp),%xmm0
  movss  %xmm0,-0x7c(%rbp)
  movss  -0x94(%rbp),%xmm0
  comiss -0x7c(%rbp),%xmm0
  jbe    L27
  movss  -0x7c(%rbp),%xmm0
  movss  %xmm0,-0x94(%rbp)
L27:
  addl   $0x1,-0x8c(%rbp)
L49:
  cmpl   $0x1,-0x8c(%rbp)
  jle    L58
  addl   $0x1,-0x90(%rbp)
L1:
  cmpl   $0x1,-0x90(%rbp)
  jle    L19
  movss  -0x94(%rbp),%xmm0
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D43
datatype: f32
name: disassemble_data
arguments: data_label: D1
datatype: f64
name: disassemble_data
arguments: data_label: D19
datatype: byte[8]

tool: D43: 999

tool: D1: 0.5

tool: {"D19": [0x00,0x00,0x00,0x60,0xfb,0x21,0x09,0x40]}

assistant: ```c
float TorusNoise(double x, double y, double z, float thick, float radius) {
  int i = (((x) > 0) ? ((int)x) : (((int)x) - 1));
  int k = (((z) > 0) ? ((int)z) : (((int)z) - 1));
  double dy = y;
  float minval = 999;
  int ox, oz;
  for (ox = -1; ox <= 1; ox++) {
    for (oz = -1; oz <= 1; oz++) {
      double fx = x - i - ox;
      double fz = z - k - oz;
      double dx = fx - 0.5f;
      double dz = fz - 0.5f;
      int id = (i + ox) * 876543 + (k + oz);
      double ang = noise1u(id) * 2 * 3.14159265f;
      double tilt = noise1u(id + 98765) * 0.5 * 3.14159265f;
      double ti = cos(tilt);
      double rx = cos(ang) * ti;
      double ry = sin(ang) * ti;
      double rz = sin(tilt);
      double h = dx * rx + dy * ry + dz * rz;
      double l2 = dx * dx + dy * dy + dz * dz;
      double d = sqrt(l2 - h * h);
      double a = d - radius;
      float val = sqrt(a * a + h * h) - thick;
      if (val < minval)
        minval = val;
    }
  }
  return minval;
}
```