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

```asm
<doughnut>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1d8,%rsp
  mov    %edi,0x88(%rsp)
  mov    %esi,0xa4(%rsp)
  mov    %edx,0x8c(%rsp)
  movsd  %xmm0,0x78(%rsp)
  movsd  %xmm1,0x80(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x1c8(%rsp)
  xor    %eax,%eax
  test   %esi,%esi
  jle    L39
  pxor   %xmm4,%xmm4
  cvtsi2sd %esi,%xmm4
  movsd  %xmm4,0xa8(%rsp)
  test   %edi,%edi
  jle    L39
  pxor   %xmm4,%xmm4
  pxor   %xmm0,%xmm0
  lea    0xc0(%rsp),%rsi
  cvtsi2sd %edi,%xmm4
  lea    0xc8(%rsp),%rdi
  mov    %rsi,0x28(%rsp)
  mov    %rdi,0x30(%rsp)
  lea    0x150(%rsp),%r15
  lea    0xd0(%rsp),%r14
  lea    0x170(%rsp),%r13
  lea    0xf0(%rsp),%r12
  lea    0x190(%rsp),%rbp
  lea    0x110(%rsp),%rbx
  movsd  %xmm4,0x90(%rsp)
  divsd  %xmm4,%xmm0
  call   <sincos@plt>
  lea    0x1b0(%rsp),%rax
  movsd  0xc0(%rsp),%xmm4
  movl   $0x0,0xa0(%rsp)
  mov    %rax,0x8(%rsp)
  lea    0x130(%rsp),%rax
  movsd  %xmm4,0xb0(%rsp)
  movsd  0xc8(%rsp),%xmm4
  movq   $0x0,0x98(%rsp)
  mov    %rax,(%rsp)
  movsd  %xmm4,0xb8(%rsp)
  nopl   0x0(%rax)
L27:
  pxor   %xmm0,%xmm0
  mov    0x28(%rsp),%rsi
  addl   $0x1,0xa0(%rsp)
  mov    0xa0(%rsp),%eax
  mov    0x30(%rsp),%rdi
  movsd  0x98(%rsp),%xmm1
  movsd  0xa8(%rsp),%xmm2
  cvtsi2sd %eax,%xmm0
  addsd  %xmm1,%xmm1
  mulsd  D29(%rip),%xmm1
  movsd  %xmm0,0x98(%rsp)
  addsd  %xmm0,%xmm0
  mulsd  D29(%rip),%xmm0
  divsd  %xmm2,%xmm1
  divsd  %xmm2,%xmm0
  movsd  %xmm1,0x18(%rsp)
  call   <sincos@plt>
  movsd  0x18(%rsp),%xmm1
  mov    0x28(%rsp),%rsi
  movsd  0xc0(%rsp),%xmm4
  mov    0x30(%rsp),%rdi
  movsd  0xc8(%rsp),%xmm2
  movapd %xmm1,%xmm0
  movsd  %xmm4,0x38(%rsp)
  movsd  %xmm2,0x10(%rsp)
  call   <sincos@plt>
  movsd  0x10(%rsp),%xmm2
  xor    %r8d,%r8d
  movsd  0xc0(%rsp),%xmm3
  movsd  0xc8(%rsp),%xmm0
  xorpd  D21(%rip),%xmm0
  xorpd  D21(%rip),%xmm2
  movapd %xmm3,%xmm4
  movsd  %xmm3,0x70(%rsp)
  movsd  0xb0(%rsp),%xmm3
  unpcklpd %xmm0,%xmm4
  movsd  %xmm0,0x40(%rsp)
  movaps %xmm4,0x60(%rsp)
  movapd %xmm2,%xmm4
  movsd  %xmm2,0x48(%rsp)
  movsd  0x38(%rsp),%xmm2
  unpcklpd %xmm4,%xmm2
  movsd  0xb8(%rsp),%xmm4
  movaps %xmm2,0x50(%rsp)
  nopl   (%rax)
L48:
  add    $0x1,%r8d
  pxor   %xmm0,%xmm0
  mov    0x28(%rsp),%rsi
  mov    0x30(%rsp),%rdi
  cvtsi2sd %r8d,%xmm0
  mov    %r8d,0x24(%rsp)
  movsd  %xmm3,0x18(%rsp)
  movsd  %xmm4,0x10(%rsp)
  addsd  %xmm0,%xmm0
  mulsd  D29(%rip),%xmm0
  divsd  0x90(%rsp),%xmm0
  call   <sincos@plt>
  movsd  0x78(%rsp),%xmm7
  movsd  0x18(%rsp),%xmm1
  movsd  0x70(%rsp),%xmm8
  mov    %r15,%rcx
  mov    %r15,%rdx
  mov    %r14,%rsi
  movapd %xmm7,%xmm0
  movsd  0x40(%rsp),%xmm9
  mov    %r14,%rdi
  movsd  0x80(%rsp),%xmm11
  mulsd  %xmm1,%xmm0
  movapd %xmm8,%xmm5
  movsd  0xc0(%rsp),%xmm3
  movsd  0x10(%rsp),%xmm2
  movapd %xmm9,%xmm6
  movsd  0x48(%rsp),%xmm10
  movsd  0xc8(%rsp),%xmm4
  movsd  %xmm3,0x18(%rsp)
  movsd  %xmm4,0x1a0(%rsp)
  movsd  %xmm2,0x160(%rsp)
  movsd  %xmm2,0x180(%rsp)
  addsd  %xmm11,%xmm0
  mulsd  %xmm0,%xmm6
  mulsd  %xmm0,%xmm5
  unpcklpd %xmm0,%xmm0
  mulpd  0x50(%rsp),%xmm0
  unpcklpd %xmm6,%xmm5
  movsd  0x38(%rsp),%xmm6
  movaps %xmm0,0xf0(%rsp)
  movapd %xmm7,%xmm0
  mulsd  %xmm3,%xmm0
  movaps %xmm5,0xd0(%rsp)
  movapd %xmm7,%xmm5
  mulsd  %xmm2,%xmm5
  mulsd  %xmm4,%xmm7
  addsd  %xmm11,%xmm0
  movsd  %xmm5,0xe0(%rsp)
  movsd  %xmm5,0x100(%rsp)
  movapd %xmm6,%xmm5
  movsd  %xmm7,0x120(%rsp)
  mulsd  %xmm0,%xmm5
  movsd  %xmm7,0x140(%rsp)
  movsd  %xmm5,0x110(%rsp)
  movapd %xmm10,%xmm5
  mulsd  %xmm0,%xmm5
  unpcklpd %xmm0,%xmm0
  mulpd  0x60(%rsp),%xmm0
  movsd  %xmm5,0x118(%rsp)
  movapd %xmm9,%xmm5
  movaps %xmm0,0x130(%rsp)
  mulsd  %xmm1,%xmm5
  movapd %xmm8,%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  %xmm3,%xmm8
  mulsd  %xmm3,%xmm9
  unpcklpd %xmm5,%xmm0
  movaps %xmm0,0x150(%rsp)
  movapd %xmm6,%xmm0
  movsd  %xmm8,0x1b0(%rsp)
  mulsd  %xmm1,%xmm0
  movsd  %xmm9,0x1b8(%rsp)
  mulsd  %xmm10,%xmm1
  mulsd  %xmm3,%xmm6
  mulsd  %xmm3,%xmm10
  movsd  %xmm0,0x170(%rsp)
  movsd  %xmm1,0x178(%rsp)
  movsd  %xmm6,0x190(%rsp)
  movsd  %xmm10,0x198(%rsp)
  movsd  %xmm4,0x1c0(%rsp)
  movsd  %xmm4,0x10(%rsp)
  call   <m_xformpt@plt>
  mov    %r13,%rcx
  mov    %r13,%rdx
  mov    %r12,%rsi
  mov    %r12,%rdi
  call   <m_xformpt@plt>
  mov    %rbp,%rcx
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    %rbx,%rdi
  call   <m_xformpt@plt>
  mov    0x8(%rsp),%rcx
  mov    (%rsp),%rsi
  mov    %rcx,%rdx
  mov    %rsi,%rdi
  call   <m_xformpt@plt>
  mov    0x8c(%rsp),%edi
  call   <glBegin@plt>
  mov    0x8(%rsp),%rdi
  call   <glNormal3dv@plt>
  mov    (%rsp),%rdi
  call   <glVertex3dv@plt>
  mov    %rbp,%rdi
  call   <glNormal3dv@plt>
  mov    %rbx,%rdi
  call   <glVertex3dv@plt>
  mov    %r13,%rdi
  call   <glNormal3dv@plt>
  mov    %r12,%rdi
  call   <glVertex3dv@plt>
  mov    %r15,%rdi
  call   <glNormal3dv@plt>
  mov    %r14,%rdi
  call   <glVertex3dv@plt>
  xor    %eax,%eax
  call   <glEnd@plt>
  mov    0x24(%rsp),%r8d
  cmp    0x88(%rsp),%r8d
  movsd  0x10(%rsp),%xmm4
  movsd  0x18(%rsp),%xmm3
  jne    L48
  mov    0xa4(%rsp),%edx
  cmp    %edx,0xa0(%rsp)
  jne    L27
L39:
  mov    0x1c8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  add    $0x1d8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L7:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D29
type: f64
name: parse_data
arguments: data_tag: D21
type: byte[16]

tool: D29: 3.1415926535897

tool: {"D21": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

assistant: ```c
void doughnut(GLdouble r, GLdouble R, GLint nsides, GLint rings, GLenum type) {
  int i, j;
  GLdouble theta, phi, theta1, phi1;
  GLdouble p0[03], p1[3], p2[3], p3[3];
  GLdouble n0[3], n1[3], n2[3], n3[3];
  for (i = 0; i < rings; i++) {
    theta = (GLdouble)i * 2.0 * 3.1415926535897 / rings;
    theta1 = (GLdouble)(i + 1) * 2.0 * 3.1415926535897 / rings;
    for (j = 0; j < nsides; j++) {
      phi = (GLdouble)j * 2.0 * 3.1415926535897 / nsides;
      phi1 = (GLdouble)(j + 1) * 2.0 * 3.1415926535897 / nsides;
      p0[0] = cos(theta) * (R + r * cos(phi));
      p0[1] = -sin(theta) * (R + r * cos(phi));
      p0[2] = r * sin(phi);
      p1[0] = cos(theta1) * (R + r * cos(phi));
      p1[1] = -sin(theta1) * (R + r * cos(phi));
      p1[2] = r * sin(phi);
      p2[0] = cos(theta1) * (R + r * cos(phi1));
      p2[1] = -sin(theta1) * (R + r * cos(phi1));
      p2[2] = r * sin(phi1);
      p3[0] = cos(theta) * (R + r * cos(phi1));
      p3[1] = -sin(theta) * (R + r * cos(phi1));
      p3[2] = r * sin(phi1);
      n0[0] = cos(theta) * (cos(phi));
      n0[1] = -sin(theta) * (cos(phi));
      n0[2] = sin(phi);
      n1[0] = cos(theta1) * (cos(phi));
      n1[1] = -sin(theta1) * (cos(phi));
      n1[2] = sin(phi);
      n2[0] = cos(theta1) * (cos(phi1));
      n2[1] = -sin(theta1) * (cos(phi1));
      n2[2] = sin(phi1);
      n3[0] = cos(theta) * (cos(phi1));
      n3[1] = -sin(theta) * (cos(phi1));
      n3[2] = sin(phi1);
      m_xformpt(p0, p0, n0, n0);
      m_xformpt(p1, p1, n1, n1);
      m_xformpt(p2, p2, n2, n2);
      m_xformpt(p3, p3, n3, n3);
      glBegin(type);
      glNormal3dv(n3);
      glVertex3dv(p3);
      glNormal3dv(n2);
      glVertex3dv(p2);
      glNormal3dv(n1);
      glVertex3dv(p1);
      glNormal3dv(n0);
      glVertex3dv(p0);
      glEnd();
    }
  }
}
```