user: 请从给定的汇编指令推导出C源代码:

```asm
<daubechies4>:
  endbr64
  cmp    $0x3,%esi
  jg     L47
  ret
L47:
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  mov    %esi,%ebp
  mov    %edx,%r13d
  movslq %esi,%r12
  lea    0x0(,%rsi,8),%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %ebp,%ecx
  sar    %ecx
  test   %r13d,%r13d
  js     L26
  mov    %rbx,%rax
  mov    %rdi,%rdx
  lea    -0x4(%rbp),%r8d
  shr    %r8d
  lea    0x1(%r8),%esi
  lea    (%rdi,%rsi,8),%r9
  movslq %ecx,%rsi
  shl    $0x3,%rsi
  movsd  D29(%rip),%xmm4
  movsd  D135(%rip),%xmm3
  movsd  D12(%rip),%xmm2
  movsd  D112(%rip),%xmm1
L52:
  movapd %xmm4,%xmm0
  mulsd  (%rax),%xmm0
  movapd %xmm3,%xmm5
  mulsd  0x8(%rax),%xmm5
  addsd  %xmm5,%xmm0
  movapd %xmm2,%xmm5
  mulsd  0x10(%rax),%xmm5
  addsd  %xmm5,%xmm0
  movapd %xmm1,%xmm5
  mulsd  0x18(%rax),%xmm5
  addsd  %xmm5,%xmm0
  movsd  %xmm0,(%rdx)
  movapd %xmm1,%xmm0
  mulsd  (%rax),%xmm0
  movapd %xmm2,%xmm5
  mulsd  0x8(%rax),%xmm5
  subsd  %xmm5,%xmm0
  movapd %xmm3,%xmm5
  mulsd  0x10(%rax),%xmm5
  addsd  %xmm5,%xmm0
  movapd %xmm4,%xmm5
  mulsd  0x18(%rax),%xmm5
  subsd  %xmm5,%xmm0
  movsd  %xmm0,(%rdx,%rsi,1)
  add    $0x10,%rax
  add    $0x8,%rdx
  cmp    %r9,%rdx
  jne    L52
  lea    0x1(%r8),%eax
  shl    $0x3,%r12
  lea    -0x10(%rbx,%r12,1),%rsi
  lea    -0x8(%rbx,%r12,1),%rdx
  movslq %eax,%r8
  movsd  D29(%rip),%xmm2
  movapd %xmm2,%xmm1
  mulsd  (%rsi),%xmm1
  movsd  D135(%rip),%xmm3
  movapd %xmm3,%xmm0
  mulsd  (%rdx),%xmm0
  addsd  %xmm0,%xmm1
  movsd  D12(%rip),%xmm4
  movapd %xmm4,%xmm0
  mulsd  (%rbx),%xmm0
  addsd  %xmm0,%xmm1
  movsd  D112(%rip),%xmm0
  movapd %xmm0,%xmm5
  mulsd  0x8(%rbx),%xmm5
  addsd  %xmm5,%xmm1
  movsd  %xmm1,(%rdi,%r8,8)
  add    %ecx,%eax
  cltq
  mulsd  (%rsi),%xmm0
  mulsd  (%rdx),%xmm4
  subsd  %xmm4,%xmm0
  mulsd  (%rbx),%xmm3
  addsd  %xmm3,%xmm0
  mulsd  0x8(%rbx),%xmm2
  subsd  %xmm2,%xmm0
  movsd  %xmm0,(%rdi,%rax,8)
L2:
  mov    %ebp,%ebp
  lea    (%rdi,%rbp,8),%rdx
  mov    %rdi,%rax
  sub    %rdi,%rbx
L28:
  movsd  (%rax),%xmm0
  movsd  %xmm0,(%rbx,%rax,1)
  add    $0x8,%rax
  cmp    %rax,%rdx
  jne    L28
  call   <free@plt>
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L26:
  movslq %ecx,%rax
  shl    $0x3,%rax
  lea    -0x8(%rbx,%rax,1),%rsi
  lea    -0x8(%rbx,%r12,8),%rdx
  add    %rbx,%rax
  movsd  D12(%rip),%xmm2
  movapd %xmm2,%xmm1
  mulsd  (%rsi),%xmm1
  movsd  D135(%rip),%xmm3
  movapd %xmm3,%xmm0
  mulsd  (%rdx),%xmm0
  addsd  %xmm0,%xmm1
  movsd  D29(%rip),%xmm4
  movapd %xmm4,%xmm0
  mulsd  (%rbx),%xmm0
  addsd  %xmm0,%xmm1
  movsd  D112(%rip),%xmm0
  movapd %xmm0,%xmm5
  mulsd  (%rax),%xmm5
  addsd  %xmm5,%xmm1
  movsd  %xmm1,(%rdi)
  mulsd  (%rsi),%xmm0
  mulsd  (%rdx),%xmm4
  subsd  %xmm4,%xmm0
  mulsd  (%rbx),%xmm3
  addsd  %xmm3,%xmm0
  mulsd  (%rax),%xmm2
  subsd  %xmm2,%xmm0
  movsd  %xmm0,0x8(%rdi)
  mov    %rbx,%rdx
  lea    0x10(%rdi),%rsi
  lea    -0x2(%rcx),%ecx
  lea    0x8(%rbx,%rcx,8),%rcx
  movsd  D12(%rip),%xmm4
  movsd  D135(%rip),%xmm3
  movsd  D29(%rip),%xmm2
  movsd  D112(%rip),%xmm1
L46:
  movapd %xmm4,%xmm0
  mulsd  (%rdx),%xmm0
  movapd %xmm3,%xmm5
  mulsd  (%rax),%xmm5
  addsd  %xmm5,%xmm0
  movapd %xmm2,%xmm5
  mulsd  0x8(%rdx),%xmm5
  addsd  %xmm5,%xmm0
  movapd %xmm1,%xmm5
  mulsd  0x8(%rax),%xmm5
  addsd  %xmm5,%xmm0
  movsd  %xmm0,(%rsi)
  movapd %xmm1,%xmm0
  mulsd  (%rdx),%xmm0
  movapd %xmm2,%xmm5
  mulsd  (%rax),%xmm5
  subsd  %xmm5,%xmm0
  movapd %xmm3,%xmm5
  mulsd  0x8(%rdx),%xmm5
  addsd  %xmm5,%xmm0
  movapd %xmm4,%xmm5
  mulsd  0x8(%rax),%xmm5
  subsd  %xmm5,%xmm0
  movsd  %xmm0,0x8(%rsi)
  add    $0x8,%rdx
  add    $0x8,%rax
  add    $0x10,%rsi
  cmp    %rcx,%rdx
  jne    L46
  jmp    L2
```

