user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<get_angle>:
  endbr64
  push   %r13
  mov    %rcx,%r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x38,%rsp
  movsd  0x50(%rdi),%xmm0
  comisd D23(%rip),%xmm0
  ja     L124
  movsd  D329(%rip),%xmm2
  comisd %xmm0,%xmm2
  ja     L136
  movsd  %xmm2,0x10(%rsp)
  call   <acos@plt>
  movsd  %xmm0,0x8(%rsp)
  call   <sin@plt>
  movsd  0x8(%rsp),%xmm6
  comisd D350(%rip),%xmm6
  movsd  0x10(%rsp),%xmm2
  movapd %xmm0,%xmm1
  jae    L229
  movsd  D86(%rip),%xmm0
  comisd %xmm6,%xmm0
  jb     L62
L229:
  movsd  0x10(%rbx),%xmm0
  movsd  0x30(%rbx),%xmm3
  divsd  %xmm1,%xmm0
  comisd D23(%rip),%xmm0
  ja     L326
  comisd %xmm0,%xmm2
  ja     L300
  divsd  %xmm1,%xmm3
  comisd D23(%rip),%xmm3
  jbe    L41
  movapd %xmm3,%xmm0
  lea    D156(%rip),%rdi
  movsd  %xmm2,0x10(%rsp)
  call   <printf@plt>
  movsd  D416(%rip),%xmm7
  movq   D26(%rip),%xmm6
  movsd  0x10(%rsp),%xmm2
L336:
  movsd  0x10(%rbx),%xmm5
  movsd  0x30(%rbx),%xmm4
  movsd  0x48(%rbx),%xmm1
  movsd  0x40(%rbx),%xmm8
  movapd %xmm5,%xmm3
  movapd %xmm4,%xmm0
  mulsd  %xmm4,%xmm0
  movapd %xmm1,%xmm9
  mulsd  %xmm5,%xmm3
  mulsd  %xmm4,%xmm9
  addsd  %xmm0,%xmm3
  movapd %xmm5,%xmm0
  mulsd  %xmm8,%xmm0
  addsd  %xmm9,%xmm0
  xorpd  %xmm6,%xmm0
  divsd  %xmm3,%xmm0
  comisd D23(%rip),%xmm0
  ja     L125
  comisd %xmm0,%xmm2
  ja     L99
  mulsd  %xmm5,%xmm1
  mulsd  %xmm4,%xmm8
  subsd  %xmm8,%xmm1
  divsd  %xmm3,%xmm1
  comisd D23(%rip),%xmm1
  jbe    L191
  movapd %xmm1,%xmm0
  lea    D177(%rip),%rdi
  movsd  %xmm7,0x10(%rsp)
  call   <printf@plt>
  movsd  D416(%rip),%xmm0
  movsd  0x10(%rsp),%xmm7
L172:
  movsd  0x8(%rsp),%xmm4
  movsd  %xmm7,0x0(%rbp)
  xor    %eax,%eax
  movsd  %xmm4,(%r12)
  movsd  %xmm0,0x0(%r13)
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  xchg   %ax,%ax
L326:
  lea    D379(%rip),%rdi
  movsd  %xmm2,0x10(%rsp)
  call   <printf@plt>
  movsd  0x10(%rsp),%xmm2
  pxor   %xmm7,%xmm7
  movq   D26(%rip),%xmm6
  jmp    L336
  nopl   0x0(%rax)
L62:
  movsd  (%rbx),%xmm0
  comisd D23(%rip),%xmm0
  movsd  0x20(%rbx),%xmm1
  ja     L252
  comisd %xmm0,%xmm2
  ja     L147
  comisd D23(%rip),%xmm1
  jbe    L263
  movapd %xmm1,%xmm0
  lea    D177(%rip),%rdi
  call   <printf@plt>
  pxor   %xmm5,%xmm5
  movsd  D416(%rip),%xmm0
  movsd  %xmm5,0x8(%rsp)
  movapd %xmm5,%xmm7
  jmp    L172
  nopw   0x0(%rax,%rax,1)
L124:
  lea    D75(%rip),%rdi
  call   <printf@plt>
  movsd  D329(%rip),%xmm2
L327:
  movsd  D291(%rip),%xmm5
  movsd  D304(%rip),%xmm1
  movsd  %xmm2,0x50(%rbx)
  movsd  %xmm5,0x8(%rsp)
  jmp    L229
  nopl   0x0(%rax)
L125:
  lea    D184(%rip),%rdi
  movsd  %xmm7,0x10(%rsp)
  call   <printf@plt>
  movsd  0x10(%rsp),%xmm7
  pxor   %xmm0,%xmm0
  jmp    L172
  nopl   0x0(%rax)
L136:
  lea    D75(%rip),%rdi
  movsd  %xmm2,0x8(%rsp)
  call   <printf@plt>
  movsd  0x8(%rsp),%xmm2
  jmp    L327
  nopw   0x0(%rax,%rax,1)
L252:
  lea    D184(%rip),%rdi
  call   <printf@plt>
  pxor   %xmm0,%xmm0
  movsd  %xmm0,0x8(%rsp)
  movapd %xmm0,%xmm7
  jmp    L172
