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

```asm
<fisTrapezoidMf>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  movsd  %xmm0,0x8(%rsp)
  mov    (%rdi),%r13
  mov    0x8(%rdi),%rbx
  mov    0x10(%rdi),%rbp
  mov    0x18(%rdi),%r12
  movq   %r13,%xmm5
  movq   %rbx,%xmm6
  comisd %xmm6,%xmm5
  ja     L14
L195:
  movq   %rbx,%xmm7
  movq   %rbp,%xmm3
  comisd %xmm3,%xmm7
  ja     L53
L19:
  movq   %rbp,%xmm2
  movq   %r12,%xmm5
  comisd %xmm5,%xmm2
  ja     L42
L30:
  movsd  0x8(%rsp),%xmm4
  movq   %rbx,%xmm6
  comisd %xmm6,%xmm4
  jae    L77
  movq   %r13,%xmm7
  comisd %xmm4,%xmm7
  ja     L89
  ucomisd %xmm6,%xmm7
  jp     L122
  jne    L122
L89:
  pxor   %xmm0,%xmm0
  movq   %rbp,%xmm1
  comisd 0x8(%rsp),%xmm1
  jae    L167
  jmp    L186
L14:
  movq   %r12,%xmm3
  movq   %rbp,%xmm2
  movq   %rbx,%xmm1
  movq   %r13,%xmm0
  lea    D75(%rip),%rdi
  call   <printf@plt>
  lea    D67(%rip),%rdi
  call   <fisError@plt>
  jmp    L195
L53:
  movq   %r12,%xmm3
  movq   %rbp,%xmm2
  movq   %rbx,%xmm1
  movq   %r13,%xmm0
  lea    D75(%rip),%rdi
  call   <printf@plt>
  lea    D25(%rip),%rdi
  call   <fisError@plt>
  jmp    L19
L42:
  movq   %r12,%xmm3
  movq   %rbx,%xmm1
  movq   %r13,%xmm0
  lea    D75(%rip),%rdi
  call   <printf@plt>
  lea    D71(%rip),%rdi
  call   <fisError@plt>
  jmp    L30
L122:
  movsd  0x8(%rsp),%xmm3
  movapd %xmm3,%xmm0
  movq   %r13,%xmm5
  subsd  %xmm5,%xmm0
  movq   %rbx,%xmm1
  subsd  %xmm5,%xmm1
  divsd  %xmm1,%xmm0
  movsd  D43(%rip),%xmm1
  movq   %rbp,%xmm7
  comisd %xmm3,%xmm7
  jae    L134
  pxor   %xmm1,%xmm1
  movq   %r12,%xmm6
  comisd %xmm6,%xmm3
  ja     L134
  jmp    L110
L158:
  movq   %r12,%xmm1
  subsd  0x8(%rsp),%xmm1
  movq   %r12,%xmm2
  movq   %rbp,%xmm5
  subsd  %xmm5,%xmm2
  divsd  %xmm2,%xmm1
  jmp    L134
L79:
  pxor   %xmm0,%xmm0
  jmp    L167
L77:
  movsd  D43(%rip),%xmm0
  movq   %rbp,%xmm1
  comisd 0x8(%rsp),%xmm1
  jae    L167
L186:
  movsd  0x8(%rsp),%xmm7
  movq   %r12,%xmm2
  comisd %xmm2,%xmm7
  ja     L79
L110:
  movq   %rbp,%xmm2
  movq   %r12,%xmm1
  ucomisd %xmm1,%xmm2
  jp     L158
  pxor   %xmm1,%xmm1
  jne    L158
L134:
  minsd  %xmm1,%xmm0
L167:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D75
datatype: string
name: extract_symbolic_data
arguments: tag: D67
datatype: string
name: extract_symbolic_data
arguments: tag: D25
datatype: string
name: extract_symbolic_data
arguments: tag: D71
datatype: string
name: extract_symbolic_data
arguments: tag: D43
datatype: f64

tool: D75: a = %f, b = %f, c = %f, d = %f


tool: D67: Illegal parameters in fisTrapezoidMf() --> a > b

tool: D25: Illegal parameters in fisTrapezoidMf() --> b > c

tool: D71: Illegal parameters in fisTrapezoidMf() --> c > d

tool: D43: 1

assistant: ```c
double fisTrapezoidMf(double x, double *params) {
  double a = params[0], b = params[1], c = params[2], d = params[3];
  double y1 = 0, y2 = 0;
  if (a > b) {
    printf("a = %f, b = %f, c = %f, d = %f\n", a, b, c, d);
    fisError("Illegal parameters in fisTrapezoidMf() --> a > b");
  }
  if (b > c) {
    printf("a = %f, b = %f, c = %f, d = %f\n", a, b, c, d);
    fisError("Illegal parameters in fisTrapezoidMf() --> b > c");
  }
  if (c > d) {
    printf("a = %f, b = %f, c = %f, d = %f\n", a, b, c, d);
    fisError("Illegal parameters in fisTrapezoidMf() --> c > d");
  }
  if (b <= x)
    y1 = 1;
  else if (x < a)
    y1 = 0;
  else if (a != b)
    y1 = (x - a) / (b - a);
  if (x <= c)
    y2 = 1;
  else if (d < x)
    y2 = 0;
  else if (c != d)
    y2 = (d - x) / (d - c);
  return (((y1) < (y2) ? (y1) : (y2)));
}
```