user: 请将以下的汇编代码转换成C语言代码:

```asm
<miundefined>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %rsi,%r15
  mov    %rdx,%r13
  mov    %rcx,%r12
  mov    %r8,%rbx
  mov    %r9d,%ebp
  mov    0x88(%rsp),%r14d
  mov    $0x8,%esi
  mov    %r14d,%edi
  call   <calloc@plt>
  mov    %rax,0x30(%rsp)
  mov    $0x8,%esi
  mov    %r14d,%edi
  call   <calloc@plt>
  mov    %rax,0x28(%rsp)
  mov    %r14d,%edx
  imul   %r14d,%edx
  mov    %edx,%edi
  mov    $0x8,%esi
  call   <calloc@plt>
  mov    %rax,%r9
  mov    %rax,0x38(%rsp)
  sub    $0x8,%rsp
  push   %r14
  mov    0x90(%rsp),%eax
  push   %rax
  push   %rbp
  push   0x48(%rsp)
  mov    0x58(%rsp),%rbp
  push   %rbp
  mov    %rbx,%r8
  mov    %r12,%rcx
  mov    %r13,%rdx
  mov    %r15,%rsi
  mov    0x38(%rsp),%rdi
  call   <histU@plt>
  add    $0x30,%rsp
  test   %r14d,%r14d
  jle    L65
  mov    %r14d,%eax
  lea    0x0(,%rax,8),%r15
  lea    (%r15,%rbp,1),%r13
  mov    %rbp,%rbx
  pxor   %xmm5,%xmm5
  movsd  %xmm5,0x20(%rsp)
  movsd  %xmm5,0x18(%rsp)
  mov    0x28(%rsp),%r12
  sub    %rbp,%r12
  jmp    L5
L6:
  movq   %rbp,%xmm0
  call   <log2d@plt>
  movq   %rbp,%xmm6
  mulsd  %xmm6,%xmm0
  movsd  0x18(%rsp),%xmm6
  subsd  %xmm0,%xmm6
  movsd  %xmm6,0x18(%rsp)
  jmp    L41
L89:
  add    $0x8,%rbx
  cmp    %r13,%rbx
  je     L112
L5:
  mov    (%rbx),%rbp
  movq   %rbp,%xmm5
  pxor   %xmm6,%xmm6
  comisd %xmm6,%xmm5
  ja     L6
L41:
  mov    (%r12,%rbx,1),%rbp
  movq   %rbp,%xmm7
  pxor   %xmm5,%xmm5
  comisd %xmm5,%xmm7
  jbe    L89
  movq   %rbp,%xmm0
  call   <log2d@plt>
  movq   %rbp,%xmm7
  mulsd  %xmm7,%xmm0
  movsd  0x20(%rsp),%xmm7
  subsd  %xmm0,%xmm7
  movsd  %xmm7,0x20(%rsp)
  jmp    L89
L112:
  movslq %r14d,%rax
  shl    $0x3,%rax
  mov    %rax,0x10(%rsp)
  mov    0x38(%rsp),%rax
  lea    (%rax,%r15,1),%r12
  pxor   %xmm6,%xmm6
  movsd  %xmm6,0x8(%rsp)
  mov    $0x0,%r13d
  mov    %r14d,%r15d
  neg    %r15
  shl    $0x3,%r15
  jmp    L0
L99:
  add    $0x8,%rbx
  cmp    %r12,%rbx
  je     L69
L12:
  mov    (%rbx),%rbp
  movq   %rbp,%xmm1
  pxor   %xmm2,%xmm2
  comisd %xmm2,%xmm1
  jbe    L99
  movq   %rbp,%xmm0
  call   <log2d@plt>
  movq   %rbp,%xmm4
  mulsd  %xmm4,%xmm0
  movsd  0x8(%rsp),%xmm3
  subsd  %xmm0,%xmm3
  movsd  %xmm3,0x8(%rsp)
  jmp    L99
L69:
  add    $0x1,%r13d
  add    0x10(%rsp),%r12
  cmp    %r13d,%r14d
  je     L75
L0:
  lea    (%r15,%r12,1),%rbx
  jmp    L12
L65:
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x20(%rsp)
  movsd  %xmm7,0x18(%rsp)
  movsd  %xmm7,0x8(%rsp)
L75:
  mov    0x38(%rsp),%rdi
  call   <free@plt>
  mov    0x30(%rsp),%rdi
  call   <free@plt>
  mov    0x28(%rsp),%rdi
  call   <free@plt>
  movsd  0x20(%rsp),%xmm0
  addsd  0x18(%rsp),%xmm0
  subsd  0x8(%rsp),%xmm0
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
double miundefined(const double *x, const double *y, const int *knots, const double *wx, const double *wy, int numSamples, int splineOrder, int numBins) {
  int curBin, curBinX, curBinY;
  double *h1 = (double *)calloc(numBins, sizeof(double));
  double *h2 = (double *)calloc(numBins, sizeof(double));
  double *h12 = (double *)calloc(numBins * numBins, sizeof(double));
  double e1 = 0;
  double e2 = 0;
  double e12 = 0;
  double p;
  histU(x, y, knots, wx, wy, h12, h1, h2, numSamples, splineOrder, numBins);
  for (curBin = 0; curBin < numBins; curBin++) {
    p = h1[curBin];
    if (p > 0)
      e1 -= p * log2d(p);
    p = h2[curBin];
    if (p > 0)
      e2 -= p * log2d(p);
  }
  for (curBinX = 0; curBinX < numBins; curBinX++)
    for (curBinY = 0; curBinY < numBins; curBinY++) {
      p = h12[curBinX * numBins + curBinY];
      if (p > 0)
        e12 -= p * log2d(p);
    }
  free(h12);
  free(h1);
  free(h2);
  return e1 + e2 - e12;
}
```