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

```asm
<MIDWT>:
  endbr64
  push   %r15
  mov    %r8d,%r15d
  push   %r14
  mov    %esi,%r14d
  push   %r13
  push   %r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  sub    $0x108,%rsp
  cmp    %esi,%edx
  cmovge %edx,%r14d
  mov    %rdi,(%rsp)
  mov    0x140(%rsp),%rbx
  mov    %esi,0x8(%rsp)
  mov    $0x8,%esi
  mov    %r14d,%edi
  mov    %r9d,0xc4(%rsp)
  mov    %edx,0x4c(%rsp)
  call   <calloc@plt>
  mov    %r15d,%edi
  mov    $0x8,%esi
  shr    $0x1f,%edi
  mov    %rax,%r12
  mov    %edi,%eax
  add    %r15d,%eax
  mov    %eax,%r13d
  sar    %r13d
  lea    -0x1(%r14,%r13,1),%r14d
  mov    %r14d,%edi
  call   <calloc@plt>
  mov    $0x8,%esi
  mov    %r14d,%edi
  mov    %rax,0x20(%rsp)
  call   <calloc@plt>
  mov    $0x8,%esi
  mov    %r15d,%edi
  mov    %rax,0x28(%rsp)
  call   <calloc@plt>
  mov    $0x8,%esi
  mov    %r15d,%edi
  mov    %rax,0x18(%rsp)
  call   <calloc@plt>
  mov    0x8(%rsp),%esi
  mov    (%rsp),%r11
  mov    %rax,0x10(%rsp)
  mov    0x4c(%rsp),%eax
  mov    %esi,%r9d
  cmp    $0x1,%eax
  je     L354
  mov    %eax,%edx
  mov    %esi,0x4c(%rsp)
  imul   %esi,%edx
  mov    %eax,0x8(%rsp)
  mov    %edx,%r9d
L354:
  movslq %r15d,%r8
  test   %r8,%r8
  jle    L282
  mov    0x18(%rsp),%r14
  lea    0x8(%rbp),%rax
  lea    -0x1(%r8),%r10
  lea    0x0(,%r8,8),%rdx
  cmp    %rax,%r14
  lea    (%rdx,%r14,1),%rsi
  lea    0x0(%rbp,%rdx,1),%rdi
  setne  %cl
  cmp    %rax,0x10(%rsp)
  setne  %al
  and    %ecx,%eax
  cmp    $0x1,%r10
  seta   %cl
  and    %ecx,%eax
  lea    0x8(%r14),%rcx
  cmp    %rcx,0x10(%rsp)
  setne  %cl
  and    %ecx,%eax
  cmp    %rsi,%rbp
  mov    %eax,%r14d
  setae  %al
  cmp    %rdi,0x18(%rsp)
  setae  %cl
  or     %ecx,%eax
  test   %al,%r14b
  je     L111
  mov    0x10(%rsp),%r14
  mov    %r14,%rax
  add    %rdx,%rax
  cmp    %rax,%rbp
  setae  %cl
  cmp    %rdi,%r14
  setae  %al
  or     %cl,%al
  je     L111
  mov    %r8,%rdi
  mov    %r14,%rsi
  mov    0x18(%rsp),%r14
  lea    -0x10(%rbp,%rdx,1),%rdx
  shr    %rdi
  mov    %rdi,%rcx
  mov    %rbp,%rdi
  mov    %r14,%rax
  sub    %r14,%rsi
  shl    $0x4,%rcx
  sub    %r14,%rdi
  add    %r14,%rcx
L341:
  movupd (%rdi,%rax,1),%xmm5
  sub    $0x10,%rdx
  movups %xmm5,(%rax)
  movupd 0x10(%rdx),%xmm0
  shufpd $0x1,%xmm0,%xmm0
  movups %xmm0,(%rsi,%rax,1)
  add    $0x10,%rax
  cmp    %rcx,%rax
  jne    L341
  mov    %r8,%rax
  and    $0xfffffffffffffffe,%rax
  test   $0x1,%r8b
  je     L244
  movsd  0x0(%rbp,%rax,8),%xmm0
  mov    0x18(%rsp),%rdi
  sub    %rax,%r8
  movsd  %xmm0,(%rdi,%rax,8)
  mov    0x10(%rsp),%rdi
  movsd  -0x8(%rbp,%r8,8),%xmm0
  movsd  %xmm0,(%rdi,%rax,8)
L244:
  mov    %r10,%rdx
  mov    0x10(%rsp),%rdi
  movq   D11(%rip),%xmm1
  shr    %rdx
  shl    $0x4,%rdx
  lea    0x8(%rdi),%rax
  lea    0x18(%rdi,%rdx,1),%rdx
  nopl   0x0(%rax,%rax,1)
L408:
  movsd  (%rax),%xmm0
  add    $0x10,%rax
  xorpd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rax)
  cmp    %rdx,%rax
  jne    L408
L282:
  lea    -0x1(%r15),%eax
  cmpl   $0x1,0xc4(%rsp)
  mov    $0x1,%ecx
  mov    %eax,0x34(%rsp)
  lea    -0x1(%r13),%eax
  mov    %eax,0x30(%rsp)
  jle    L342
  movslq 0xc4(%rsp),%rdx
  mov    %rdx,%rax
  sub    $0x1,%rdx
  cmp    $0x2,%eax
  je     L352
  movq   D15(%rip),%xmm0
  mov    %rdx,%rcx
  xor    %eax,%eax
  shr    %rcx
L142:
  add    $0x1,%eax
  pslld  $0x1,%xmm0
  cmp    %ecx,%eax
  jne    L142
  movd   %xmm0,%ecx
  pshufd $0xe5,%xmm0,%xmm1
  movd   %xmm1,%eax
  imul   %eax,%ecx
  and    $0x1,%edx
  je     L183
L289:
  add    %ecx,%ecx
L183:
  mov    0x8(%rsp),%eax
  cltd
  idiv   %ecx
  mov    %eax,0x8(%rsp)
L342:
  mov    0x4c(%rsp),%eax
  movl   $0x1,0xc(%rsp)
  cmp    $0x1,%eax
  jle    L356
  cltd
  idiv   %ecx
  mov    %eax,0xc(%rsp)
L356:
  movslq %r9d,%rdx
  test   %rdx,%rdx
  jle    L400
  lea    -0x1(%rdx),%rax
  cmp    $0x2,%rax
  jbe    L166
  lea    0x8(%rbx),%rax
  cmp    %rax,%r11
  je     L166
  mov    %rdx,%rcx
  xor    %eax,%eax
  shr    %rcx
  shl    $0x4,%rcx
L330:
  movupd (%rbx,%rax,1),%xmm7
  movups %xmm7,(%r11,%rax,1)
  add    $0x10,%rax
  cmp    %rcx,%rax
  jne    L330
  mov    %rdx,%rax
  and    $0xfffffffffffffffe,%rax
  and    $0x1,%edx
  je     L400
  movsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%r11,%rax,8)
L400:
  mov    0xc4(%rsp),%eax
  test   %eax,%eax
  jle    L208
  mov    0x20(%rsp),%rsi
  movslq %r13d,%rax
  mov    %r11,0xd0(%rsp)
  mov    %rax,0xb8(%rsp)
  shl    $0x3,%rax
  lea    (%rsi,%rax,1),%rdi
  lea    0x8(%rdi),%rcx
  mov    %rdi,0xb0(%rsp)
  mov    %rcx,0x98(%rsp)
  lea    -0x8(%rdi),%rcx
  mov    %rcx,0x70(%rsp)
  mov    0x28(%rsp),%rcx
  lea    -0x8(%rcx,%rax,1),%rbx
  cmp    %rdi,%rbx
  movslq 0x30(%rsp),%rdi
  mov    %rbx,0x68(%rsp)
  setne  0xc3(%rsp)
  neg    %rax
  sub    %rsi,%rcx
  mov    %rax,0xf0(%rsp)
  movslq 0x4c(%rsp),%rax
  mov    %rcx,%r13
  mov    %rdi,0xf8(%rsp)
  lea    (%rsi,%rdi,8),%rdi
  lea    0x0(,%rax,8),%r10
  lea    -0x8(%rsi),%rax
  mov    %rdi,0x40(%rsp)
  mov    %r12,%rdi
  mov    %rax,0xc8(%rsp)
  lea    0x8(%r12),%rax
  mov    %r10,%rbx
  mov    %rax,0xa8(%rsp)
  nopl   (%rax)
L219:
  mov    0x8(%rsp),%esi
  mov    %esi,%eax
  shr    $0x1f,%eax
  add    %esi,%eax
  sar    %eax
  cmpl   $0x1,0x4c(%rsp)
  mov    %eax,0x48(%rsp)
  jg     L348
  mov    0xc(%rsp),%r8d
  test   %r8d,%r8d
  je     L105
L274:
  movslq 0x48(%rsp),%rax
  mov    0x4c(%rsp),%r12d
  mov    0xd0(%rsp),%r10
  imul   %eax,%r12d
  add    0xb8(%rsp),%rax
  mov    %r10,%r15
  movslq %r12d,%r12
  lea    0x0(,%r12,8),%rsi
  xor    %r12d,%r12d
  mov    %rsi,0x38(%rsp)
  mov    0xc8(%rsp),%rsi
  mov    %r12,%r11
  mov    %rdi,%r12
  lea    (%rsi,%rax,8),%r14
  movslq 0x8(%rsp),%rax
  lea    (%rdi,%rax,8),%rbp
  nopl   0x0(%rax)
L428:
  mov    0x38(%rsp),%rax
  cmpl   $0x1,0x8(%rsp)
  mov    %r15,%rdx
  lea    (%rax,%r15,1),%rcx
  mov    0x40(%rsp),%rax
  jle    L450
L35:
  movsd  (%rdx),%xmm0
  add    %rbx,%rdx
  movsd  %xmm0,(%rax)
  movsd  (%rcx),%xmm0
  add    %rbx,%rcx
  movsd  %xmm0,0x0(%r13,%rax,1)
  add    $0x8,%rax
  cmp    %rax,%r14
  jne    L35
L450:
  mov    %r11,(%rsp)
  mov    %r12,%rdi
  push   0x28(%rsp)
  push   0x28(%rsp)
  mov    0x58(%rsp),%esi
  mov    0x40(%rsp),%r9d
  mov    0x44(%rsp),%r8d
  mov    0x20(%rsp),%rcx
  mov    0x28(%rsp),%rdx
  call   <bpsconv@plt>
  pop    %rdx
  pop    %rcx
  mov    %r15,%rdx
  mov    0x8(%rsp),%esi
  mov    (%rsp),%r11
  mov    %r12,%rax
  test   %esi,%esi
  jle    L49
  nopw   0x0(%rax,%rax,1)
L412:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  movsd  %xmm0,(%rdx)
  add    %rbx,%rdx
  cmp    %rbp,%rax
  jne    L412
L49:
  add    $0x1,%r11
  add    $0x8,%r15
  cmp    %r11d,0xc(%rsp)
  jg     L428
  mov    %r12,%rdi
L105:
  cmpl   $0x1,0x4c(%rsp)
  je     L38
L210:
  shll   0xc(%rsp)
L417:
  shll   0x8(%rsp)
  subl   $0x1,0xc4(%rsp)
  jne    L219
  mov    %rdi,%r12
L208:
  mov    %r12,%rdi
  call   <free@plt>
  mov    0x20(%rsp),%rdi
  call   <free@plt>
  mov    0x28(%rsp),%rdi
  call   <free@plt>
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  mov    0x10(%rsp),%rdi
  add    $0x108,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <free@plt>
L348:
  test   %esi,%esi
  jle    L462
  movslq 0xc(%rsp),%rcx
  mov    0x20(%rsp),%r9
  xor    %ebp,%ebp
  movl   $0x0,0x38(%rsp)
  mov    %rdi,0x50(%rsp)
  mov    0xd0(%rsp),%r15
  mov    %ecx,%edx
  mov    %rcx,%r14
  mov    %rcx,0x78(%rsp)
  sar    %edx
  and    $0xfffffffffffffffe,%r14
  mov    %rbx,0xe8(%rsp)
  movslq %edx,%rsi
  lea    (%rdi,%r14,8),%r10
  mov    %edx,0x60(%rsp)
  mov    %rsi,%rax
  mov    %rsi,%r12
  mov    %rsi,0x80(%rsp)
  mov    %r10,%rbx
  shr    %rax
  and    $0xfffffffffffffffe,%r12
  shl    $0x4,%rax
  add    0x70(%rsp),%rax
  add    %r12d,%edx
  mov    %rax,0x90(%rsp)
  mov    0xf8(%rsp),%rax
  mov    %edx,%r10d
  add    %r12,%rax
  shl    $0x3,%rax
  lea    (%r9,%rax,1),%r11
  add    0x28(%rsp),%rax
  mov    0xc8(%rsp),%r9
  mov    %rax,(%rsp)
  mov    0xb8(%rsp),%rax
  add    %rsi,%rax
  lea    (%r9,%rax,8),%rax
  mov    %rax,0xd8(%rsp)
  mov    %rcx,%rax
  shr    %rax
  shl    $0x4,%rax
  add    %rdi,%rax
  mov    %rax,0xa0(%rsp)
  lea    (%rdi,%rcx,8),%rax
  mov    %rax,0xe0(%rsp)
  lea    -0x1(%rsi),%rax
  mov    %rax,0x88(%rsp)
  nopw   0x0(%rax,%rax,1)
L287:
  mov    0x60(%rsp),%r9d
  test   %r9d,%r9d
  je     L489
  mov    0x80(%rsp),%rdi
  movslq %ebp,%rax
  lea    0x8(,%rax,8),%rdx
  lea    (%rax,%rdi,1),%rsi
  lea    (%r15,%rdx,1),%r9
  shl    $0x3,%rsi
  cmpq   $0x1,0x88(%rsp)
  seta   %r8b
  and    0xc3(%rsp),%r8b
  lea    (%r15,%rsi,1),%rcx
  cmp    0x70(%rsp),%r9
  setne  %dil
  and    %r8d,%edi
  cmp    0x68(%rsp),%r9
  setne  %r8b
  and    %r8d,%edi
  lea    0x8(%r15,%rsi,1),%r8
  cmp    %r8,0x68(%rsp)
  setne  %r8b
  test   %r8b,%dil
  je     L57
  mov    0x70(%rsp),%r9
  lea    0x10(%r15,%rsi,1),%rdi
  cmp    %rdi,%r9
  setae  %r8b
  cmp    0x98(%rsp),%rcx
  setae  %dil
  or     %r8b,%dil
  je     L57
  mov    0xb0(%rsp),%rdi
  sub    $0x8,%rdx
  mov    %r9,%rsi
  sub    %rdi,%rdx
  sub    %rdi,%rcx
  mov    0x90(%rsp),%rdi
  add    %r15,%rdx
  nopl   0x0(%rax,%rax,1)
L157:
  movupd 0x8(%rdx,%rsi,1),%xmm2
  movups %xmm2,(%rsi)
  movupd 0x8(%rcx,%rsi,1),%xmm3
  movups %xmm3,0x0(%r13,%rsi,1)
  add    $0x10,%rsi
  cmp    %rsi,%rdi
  jne    L157
  cmp    %r12,0x80(%rsp)
  je     L489
  add    %r12,%rax
  movsd  (%r15,%rax,8),%xmm0
  lea    0x0(%rbp,%r10,1),%eax
  cltq
  movsd  %xmm0,(%r11)
  movsd  (%r15,%rax,8),%xmm0
  mov    (%rsp),%rax
  movsd  %xmm0,(%rax)
L489:
  mov    %r10d,0x64(%rsp)
  mov    %r11,0x58(%rsp)
  push   0x28(%rsp)
  push   0x28(%rsp)
  mov    0x40(%rsp),%r9d
  mov    0x44(%rsp),%r8d
  mov    0x20(%rsp),%rcx
  mov    0x28(%rsp),%rdx
  mov    0x70(%rsp),%esi
  mov    0x60(%rsp),%rdi
  call   <bpsconv@plt>
  pop    %r10
  pop    %r11
  mov    0xc(%rsp),%eax
  mov    0x58(%rsp),%r11
  mov    0x64(%rsp),%r10d
  test   %eax,%eax
  je     L337
  mov    0x78(%rsp),%rdi
  movslq %ebp,%rdx
  lea    0x0(,%rdx,8),%rax
  lea    -0x1(%rdi),%rsi
  lea    (%r15,%rax,1),%rcx
  mov    0x50(%rsp),%rdi
  cmp    $0x2,%rsi
  jbe    L42
  cmp    0xa8(%rsp),%rcx
  je     L42
  mov    0xa0(%rsp),%rsi
  mov    %rdi,%rax
  sub    %rdi,%rcx
L392:
  movupd (%rax),%xmm4
  movups %xmm4,(%rcx,%rax,1)
  add    $0x10,%rax
  cmp    %rax,%rsi
  jne    L392
  cmp    %r14,0x78(%rsp)
  je     L337
  movsd  (%rbx),%xmm0
  lea    (%rdx,%r14,1),%rax
  movsd  %xmm0,(%r15,%rax,8)
L337:
  addl   $0x1,0x38(%rsp)
  add    0x4c(%rsp),%ebp
  mov    0x38(%rsp),%eax
  cmp    0x8(%rsp),%eax
  jne    L287
  mov    0x50(%rsp),%rdi
  mov    0xe8(%rsp),%rbx
L462:
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jne    L274
  jmp    L210
  nopl   0x0(%rax,%rax,1)
L42:
  sub    %rdi,%rax
  mov    0xe0(%rsp),%rcx
  lea    (%r15,%rax,1),%rdx
  mov    %rdi,%rax
  nopw   0x0(%rax,%rax,1)
L498:
  movsd  (%rax),%xmm0
  movsd  %xmm0,(%rdx,%rax,1)
  add    $0x8,%rax
  cmp    %rcx,%rax
  jne    L498
  jmp    L337
L57:
  mov    0xf0(%rsp),%rax
  sub    0x20(%rsp),%rax
  lea    -0x8(%rax,%rdx,1),%rcx
  add    %rsi,%rax
  mov    0xd8(%rsp),%rsi
  lea    (%r15,%rax,1),%rdx
  mov    0x40(%rsp),%rax
  add    %r15,%rcx
  nopl   (%rax)
L339:
  movsd  0x8(%rcx,%rax,1),%xmm0
  movsd  %xmm0,(%rax)
  movsd  0x8(%rdx,%rax,1),%xmm0
  movsd  %xmm0,0x0(%r13,%rax,1)
  add    $0x8,%rax
  cmp    %rax,%rsi
  jne    L339
  jmp    L489
L38:
  movl   $0x1,0xc(%rsp)
  jmp    L417
L111:
  mov    0x10(%rsp),%rcx
  mov    %rdi,%rdx
  mov    0x18(%rsp),%rdi
  mov    %rdi,%rax
  sub    %rdi,%rbp
  sub    %rdi,%rcx
L54:
  movsd  0x0(%rbp,%rax,1),%xmm0
  sub    $0x8,%rdx
  movsd  %xmm0,(%rax)
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rcx,%rax,1)
  add    $0x8,%rax
  cmp    %rsi,%rax
  jne    L54
  jmp    L244
L166:
  xor    %eax,%eax
L479:
  movsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%r11,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L479
  jmp    L400
L352:
  mov    $0x1,%ecx
  jmp    L289
```

