user: Translate the below assembly code into C programming language:

```asm
<lmattoang>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x38,%rsp
  movsd  0x28(%rdi),%xmm1
  movapd %xmm1,%xmm0
  xorpd  D51(%rip),%xmm0
  movsd  %xmm1,0x10(%rsp)
  movsd  %xmm0,0x8(%rsp)
  call   <fabs@plt>
  movsd  0x8(%rsp),%xmm0
  cmp    $0x1,%eax
  jle    L42
  movsd  0x10(%rsp),%xmm1
  pxor   %xmm4,%xmm4
  xor    %eax,%eax
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm4
  seta   %al
  xor    %edx,%edx
  comisd %xmm4,%xmm1
  seta   %dl
  sub    %edx,%eax
  cvtsi2sd %eax,%xmm0
L42:
  call   <asin@plt>
  movsd  %xmm0,0x8(%rbx)
  call   <cos@plt>
  call   <fabs@plt>
  test   %eax,%eax
  jle    L27
  movsd  0x8(%rbx),%xmm0
  call   <cos@plt>
  movapd %xmm0,%xmm1
  movsd  0x18(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,0x8(%rsp)
  call   <fabs@plt>
  movsd  0x8(%rsp),%xmm0
  cmp    $0x1,%eax
  jle    L0
  pxor   %xmm6,%xmm6
  xor    %eax,%eax
  comisd %xmm6,%xmm0
  seta   %al
  xor    %edx,%edx
  comisd %xmm0,%xmm6
  pxor   %xmm0,%xmm0
  seta   %dl
  sub    %edx,%eax
  cvtsi2sd %eax,%xmm0
L0:
  call   <asin@plt>
  movsd  %xmm0,(%rbx)
  movsd  %xmm0,0x10(%rsp)
  call   <cos@plt>
  movsd  %xmm0,0x8(%rsp)
  movsd  0x8(%rbx),%xmm0
  call   <cos@plt>
  movsd  0x8(%rsp),%xmm1
  pxor   %xmm6,%xmm6
  movapd %xmm0,%xmm3
  mulsd  %xmm0,%xmm1
  mulsd  0x20(%rbp),%xmm1
  comisd %xmm1,%xmm6
  ja     L3
L54:
  movsd  0x10(%rbp),%xmm0
  divsd  %xmm3,%xmm0
  movsd  %xmm0,0x8(%rsp)
  call   <fabs@plt>
  movsd  0x8(%rsp),%xmm0
  cmp    $0x1,%eax
  jle    L17
  pxor   %xmm3,%xmm3
  xor    %eax,%eax
  comisd %xmm3,%xmm0
  seta   %al
  xor    %edx,%edx
  comisd %xmm0,%xmm3
  pxor   %xmm0,%xmm0
  seta   %dl
  sub    %edx,%eax
  cvtsi2sd %eax,%xmm0
L17:
  call   <asin@plt>
  lea    0x28(%rsp),%r12
  lea    0x20(%rsp),%r13
  movsd  %xmm0,0x10(%rbx)
  movsd  %xmm0,0x18(%rsp)
  call   <cos@plt>
  mov    %r13,%rsi
  mov    %r12,%rdi
  movsd  %xmm0,0x10(%rsp)
  movsd  0x8(%rbx),%xmm0
  call   <sincos@plt>
  movsd  0x10(%rsp),%xmm1
  movsd  0x40(%rbp),%xmm0
  pxor   %xmm4,%xmm4
  mulsd  0x20(%rsp),%xmm1
  movsd  0x28(%rsp),%xmm7
  movsd  0x18(%rsp),%xmm2
  movsd  %xmm7,0x8(%rsp)
  mulsd  %xmm1,%xmm0
  comisd %xmm0,%xmm4
  ja     L31
L118:
  movapd %xmm2,%xmm0
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <sincos@plt>
  movsd  (%rbx),%xmm0
  mov    %r13,%rsi
  mov    %r12,%rdi
  movsd  0x20(%rsp),%xmm1
  movsd  0x28(%rsp),%xmm5
  movsd  %xmm1,0x18(%rsp)
  movsd  %xmm5,0x10(%rsp)
  call   <sincos@plt>
  movsd  0x8(%rsp),%xmm0
  mulsd  0x10(%rsp),%xmm0
  mulsd  0x28(%rsp),%xmm0
  movsd  0x18(%rsp),%xmm1
  mulsd  0x20(%rsp),%xmm1
  addsd  %xmm1,%xmm0
  subsd  0x0(%rbp),%xmm0
  call   <fabs@plt>
  test   %eax,%eax
  jle    L24
L122:
  movsd  D34(%rip),%xmm0
  movsd  (%rbx),%xmm1
  addsd  %xmm0,%xmm1
  movsd  %xmm1,(%rbx)
  movapd %xmm0,%xmm1
  addsd  0x10(%rbx),%xmm0
  subsd  0x8(%rbx),%xmm1
  movsd  %xmm0,0x10(%rbx)
  movsd  %xmm1,0x8(%rbx)
L61:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nop
L3:
  movsd  D34(%rip),%xmm0
  movsd  0x10(%rsp),%xmm2
  subsd  %xmm2,%xmm0
  movsd  %xmm0,(%rbx)
  jmp    L54
  nopl   0x0(%rax,%rax,1)
L31:
  movsd  D34(%rip),%xmm0
  subsd  %xmm2,%xmm0
  movapd %xmm0,%xmm2
  movsd  %xmm0,0x10(%rbx)
  jmp    L118
  nopw   0x0(%rax,%rax,1)
L27:
  movq   $0x0,0x10(%rbx)
  movsd  0x0(%rbp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  call   <fabs@plt>
  movsd  0x8(%rsp),%xmm0
  cmp    $0x1,%eax
  jle    L95
  pxor   %xmm7,%xmm7
  xor    %eax,%eax
  comisd %xmm7,%xmm0
  seta   %al
  xor    %edx,%edx
  comisd %xmm0,%xmm7
  pxor   %xmm0,%xmm0
  seta   %dl
  sub    %edx,%eax
  cvtsi2sd %eax,%xmm0
L95:
  call   <acos@plt>
  movsd  %xmm0,(%rbx)
  call   <sin@plt>
  xorpd  D51(%rip),%xmm0
  subsd  0x8(%rbp),%xmm0
  call   <fabs@plt>
  test   %eax,%eax
  jle    L61
  movsd  (%rbx),%xmm0
  xorpd  D51(%rip),%xmm0
  movsd  %xmm0,(%rbx)
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  cs nopw 0x0(%rax,%rax,1)
L24:
  movsd  0x8(%rbx),%xmm0
  call   <sin@plt>
  mov    %r13,%rsi
  mov    %r12,%rdi
  movsd  %xmm0,0x8(%rsp)
  movsd  0x10(%rbx),%xmm0
  call   <sincos@plt>
  movsd  (%rbx),%xmm0
  mov    %r13,%rsi
  mov    %r12,%rdi
  movsd  0x20(%rsp),%xmm1
  movsd  0x28(%rsp),%xmm4
  movsd  %xmm1,0x18(%rsp)
  movsd  %xmm4,0x10(%rsp)
  call   <sincos@plt>
  movsd  0x10(%rsp),%xmm4
  mulsd  0x8(%rsp),%xmm4
  movsd  0x20(%rsp),%xmm0
  movsd  0x18(%rsp),%xmm1
  mulsd  0x28(%rsp),%xmm1
  mulsd  %xmm4,%xmm0
  subsd  %xmm1,%xmm0
  subsd  0x8(%rbp),%xmm0
  call   <fabs@plt>
  test   %eax,%eax
  jg     L122
  jmp    L61
```

