user: Converte this assembly snippet into its equivalent C code:

```asm
<ch_evals3>:
  endbr64
  push   %r15
  pxor   %xmm0,%xmm0
  mov    %rcx,%r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  sub    $0x98,%rsp
  mov    %rdx,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  movaps %xmm0,0x40(%rsp)
  movq   $0x0,0x80(%rsp)
  movq   $0x0,0x8(%rsp)
  movaps %xmm0,0x50(%rsp)
  movaps %xmm0,0x60(%rsp)
  movaps %xmm0,0x70(%rsp)
L102:
  mov    %rbp,%rbx
L256:
  movsd  (%r14,%rbx,8),%xmm0
  call   <fabs@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  comisd 0x8(%rsp),%xmm0
  ja     L143
L165:
  add    $0x1,%rbx
  cmp    $0x3,%ebx
  jne    L256
  add    $0x1,%rbp
  add    $0x18,%r14
  cmp    $0x3,%rbp
  jne    L102
  movsd  0x8(%rsp),%xmm4
  pxor   %xmm5,%xmm5
  ucomisd %xmm5,%xmm4
  movapd %xmm4,%xmm0
  unpcklpd %xmm0,%xmm0
  jp     L212
  jne    L212
L90:
  movsd  0x40(%rsp),%xmm2
  xor    %eax,%eax
  movsd  0x60(%rsp),%xmm0
  lea    0x40(%rsp),%rdi
  movsd  0x48(%rsp),%xmm5
  mulsd  0x58(%rsp),%xmm5
  mov    $0x3,%esi
  movapd %xmm2,%xmm3
  movapd %xmm2,%xmm1
  movsd  0x80(%rsp),%xmm4
  mulsd  %xmm0,%xmm3
  addsd  %xmm0,%xmm1
  mulsd  %xmm4,%xmm2
  mulsd  %xmm4,%xmm0
  addsd  %xmm4,%xmm1
  subsd  %xmm5,%xmm3
  movsd  0x50(%rsp),%xmm5
  mulsd  0x70(%rsp),%xmm5
  movsd  %xmm1,0x20(%rsp)
  subsd  %xmm5,%xmm2
  addsd  %xmm3,%xmm2
  movsd  0x68(%rsp),%xmm3
  mulsd  0x78(%rsp),%xmm3
  subsd  %xmm3,%xmm0
  addsd  %xmm0,%xmm2
  movsd  %xmm2,0x10(%rsp)
  call   <determinant@plt>
  pxor   %xmm5,%xmm5
  movsd  0x20(%rsp),%xmm1
  ucomisd %xmm5,%xmm0
  jp     L239
  jne    L239
  movapd %xmm1,%xmm0
  movsd  0x10(%rsp),%xmm2
  comisd %xmm5,%xmm1
  mov    $0x1,%eax
  mulsd  %xmm1,%xmm0
  mov    $0xffffffff,%ebx
  mulsd  D18(%rip),%xmm2
  cmovbe %eax,%ebx
  subsd  %xmm2,%xmm0
  call   <sqrt@plt>
  pxor   %xmm2,%xmm2
  movsd  0x20(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm0
  imul   %ebx,%eax
  cvtsi2sd %eax,%xmm2
  subsd  %xmm1,%xmm2
  mulsd  D21(%rip),%xmm2
  pxor   %xmm1,%xmm1
  divsd  %xmm2,%xmm0
L0:
  movsd  0x8(%rsp),%xmm6
  mov    $0x1,%edx
  mulsd  %xmm6,%xmm1
  mulsd  %xmm6,%xmm2
  mulsd  %xmm6,%xmm0
  movapd %xmm1,%xmm3
  minsd  %xmm2,%xmm3
  minsd  %xmm0,%xmm3
  movsd  %xmm3,0x0(%r13)
  movapd %xmm1,%xmm3
  maxsd  %xmm2,%xmm3
  maxsd  %xmm0,%xmm3
  ucomisd %xmm1,%xmm3
  movsd  %xmm3,(%r15)
  movsd  0x0(%r13),%xmm4
  setp   %al
  cmovne %edx,%eax
  test   %al,%al
  je     L109
  ucomisd %xmm1,%xmm4
  setp   %al
  cmovne %edx,%eax
  test   %al,%al
  jne    L12
L109:
  ucomisd %xmm2,%xmm4
  mov    $0x1,%edx
  setp   %al
  cmovne %edx,%eax
  test   %al,%al
  je     L19
  ucomisd %xmm2,%xmm3
  setp   %al
  cmovne %edx,%eax
  test   %al,%al
  jne    L160
L19:
  mov    0x18(%rsp),%rax
  movsd  %xmm0,(%rax)
  mov    0x88(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L100
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L143:
  movsd  (%r14,%rbx,8),%xmm0
  call   <fabs@plt>
  pxor   %xmm6,%xmm6
  cvtsi2sd %eax,%xmm6
  movsd  %xmm6,0x8(%rsp)
  jmp    L165
  cs nopw 0x0(%rax,%rax,1)
L212:
  movupd 0x20(%r12),%xmm1
  movupd 0x10(%r12),%xmm2
  movupd (%r12),%xmm3
  divpd  %xmm0,%xmm1
  divpd  %xmm0,%xmm2
  movaps %xmm1,0x60(%rsp)
  movupd 0x30(%r12),%xmm1
  divpd  %xmm0,%xmm3
  movaps %xmm2,0x50(%rsp)
  divpd  %xmm0,%xmm1
  movsd  0x40(%r12),%xmm0
  divsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x80(%rsp)
  movaps %xmm3,0x40(%rsp)
  movaps %xmm1,0x70(%rsp)
  jmp    L90
  nopw   0x0(%rax,%rax,1)
L239:
  movsd  0x10(%rsp),%xmm5
  movsd  D56(%rip),%xmm3
  movapd %xmm1,%xmm4
  mulsd  %xmm1,%xmm1
  xorpd  D147(%rip),%xmm4
  mulsd  %xmm5,%xmm3
  mulsd  D142(%rip),%xmm0
  movapd %xmm1,%xmm2
  movsd  D108(%rip),%xmm1
  subsd  %xmm3,%xmm2
  movapd %xmm4,%xmm3
  addsd  %xmm4,%xmm3
  divsd  %xmm1,%xmm2
  mulsd  %xmm4,%xmm3
  mulsd  %xmm4,%xmm1
  mulsd  %xmm4,%xmm3
  mulsd  %xmm5,%xmm1
  subsd  %xmm1,%xmm3
  subsd  %xmm0,%xmm3
  divsd  D8(%rip),%xmm3
  movapd %xmm3,%xmm5
  mulsd  %xmm3,%xmm5
  movapd %xmm2,%xmm1
  mulsd  %xmm2,%xmm1
  mulsd  %xmm2,%xmm1
  comisd %xmm1,%xmm5
  ja     L65
  comisd %xmm5,%xmm1
  jb     L113
L267:
  pxor   %xmm6,%xmm6
  ucomisd %xmm6,%xmm3
  jp     L170
  mov    D149(%rip),%rbx
  jne    L170
L2:
  movapd %xmm2,%xmm0
  movsd  %xmm4,0x20(%rsp)
  call   <sqrt@plt>
  pxor   %xmm7,%xmm7
  movq   %rbx,%xmm0
  divsd  D56(%rip),%xmm0
  neg    %eax
  add    %eax,%eax
  cvtsi2sd %eax,%xmm7
  movsd  %xmm7,0x10(%rsp)
  call   <cos@plt>
  movsd  0x10(%rsp),%xmm1
  movsd  0x20(%rsp),%xmm4
  divsd  D56(%rip),%xmm4
  movsd  %xmm4,0x20(%rsp)
  mulsd  %xmm0,%xmm1
  movq   %rbx,%xmm0
  addsd  D23(%rip),%xmm0
  divsd  D56(%rip),%xmm0
  subsd  %xmm4,%xmm1
  movsd  %xmm1,0x30(%rsp)
  call   <cos@plt>
  movsd  0x10(%rsp),%xmm2
  mulsd  %xmm0,%xmm2
  movq   %rbx,%xmm0
  addsd  D166(%rip),%xmm0
  divsd  D56(%rip),%xmm0
  subsd  0x20(%rsp),%xmm2
  movsd  %xmm2,0x28(%rsp)
  call   <cos@plt>
  mulsd  0x10(%rsp),%xmm0
  movsd  0x28(%rsp),%xmm2
  subsd  0x20(%rsp),%xmm0
  movsd  0x30(%rsp),%xmm1
  jmp    L0
  nopl   0x0(%rax,%rax,1)
L12:
  movapd %xmm1,%xmm0
  jmp    L19
  nopl   0x0(%rax)
L160:
  movapd %xmm2,%xmm0
  jmp    L19
  nopl   0x0(%rax)
L65:
  movapd %xmm1,%xmm0
  movsd  %xmm3,0x38(%rsp)
  subsd  %xmm5,%xmm0
  movsd  %xmm2,0x30(%rsp)
  movsd  %xmm4,0x28(%rsp)
  movsd  %xmm5,0x10(%rsp)
  movsd  %xmm1,0x20(%rsp)
  call   <fabs@plt>
  movsd  0x20(%rsp),%xmm1
  mov    %eax,%ebp
  movapd %xmm1,%xmm0
  call   <fabs@plt>
  movsd  0x10(%rsp),%xmm5
  mov    %eax,%ebx
  movapd %xmm5,%xmm0
  call   <fabs@plt>
  pxor   %xmm6,%xmm6
  pxor   %xmm0,%xmm0
  movsd  0x10(%rsp),%xmm5
  add    %eax,%ebx
  cvtsi2sd %ebp,%xmm0
  movsd  0x20(%rsp),%xmm1
  movsd  0x38(%rsp),%xmm3
  cvtsi2sd %ebx,%xmm6
  movsd  0x30(%rsp),%xmm2
  movsd  0x28(%rsp),%xmm4
  mulsd  D152(%rip),%xmm6
  cmpnltsd %xmm6,%xmm0
  andpd  %xmm0,%xmm1
  andnpd %xmm5,%xmm0
  orpd   %xmm0,%xmm1
  comisd %xmm5,%xmm1
  jae    L267
L113:
  subsd  %xmm1,%xmm5
  movsd  %xmm2,0x28(%rsp)
  movsd  %xmm4,0x20(%rsp)
  movsd  %xmm3,0x10(%rsp)
  movapd %xmm5,%xmm0
  call   <sqrt@plt>
  movsd  0x10(%rsp),%xmm3
  mov    %eax,%ebx
  movapd %xmm3,%xmm0
  call   <fabs@plt>
  pxor   %xmm0,%xmm0
  movsd  D71(%rip),%xmm1
  add    %eax,%ebx
  cvtsi2sd %ebx,%xmm0
  call   <pow@plt>
  movsd  0x10(%rsp),%xmm3
  pxor   %xmm6,%xmm6
  movsd  D1(%rip),%xmm1
  movsd  0x20(%rsp),%xmm4
  movsd  0x28(%rsp),%xmm2
  comisd %xmm3,%xmm6
  ja     L10
  movsd  D122(%rip),%xmm1
L10:
  divsd  %xmm0,%xmm2
  divsd  D56(%rip),%xmm4
  addsd  %xmm0,%xmm2
  mulsd  %xmm2,%xmm1
  subsd  %xmm4,%xmm1
  movapd %xmm1,%xmm0
  movapd %xmm1,%xmm2
  jmp    L0
L170:
  movapd %xmm1,%xmm0
  movsd  %xmm2,0x28(%rsp)
  movsd  %xmm4,0x20(%rsp)
  movsd  %xmm3,0x10(%rsp)
  call   <sqrt@plt>
  movsd  0x10(%rsp),%xmm3
  mov    %eax,%ebx
  movapd %xmm3,%xmm0
  call   <fabs@plt>
  movsd  0x10(%rsp),%xmm3
  movsd  0x20(%rsp),%xmm4
  cmp    %eax,%ebx
  movsd  0x28(%rsp),%xmm2
  jl     L217
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebx,%xmm0
L9:
  divsd  %xmm0,%xmm3
  movsd  %xmm2,0x20(%rsp)
  movsd  %xmm4,0x10(%rsp)
  movapd %xmm3,%xmm0
  call   <acos@plt>
  movsd  0x20(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm4
  movq   %xmm0,%rbx
  jmp    L2
L217:
  movapd %xmm3,%xmm0
  movsd  %xmm2,0x28(%rsp)
  movsd  %xmm4,0x20(%rsp)
  movsd  %xmm3,0x10(%rsp)
  call   <fabs@plt>
  pxor   %xmm0,%xmm0
  movsd  0x28(%rsp),%xmm2
  movsd  0x20(%rsp),%xmm4
  cvtsi2sd %eax,%xmm0
  movsd  0x10(%rsp),%xmm3
  jmp    L9
L100:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D18
data_type: f32[2]
name: extract_symbolic_data
arguments: label: D21
data_type: f32[2]
name: extract_symbolic_data
arguments: label: D56
data_type: f64
name: extract_symbolic_data
arguments: label: D147
data_type: f32[4]
name: extract_symbolic_data
arguments: label: D142
data_type: f32[2]
name: extract_symbolic_data
arguments: label: D108
data_type: f32[2]
name: extract_symbolic_data
arguments: label: D8
data_type: f32[2]
name: extract_symbolic_data
arguments: label: D149
data_type: f64
name: extract_symbolic_data
arguments: label: D23
data_type: f64
name: extract_symbolic_data
arguments: label: D166
data_type: byte[8]
name: extract_symbolic_data
arguments: label: D152
data_type: byte[8]
name: extract_symbolic_data
arguments: label: D71
data_type: byte[8]
name: extract_symbolic_data
arguments: label: D1
data_type: f64
name: extract_symbolic_data
arguments: label: D122
data_type: f32[2]

tool: {"D18": [0.0,2.25]}

tool: {"D21": [0.0,-1.75]}

tool: D56: 3

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

tool: {"D142": [0.0,2.921875]}

tool: {"D108": [0.0,2.53125]}

tool: {"D8": [0.0,3.171875]}

tool: D149: 1.570796326794896

tool: D23: 6.283185307179586

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

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

tool: {"D71": [0x55,0x55,0x55,0x55,0x55,0x55,0xd5,0x3f]}

tool: D1: 1

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

assistant: ```c
void ch_evals3(double H[3][3], double *eval1, double *eval2, double *eval3) {
  double mat[3][3] = {{0.0}};
  double a1, a2, a3;
  double q, r;
  double q3, r2;
  double theta;
  double root1, root2, root3;
  double tol = 1.0e-6;
  double xmax;
  int i, j;
  double determinant();
  xmax = 0.0;
  for (i = 0; i < 3; i++) {
    for (j = i; j < 3; j++) {
      if (fabs(H[i][j]) > xmax) {
        xmax = fabs(H[i][j]);
      }
    }
  }
  if (xmax != 0) {
    for (i = 0; i < 3; i++) {
      for (j = 0; j < 3; j++) {
        mat[i][j] = H[i][j] / xmax;
      }
    }
  }
  a1 = -(mat[0][0] + mat[1][1] + mat[2][2]);
  a2 = (mat[0][0] * mat[1][1] - mat[0][1] * mat[1][0]) + (mat[0][0] * mat[2][2] - mat[0][2] * mat[2][0]) + (mat[1][1] * mat[2][2] - mat[1][2] * mat[2][1]);
  a3 = -determinant(mat, 3);
  if (a3 == 0) {
    root1 = 0;
    q = -.5 * (a1 + ((a1) < 0 ? -1 : 1) * sqrt(a1 * a1 - 4 * a2));
    root2 = q;
    root3 = a2 / q;
  } else {
    q = (a1 * a1 - 3 * a2) / 9;
    r = (2 * a1 * a1 * a1 - 9 * a1 * a2 + 27 * a3) / 54;
    q3 = q * q * q;
    r2 = r * r;
    if ((q3 < r2) && fabs(q3 - r2) < tol * (fabs(q3) + fabs(r2))) {
      q3 = r2;
    }
    if (q3 >= r2) {
      if (r == 0) {
        theta = 1.570796326794896;
      } else {
        q3 = sqrt(q3);
        if (q3 < fabs(r)) {
          q3 = fabs(r);
        }
        theta = acos(r / q3);
      }
      q = -2 * sqrt(q);
      root1 = q * cos(theta / 3) - a1 / 3;
      root2 = q * cos((theta + 6.283185307179586) / 3) - a1 / 3;
      root3 = q * cos((theta + 2 * 6.283185307179586) / 3) - a1 / 3;
    } else {
      theta = sqrt(r2 - q3) + fabs(r);
      theta = pow(theta, 1.0 / 3.0);
      root1 = root2 = root3 = -((r) < 0 ? -1 : 1) * (theta + q / theta) - a1 / 3;
    }
  }
  root1 *= xmax;
  root2 *= xmax;
  root3 *= xmax;
  *eval1 = ((root1) < (root2) ? (root1) : (root2));
  *eval1 = ((*eval1) < (root3) ? (*eval1) : (root3));
  *eval3 = ((root1) > (root2) ? (root1) : (root2));
  *eval3 = ((*eval3) > (root3) ? (*eval3) : (root3));
  if (root1 != *eval1 && root1 != *eval3) {
    *eval2 = root1;
  } else if (root2 != *eval1 && root2 != *eval3) {
    *eval2 = root2;
  } else {
    *eval2 = root3;
  }
}
```