L191:
  comisd %xmm1,%xmm2
  jbe    L314
  movapd %xmm1,%xmm0
  lea    D177(%rip),%rdi
  movsd  %xmm7,0x10(%rsp)
  call   <printf@plt>
  movsd  D374(%rip),%xmm0
  movsd  0x10(%rsp),%xmm7
  jmp    L172
  nopw   0x0(%rax,%rax,1)
L99:
  lea    D184(%rip),%rdi
  movsd  %xmm7,0x10(%rsp)
  call   <printf@plt>
  movsd  D291(%rip),%xmm0
  movsd  0x10(%rsp),%xmm7
  jmp    L172
L41:
  comisd %xmm3,%xmm2
  jbe    L184
  movapd %xmm3,%xmm0
  lea    D156(%rip),%rdi
  movsd  %xmm2,0x10(%rsp)
  call   <printf@plt>
  movsd  D374(%rip),%xmm7
  movq   D26(%rip),%xmm6
  movsd  0x10(%rsp),%xmm2
  jmp    L336
  nopl   0x0(%rax,%rax,1)
L300:
  lea    D379(%rip),%rdi
  movsd  %xmm2,0x10(%rsp)
  call   <printf@plt>
  movsd  D291(%rip),%xmm7
  movq   D26(%rip),%xmm6
  movsd  0x10(%rsp),%xmm2
  jmp    L336
L314:
  movsd  %xmm1,0x18(%rsp)
  movsd  %xmm7,0x10(%rsp)
  movaps %xmm6,0x20(%rsp)
  call   <acos@plt>
  movsd  0x18(%rsp),%xmm1
  pxor   %xmm2,%xmm2
  movsd  0x10(%rsp),%xmm7
  comisd %xmm1,%xmm2
  jbe    L172
  movapd 0x20(%rsp),%xmm6
  xorpd  %xmm6,%xmm0
  jmp    L172
L184:
  movsd  %xmm2,0x18(%rsp)
  movsd  %xmm3,0x10(%rsp)
  call   <acos@plt>
  movsd  0x10(%rsp),%xmm3
  movq   D26(%rip),%xmm6
  movapd %xmm0,%xmm7
  pxor   %xmm0,%xmm0
  movsd  0x18(%rsp),%xmm2
  comisd %xmm3,%xmm0
  jbe    L336
  xorpd  %xmm6,%xmm7
  jmp    L336
L263:
  comisd %xmm1,%xmm2
  jbe    L313
  movapd %xmm1,%xmm0
  lea    D177(%rip),%rdi
  call   <printf@plt>
  movsd  D374(%rip),%xmm0
  pxor   %xmm2,%xmm2
L312:
  movapd %xmm2,%xmm7
  movsd  %xmm2,0x8(%rsp)
  jmp    L172
  nopl   (%rax)
L147:
  lea    D184(%rip),%rdi
  call   <printf@plt>
  pxor   %xmm5,%xmm5
  movsd  D291(%rip),%xmm0
  movsd  %xmm5,0x8(%rsp)
  movapd %xmm5,%xmm7
  jmp    L172
L313:
  movsd  %xmm1,0x8(%rsp)
  call   <acos@plt>
  movsd  0x8(%rsp),%xmm1
  pxor   %xmm2,%xmm2
  comisd %xmm1,%xmm2
  jbe    L312
  xorpd  D26(%rip),%xmm0
  jmp    L312
```

tool_calls: name: unpack_data
arguments: label: D23
type_infered: f64[2]
name: unpack_data
arguments: label: D329
type_infered: f32[2]
name: unpack_data
arguments: label: D350
type_infered: f64[2]
name: unpack_data
arguments: label: D86
type_infered: byte[8]
name: unpack_data
arguments: label: D156
type_infered: string
name: unpack_data
arguments: label: D416
type_infered: byte[8]
name: unpack_data
arguments: label: D26
type_infered: f32[4]
name: unpack_data
arguments: label: D177
type_infered: string
name: unpack_data
arguments: label: D379
type_infered: string
name: unpack_data
arguments: label: D75
type_infered: string
name: unpack_data
arguments: label: D291
type_infered: byte[8]
name: unpack_data
arguments: label: D304
type_infered: byte[8]
name: unpack_data
arguments: label: D184
type_infered: string
name: unpack_data
arguments: label: D374
type_infered: byte[8]

tool: {"D23": [1.0,-1.0]}

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

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

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

tool: D156: sin(alph) = %f


tool: {"D416": [0x18,0x2d,0x44,0x54,0xfb,0x21,0xf9,0x3f]}

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

tool: D177: sin(r) = %f


tool: D379: cos(alph) = %f


tool: D75: cos(beta) = %f


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

tool: {"D304": [0x07,0x5c,0x14,0x33,0x26,0xa6,0xa1,0x3c]}

tool: D184: cos(r) = %f


tool: {"D374": [0x18,0x2d,0x44,0x54,0xfb,0x21,0xf9,0xbf]}

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);
}
```