user: 请将以下的汇编代码转换成C语言代码:

```asm
<halfsphere>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  movss  %xmm0,-0x24(%rbp)
  mov    %edi,-0x28(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L1
L22:
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x20(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x28(%rbp),%xmm1
  divss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  movsd  D59(%rip),%xmm2
  movapd %xmm0,%xmm1
  subsd  %xmm2,%xmm1
  movsd  D71(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  pxor   %xmm5,%xmm5
  cvtsd2ss %xmm0,%xmm5
  movd   %xmm5,%eax
  movd   %eax,%xmm0
  call   <sin@plt>
  movss  -0x24(%rbp),%xmm1
  mulss  %xmm1,%xmm0
  movss  %xmm0,-0x18(%rbp)
  mov    -0x20(%rbp),%eax
  add    $0x1,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x28(%rbp),%xmm1
  divss  %xmm1,%xmm0
  cvtss2sd %xmm0,%xmm0
  movsd  D59(%rip),%xmm2
  movapd %xmm0,%xmm1
  subsd  %xmm2,%xmm1
  movsd  D71(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  pxor   %xmm6,%xmm6
  cvtsd2ss %xmm0,%xmm6
  movd   %xmm6,%eax
  movd   %eax,%xmm0
  call   <sin@plt>
  movss  -0x24(%rbp),%xmm1
  mulss  %xmm1,%xmm0
  movss  %xmm0,-0x14(%rbp)
  movss  -0x24(%rbp),%xmm0
  movaps %xmm0,%xmm1
  mulss  %xmm0,%xmm1
  movss  -0x18(%rbp),%xmm0
  mulss  %xmm0,%xmm0
  subss  %xmm0,%xmm1
  movd   %xmm1,%eax
  movd   %eax,%xmm0
  call   <sqrt@plt>
  movd   %xmm0,%eax
  mov    %eax,-0x10(%rbp)
  movss  -0x24(%rbp),%xmm0
  movaps %xmm0,%xmm1
  mulss  %xmm0,%xmm1
  movss  -0x14(%rbp),%xmm0
  mulss  %xmm0,%xmm0
  subss  %xmm0,%xmm1
  movd   %xmm1,%eax
  movd   %eax,%xmm0
  call   <sqrt@plt>
  movd   %xmm0,%eax
  mov    %eax,-0xc(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L11
L32:
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x1c(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movsd  D71(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x28(%rbp),%xmm1
  pxor   %xmm2,%xmm2
  cvtss2sd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  D69(%rip),%xmm0
  addsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x8(%rbp)
  mov    -0x1c(%rbp),%eax
  add    $0x1,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movsd  D71(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x28(%rbp),%xmm1
  pxor   %xmm2,%xmm2
  cvtss2sd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  D69(%rip),%xmm0
  addsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  movd   %eax,%xmm0
  call   <sin@plt>
  movd   %xmm0,%eax
  movd   %eax,%xmm4
  mulss  -0xc(%rbp),%xmm4
  movss  %xmm4,-0x2c(%rbp)
  mov    -0x8(%rbp),%eax
  movd   %eax,%xmm0
  call   <cos@plt>
  movd   %xmm0,%eax
  movd   %eax,%xmm5
  mulss  -0xc(%rbp),%xmm5
  movss  %xmm5,-0x30(%rbp)
  mov    -0x4(%rbp),%eax
  movd   %eax,%xmm0
  call   <sin@plt>
  movd   %xmm0,%eax
  movd   %eax,%xmm6
  mulss  -0xc(%rbp),%xmm6
  movss  %xmm6,-0x34(%rbp)
  mov    -0x4(%rbp),%eax
  movd   %eax,%xmm0
  call   <cos@plt>
  movd   %xmm0,%eax
  movd   %eax,%xmm3
  mulss  -0xc(%rbp),%xmm3
  movss  %xmm3,-0x38(%rbp)
  mov    -0x4(%rbp),%eax
  movd   %eax,%xmm0
  call   <sin@plt>
  movd   %xmm0,%eax
  movd   %eax,%xmm2
  mulss  -0x10(%rbp),%xmm2
  movss  %xmm2,-0x3c(%rbp)
  mov    -0x4(%rbp),%eax
  movd   %eax,%xmm0
  call   <cos@plt>
  movd   %xmm0,%eax
  movd   %eax,%xmm1
  mulss  -0x10(%rbp),%xmm1
  movss  %xmm1,-0x40(%rbp)
  mov    -0x8(%rbp),%eax
  movd   %eax,%xmm0
  call   <sin@plt>
  movd   %xmm0,%eax
  movd   %eax,%xmm0
  mulss  -0x10(%rbp),%xmm0
  movss  %xmm0,-0x44(%rbp)
  mov    -0x8(%rbp),%eax
  movd   %eax,%xmm0
  call   <cos@plt>
  movd   %xmm0,%eax
  movd   %eax,%xmm8
  mulss  -0x10(%rbp),%xmm8
  movd   %xmm8,%eax
  movss  -0x14(%rbp),%xmm3
  movss  -0x18(%rbp),%xmm2
  movss  -0x18(%rbp),%xmm1
  movss  -0x2c(%rbp),%xmm4
  lea    -0x8(%rsp),%rsp
  movss  %xmm4,(%rsp)
  movss  -0x14(%rbp),%xmm0
  lea    -0x8(%rsp),%rsp
  movss  %xmm0,(%rsp)
  movss  -0x30(%rbp),%xmm7
  lea    -0x8(%rsp),%rsp
  movss  %xmm7,(%rsp)
  movss  -0x34(%rbp),%xmm7
  lea    -0x8(%rsp),%rsp
  movss  %xmm7,(%rsp)
  movaps %xmm3,%xmm7
  movss  -0x38(%rbp),%xmm6
  movss  -0x3c(%rbp),%xmm5
  movaps %xmm2,%xmm4
  movss  -0x40(%rbp),%xmm3
  movss  -0x44(%rbp),%xmm2
  movd   %eax,%xmm0
  call   <quad@plt>
  add    $0x20,%rsp
  addl   $0x1,-0x1c(%rbp)
L11:
  mov    -0x1c(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L32
  addl   $0x1,-0x20(%rbp)
L1:
  mov    -0x20(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L22
  nop
  nop
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D59
type: f64
name: parse_data
arguments: label: D71
type: f64
name: parse_data
arguments: label: D69
type: byte[8]

tool: D59: 0.5

tool: D71: 3.141592653589793

tool: {"D69": [0x18,0x2d,0x44,0x54,0xfb,0x21,0xf9,0x3f]}

assistant: ```c
void halfsphere(float r, int detail) {
  for (int i = 0; i < detail; ++i) {
    float a = r * sin(3.14159265358979323846 * ((float)i / (float)detail - 0.5));
    float b = r * sin(3.14159265358979323846 * ((float)(i + 1) / (float)detail - 0.5));
    float ra = sqrt(r * r - a * a);
    float rb = sqrt(r * r - b * b);
    for (int j = 0; j < detail; ++j) {
      float p = 0.5 * 3.14159265358979323846 + 3.14159265358979323846 * (float)j / (float)detail;
      float q = 0.5 * 3.14159265358979323846 + 3.14159265358979323846 * (float)(j + 1) / (float)detail;
      quad(ra * cos(p), a, ra * sin(p), ra * cos(q), a, ra * sin(q), rb * cos(q), b, rb * sin(q), rb * cos(p), b, rb * sin(p));
    }
  }
}
```