user: Please show me the C implementation that matches the assembly code listed below:

```asm
<rl_to_rls>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  movsd  %xmm0,-0x48(%rbp)
  movsd  %xmm1,-0x50(%rbp)
  movsd  %xmm2,-0x58(%rbp)
  movsd  %xmm3,-0x60(%rbp)
  movsd  -0x58(%rbp),%xmm1
  movsd  D37(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <sin@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x30(%rbp)
  movsd  -0x58(%rbp),%xmm1
  movsd  D37(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x28(%rbp)
  movsd  -0x60(%rbp),%xmm1
  movsd  D37(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x50(%rbp),%xmm0
  comisd D99(%rip),%xmm0
  jbe    L9
  movsd  -0x50(%rbp),%xmm0
  movsd  D14(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x50(%rbp)
L9:
  movsd  -0x50(%rbp),%xmm1
  movsd  D37(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x48(%rbp),%xmm1
  movsd  D37(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x18(%rbp),%xmm0
  subsd  -0x20(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <sin@plt>
  movq   %xmm0,%rax
  movq   D30(%rip),%xmm0
  movq   %rax,%xmm4
  xorpd  %xmm0,%xmm4
  movsd  %xmm4,-0x68(%rbp)
  mov    -0x10(%rbp),%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  mulsd  -0x68(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x30(%rbp),%xmm0
  movq   D30(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,-0x68(%rbp)
  mov    -0x10(%rbp),%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  movapd %xmm0,%xmm6
  mulsd  -0x68(%rbp),%xmm6
  movsd  %xmm6,-0x68(%rbp)
  movsd  -0x18(%rbp),%xmm0
  subsd  -0x20(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <cos@plt>
  mulsd  -0x68(%rbp),%xmm0
  movsd  %xmm0,-0x68(%rbp)
  mov    -0x10(%rbp),%rax
  movq   %rax,%xmm0
  call   <sin@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm2
  mulsd  -0x28(%rbp),%xmm2
  movapd %xmm2,%xmm0
  addsd  -0x68(%rbp),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movsd  -0x38(%rbp),%xmm0
  movq   D82(%rip),%xmm1
  andpd  %xmm0,%xmm1
  movsd  D28(%rip),%xmm0
  comisd %xmm1,%xmm0
  jbe    L16
  movsd  D28(%rip),%xmm0
  movsd  %xmm0,-0x38(%rbp)
L16:
  movsd  -0x38(%rbp),%xmm0
  mov    -0x8(%rbp),%rax
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <atan2@plt>
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  D9(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D37
data_type: byte[8]
name: retrieve_data
arguments: data_label: D99
data_type: f64[2]
name: retrieve_data
arguments: data_label: D14
data_type: f64
name: retrieve_data
arguments: data_label: D30
data_type: byte[8]
name: retrieve_data
arguments: data_label: D82
data_type: qword
name: retrieve_data
arguments: data_label: D28
data_type: byte[8]
name: retrieve_data
arguments: data_label: D9
data_type: byte[8]

tool: {"D37": [0x39,0x9d,0x52,0xa2,0x46,0xdf,0x91,0x3f]}

tool: {"D99": [180.0,360.0]}

tool: D14: 360

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

tool: D82: 9223372036854775807

tool: {"D28": [0x23,0x42,0x92,0x0c,0xa1,0x9c,0xc7,0x3b]}

tool: {"D9": [0xf8,0xc1,0x63,0x1a,0xdc,0xa5,0x4c,0x40]}

assistant: ```c
double rl_to_rls(double phi, double rla, double polphi, double pollam) {
  double zsinpol, zcospol, zlampol;
  double zphi, zrla, zarg1, zarg2;
  zsinpol = sin((3.14159265358979323846 / 180.) * polphi);
  zcospol = cos((3.14159265358979323846 / 180.) * polphi);
  zlampol = (3.14159265358979323846 / 180.) * pollam;
  if (rla > 180.0)
    rla -= 360.0;
  zrla = (3.14159265358979323846 / 180.) * rla;
  zphi = (3.14159265358979323846 / 180.) * phi;
  zarg1 = -sin(zrla - zlampol) * cos(zphi);
  zarg2 = -zsinpol * cos(zphi) * cos(zrla - zlampol) + zcospol * sin(zphi);
  if (fabs(zarg2) < 1.0e-20)
    zarg2 = 1.0e-20;
  return ((180. / 3.14159265358979323846) * atan2(zarg1, zarg2));
}
```