tool_calls: name: read_data
arguments: tag: D29
type: f64
name: read_data
arguments: tag: D135
type: f64
name: read_data
arguments: tag: D12
type: f64
name: read_data
arguments: tag: D112
type: byte[8]

tool: D29: 0.4829629131445341

tool: D135: 0.8365163037378077

tool: D12: 0.2241438680420134

tool: {"D112": [0x8f,0x06,0x93,0xc1,0x7d,0x90,0xc0,0xbf]}

assistant: ```c
void daubechies4(double *a, const int n, const int isign) {
  const double C0 = 0.4829629131445341, C1 = 0.83651630373780772, C2 = 0.22414386804201339, C3 = -0.12940952255126034;
  int nh, i, j;
  double *dwt;
  if (n < 4)
    return;
  dwt = (double *)malloc(n * sizeof(double));
  nh = n >> 1;
  if (isign >= 0) {
    for (j = 0, i = 0; j < n - 3; j += 2) {
      dwt[i] = C0 * a[j] + C1 * a[j + 1] + C2 * a[j + 2] + C3 * a[j + 3];
      dwt[i + nh] = C3 * a[j] - C2 * a[j + 1] + C1 * a[j + 2] - C0 * a[j + 3];
      i++;
    }
    dwt[i] = C0 * a[n - 2] + C1 * a[n - 1] + C2 * a[0] + C3 * a[1];
    dwt[i + nh] = C3 * a[n - 2] - C2 * a[n - 1] + C1 * a[0] - C0 * a[1];
  } else {
    dwt[0] = C2 * a[nh - 1] + C1 * a[n - 1] + C0 * a[0] + C3 * a[nh];
    dwt[1] = C3 * a[nh - 1] - C0 * a[n - 1] + C1 * a[0] - C2 * a[nh];
    for (i = 0, j = 2; i < nh - 1; i++) {
      dwt[j++] = C2 * a[i] + C1 * a[i + nh] + C0 * a[i + 1] + C3 * a[i + nh + 1];
      dwt[j++] = C3 * a[i] - C0 * a[i + nh] + C1 * a[i + 1] - C2 * a[i + nh + 1];
    }
  }
  for (i = 0; i < n; i++)
    a[i] = dwt[i];
  free(dwt);
  return;
}
```