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

```asm
<arc_find_angles>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  push   %r14
  mov    $0xaaaaaaab,%r14d
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x38,%rsp
L83:
  lea    0x1(%rbx),%ecx
  movsd  (%r15,%rbx,8),%xmm4
  movsd  0x0(%rbp,%rbx,8),%xmm0
  mov    %rcx,%rax
  imul   %r14,%rcx
  movsd  %xmm4,0x10(%rsp)
  shr    $0x21,%rcx
  lea    (%rcx,%rcx,2),%ecx
  sub    %ecx,%eax
  lea    0x2(%rbx),%ecx
  cltq
  movsd  (%r15,%rax,8),%xmm6
  lea    0x0(,%rax,8),%r12
  mov    %rcx,%rax
  imul   %r14,%rcx
  add    %rbp,%r12
  movsd  %xmm6,0x18(%rsp)
  shr    $0x21,%rcx
  lea    (%rcx,%rcx,2),%ecx
  sub    %ecx,%eax
  cltq
  movsd  (%r15,%rax,8),%xmm5
  lea    0x0(,%rax,8),%r13
  lea    0x0(%rbp,%rbx,8),%rax
  mov    %rax,0x28(%rsp)
  add    %rbp,%r13
  movsd  %xmm5,0x20(%rsp)
  call   <to_radians@plt>
  movsd  %xmm0,0x8(%rsp)
  movsd  (%r12),%xmm0
  call   <to_radians@plt>
  movsd  %xmm0,(%rsp)
  movsd  0x0(%r13),%xmm0
  call   <to_radians@plt>
  movsd  0x8(%rsp),%xmm3
  pxor   %xmm1,%xmm1
  movapd %xmm0,%xmm2
  comisd %xmm1,%xmm3
  jbe    L166
L31:
  movsd  (%rsp),%xmm7
  comisd %xmm1,%xmm7
  jbe    L52
L123:
  comisd %xmm1,%xmm2
  jbe    L122
L136:
  add    $0x1,%rbx
  cmp    $0x3,%rbx
  jne    L83
  xor    %eax,%eax
L62:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L166:
  movsd  0x10(%rsp),%xmm4
  comisd %xmm1,%xmm4
  jbe    L31
  comisd %xmm1,%xmm0
  jbe    L31
  movsd  0x20(%rsp),%xmm5
  comisd %xmm1,%xmm5
  ja     L23
  movsd  (%rsp),%xmm5
  comisd %xmm1,%xmm5
  ja     L136
  movsd  0x18(%rsp),%xmm6
  comisd %xmm1,%xmm6
  jbe    L123
L86:
  movsd  0x20(%rsp),%xmm5
  comisd %xmm1,%xmm5
  jbe    L136
  movapd %xmm2,%xmm0
  movsd  %xmm3,0x10(%rsp)
  movsd  %xmm2,0x8(%rsp)
  call   <sin@plt>
  movapd %xmm0,%xmm1
  movsd  0x18(%rsp),%xmm0
  divsd  0x20(%rsp),%xmm0
  mulsd  %xmm1,%xmm0
  call   <asin@plt>
  movsd  0x8(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm3
  movsd  %xmm0,(%rsp)
L72:
  movapd %xmm3,%xmm0
  movsd  %xmm2,0x8(%rsp)
  call   <to_degrees@plt>
  mov    0x28(%rsp),%rax
  movsd  %xmm0,(%rax)
  movsd  (%rsp),%xmm0
  call   <to_degrees@plt>
  movsd  0x8(%rsp),%xmm2
  movsd  %xmm0,(%r12)
  movapd %xmm2,%xmm0
  call   <to_degrees@plt>
  mov    $0x1,%eax
  movsd  %xmm0,0x0(%r13)
  jmp    L62
  nopl   0x0(%rax,%rax,1)
L52:
  movsd  0x18(%rsp),%xmm6
  comisd %xmm1,%xmm6
  jbe    L123
  comisd %xmm1,%xmm2
  ja     L86
L122:
  movsd  0x10(%rsp),%xmm7
  comisd %xmm1,%xmm7
  jbe    L136
  movsd  0x18(%rsp),%xmm2
  comisd %xmm1,%xmm2
  jbe    L136
  movsd  0x20(%rsp),%xmm7
  comisd %xmm1,%xmm7
  jbe    L136
  movapd %xmm2,%xmm7
  movsd  0x10(%rsp),%xmm2
  movsd  %xmm3,0x8(%rsp)
  movapd %xmm7,%xmm1
  mulsd  %xmm7,%xmm1
  movapd %xmm2,%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  0x20(%rsp),%xmm1
  mulsd  %xmm1,%xmm1
  subsd  %xmm1,%xmm0
  movapd %xmm2,%xmm1
  addsd  %xmm2,%xmm1
  mulsd  %xmm7,%xmm1
  divsd  %xmm1,%xmm0
  call   <acos@plt>
  movsd  0x8(%rsp),%xmm3
  movapd %xmm0,%xmm2
  jmp    L72
L23:
  movsd  %xmm0,0x8(%rsp)
  call   <sin@plt>
  movapd %xmm0,%xmm1
  movsd  0x10(%rsp),%xmm0
  divsd  0x20(%rsp),%xmm0
  mulsd  %xmm1,%xmm0
  call   <asin@plt>
  movsd  0x8(%rsp),%xmm2
  movapd %xmm0,%xmm3
  jmp    L72
```

assistant: ```c
int arc_find_angles(double *angles, const double *sides) {
  double A, B, C;
  register int i;
  A = B = C = 0;
  for (i = 0; i < 3; i++) {
    const double a = sides[(i + 0)];
    const double b = sides[(i + 1) % 3];
    const double c = sides[(i + 2) % 3];
    A = to_radians(angles[(i + 0)]);
    B = to_radians(angles[(i + 1) % 3]);
    C = to_radians(angles[(i + 2) % 3]);
    if (!((A) > 0) && ((a) > 0) && ((C) > 0) && ((c) > 0)) {
      A = asin(a / c * sin(C));
      goto new_info;
    }
    if (!((B) > 0) && ((b) > 0) && ((C) > 0) && ((c) > 0)) {
      B = asin(b / c * sin(C));
      goto new_info;
    }
    if (!((C) > 0) && ((a) > 0) && ((b) > 0) && ((c) > 0)) {
      C = acos((a * a + b * b - c * c) / (2 * a * b));
      goto new_info;
    }
  }
  return 0;
new_info:
  angles[(i + 0) % 3] = to_degrees(A);
  angles[(i + 1) % 3] = to_degrees(B);
  angles[(i + 2) % 3] = to_degrees(C);
  return 1;
}
```