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

```asm
<mycs>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xa8,%rsp
  mov    %rdi,%rax
  mov    %fs:0x28,%rdx
  mov    %rdx,0x98(%rsp)
  xor    %edx,%edx
  mov    0x18(%rdi),%r13
  mov    0x28(%rdi),%r14
  movq   %r13,%xmm7
  movq   %r14,%xmm6
  addsd  %xmm6,%xmm7
  movsd  %xmm7,0x10(%rsp)
  movsd  0x8(%rdi),%xmm5
  movsd  0x38(%rdi),%xmm14
  movsd  0x20(%rdi),%xmm4
  mov    0xa8(%rdi),%r8
  mov    0xb8(%rdi),%rdi
  movq   %r8,%xmm13
  movq   %rdi,%xmm6
  addsd  %xmm6,%xmm13
  movsd  0x98(%rax),%xmm10
  movsd  0xc8(%rax),%xmm8
  mov    0xb0(%rax),%r11
  addsd  %xmm5,%xmm7
  movapd %xmm7,%xmm1
  addsd  %xmm14,%xmm1
  addsd  %xmm4,%xmm1
  movapd %xmm13,%xmm0
  addsd  %xmm10,%xmm0
  addsd  %xmm8,%xmm0
  movq   %r11,%xmm6
  addsd  %xmm6,%xmm0
  movsd  D51(%rip),%xmm11
  comisd %xmm0,%xmm1
  ja     L8
  movsd  D69(%rip),%xmm11
L8:
  movapd %xmm5,%xmm6
  addsd  %xmm10,%xmm6
  movsd  %xmm6,0x18(%rsp)
  mov    0x50(%rax),%rbp
  movapd %xmm14,%xmm7
  addsd  %xmm8,%xmm7
  movsd  %xmm7,0x20(%rsp)
  mov    0x80(%rax),%r12
  movq   %rbp,%xmm2
  addsd  %xmm6,%xmm2
  movq   %r12,%xmm0
  addsd  %xmm7,%xmm0
  subsd  %xmm0,%xmm2
  movsd  D47(%rip),%xmm1
  mulsd  %xmm1,%xmm2
  movq   %xmm2,%rcx
  movq   %r13,%xmm7
  movq   %r8,%xmm6
  addsd  %xmm6,%xmm7
  mov    0x60(%rax),%rbx
  movq   %r14,%xmm6
  movq   %rdi,%xmm0
  addsd  %xmm0,%xmm6
  movsd  0x70(%rax),%xmm9
  movq   %rbx,%xmm2
  addsd  %xmm7,%xmm2
  movapd %xmm6,%xmm0
  addsd  %xmm9,%xmm0
  subsd  %xmm0,%xmm2
  mulsd  %xmm1,%xmm2
  movq   %xmm2,%rdx
  movapd %xmm5,%xmm0
  addsd  %xmm14,%xmm0
  movapd %xmm10,%xmm2
  addsd  %xmm8,%xmm2
  movsd  %xmm2,0x28(%rsp)
  movapd %xmm4,%xmm15
  addsd  %xmm0,%xmm15
  movq   %r11,%xmm3
  addsd  %xmm2,%xmm3
  subsd  %xmm3,%xmm15
  mulsd  %xmm1,%xmm15
  movsd  0x48(%rax),%xmm1
  movsd  %xmm1,0x8(%rsp)
  mov    0x58(%rax),%r9
  movq   %r9,%xmm3
  addsd  %xmm1,%xmm3
  movsd  0x78(%rax),%xmm2
  mov    0x88(%rax),%r15
  movq   %r15,%xmm12
  addsd  %xmm2,%xmm12
  addsd  %xmm3,%xmm10
  addsd  %xmm5,%xmm10
  movq   %rbp,%xmm5
  addsd  %xmm5,%xmm10
  addsd  %xmm12,%xmm8
  addsd  %xmm14,%xmm8
  movq   %r12,%xmm5
  addsd  %xmm5,%xmm8
  movsd  D51(%rip),%xmm14
  comisd %xmm8,%xmm10
  ja     L24
  movsd  D69(%rip),%xmm14
L24:
  movq   %rbx,%xmm8
  addsd  0x8(%rsp),%xmm8
  addsd  %xmm2,%xmm8
  movq   %r9,%xmm10
  addsd  %xmm9,%xmm10
  movq   %r15,%xmm5
  addsd  %xmm5,%xmm10
  subsd  %xmm10,%xmm8
  movsd  D47(%rip),%xmm10
  mulsd  %xmm10,%xmm8
  movsd  0x10(%rsp),%xmm5
  addsd  %xmm4,%xmm5
  movq   %r11,%xmm1
  addsd  %xmm1,%xmm13
  subsd  %xmm13,%xmm5
  mulsd  %xmm10,%xmm5
  movq   %rbp,%xmm1
  addsd  %xmm1,%xmm3
  movq   %r12,%xmm1
  addsd  %xmm1,%xmm12
  subsd  %xmm12,%xmm3
  mulsd  %xmm10,%xmm3
  movq   %xmm3,%r10
  addsd  0x8(%rsp),%xmm7
  addsd  %xmm2,%xmm7
  movq   %r9,%xmm1
  addsd  %xmm1,%xmm6
  movq   %r15,%xmm1
  addsd  %xmm1,%xmm6
  movq   %rbx,%xmm3
  addsd  %xmm7,%xmm3
  movapd %xmm9,%xmm10
  addsd  %xmm6,%xmm10
  movsd  D51(%rip),%xmm13
  comisd %xmm10,%xmm3
  ja     L40
  movsd  D69(%rip),%xmm13
L40:
  movq   D113(%rip),%xmm3
  movapd %xmm11,%xmm10
  andpd  %xmm3,%xmm10
  movq   %rcx,%xmm12
  andpd  %xmm3,%xmm12
  addsd  %xmm10,%xmm12
  movq   %rdx,%xmm10
  andpd  %xmm3,%xmm10
  addsd  %xmm12,%xmm10
  divsd  %xmm10,%xmm11
  movsd  %xmm11,0x30(%rsp)
  movq   %rcx,%xmm12
  divsd  %xmm10,%xmm12
  movsd  %xmm12,0x38(%rsp)
  movq   %rdx,%xmm12
  divsd  %xmm10,%xmm12
  movsd  %xmm12,0x40(%rsp)
  movapd %xmm15,%xmm10
  andpd  %xmm3,%xmm10
  movapd %xmm14,%xmm12
  andpd  %xmm3,%xmm12
  addsd  %xmm10,%xmm12
  movapd %xmm8,%xmm10
  andpd  %xmm3,%xmm10
  addsd  %xmm12,%xmm10
  divsd  %xmm10,%xmm15
  movsd  %xmm15,0x48(%rsp)
  divsd  %xmm10,%xmm14
  movsd  %xmm14,0x50(%rsp)
  divsd  %xmm10,%xmm8
  movsd  %xmm8,0x58(%rsp)
  movapd %xmm5,%xmm8
  andpd  %xmm3,%xmm8
  movq   %r10,%xmm10
  andpd  %xmm3,%xmm10
  addsd  %xmm8,%xmm10
  movapd %xmm13,%xmm8
  andpd  %xmm3,%xmm8
  addsd  %xmm10,%xmm8
  divsd  %xmm8,%xmm5
  movsd  %xmm5,0x60(%rsp)
  movq   %r10,%xmm5
  divsd  %xmm8,%xmm5
  movsd  %xmm5,0x68(%rsp)
  divsd  %xmm8,%xmm13
  movsd  %xmm13,0x70(%rsp)
  andpd  %xmm3,%xmm11
  andpd  %xmm3,%xmm14
  andpd  %xmm3,%xmm13
  mov    $0x0,%edx
  comisd %xmm11,%xmm14
  jbe    L46
  movapd %xmm14,%xmm11
  mov    $0x1,%edx
L46:
  ucomisd %xmm11,%xmm13
  mov    $0x2,%ecx
  cmova  %ecx,%edx
  movsd  (%rax),%xmm12
  movsd  0x30(%rax),%xmm10
  movapd %xmm12,%xmm5
  addsd  %xmm10,%xmm5
  movsd  0x10(%rax),%xmm8
  movsd  0x40(%rax),%xmm14
  movsd  0x90(%rax),%xmm3
  movsd  0xc0(%rax),%xmm15
  movsd  0xa0(%rax),%xmm13
  mov    0xd0(%rax),%rax
  movq   %r13,%xmm11
  addsd  %xmm0,%xmm11
  movapd %xmm11,%xmm0
  movq   %r14,%xmm1
  addsd  %xmm1,%xmm0
  addsd  %xmm0,%xmm0
  movsd  %xmm5,0x10(%rsp)
  addsd  %xmm8,%xmm5
  addsd  %xmm14,%xmm5
  addsd  %xmm5,%xmm0
  movsd  D57(%rip),%xmm5
  movapd %xmm4,%xmm11
  mulsd  %xmm5,%xmm11
  addsd  %xmm11,%xmm0
  movapd %xmm3,%xmm11
  addsd  %xmm15,%xmm11
  addsd  %xmm13,%xmm11
  movq   %rax,%xmm1
  addsd  %xmm1,%xmm11
  movq   %r8,%xmm4
  addsd  0x28(%rsp),%xmm4
  movq   %rdi,%xmm1
  addsd  %xmm1,%xmm4
  addsd  %xmm4,%xmm4
  addsd  %xmm11,%xmm4
  movq   %r11,%xmm11
  mulsd  %xmm5,%xmm11
  addsd  %xmm4,%xmm11
  subsd  %xmm11,%xmm0
  addsd  %xmm8,%xmm12
  addsd  %xmm3,%xmm12
  addsd  %xmm13,%xmm12
  movsd  0x8(%rsp),%xmm1
  addsd  0x18(%rsp),%xmm1
  movq   %r9,%xmm11
  addsd  %xmm11,%xmm1
  addsd  %xmm1,%xmm1
  addsd  %xmm12,%xmm1
  movq   %rbp,%xmm4
  mulsd  %xmm5,%xmm4
  addsd  %xmm4,%xmm1
  addsd  %xmm14,%xmm10
  addsd  %xmm15,%xmm10
  movq   %rax,%xmm11
  addsd  %xmm11,%xmm10
  addsd  0x20(%rsp),%xmm2
  movq   %r15,%xmm11
  addsd  %xmm11,%xmm2
  addsd  %xmm2,%xmm2
  addsd  %xmm10,%xmm2
  movq   %r12,%xmm4
  mulsd  %xmm5,%xmm4
  addsd  %xmm4,%xmm2
  subsd  %xmm2,%xmm1
  addsd  0x10(%rsp),%xmm3
  addsd  %xmm15,%xmm3
  addsd  %xmm7,%xmm7
  addsd  %xmm7,%xmm3
  movq   %rbx,%xmm2
  mulsd  %xmm5,%xmm2
  addsd  %xmm2,%xmm3
  addsd  %xmm14,%xmm8
  addsd  %xmm13,%xmm8
  movq   %rax,%xmm7
  addsd  %xmm7,%xmm8
  addsd  %xmm6,%xmm6
  addsd  %xmm8,%xmm6
  movapd %xmm9,%xmm2
  mulsd  %xmm5,%xmm2
  addsd  %xmm2,%xmm6
  subsd  %xmm6,%xmm3
  movq   D113(%rip),%xmm4
  movapd %xmm0,%xmm2
  andpd  %xmm4,%xmm2
  movapd %xmm1,%xmm5
  andpd  %xmm4,%xmm5
  addsd  %xmm5,%xmm2
  movapd %xmm3,%xmm5
  andpd  %xmm4,%xmm5
  addsd  %xmm5,%xmm2
  addsd  D75(%rip),%xmm2
  divsd  %xmm2,%xmm0
  movsd  %xmm0,0x78(%rsp)
  divsd  %xmm2,%xmm1
  movsd  %xmm1,0x80(%rsp)
  divsd  %xmm2,%xmm3
  movsd  %xmm3,0x88(%rsp)
  andpd  %xmm4,%xmm0
  andpd  %xmm4,%xmm1
  andpd  %xmm4,%xmm3
  maxsd  %xmm0,%xmm1
  maxsd  %xmm1,%xmm3
  movslq %edx,%rax
  shl    $0x5,%rax
  movsd  0x30(%rsp,%rax,1),%xmm1
  andpd  %xmm4,%xmm1
  ucomisd %xmm3,%xmm1
  mov    $0x3,%eax
  cmova  %eax,%edx
  movslq %edx,%rdx
  lea    (%rdx,%rdx,1),%rax
  lea    (%rax,%rdx,1),%rcx
  movsd  0x30(%rsp,%rcx,8),%xmm0
  movsd  %xmm0,(%rsi)
  movsd  0x38(%rsp,%rcx,8),%xmm0
  movsd  %xmm0,0x8(%rsi)
  movsd  0x40(%rsp,%rcx,8),%xmm0
  movsd  %xmm0,0x10(%rsi)
  mov    0x98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L38
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L38:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D51
datatype: f64
name: disassemble_data
arguments: data_tag: D69
datatype: byte[8]
name: disassemble_data
arguments: data_tag: D47
datatype: f64
name: disassemble_data
arguments: data_tag: D113
datatype: qword
name: disassemble_data
arguments: data_tag: D57
datatype: f64
name: disassemble_data
arguments: data_tag: D75
datatype: byte[8]

tool: D51: 1

tool: {"D69": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xbf]}

tool: D47: 0.5

tool: D113: 9223372036854775807

tool: D57: 4

tool: {"D75": [0xa0,0xc2,0xeb,0xfe,0x4b,0x48,0xb4,0x39]}

assistant: ```c
void mycs(double c[3][3][3], double mxyz[3]) {
  double m1, m2, m[4][3], t0, t1, t2;
  int cn;
  m1 = c[0][1][0] + c[0][1][2] + c[0][0][1] + c[0][2][1] + c[0][1][1];
  m2 = c[2][1][0] + c[2][1][2] + c[2][0][1] + c[2][2][1] + c[2][1][1];
  m[0][0] = m1 > m2 ? 1. : -1.;
  m1 = c[0][0][1] + c[2][0][1] + c[1][0][1];
  m2 = c[0][2][1] + c[2][2][1] + c[1][2][1];
  m[0][1] = 0.5 * (m1 - m2);
  m1 = c[0][1][0] + c[2][1][0] + c[1][1][0];
  m2 = c[0][1][2] + c[2][1][2] + c[1][1][2];
  m[0][2] = 0.5 * (m1 - m2);
  m1 = c[0][0][1] + c[0][2][1] + c[0][1][1];
  m2 = c[2][0][1] + c[2][2][1] + c[2][1][1];
  m[1][0] = 0.5 * (m1 - m2);
  m1 = c[1][0][0] + c[1][0][2] + c[2][0][1] + c[0][0][1] + c[1][0][1];
  m2 = c[1][2][0] + c[1][2][2] + c[2][2][1] + c[0][2][1] + c[1][2][1];
  m[1][1] = m1 > m2 ? 1. : -1.;
  m1 = c[1][0][0] + c[1][1][0] + c[1][2][0];
  m2 = c[1][0][2] + c[1][1][2] + c[1][2][2];
  m[1][2] = 0.5 * (m1 - m2);
  m1 = c[0][1][0] + c[0][1][2] + c[0][1][1];
  m2 = c[2][1][0] + c[2][1][2] + c[2][1][1];
  m[2][0] = 0.5 * (m1 - m2);
  m1 = c[1][0][0] + c[1][0][2] + c[1][0][1];
  m2 = c[1][2][0] + c[1][2][2] + c[1][2][1];
  m[2][1] = 0.5 * (m1 - m2);
  m1 = c[0][1][0] + c[2][1][0] + c[1][0][0] + c[1][2][0] + c[1][1][0];
  m2 = c[0][1][2] + c[2][1][2] + c[1][0][2] + c[1][2][2] + c[1][1][2];
  m[2][2] = m1 > m2 ? 1. : -1.;
  t0 = fabs(m[0][0]) + fabs(m[0][1]) + fabs(m[0][2]);
  m[0][0] /= t0;
  m[0][1] /= t0;
  m[0][2] /= t0;
  t0 = fabs(m[1][0]) + fabs(m[1][1]) + fabs(m[1][2]);
  m[1][0] /= t0;
  m[1][1] /= t0;
  m[1][2] /= t0;
  t0 = fabs(m[2][0]) + fabs(m[2][1]) + fabs(m[2][2]);
  m[2][0] /= t0;
  m[2][1] /= t0;
  m[2][2] /= t0;
  t0 = fabs(m[0][0]);
  t1 = fabs(m[1][1]);
  t2 = fabs(m[2][2]);
  cn = 0;
  if (t1 > t0) {
    t0 = t1;
    cn = 1;
  }
  if (t2 > t0)
    cn = 2;
  m1 = c[0][0][0] + c[0][2][0] + c[0][0][2] + c[0][2][2] + 2. * (c[0][0][1] + c[0][2][1] + c[0][1][0] + c[0][1][2]) + 4. * c[0][1][1];
  m2 = c[2][0][0] + c[2][2][0] + c[2][0][2] + c[2][2][2] + 2. * (c[2][0][1] + c[2][2][1] + c[2][1][0] + c[2][1][2]) + 4. * c[2][1][1];
  m[3][0] = m1 - m2;
  m1 = c[0][0][0] + c[0][0][2] + c[2][0][0] + c[2][0][2] + 2. * (c[0][0][1] + c[2][0][1] + c[1][0][0] + c[1][0][2]) + 4. * c[1][0][1];
  m2 = c[0][2][0] + c[0][2][2] + c[2][2][0] + c[2][2][2] + 2. * (c[0][2][1] + c[2][2][1] + c[1][2][0] + c[1][2][2]) + 4. * c[1][2][1];
  m[3][1] = m1 - m2;
  m1 = c[0][0][0] + c[0][2][0] + c[2][0][0] + c[2][2][0] + 2. * (c[0][1][0] + c[2][1][0] + c[1][0][0] + c[1][2][0]) + 4. * c[1][1][0];
  m2 = c[0][0][2] + c[0][2][2] + c[2][0][2] + c[2][2][2] + 2. * (c[0][1][2] + c[2][1][2] + c[1][0][2] + c[1][2][2]) + 4. * c[1][1][2];
  m[3][2] = m1 - m2;
  t0 = fabs(m[3][0]) + fabs(m[3][1]) + fabs(m[3][2]) + 1.e-30;
  m[3][0] /= t0;
  m[3][1] /= t0;
  m[3][2] /= t0;
  t0 = fabs(m[3][0]);
  t1 = fabs(m[3][1]);
  t2 = fabs(m[3][2]);
  if (t1 > t0)
    t0 = t1;
  if (t2 > t0)
    t0 = t2;
  if (fabs(m[cn][cn]) > t0)
    cn = 3;
  mxyz[0] = m[cn][0];
  mxyz[1] = m[cn][1];
  mxyz[2] = m[cn][2];
  return;
}
```