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

```asm
<GetAngles>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x60,%rsp
  movsd  %xmm0,0x28(%rsp)
  movsd  %xmm1,0x30(%rsp)
  movsd  %xmm2,0x38(%rsp)
  movsd  %xmm3,0x8(%rsp)
  movsd  %xmm4,0x10(%rsp)
  movsd  %xmm5,0x18(%rsp)
  movq   %xmm6,%rbx
  movq   %xmm7,%rbp
  mov    %rdi,%r12
  mov    %rsi,%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  movapd %xmm0,%xmm7
  mulsd  %xmm0,%xmm7
  movapd %xmm7,%xmm0
  movapd %xmm1,%xmm6
  mulsd  %xmm1,%xmm6
  addsd  %xmm6,%xmm0
  movapd %xmm2,%xmm1
  mulsd  %xmm2,%xmm1
  addsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L34
  sqrtsd %xmm0,%xmm0
  movsd  %xmm0,0x20(%rsp)
L9:
  movsd  0x10(%rsp),%xmm7
  movapd %xmm7,%xmm1
  mulsd  %xmm7,%xmm1
  movsd  0x8(%rsp),%xmm6
  movapd %xmm6,%xmm0
  mulsd  %xmm6,%xmm0
  addsd  %xmm1,%xmm0
  movsd  0x18(%rsp),%xmm5
  movapd %xmm5,%xmm1
  mulsd  %xmm5,%xmm1
  addsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L57
  sqrtsd %xmm0,%xmm0
L112:
  movsd  0x28(%rsp),%xmm2
  movsd  0x20(%rsp),%xmm4
  divsd  %xmm4,%xmm2
  movsd  0x30(%rsp),%xmm1
  divsd  %xmm4,%xmm1
  movsd  0x38(%rsp),%xmm3
  divsd  %xmm4,%xmm3
  movq   D1(%rip),%xmm4
  movapd %xmm2,%xmm5
  xorpd  %xmm4,%xmm5
  movsd  %xmm5,0x40(%rsp)
  movapd %xmm1,%xmm5
  xorpd  %xmm4,%xmm5
  movsd  %xmm5,0x48(%rsp)
  xorpd  %xmm3,%xmm4
  movsd  %xmm4,0x50(%rsp)
  movq   %rbx,%xmm6
  ucomisd D12(%rip),%xmm6
  setp   %al
  mov    $0x1,%edx
  cmovne %edx,%eax
  test   %al,%al
  jne    L68
  movq   %rbp,%xmm6
  ucomisd D12(%rip),%xmm6
  setp   %al
  cmovne %edx,%eax
  test   %al,%al
  jne    L68
L66:
  mov    0x40(%rsp),%r14
  mov    0x48(%rsp),%rbp
  movq   %r14,%xmm0
  mulsd  %xmm0,%xmm0
  movq   %rbp,%xmm1
  mulsd  %xmm1,%xmm1
  addsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L11
  sqrtsd %xmm0,%xmm0
  movq   %xmm0,%rbx
L121:
  movq   %r14,%xmm1
  movq   %rbp,%xmm0
  call   <atan2@plt>
  addsd  D42(%rip),%xmm0
  movsd  %xmm0,0x0(%r13)
  pxor   %xmm0,%xmm0
  comisd 0x50(%rsp),%xmm0
  jae    L37
  movq   %rbx,%xmm0
  call   <acos@plt>
  xorpd  D1(%rip),%xmm0
L128:
  movsd  %xmm0,(%r12)
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L159
  add    $0x60,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L34:
  call   <sqrt@plt>
  movsd  %xmm0,0x20(%rsp)
  jmp    L9
L57:
  call   <sqrt@plt>
  jmp    L112
L68:
  movsd  0x8(%rsp),%xmm5
  divsd  %xmm0,%xmm5
  movsd  0x10(%rsp),%xmm6
  divsd  %xmm0,%xmm6
  movsd  0x18(%rsp),%xmm4
  divsd  %xmm0,%xmm4
  movapd %xmm1,%xmm7
  mulsd  %xmm4,%xmm7
  movapd %xmm3,%xmm0
  mulsd  %xmm6,%xmm0
  subsd  %xmm0,%xmm7
  movsd  %xmm7,0x8(%rsp)
  mulsd  %xmm5,%xmm3
  mulsd  %xmm2,%xmm4
  subsd  %xmm4,%xmm3
  movsd  %xmm3,0x10(%rsp)
  mulsd  %xmm6,%xmm2
  mulsd  %xmm5,%xmm1
  movapd %xmm2,%xmm6
  subsd  %xmm1,%xmm6
  movsd  %xmm6,0x18(%rsp)
  movapd %xmm7,%xmm0
  mulsd  %xmm7,%xmm0
  movapd %xmm3,%xmm1
  mulsd  %xmm3,%xmm1
  addsd  %xmm1,%xmm0
  movapd %xmm6,%xmm1
  mulsd  %xmm6,%xmm1
  addsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L72
  sqrtsd %xmm0,%xmm0
L105:
  movsd  0x8(%rsp),%xmm4
  divsd  %xmm0,%xmm4
  movsd  0x10(%rsp),%xmm5
  divsd  %xmm0,%xmm5
  movsd  0x18(%rsp),%xmm7
  divsd  %xmm0,%xmm7
  lea    0x50(%rsp),%rdx
  lea    0x48(%rsp),%rsi
  lea    0x40(%rsp),%rdi
  movq   %rbx,%xmm3
  movsd  %xmm7,0x18(%rsp)
  movapd %xmm7,%xmm2
  movsd  %xmm5,0x10(%rsp)
  movapd %xmm5,%xmm1
  movsd  %xmm4,0x8(%rsp)
  movapd %xmm4,%xmm0
  call   <Rodrigues@plt>
  movsd  0x50(%rsp),%xmm3
  movsd  0x48(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm5
  movapd %xmm5,%xmm1
  mulsd  %xmm3,%xmm1
  movsd  0x18(%rsp),%xmm7
  movapd %xmm7,%xmm6
  mulsd  %xmm2,%xmm6
  movapd %xmm6,%xmm0
  movapd %xmm1,%xmm6
  subsd  %xmm0,%xmm6
  movsd  %xmm6,0x10(%rsp)
  movsd  0x40(%rsp),%xmm1
  mulsd  %xmm1,%xmm7
  movsd  0x8(%rsp),%xmm4
  mulsd  %xmm4,%xmm3
  subsd  %xmm3,%xmm7
  movsd  %xmm7,0x8(%rsp)
  mulsd  %xmm4,%xmm2
  mulsd  %xmm5,%xmm1
  subsd  %xmm1,%xmm2
  movsd  %xmm2,0x18(%rsp)
  movapd %xmm6,%xmm0
  mulsd  %xmm6,%xmm0
  movapd %xmm7,%xmm1
  mulsd  %xmm7,%xmm1
  addsd  %xmm1,%xmm0
  movapd %xmm2,%xmm1
  mulsd  %xmm2,%xmm1
  addsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L95
  sqrtsd %xmm0,%xmm0
L52:
  movsd  0x10(%rsp),%xmm4
  divsd  %xmm0,%xmm4
  lea    0x50(%rsp),%rdx
  lea    0x48(%rsp),%rsi
  lea    0x40(%rsp),%rdi
  movq   %rbp,%xmm3
  movsd  0x18(%rsp),%xmm2
  divsd  %xmm0,%xmm2
  movsd  0x8(%rsp),%xmm1
  divsd  %xmm0,%xmm1
  movapd %xmm4,%xmm0
  call   <Rodrigues@plt>
  jmp    L66
L72:
  call   <sqrt@plt>
  jmp    L105
L95:
  call   <sqrt@plt>
  jmp    L52
L11:
  call   <sqrt@plt>
  movq   %xmm0,%rbx
  jmp    L121
L37:
  movq   %rbx,%xmm0
  call   <acos@plt>
  jmp    L128
L159:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D1
type_infered: byte[16]
name: extract_symbolic_data
arguments: tag: D12
type_infered: byte[8]
name: extract_symbolic_data
arguments: tag: D42
type_infered: byte[8]

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

tool: {"D12": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

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

assistant: ```c
void GetAngles(double x, double y, double z, double vx, double vy, double vz, double Lambda, double Phi, double *theta, double *gamma) {
  double r, xstar, ystar, zstar, v, d;
  r = sqrt(x * x + y * y + z * z);
  v = sqrt(vx * vx + vy * vy + vz * vz);
  x /= r;
  y /= r;
  z /= r;
  vx /= v;
  vy /= v;
  vz /= v;
  xstar = -x;
  ystar = -y;
  zstar = -z;
  if ((Lambda != 0) || (Phi != 0)) {
    double vlon, vlonx, vlony, vlonz;
    double vlat, vlatx, vlaty, vlatz;
    vlonx = (y * vz - z * vy);
    vlony = (z * vx - x * vz);
    vlonz = (x * vy - y * vx);
    vlon = sqrt(vlonx * vlonx + vlony * vlony + vlonz * vlonz);
    vlonx /= vlon;
    vlony /= vlon;
    vlonz /= vlon;
    Rodrigues(&xstar, &ystar, &zstar, vlonx, vlony, vlonz, Lambda);
    vlatx = (vlony * zstar - vlonz * ystar);
    vlaty = (vlonz * xstar - vlonx * zstar);
    vlatz = (vlonx * ystar - vlony * xstar);
    vlat = sqrt(vlatx * vlatx + vlaty * vlaty + vlatz * vlatz);
    vlatx /= vlat;
    vlaty /= vlat;
    vlatz /= vlat;
    Rodrigues(&xstar, &ystar, &zstar, vlatx, vlaty, vlatz, Phi);
  }
  d = sqrt(xstar * xstar + ystar * ystar);
  *gamma = atan2(ystar, xstar) + acos(-1.);
  if (zstar <= 0)
    *theta = acos(d);
  else
    *theta = -acos(d);
}
```