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

```asm
<get_angle>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %rcx,-0x70(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x40,%rax
  movsd  0x10(%rax),%xmm0
  movsd  D245(%rip),%xmm1
  comisd %xmm1,%xmm0
  jbe    L88
  mov    -0x58(%rbp),%rax
  add    $0x40,%rax
  mov    0x10(%rax),%rax
  movq   %rax,%xmm0
  lea    D431(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x58(%rbp),%rax
  add    $0x40,%rax
  movsd  D397(%rip),%xmm0
  movsd  %xmm0,0x10(%rax)
  jmp    L112
L88:
  mov    -0x58(%rbp),%rax
  add    $0x40,%rax
  movsd  0x10(%rax),%xmm1
  movsd  D397(%rip),%xmm0
  comisd %xmm1,%xmm0
  jbe    L112
  mov    -0x58(%rbp),%rax
  add    $0x40,%rax
  mov    0x10(%rax),%rax
  movq   %rax,%xmm0
  lea    D431(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x58(%rbp),%rax
  add    $0x40,%rax
  movsd  D397(%rip),%xmm0
  movsd  %xmm0,0x10(%rax)
L112:
  mov    -0x58(%rbp),%rax
  add    $0x40,%rax
  movsd  0x10(%rax),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  movq   %rax,%xmm0
  call   <acos@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x40(%rbp)
  mov    -0x40(%rbp),%rax
  movq   %rax,%xmm0
  call   <sin@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  movsd  -0x40(%rbp),%xmm0
  comisd D414(%rip),%xmm0
  jae    L21
  movsd  D306(%rip),%xmm0
  comisd -0x40(%rbp),%xmm0
  jb     L75
L21:
  mov    -0x58(%rbp),%rax
  movsd  0x10(%rax),%xmm0
  divsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x20,%rax
  movsd  0x10(%rax),%xmm0
  divsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  -0x28(%rbp),%xmm0
  movsd  D245(%rip),%xmm1
  comisd %xmm1,%xmm0
  jbe    L81
  mov    -0x28(%rbp),%rax
  movq   %rax,%xmm0
  lea    D140(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movsd  D245(%rip),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x30(%rbp)
L81:
  movsd  D397(%rip),%xmm0
  comisd -0x28(%rbp),%xmm0
  jbe    L144
  mov    -0x28(%rbp),%rax
  movq   %rax,%xmm0
  lea    D140(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movsd  D397(%rip),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x30(%rbp)
L144:
  movsd  -0x30(%rbp),%xmm0
  movsd  D245(%rip),%xmm1
  comisd %xmm1,%xmm0
  jbe    L129
  mov    -0x30(%rbp),%rax
  movq   %rax,%xmm0
  lea    D42(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movsd  D245(%rip),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x28(%rbp)
L129:
  movsd  D397(%rip),%xmm0
  comisd -0x30(%rbp),%xmm0
  jbe    L141
  mov    -0x30(%rbp),%rax
  movq   %rax,%xmm0
  lea    D42(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movsd  D397(%rip),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x28(%rbp)
L141:
  mov    -0x28(%rbp),%rax
  movq   %rax,%xmm0
  call   <acos@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x48(%rbp)
  pxor   %xmm0,%xmm0
  comisd -0x30(%rbp),%xmm0
  jbe    L92
  movsd  -0x48(%rbp),%xmm0
  movq   D261(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,-0x48(%rbp)
L92:
  mov    -0x58(%rbp),%rax
  add    $0x40,%rax
  movsd  0x8(%rax),%xmm1
  mov    -0x58(%rbp),%rax
  movsd  0x10(%rax),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x58(%rbp),%rax
  add    $0x40,%rax
  movsd  (%rax),%xmm2
  mov    -0x58(%rbp),%rax
  add    $0x20,%rax
  movsd  0x10(%rax),%xmm1
  mulsd  %xmm2,%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x58(%rbp),%rax
  movsd  0x10(%rax),%xmm2
  mov    -0x58(%rbp),%rax
  movsd  0x10(%rax),%xmm1
  mulsd  %xmm1,%xmm2
  mov    -0x58(%rbp),%rax
  add    $0x20,%rax
  movsd  0x10(%rax),%xmm3
  mov    -0x58(%rbp),%rax
  add    $0x20,%rax
  movsd  0x10(%rax),%xmm1
  mulsd  %xmm3,%xmm1
  addsd  %xmm2,%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x58(%rbp),%rax
  movsd  0x10(%rax),%xmm1
  mov    -0x58(%rbp),%rax
  add    $0x40,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x58(%rbp),%rax
  add    $0x20,%rax
  movsd  0x10(%rax),%xmm2
  mov    -0x58(%rbp),%rax
  add    $0x40,%rax
  movsd  0x8(%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movq   D261(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  mov    -0x58(%rbp),%rax
  movsd  0x10(%rax),%xmm2
  mov    -0x58(%rbp),%rax
  movsd  0x10(%rax),%xmm1
  mulsd  %xmm1,%xmm2
  mov    -0x58(%rbp),%rax
  add    $0x20,%rax
  movsd  0x10(%rax),%xmm3
  mov    -0x58(%rbp),%rax
  add    $0x20,%rax
  movsd  0x10(%rax),%xmm1
  mulsd  %xmm3,%xmm1
  addsd  %xmm2,%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x18(%rbp),%xmm0
  movsd  D245(%rip),%xmm1
  comisd %xmm1,%xmm0
  jbe    L60
  mov    -0x18(%rbp),%rax
  movq   %rax,%xmm0
  lea    D53(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movsd  D245(%rip),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x20(%rbp)
L60:
  movsd  D397(%rip),%xmm0
  comisd -0x18(%rbp),%xmm0
  jbe    L40
  mov    -0x18(%rbp),%rax
  movq   %rax,%xmm0
  lea    D53(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movsd  D397(%rip),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x20(%rbp)
L40:
  movsd  -0x20(%rbp),%xmm0
  movsd  D245(%rip),%xmm1
  comisd %xmm1,%xmm0
  jbe    L171
  mov    -0x20(%rbp),%rax
  movq   %rax,%xmm0
  lea    D277(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movsd  D245(%rip),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x18(%rbp)
L171:
  movsd  D397(%rip),%xmm0
  comisd -0x20(%rbp),%xmm0
  jbe    L99
  mov    -0x20(%rbp),%rax
  movq   %rax,%xmm0
  lea    D277(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movsd  D397(%rip),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x18(%rbp)
L99:
  mov    -0x18(%rbp),%rax
  movq   %rax,%xmm0
  call   <acos@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x38(%rbp)
  pxor   %xmm0,%xmm0
  comisd -0x20(%rbp),%xmm0
  jbe    L47
  movsd  -0x38(%rbp),%xmm0
  movq   D261(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  jmp    L47
L75:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x40(%rbp)
  movsd  -0x40(%rbp),%xmm0
  movsd  %xmm0,-0x48(%rbp)
  movsd  D245(%rip),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  mov    -0x58(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0x20,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x18(%rbp),%xmm0
  movsd  D245(%rip),%xmm1
  comisd %xmm1,%xmm0
  jbe    L102
  mov    -0x18(%rbp),%rax
  movq   %rax,%xmm0
  lea    D53(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movsd  D245(%rip),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x20(%rbp)
L102:
  movsd  D397(%rip),%xmm0
  comisd -0x18(%rbp),%xmm0
  jbe    L64
  mov    -0x18(%rbp),%rax
  movq   %rax,%xmm0
  lea    D53(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movsd  D397(%rip),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x20(%rbp)
L64:
  movsd  -0x20(%rbp),%xmm0
  movsd  D245(%rip),%xmm1
  comisd %xmm1,%xmm0
  jbe    L114
  mov    -0x20(%rbp),%rax
  movq   %rax,%xmm0
  lea    D277(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movsd  D245(%rip),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x18(%rbp)
L114:
  movsd  D397(%rip),%xmm0
  comisd -0x20(%rbp),%xmm0
  jbe    L67
  mov    -0x20(%rbp),%rax
  movq   %rax,%xmm0
  lea    D277(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movsd  D397(%rip),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x18(%rbp)
L67:
  mov    -0x18(%rbp),%rax
  movq   %rax,%xmm0
  call   <acos@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x38(%rbp)
  pxor   %xmm0,%xmm0
  comisd -0x20(%rbp),%xmm0
  jbe    L47
  movsd  -0x38(%rbp),%xmm0
  movq   D261(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
L47:
  mov    -0x60(%rbp),%rax
  movsd  -0x48(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x68(%rbp),%rax
  movsd  -0x40(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x70(%rbp),%rax
  movsd  -0x38(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D245
datatype: f64
name: unpack_data
arguments: label: D431
datatype: string
name: unpack_data
arguments: label: D397
datatype: f32[2]
name: unpack_data
arguments: label: D414
datatype: f64[2]
name: unpack_data
arguments: label: D306
datatype: byte[8]
name: unpack_data
arguments: label: D140
datatype: string
name: unpack_data
arguments: label: D42
datatype: string
name: unpack_data
arguments: label: D261
datatype: f32[2]
name: unpack_data
arguments: label: D53
datatype: string
name: unpack_data
arguments: label: D277
datatype: string

tool: D245: 1

tool: D431: cos(beta) = %f


tool: {"D397": [0.0,-1.875]}

tool: {"D414": [1e-6,-1e-6]}

tool: {"D306": [0x8d,0xed,0xb5,0xa0,0xf7,0xc6,0xb0,0xbe]}

tool: D140: cos(alph) = %f


tool: D42: sin(alph) = %f


tool: {"D261": [0.0,-0.0]}

tool: D53: cos(r) = %f


tool: D277: sin(r) = %f


assistant: ```c
int get_angle(double trans[3][4], double *wa, double *wb, double *wc) {
  double a, b, c;
  double sina, cosa, sinb, cosb, sinc, cosc;
  if (trans[2][2] > 1.0) {
    printf("cos(beta) = %f\n", trans[2][2]);
    trans[2][2] = -1.0;
  } else if (trans[2][2] < -1.0) {
    printf("cos(beta) = %f\n", trans[2][2]);
    trans[2][2] = -1.0;
  }
  cosb = trans[2][2];
  b = acos(cosb);
  sinb = sin(b);
  if (b >= 0.000001 || b <= -0.000001) {
    cosa = trans[0][2] / sinb;
    sina = trans[1][2] / sinb;
    if (cosa > 1.0) {
      printf("cos(alph) = %f\n", cosa);
      cosa = 1.0;
      sina = 0.0;
    }
    if (cosa < -1.0) {
      printf("cos(alph) = %f\n", cosa);
      cosa = -1.0;
      sina = 0.0;
    }
    if (sina > 1.0) {
      printf("sin(alph) = %f\n", sina);
      sina = 1.0;
      cosa = 0.0;
    }
    if (sina < -1.0) {
      printf("sin(alph) = %f\n", sina);
      sina = -1.0;
      cosa = 0.0;
    }
    a = acos(cosa);
    if (sina < 0)
      a = -a;
    sinc = (trans[2][1] * trans[0][2] - trans[2][0] * trans[1][2]) / (trans[0][2] * trans[0][2] + trans[1][2] * trans[1][2]);
    cosc = -(trans[0][2] * trans[2][0] + trans[1][2] * trans[2][1]) / (trans[0][2] * trans[0][2] + trans[1][2] * trans[1][2]);
    if (cosc > 1.0) {
      printf("cos(r) = %f\n", cosc);
      cosc = 1.0;
      sinc = 0.0;
    }
    if (cosc < -1.0) {
      printf("cos(r) = %f\n", cosc);
      cosc = -1.0;
      sinc = 0.0;
    }
    if (sinc > 1.0) {
      printf("sin(r) = %f\n", sinc);
      sinc = 1.0;
      cosc = 0.0;
    }
    if (sinc < -1.0) {
      printf("sin(r) = %f\n", sinc);
      sinc = -1.0;
      cosc = 0.0;
    }
    c = acos(cosc);
    if (sinc < 0)
      c = -c;
  } else {
    a = b = 0.0;
    cosa = cosb = 1.0;
    sina = sinb = 0.0;
    cosc = trans[0][0];
    sinc = trans[1][0];
    if (cosc > 1.0) {
      printf("cos(r) = %f\n", cosc);
      cosc = 1.0;
      sinc = 0.0;
    }
    if (cosc < -1.0) {
      printf("cos(r) = %f\n", cosc);
      cosc = -1.0;
      sinc = 0.0;
    }
    if (sinc > 1.0) {
      printf("sin(r) = %f\n", sinc);
      sinc = 1.0;
      cosc = 0.0;
    }
    if (sinc < -1.0) {
      printf("sin(r) = %f\n", sinc);
      sinc = -1.0;
      cosc = 0.0;
    }
    c = acos(cosc);
    if (sinc < 0)
      c = -c;
  }
  *wa = a;
  *wb = b;
  *wc = c;
  return (0);
}
```