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

```asm
<compute_ref_coefs>:
  endbr64
  sub    $0x3d8,%rsp
  mov    %rdi,%r8
  mov    %rdx,%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x3c8(%rsp)
  xor    %eax,%eax
  mov    %esi,%ecx
  and    $0xff,%ecx
  je     L56
  lea    0x8(%r8),%rdx
  lea    0x1e0(%rsp),%rax
  movzbl %sil,%esi
  lea    -0x1(%rsi),%esi
  lea    0x10(%r8,%rsi,8),%rsi
L24:
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  movsd  %xmm0,-0x1e0(%rax)
  add    $0x8,%rdx
  add    $0x8,%rax
  cmp    %rsi,%rdx
  jne    L24
  movsd  (%r8),%xmm1
  movsd  0x1e0(%rsp),%xmm4
  movapd %xmm4,%xmm0
  xorpd  D25(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rdi)
  mulsd  %xmm0,%xmm4
  addsd  %xmm1,%xmm4
  lea    -0x1(%rcx),%r8d
  mov    $0x1,%esi
  cmp    $0x1,%ecx
  jle    L90
  lea    0x8(%rsp),%r9
  movq   D25(%rip),%xmm5
  jmp    L138
L56:
  movsd  0x1e0(%rsp),%xmm0
  xorpd  D25(%rip),%xmm0
  divsd  (%r8),%xmm0
  movsd  %xmm0,(%rdx)
L36:
  sub    $0x1,%ecx
  js     L141
L108:
  movslq %ecx,%rax
  movq   D7(%rip),%xmm2
  movsd  D1(%rip),%xmm1
L119:
  movsd  (%rdi,%rax,8),%xmm0
  andpd  %xmm2,%xmm0
  comisd %xmm1,%xmm0
  ja     L148
  sub    $0x1,%rax
  test   %eax,%eax
  jns    L119
  mov    $0x1,%eax
  jmp    L86
L81:
  movsd  -0x8(%rdi,%rsi,8),%xmm3
  mov    %rsp,%rax
  lea    -0x1(%r8),%edx
  lea    (%r9,%rdx,8),%rdx
L76:
  movsd  0x1e8(%rax),%xmm0
  movsd  (%rax),%xmm2
  movapd %xmm3,%xmm1
  mulsd  %xmm2,%xmm1
  addsd  %xmm0,%xmm1
  movsd  %xmm1,0x1e0(%rax)
  mulsd  %xmm3,%xmm0
  addsd  %xmm2,%xmm0
  movsd  %xmm0,(%rax)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L76
L104:
  movsd  0x1e0(%rsp),%xmm0
  movapd %xmm0,%xmm1
  xorpd  %xmm5,%xmm1
  divsd  %xmm4,%xmm1
  movsd  %xmm1,(%rdi,%rsi,8)
  mulsd  %xmm1,%xmm0
  addsd  %xmm0,%xmm4
  add    $0x1,%rsi
  sub    $0x1,%r8d
  cmp    %esi,%ecx
  jle    L36
L138:
  test   %r8d,%r8d
  jg     L81
  jmp    L104
L148:
  add    $0x1,%eax
L86:
  mov    0x3c8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L128
  add    $0x3d8,%rsp
  ret
L141:
  mov    $0x1,%eax
  jmp    L86
L90:
  mov    $0x0,%ecx
  jmp    L108
L128:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D25
type_infered: byte[16]
name: read_data
arguments: tag: D7
type_infered: qword
name: read_data
arguments: tag: D1
type_infered: f64

tool: {"D25": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: D7: 9223372036854775807

tool: D1: 0.1

assistant: ```c
unsigned char compute_ref_coefs(double *autoc, unsigned char max_order, double *ref) {
  int i, j;
  double error;
  double gen[2][60];
  unsigned char order_est;
  for (i = 0; i < max_order; i++)
    gen[0][i] = gen[1][i] = autoc[i + 1];
  error = autoc[0];
  ref[0] = -gen[1][0] / error;
  error += gen[1][0] * ref[0];
  for (i = 1; i < max_order; i++) {
    for (j = 0; j < max_order - i; j++) {
      gen[1][j] = gen[1][j + 1] + ref[i - 1] * gen[0][j];
      gen[0][j] = gen[1][j + 1] * ref[i - 1] + gen[0][j];
    }
    ref[i] = -gen[1][0] / error;
    error += gen[1][0] * ref[i];
  }
  order_est = 1;
  for (i = max_order - 1; i >= 0; i--) {
    if (fabs(ref[i]) > 0.10) {
      order_est = i + 1;
      break;
    }
  }
  return (order_est);
}
```