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

```asm
<helval>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    %ecx,-0x28(%rbp)
  mov    %r8,-0x30(%rbp)
  mov    -0x18(%rbp),%rax
  movsd  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  jbe    L20
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mov    -0x18(%rbp),%rax
  movsd  (%rax),%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <atan@plt>
  movq   %xmm0,%rax
  movsd  D69(%rip),%xmm0
  movq   %rax,%xmm1
  divsd  %xmm0,%xmm1
  movsd  D48(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  jmp    L0
L20:
  mov    -0x18(%rbp),%rax
  movsd  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L33
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mov    -0x18(%rbp),%rax
  movsd  (%rax),%xmm1
  divsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <atan@plt>
  movq   %xmm0,%rax
  movsd  D69(%rip),%xmm1
  movq   %rax,%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  jmp    L0
L33:
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jb     L38
  movsd  D63(%rip),%xmm0
  jmp    L44
L38:
  movsd  D71(%rip),%xmm0
L44:
  movsd  %xmm0,-0x8(%rbp)
L0:
  mov    -0x18(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  movsd  -0x8(%rbp),%xmm2
  movsd  D78(%rip),%xmm1
  mulsd  %xmm1,%xmm2
  movapd %xmm0,%xmm1
  subsd  %xmm2,%xmm1
  movsd  D78(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x20(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x18(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x18(%rbp),%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm2
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rax
  movsd  D75(%rip),%xmm0
  movq   %rax,%xmm1
  subsd  %xmm0,%xmm1
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  movsd  D78(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x20(%rbp),%rax
  lea    0x10(%rax),%rdx
  mov    -0x18(%rbp),%rax
  movsd  0x10(%rax),%xmm0
  movsd  %xmm0,(%rdx)
  nop
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D69
datatype: byte[8]
name: unpack_data
arguments: data_tag: D48
datatype: f64
name: unpack_data
arguments: data_tag: D63
datatype: f64
name: unpack_data
arguments: data_tag: D71
datatype: f32[2]
name: unpack_data
arguments: data_tag: D78
datatype: f64
name: unpack_data
arguments: data_tag: D75
datatype: f64

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

tool: D48: 0.5

tool: D63: 0.25

tool: {"D71": [0.0,-1.625]}

tool: D78: 10

tool: D75: 1

assistant: ```c
void helval(double *p, double *x, int m, int n, void *data) {
  double theta;
  if (p[0] < 0.0)
    theta = atan(p[1] / p[0]) / (2.0 * 3.14159265358979323846) + 0.5;
  else if (0.0 < p[0])
    theta = atan(p[1] / p[0]) / (2.0 * 3.14159265358979323846);
  else
    theta = (p[1] >= 0) ? 0.25 : -0.25;
  x[0] = 10.0 * (p[2] - 10.0 * theta);
  x[1] = 10.0 * (sqrt(p[0] * p[0] + p[1] * p[1]) - 1.0);
  x[2] = p[2];
}
```