tool_calls: name: unpack_data
arguments: label: D51
type_guessed: byte[16]
name: unpack_data
arguments: label: D34
type_guessed: f64

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

tool: D34: 3.141592653589793

assistant: ```c
void lmattoang(double *r, double *a) {
  double temp;
  temp = -r[5];
  if (fabs(temp) > 1)
    temp = (temp > 0) - (temp < 0);
  a[1] = asin(temp);
  if (fabs(cos(a[1])) > 1e-30) {
    temp = r[3] / cos(a[1]);
    if (fabs(temp) > 1)
      temp = (temp > 0) - (temp < 0);
    a[0] = asin(temp);
    if (cos(a[0]) * cos(a[1]) * r[4] < 0)
      a[0] = 3.14159265358979323846264338327950 - a[0];
    temp = r[2] / cos(a[1]);
    if (fabs(temp) > 1)
      temp = (temp > 0) - (temp < 0);
    a[2] = asin(temp);
    if (cos(a[2]) * cos(a[1]) * r[8] < 0)
      a[2] = 3.14159265358979323846264338327950 - a[2];
    if (fabs(sin(a[1]) * sin(a[2]) * sin(a[0]) + cos(a[2]) * cos(a[0]) - r[0]) > 1e-30 || fabs(sin(a[1]) * sin(a[2]) * cos(a[0]) - cos(a[2]) * sin(a[0]) - r[1]) > 1e-30) {
      a[0] = 3.14159265358979323846264338327950 + a[0];
      a[1] = 3.14159265358979323846264338327950 - a[1];
      a[2] = 3.14159265358979323846264338327950 + a[2];
    }
  } else {
    a[2] = 0;
    temp = r[0];
    if (fabs(temp) > 1)
      temp = (temp > 0) - (temp < 0);
    a[0] = acos(temp);
    if (fabs(-sin(a[0]) - r[1]) > 1e-30)
      a[0] *= -1;
  }
}
```