user: What is the c source code of the assembly code below?

```asm
<trapizoidalRule2D>:
  endbr64
  push   %r15
  push   %r14
  mov    %edx,%r14d
  push   %r13
  movq   %xmm3,%r13
  movapd %xmm0,%xmm3
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  movq   %xmm1,%rbx
  subsd  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  sub    $0x98,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  movsd  %xmm3,0x20(%rsp)
  divsd  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  movsd  %xmm2,0x10(%rsp)
  movq   $0x0,0x58(%rsp)
  cvtsi2sd %esi,%xmm0
  movq   $0x0,0x60(%rsp)
  movq   $0x0,0x68(%rsp)
  movq   $0x0,0x70(%rsp)
  movq   $0x0,0x78(%rsp)
  movsd  %xmm1,0x30(%rsp)
  movq   %r13,%xmm1
  subsd  %xmm2,%xmm1
  divsd  %xmm0,%xmm1
  movapd %xmm3,%xmm0
  movsd  %xmm1,0x18(%rsp)
  movapd %xmm2,%xmm1
  call   *%rdi
  movsd  0x10(%rsp),%xmm1
  movsd  %xmm0,0x8(%rsp)
  movq   %rbx,%xmm0
  call   *%rbp
  movsd  0x8(%rsp),%xmm7
  movq   %r13,%xmm1
  addsd  %xmm0,%xmm7
  movsd  0x20(%rsp),%xmm0
  movsd  %xmm7,0x8(%rsp)
  call   *%rbp
  addsd  0x8(%rsp),%xmm0
  movq   %r13,%xmm1
  movsd  %xmm0,0x8(%rsp)
  movq   %rbx,%xmm0
  call   *%rbp
  movsd  0x8(%rsp),%xmm3
  addsd  %xmm0,%xmm3
  movsd  %xmm3,0x48(%rsp)
  cmp    $0x1,%r14d
  jle    L67
  pxor   %xmm3,%xmm3
  mov    $0x1,%r15d
  movsd  %xmm3,0x8(%rsp)
  nopl   (%rax)
L111:
  pxor   %xmm2,%xmm2
  movsd  %xmm3,0x38(%rsp)
  movsd  0x10(%rsp),%xmm1
  cvtsi2sd %r15d,%xmm2
  mulsd  0x30(%rsp),%xmm2
  add    $0x1,%r15d
  addsd  0x20(%rsp),%xmm2
  movapd %xmm2,%xmm0
  movsd  %xmm2,0x28(%rsp)
  call   *%rbp
  addsd  0x8(%rsp),%xmm0
  movsd  0x28(%rsp),%xmm2
  movq   %r13,%xmm1
  movsd  %xmm0,0x8(%rsp)
  movsd  %xmm0,0x58(%rsp)
  movapd %xmm2,%xmm0
  call   *%rbp
  movsd  0x38(%rsp),%xmm3
  addsd  %xmm0,%xmm3
  movsd  %xmm3,0x60(%rsp)
  cmp    %r15d,%r14d
  jne    L111
L102:
  pxor   %xmm2,%xmm2
  mov    $0x1,%r13d
  movsd  %xmm2,0x28(%rsp)
  cmp    $0x1,%r12d
  jle    L57
  nopw   0x0(%rax,%rax,1)
L23:
  pxor   %xmm1,%xmm1
  movsd  %xmm2,0x40(%rsp)
  movsd  0x20(%rsp),%xmm0
  cvtsi2sd %r13d,%xmm1
  mulsd  0x18(%rsp),%xmm1
  add    $0x1,%r13d
  addsd  0x10(%rsp),%xmm1
  movsd  %xmm1,0x38(%rsp)
  call   *%rbp
  addsd  0x28(%rsp),%xmm0
  movsd  0x38(%rsp),%xmm1
  movsd  %xmm0,0x28(%rsp)
  movsd  %xmm0,0x68(%rsp)
  movq   %rbx,%xmm0
  call   *%rbp
  movsd  0x40(%rsp),%xmm2
  addsd  %xmm0,%xmm2
  movsd  %xmm2,0x70(%rsp)
  cmp    %r13d,%r12d
  jne    L23
L57:
  movsd  0x8(%rsp),%xmm0
  pxor   %xmm2,%xmm2
  mov    $0x1,%r13d
  addsd  %xmm0,%xmm0
  movsd  %xmm0,0x58(%rsp)
  movsd  0x60(%rsp),%xmm0
  addsd  %xmm0,%xmm0
  movsd  %xmm0,0x60(%rsp)
  movsd  0x68(%rsp),%xmm0
  addsd  %xmm0,%xmm0
  movsd  %xmm0,0x68(%rsp)
  movsd  0x70(%rsp),%xmm0
  addsd  %xmm0,%xmm0
  movsd  %xmm0,0x70(%rsp)
  cmp    $0x1,%r14d
  jle    L59
  nopl   0x0(%rax)
L65:
  cmp    $0x1,%r12d
  jle    L77
  pxor   %xmm0,%xmm0
  mov    $0x1,%ebx
  cvtsi2sd %r13d,%xmm0
  mulsd  0x30(%rsp),%xmm0
  addsd  0x20(%rsp),%xmm0
  movq   %xmm0,%r15
  nopl   (%rax)
L22:
  pxor   %xmm1,%xmm1
  movsd  %xmm2,0x8(%rsp)
  movq   %r15,%xmm0
  cvtsi2sd %ebx,%xmm1
  mulsd  0x18(%rsp),%xmm1
  add    $0x1,%ebx
  addsd  0x10(%rsp),%xmm1
  call   *%rbp
  movsd  0x8(%rsp),%xmm2
  addsd  %xmm0,%xmm2
  movsd  %xmm2,0x78(%rsp)
  cmp    %ebx,%r12d
  jne    L22
L77:
  add    $0x1,%r13d
  cmp    %r13d,%r14d
  jne    L65
L59:
  mulsd  D16(%rip),%xmm2
  lea    0x50(%rsp),%rax
  lea    0x80(%rsp),%rdx
  pxor   %xmm1,%xmm1
  movsd  %xmm2,0x78(%rsp)
  jmp    L108
  nopl   0x0(%rax,%rax,1)
L4:
  movsd  (%rax),%xmm3
  movsd  %xmm3,0x48(%rsp)
L108:
  add    $0x8,%rax
  addsd  0x48(%rsp),%xmm1
  cmp    %rdx,%rax
  jne    L4
  movsd  0x30(%rsp),%xmm0
  mulsd  0x18(%rsp),%xmm0
  mulsd  D10(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  mov    0x88(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L31
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L67:
  movq   $0x0,0x8(%rsp)
  jmp    L102
L31:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D16
type: f32[2]
name: unpack_data
arguments: data_tag: D10
type: f32[2]

tool: {"D16": [0.0,2.25]}

tool: {"D10": [0.0,1.625]}

assistant: ```c
double trapizoidalRule2D(double (*f)(double, double), double a, double b, double c, double d, int n, int m) {
  int i, j;
  double sum[6], h, k, integral = 0, x, y;
  h = (b - a) / (double)m;
  k = (d - c) / (double)n;
  for (i = 0; i < 6; i++)
    sum[i] = 0;
  sum[0] = f(a, c) + f(b, c) + f(a, d) + f(b, d);
  for (i = 1; i < m; i++) {
    x = a + (i * h);
    sum[1] += f(x, c);
    sum[2] += f(x, d);
  }
  for (j = 1; j < n; j++) {
    y = c + (j * k);
    sum[3] += f(a, y);
    sum[4] += f(b, y);
  }
  for (i = 1; i < 5; i++)
    sum[i] *= 2;
  for (i = 1; i < m; i++) {
    for (j = 1; j < n; j++) {
      x = a + (i * h);
      y = c + (j * k);
      sum[5] += f(x, y);
    }
  }
  sum[5] *= 4;
  for (i = 0; i < 6; i++)
    integral += sum[i];
  integral = ((h * k) / 4) * integral;
  return integral;
}
```