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

```asm
<frac>:
  endbr64
  movapd %xmm0,%xmm7
  movsd  D38(%rip),%xmm0
  mov    %rdi,%r9
  mov    %rsi,%r8
  comisd %xmm7,%xmm0
  movsd  D43(%rip),%xmm0
  ja     L108
  comisd D32(%rip),%xmm7
  ja     L108
  pxor   %xmm8,%xmm8
  comisd %xmm1,%xmm8
  ja     L108
  cvttsd2si %xmm7,%eax
  movl   $0x1,(%rsi)
  movsd  D18(%rip),%xmm5
  mov    $0x1,%edx
  movq   D21(%rip),%xmm9
  movsd  D28(%rip),%xmm6
  movsd  D6(%rip),%xmm10
  mov    %eax,(%rdi)
  mov    (%r8),%edi
  lea    0x1(%rax),%esi
  nop
L10:
  pxor   %xmm3,%xmm3
  pxor   %xmm0,%xmm0
  cvtsi2sd %edi,%xmm3
  cvtsi2sd %eax,%xmm0
  mulsd  %xmm7,%xmm3
  ucomisd %xmm0,%xmm3
  jp     L40
  movapd %xmm8,%xmm4
  je     L107
L40:
  pxor   %xmm2,%xmm2
  pxor   %xmm4,%xmm4
  movapd %xmm3,%xmm11
  cvtsi2sd %edx,%xmm2
  subsd  %xmm0,%xmm11
  cvtsi2sd %esi,%xmm4
  mulsd  %xmm7,%xmm2
  subsd  %xmm2,%xmm4
  divsd  %xmm11,%xmm4
  comisd %xmm5,%xmm4
  ja     L107
  mov    %esi,(%r9)
  mov    (%r8),%r10d
  pxor   %xmm0,%xmm0
  mov    %edx,%edi
  mov    %edx,(%r8)
  mov    (%r9),%ecx
  mov    %eax,%esi
  movapd %xmm2,%xmm3
  mov    %r10d,%edx
  cvtsi2sd %ecx,%xmm0
  mov    %ecx,%eax
L107:
  movapd %xmm0,%xmm2
  movapd %xmm5,%xmm0
  divsd  %xmm3,%xmm2
  subsd  %xmm2,%xmm0
  andpd  %xmm9,%xmm0
  comisd %xmm0,%xmm1
  jae    L108
  movapd %xmm5,%xmm2
  nopw   0x0(%rax,%rax,1)
L26:
  mulsd  %xmm6,%xmm2
  movapd %xmm0,%xmm3
  mulsd  %xmm2,%xmm3
  comisd %xmm3,%xmm5
  ja     L26
  addsd  %xmm10,%xmm3
  pxor   %xmm0,%xmm0
  cvttsd2si %xmm3,%ecx
  movapd %xmm5,%xmm3
  divsd  %xmm2,%xmm3
  cvtsi2sd %ecx,%xmm0
  mulsd  %xmm3,%xmm0
  comisd %xmm0,%xmm1
  jae    L108
  ucomisd %xmm8,%xmm4
  jp     L8
  je     L106
L8:
  comisd %xmm5,%xmm4
  ja     L115
  movapd %xmm5,%xmm2
  divsd  %xmm4,%xmm2
  movapd %xmm2,%xmm4
L115:
  cvttsd2si %xmm4,%ecx
  mov    %ecx,%r10d
  imul   %edi,%ecx
  imul   %eax,%r10d
  add    %ecx,%edx
  add    %r10d,%esi
  add    %esi,%eax
  mov    %eax,(%r9)
  mov    (%r8),%edi
  add    %edx,%edi
  mov    %edi,(%r8)
  mov    (%r9),%eax
  jmp    L10
L108:
  ret
  nopl   0x0(%rax)
L106:
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D38
type_infered: byte[8]
name: parse_data
arguments: data_tag: D43
type_infered: f32[2]
name: parse_data
arguments: data_tag: D32
type_infered: byte[16]
name: parse_data
arguments: data_tag: D18
type_infered: f64
name: parse_data
arguments: data_tag: D21
type_infered: qword
name: parse_data
arguments: data_tag: D28
type_infered: f64
name: parse_data
arguments: data_tag: D6
type_infered: f64

tool: {"D38": [0x4c,0xce,0x61,0xe3,0xa7,0x9d,0xf4,0x3d]}

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

tool: {"D32": [0x00,0x00,0x00,0x20,0x5f,0xa0,0x22,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x40]}

tool: D18: 1

tool: D21: 9223372036854775807

tool: D28: 10

tool: D6: 0.5

assistant: ```c
double frac(v, n, d, error)
double v, error;
int *n, *d;
{
  int D, N, t;
  double epsilon, r, m, fabs();
  if (v < 3.0e-10 || v > 4.0e+10 || error < 0.0)
    return (-1.0);
  *d = D = 1;
  *n = (int)v;
  N = (*n) + 1;
  goto three;
one:
  if (r > 1.0)
    goto two;
  r = 1.0 / r;
two:
  N += (*n) * (int)r;
  D += (*d) * (int)r;
  (*n) += N;
  (*d) += D;
three:
  r = 0.0;
  if (v * (*d) == (double)(*n))
    goto four;
  r = (N - v * D) / (v * (*d) - (*n));
  if (r > 1.0)
    goto four;
  t = N;
  N = (*n);
  *n = t;
  t = D;
  D = (*d);
  *d = t;
four:
  epsilon = fabs(1.0 - (*n) / (v * (*d)));
  if (epsilon <= error)
    goto six;
  m = 1.0;
  do {
    m *= 10.0;
  } while (m * epsilon < 1.0);
  epsilon = 1.0 / m * ((int)(0.5 + m * epsilon));
six:
  if (epsilon <= error)
    return (epsilon);
  if (r != 0.0)
    goto one;
}
```