user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<int_sim_ad>:
  endbr64
  push   %r13
  movapd %xmm0,%xmm7
  movapd %xmm1,%xmm0
  push   %r12
  subsd  %xmm7,%xmm0
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  mov    %rsi,%rdi
  push   %rbx
  sub    $0x38,%rsp
  mulsd  D46(%rip),%xmm0
  movsd  %xmm2,0x28(%rsp)
  movsd  %xmm7,0x10(%rsp)
  movsd  %xmm1,0x18(%rsp)
  movsd  %xmm0,0x8(%rsp)
  movapd %xmm7,%xmm0
  call   *%rbp
  movsd  0x18(%rsp),%xmm1
  mov    %r12,%rdi
  movsd  %xmm0,(%rsp)
  movapd %xmm1,%xmm0
  call   *%rbp
  movsd  0x8(%rsp),%xmm5
  movsd  (%rsp),%xmm6
  mov    %r12,%rdi
  movapd %xmm5,%xmm7
  addsd  %xmm0,%xmm6
  movsd  0x10(%rsp),%xmm0
  addsd  %xmm5,%xmm7
  movsd  %xmm6,(%rsp)
  addsd  %xmm7,%xmm0
  call   *%rbp
  mov    %r12,%rdi
  addsd  %xmm0,%xmm0
  addsd  (%rsp),%xmm0
  movq   %xmm0,%rbx
  movsd  0x10(%rsp),%xmm0
  addsd  0x8(%rsp),%xmm0
  call   *%rbp
  pxor   %xmm4,%xmm4
  mov    %r12,%rdi
  movapd %xmm0,%xmm3
  movsd  0x10(%rsp),%xmm0
  addsd  %xmm4,%xmm3
  movsd  D54(%rip),%xmm4
  mulsd  0x8(%rsp),%xmm4
  movsd  %xmm3,(%rsp)
  addsd  %xmm4,%xmm0
  call   *%rbp
  movsd  (%rsp),%xmm1
  movq   %rbx,%xmm6
  divsd  D54(%rip),%xmm6
  movsd  0x28(%rsp),%xmm7
  movsd  %xmm6,0x18(%rsp)
  addsd  %xmm0,%xmm1
  mulsd  D5(%rip),%xmm1
  movapd %xmm1,%xmm0
  addsd  %xmm1,%xmm0
  addsd  %xmm6,%xmm0
  mulsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x20(%rsp)
  movsd  D66(%rip),%xmm0
  mulsd  %xmm7,%xmm0
  andpd  D12(%rip),%xmm0
  comisd %xmm7,%xmm0
  jbe    L32
  mov    $0x4,%ebx
  nopw   0x0(%rax,%rax,1)
L24:
  movsd  D84(%rip),%xmm5
  mulsd  0x8(%rsp),%xmm5
  add    %ebx,%ebx
  mov    $0x1,%r13d
  addsd  0x18(%rsp),%xmm1
  movsd  %xmm1,0x18(%rsp)
  pxor   %xmm1,%xmm1
  movsd  %xmm5,0x8(%rsp)
  nopl   0x0(%rax)
L27:
  pxor   %xmm0,%xmm0
  movsd  %xmm1,(%rsp)
  mov    %r12,%rdi
  cvtsi2sd %r13d,%xmm0
  mulsd  0x8(%rsp),%xmm0
  add    $0x2,%r13d
  addsd  0x10(%rsp),%xmm0
  call   *%rbp
  movsd  (%rsp),%xmm1
  addsd  %xmm0,%xmm1
  cmp    %r13d,%ebx
  jg     L27
  mulsd  D5(%rip),%xmm1
  movapd %xmm1,%xmm0
  addsd  %xmm1,%xmm0
  addsd  0x18(%rsp),%xmm0
  mulsd  0x8(%rsp),%xmm0
  movapd %xmm0,%xmm2
  subsd  0x20(%rsp),%xmm2
  divsd  D23(%rip),%xmm2
  andpd  D12(%rip),%xmm2
  comisd 0x28(%rsp),%xmm2
  jbe    L30
  movsd  %xmm0,0x20(%rsp)
  jmp    L24
L32:
  movsd  0x20(%rsp),%xmm0
L30:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D46
datatype: f32[2]
name: retrieve_data
arguments: tag: D54
datatype: f64
name: retrieve_data
arguments: tag: D5
datatype: byte[8]
name: retrieve_data
arguments: tag: D66
datatype: f64
name: retrieve_data
arguments: tag: D12
datatype: qword[2]
name: retrieve_data
arguments: tag: D84
datatype: f64
name: retrieve_data
arguments: tag: D23
datatype: f64

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

tool: D54: 3

tool: {"D5": [0x55,0x55,0x55,0x55,0x55,0x55,0xe5,0x3f]}

tool: D66: 10000000000

tool: {"D12": [0x7fffffffffffffff,0x0000000000000000]}

tool: D84: 0.5

tool: D23: 15

assistant: ```c
double int_sim_ad(double a, double b, double tol, double (*f)(double, void *), void *args) {
  int N1 = 4;
  double S = 0.0;
  double T = 0.0;
  double I = 0.0;
  double I1 = 0.0;
  int i, n;
  int N = N1;
  double h = (b - a) / N;
  S = f(a, args) + f(b, args);
  for (i = 2; i < N; i += 2)
    S += 2 * f(a + i * h, args);
  for (i = 1; i < N; i += 2)
    T += f(a + i * h, args);
  S /= 3.0;
  T *= 2.0 / 3.0;
  I1 = h * (S + 2 * T);
  double err = 1.0e10 * tol;
  while (fabs(err) > tol) {
    N *= 2;
    h *= 0.5;
    I = I1;
    S += T;
    T = 0.0;
    for (i = 1; i < N; i += 2)
      T += f(a + i * h, args);
    T *= 2.0 / 3.0;
    I1 = h * (S + 2 * T);
    err = (I1 - I) / 15.0;
  }
  return I1;
}
```