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

```asm
<Interpolate>:
  endbr64
  push   %r15
  mov    %rcx,%r15
  push   %r14
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x38,%rsp
  mov    0x90(%rsp),%r14d
  mov    0x70(%rsp),%r11
  mov    0x78(%rsp),%ecx
  mov    0x80(%rsp),%eax
  mov    0x88(%rsp),%r10
  mov    0x98(%rsp),%esi
  cmp    $0x1,%r14d
  je     L65
  cmp    $0x1,%esi
  jne    L147
L65:
  cmp    $0x1,%edx
  je     L186
  cmp    $0x1,%r13d
  jne    L147
L186:
  movsd  D43(%rip),%xmm4
  movsd  D48(%rip),%xmm3
  mov    %edx,%edi
  mov    %r8d,%edx
  movsd  D64(%rip),%xmm5
L23:
  cmp    $0x1,%r14d
  cmovle %esi,%r14d
  cmp    $0x1,%r13d
  jle    L94
  cmp    %r13d,%r14d
  jne    L122
L210:
  xor    %esi,%esi
  mov    $0x1,%r12d
  xor    %ebp,%ebp
  jmp    L238
  nopl   0x0(%rax)
L60:
  cvttsd2si %xmm0,%edi
  add    $0x1,%rsi
  imul   %edi,%r12d
  add    %edi,%ebp
  cmp    %esi,%r13d
  jle    L162
L238:
  movsd  (%rbx,%rsi,8),%xmm0
  movapd %xmm0,%xmm1
  movapd %xmm0,%xmm2
  andpd  %xmm3,%xmm1
  ucomisd %xmm1,%xmm4
  jbe    L105
  cvttsd2si %xmm0,%rdi
  pxor   %xmm1,%xmm1
  cvtsi2sd %rdi,%xmm1
  movapd %xmm1,%xmm2
  cmpnlesd %xmm0,%xmm2
  andpd  %xmm5,%xmm2
  subsd  %xmm2,%xmm1
  movapd %xmm3,%xmm2
  andnpd %xmm0,%xmm2
  orpd   %xmm1,%xmm2
L105:
  ucomisd %xmm2,%xmm0
  jp     L103
  je     L60
L103:
  lea    D72(%rip),%rdi
L83:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <DymosimError@plt>
  nopl   0x0(%rax,%rax,1)
L94:
  cmp    %edi,%r14d
  jne    L122
  mov    %r14d,%r13d
  mov    $0x1,%r12d
  xor    %ebp,%ebp
  test   %r14d,%r14d
  jg     L210
  nopl   (%rax)
L162:
  imul   %edx,%r9d
  cmp    %r9d,%ebp
  jne    L38
  imul   %ecx,%eax
  cmp    %eax,%r12d
  jne    L85
  movsd  (%r10),%xmm0
  cmp    $0x1,%r13d
  jle    L215
  cvttsd2si (%rbx),%esi
  sub    $0x1,%r14d
  lea    0x8(%r10),%r9
  sub    $0x1,%r13d
  movsd  (%r15),%xmm1
  lea    0x8(%rbx),%r8
  movslq %esi,%rdi
  shl    $0x3,%rdi
  comisd %xmm0,%xmm1
  jae    L32
  comisd -0x8(%r15,%rdi,1),%xmm0
  jb     L119
  mov    %r12d,%eax
  add    %rdi,%r15
  cltd
  idiv   %esi
  mov    %eax,%ecx
  lea    -0x1(%rsi),%eax
  imul   %r12d,%eax
  cltd
  idiv   %esi
  mov    %ebp,%edx
  sub    %esi,%edx
  cltq
  lea    (%r11,%rax,8),%r11
L13:
  mov    %r9,%r10
  mov    %r8,%rbx
  mov    $0x1,%eax
  mov    $0x1,%edi
  mov    $0x1,%r9d
  mov    $0x1,%esi
  jmp    L23
  nopw   0x0(%rax,%rax,1)
L32:
  mov    %r12d,%eax
  add    %rdi,%r15
  cltd
  idiv   %esi
  mov    %ebp,%edx
  sub    %esi,%edx
  mov    %eax,%ecx
  jmp    L13
L147:
  lea    D2(%rip),%rdi
  jmp    L83
L122:
  lea    D69(%rip),%rdi
  jmp    L83
L215:
  add    $0x38,%rsp
  mov    %r12d,%r8d
  mov    %ebp,%esi
  mov    %r15,%rdi
  pop    %rbx
  mov    $0x1,%r9d
  pop    %rbp
  mov    %r11,%rcx
  pop    %r12
  mov    $0x1,%edx
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <Interpolate1@plt>
L85:
  lea    D8(%rip),%rdi
  jmp    L83
L38:
  lea    D65(%rip),%rdi
  jmp    L83
L119:
  mov    %r15,%rdi
  mov    %r10,0x28(%rsp)
  mov    %r9,(%rsp)
  mov    %r8,0x8(%rsp)
  mov    %r11,0x18(%rsp)
  call   <SearchGrid@plt>
  cvttsd2si (%rbx),%ecx
  mov    $0x1,%r9d
  mov    %eax,0x14(%rsp)
  imul   %r12d,%eax
  push   $0x1
  push   %r14
  mov    %eax,%edi
  movslq %ecx,%rax
  push   0x10(%rsp)
  lea    (%r15,%rax,8),%rsi
  mov    %r12d,%eax
  push   $0x1
  cltd
  idiv   %ecx
  push   %rax
  mov    %edi,%eax
  mov    0x40(%rsp),%r11
  cltd
  idiv   %ecx
  mov    %edi,0x38(%rsp)
  mov    %r11,0x48(%rsp)
  mov    %ebp,%edx
  sub    %ecx,%edx
  mov    %rsi,%rcx
  mov    %r13d,%esi
  mov    %edx,%r8d
  mov    $0x1,%edx
  cltq
  lea    (%r11,%rax,8),%rax
  push   %rax
  mov    0x38(%rsp),%rdi
  call   <Interpolate>
  cvttsd2si (%rbx),%esi
  mov    %ebp,%r8d
  mov    $0x1,%r9d
  movsd  %xmm0,0x48(%rsp)
  add    $0x30,%rsp
  push   $0x1
  push   %r14
  movslq %esi,%rax
  push   0x10(%rsp)
  sub    %esi,%r8d
  lea    (%r15,%rax,8),%rcx
  mov    %r12d,%eax
  push   $0x1
  cltd
  idiv   %esi
  push   %rax
  mov    0x38(%rsp),%edx
  mov    0x48(%rsp),%r11
  lea    (%rdx,%r12,1),%eax
  cltd
  idiv   %esi
  mov    %r13d,%esi
  mov    $0x1,%edx
  cltq
  lea    (%r11,%rax,8),%rax
  push   %rax
  mov    0x38(%rsp),%rdi
  call   <Interpolate>
  movslq 0x44(%rsp),%rax
  mov    0x58(%rsp),%r10
  movsd  0x48(%rsp),%xmm1
  movapd %xmm0,%xmm2
  movsd  (%r15,%rax,8),%xmm3
  movsd  (%r10),%xmm0
  subsd  %xmm1,%xmm2
  subsd  %xmm3,%xmm0
  mulsd  %xmm2,%xmm0
  movsd  0x8(%r15,%rax,8),%xmm2
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  subsd  %xmm3,%xmm2
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  divsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D43
type_infered: byte[8]
name: extract_symbolic_data
arguments: tag: D48
type_infered: byte[8]
name: extract_symbolic_data
arguments: tag: D64
type_infered: byte[8]
name: extract_symbolic_data
arguments: tag: D72
type_infered: string
name: extract_symbolic_data
arguments: tag: D2
type_infered: string
name: extract_symbolic_data
arguments: tag: D69
type_infered: string
name: extract_symbolic_data
arguments: tag: D8
type_infered: string
name: extract_symbolic_data
arguments: tag: D65
type_infered: string

tool: {"D43": [0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x43]}

tool: {"D48": [0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f]}

tool: {"D64": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

tool: D72: The dimension vector of a table must only contain integers.

tool: D2: Arguments to Interpolate must be vectors.

tool: D69: The size of the argument vector is not the same as
  the dimension vector of a table.

tool: D8: The size of the table value vector is not
  consistent with information in the dimension vector.

tool: D65: The size of the grid vector is not consistent with
  information in the dimension vector of a table.

assistant: ```c
double Interpolate(const double dim[], int Mdim, int Ndim, const double xval[], int Mxval, int Nxval, const double yval[], int Myval, int Nyval, const double x[], int Mx, int Nx) {
  int below;
  double ybelow, yabove;
  int i, dimsum, dimprod;
  int Kx, Kdim, Kxval, Kyval;
  if ((Mx != 1 && Nx != 1) || (Mdim != 1 && Ndim != 1)) {
    return DymosimError("Arguments to Interpolate must be vectors.");
  }
  Kx = Mx > 1 ? Mx : Nx;
  Kdim = Mdim > 1 ? Mdim : Ndim;
  Kxval = Mxval * Nxval;
  Kyval = Myval * Nyval;
  if (Kx != Kdim) {
    return DymosimError("The size of the argument vector is not the same as\n"
                        "  the dimension vector of a table.");
  }
  dimsum = 0;
  dimprod = 1;
  for (i = 0; i < Kdim; i++) {
    if (dim[i] != floor(dim[i])) {
      return DymosimError("The dimension vector of a table must only contain "
                          "integers.");
    }
    dimsum = dimsum + (int)dim[i];
    dimprod = dimprod * (int)dim[i];
  }
  if (Kxval != dimsum) {
    return DymosimError("The size of the grid vector is not consistent with\n"
                        "  information in the dimension vector of a table.");
  }
  if (Kyval != dimprod) {
    return DymosimError("The size of the table value vector is not\n"
                        "  consistent with information in the dimension vector.");
  }
  if (Kdim <= 1)
    return Interpolate1(x[0], xval, Kxval, 1, yval, Kyval, 1);
  else if (x[0] <= xval[0]) {
    below = 0;
    return Interpolate(&dim[1], Kdim - 1, 1, &xval[(int)dim[0]], Kxval - (int)dim[0], 1, &yval[below * dimprod / (int)dim[0]], Kyval / (int)dim[0], 1, &x[1], Kx - 1, 1);
  } else if (x[0] >= xval[(int)dim[0] - 1]) {
    below = (int)dim[0] - 1;
    return Interpolate(&dim[1], Kdim - 1, 1, &xval[(int)dim[0]], Kxval - (int)dim[0], 1, &yval[below * dimprod / (int)dim[0]], Kyval / (int)dim[0], 1, &x[1], Kx - 1, 1);
  } else {
    below = SearchGrid(x[0], xval, (int)dim[0]);
    ybelow = Interpolate(&dim[1], Kdim - 1, 1, &xval[(int)dim[0]], Kxval - (int)dim[0], 1, &yval[below * dimprod / (int)dim[0]], Kyval / (int)dim[0], 1, &x[1], Kx - 1, 1);
    yabove = Interpolate(&dim[1], Kdim - 1, 1, &xval[(int)dim[0]], Kxval - (int)dim[0], 1, &yval[(below + 1) * dimprod / (int)dim[0]], Kyval / (int)dim[0], 1, &x[1], Kx - 1, 1);
    return (ybelow + (yabove - ybelow) * (x[0] - xval[below]) / (xval[below + 1] - xval[below]));
  }
}
```