tool_calls: name: disassemble_data
arguments: data_tag: D11
type: byte[8]
name: disassemble_data
arguments: data_tag: D15
type: byte[8]

tool: {"D11": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80]}

tool: {"D15": [0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00]}

assistant: ```c
void MIDWT(double *x, int m, int n, double *h, int lh, int L, double *y) {
  double *g0, *g1, *ydummyl, *ydummyh, *xdummy;
  long i, j;
  int actual_L, actual_m, actual_n, r_o_a, c_o_a, ir, ic, lhm1, lhhm1, sample_f;
  xdummy = (double *)calloc((m > n ? m : n), sizeof(double));
  ydummyl = (double *)calloc((m > n ? m : n) + lh / 2 - 1, sizeof(double));
  ydummyh = (double *)calloc((m > n ? m : n) + lh / 2 - 1, sizeof(double));
  g0 = (double *)calloc(lh, sizeof(double));
  g1 = (double *)calloc(lh, sizeof(double));
  if (n == 1) {
    n = m;
    m = 1;
  }
  for (i = 0; i < lh; i++) {
    g0[i] = h[i];
    g1[i] = h[lh - i - 1];
  }
  for (i = 1; i <= lh; i += 2)
    g1[i] = -g1[i];
  lhm1 = lh - 1;
  lhhm1 = lh / 2 - 1;
  sample_f = 1;
  for (i = 1; i < L; i++)
    sample_f = sample_f * 2;
  if (m > 1)
    actual_m = m / sample_f;
  else
    actual_m = 1;
  actual_n = n / sample_f;
  for (i = 0; i < (m * n); i++)
    x[i] = y[i];
  for (actual_L = L; actual_L >= 1; actual_L--) {
    r_o_a = actual_m / 2;
    c_o_a = actual_n / 2;
    if (m > 1) {
      for (ic = 0; ic < actual_n; ic++) {
        ir = r_o_a;
        for (i = 0; i < r_o_a; i++) {
          ydummyl[i + lhhm1] = (*(x + (m * (ic) + i)));
          ydummyh[i + lhhm1] = (*(x + (m * (ic) + ir++)));
        }
        bpsconv(xdummy, r_o_a, g0, g1, lhm1, lhhm1, ydummyl, ydummyh);
        for (i = 0; i < actual_m; i++)
          (*(x + (m * (ic) + i))) = xdummy[i];
      }
    }
    for (ir = 0; ir < actual_m; ir++) {
      ic = c_o_a;
      for (i = 0; i < c_o_a; i++) {
        ydummyl[i + lhhm1] = (*(x + (m * (i) + ir)));
        ydummyh[i + lhhm1] = (*(x + (m * (ic++) + ir)));
      }
      bpsconv(xdummy, c_o_a, g0, g1, lhm1, lhhm1, ydummyl, ydummyh);
      for (i = 0; i < actual_n; i++)
        (*(x + (m * (i) + ir))) = xdummy[i];
    }
    if (m == 1)
      actual_m = 1;
    else
      actual_m = actual_m * 2;
    actual_n = actual_n * 2;
  }
  free(xdummy);
  free(ydummyl);
  free(ydummyh);
  free(g0);
  free(g1);
}
```