user: Translate the below assembly code into C programming language:

```asm
<fisTrapezoidMf>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  movsd  %xmm0,-0x38(%rbp)
  mov    %rdi,-0x40(%rbp)
  mov    -0x40(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  mov    -0x40(%rbp),%rax
  movsd  0x8(%rax),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x40(%rbp),%rax
  movsd  0x10(%rax),%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x40(%rbp),%rax
  movsd  0x18(%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  -0x20(%rbp),%xmm0
  comisd -0x18(%rbp),%xmm0
  jbe    L82
  movsd  -0x8(%rbp),%xmm2
  movsd  -0x10(%rbp),%xmm1
  movsd  -0x18(%rbp),%xmm0
  mov    -0x20(%rbp),%rax
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  call   <fisError@plt>
L82:
  movsd  -0x18(%rbp),%xmm0
  comisd -0x10(%rbp),%xmm0
  jbe    L106
  movsd  -0x8(%rbp),%xmm2
  movsd  -0x10(%rbp),%xmm1
  movsd  -0x18(%rbp),%xmm0
  mov    -0x20(%rbp),%rax
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  call   <fisError@plt>
L106:
  movsd  -0x10(%rbp),%xmm0
  comisd -0x8(%rbp),%xmm0
  jbe    L140
  movsd  -0x8(%rbp),%xmm2
  movsd  -0x10(%rbp),%xmm1
  movsd  -0x18(%rbp),%xmm0
  mov    -0x20(%rbp),%rax
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    D20(%rip),%rax
  mov    %rax,%rdi
  call   <fisError@plt>
L140:
  movsd  -0x38(%rbp),%xmm0
  comisd -0x18(%rbp),%xmm0
  jb     L94
  movsd  D58(%rip),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  jmp    L14
L94:
  movsd  -0x20(%rbp),%xmm0
  comisd -0x38(%rbp),%xmm0
  jbe    L7
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  jmp    L14
L7:
  movsd  -0x20(%rbp),%xmm0
  ucomisd -0x18(%rbp),%xmm0
  jp     L89
  movsd  -0x20(%rbp),%xmm0
  ucomisd -0x18(%rbp),%xmm0
  je     L14
L89:
  movsd  -0x38(%rbp),%xmm0
  subsd  -0x20(%rbp),%xmm0
  movsd  -0x18(%rbp),%xmm1
  subsd  -0x20(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
L14:
  movsd  -0x10(%rbp),%xmm0
  comisd -0x38(%rbp),%xmm0
  jb     L69
  movsd  D58(%rip),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  jmp    L0
L69:
  movsd  -0x38(%rbp),%xmm0
  comisd -0x8(%rbp),%xmm0
  jbe    L131
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x28(%rbp)
  jmp    L0
L131:
  movsd  -0x10(%rbp),%xmm0
  ucomisd -0x8(%rbp),%xmm0
  jp     L120
  movsd  -0x10(%rbp),%xmm0
  ucomisd -0x8(%rbp),%xmm0
  je     L0
L120:
  movsd  -0x8(%rbp),%xmm0
  subsd  -0x38(%rbp),%xmm0
  movsd  -0x8(%rbp),%xmm1
  subsd  -0x10(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x28(%rbp)
L0:
  movsd  -0x28(%rbp),%xmm0
  comisd -0x30(%rbp),%xmm0
  jbe    L77
  movsd  -0x30(%rbp),%xmm0
  jmp    L71
L77:
  movsd  -0x28(%rbp),%xmm0
L71:
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D28
type: string
name: parse_data
arguments: label: D8
type: string
name: parse_data
arguments: label: D24
type: string
name: parse_data
arguments: label: D20
type: string
name: parse_data
arguments: label: D58
type: f64

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


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

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

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

tool: D58: 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)));
}
```