user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<interp_z>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %esi,-0x5c(%rbp)
  mov    %edx,-0x60(%rbp)
  mov    %ecx,-0x64(%rbp)
  movss  %xmm0,-0x68(%rbp)
  movss  %xmm1,-0x6c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpq   $0x0,-0x58(%rbp)
  jne    L46
  mov    D3(%rip),%eax
  jmp    L94
L46:
  mov    -0x5c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x3c(%rbp)
  pxor   %xmm0,%xmm0
  comiss -0x68(%rbp),%xmm0
  jbe    L202
  pxor   %xmm0,%xmm0
  jmp    L166
L202:
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x3c(%rbp),%xmm1
  movss  -0x68(%rbp),%xmm0
  comiss %xmm1,%xmm0
  jbe    L142
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x3c(%rbp),%xmm0
  jmp    L166
L142:
  movss  -0x68(%rbp),%xmm0
L166:
  movss  %xmm0,-0x38(%rbp)
  movss  -0x38(%rbp),%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,-0x40(%rbp)
  mov    -0x40(%rbp),%eax
  mov    %eax,-0x34(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x40(%rbp),%xmm1
  movss  -0x38(%rbp),%xmm0
  comiss %xmm1,%xmm0
  jbe    L79
  addl   $0x1,-0x40(%rbp)
L79:
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x34(%rbp),%xmm1
  movss  -0x38(%rbp),%xmm0
  subss  %xmm1,%xmm0
  movss  %xmm0,-0x38(%rbp)
  mov    -0x60(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x30(%rbp)
  pxor   %xmm0,%xmm0
  comiss -0x6c(%rbp),%xmm0
  jbe    L121
  pxor   %xmm0,%xmm0
  jmp    L181
L121:
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x30(%rbp),%xmm1
  movss  -0x6c(%rbp),%xmm0
  comiss %xmm1,%xmm0
  jbe    L178
  pxor   %xmm0,%xmm0
  cvtsi2ssl -0x30(%rbp),%xmm0
  jmp    L181
L178:
  movss  -0x6c(%rbp),%xmm0
L181:
  movss  %xmm0,-0x2c(%rbp)
  movss  -0x2c(%rbp),%xmm0
  cvttss2si %xmm0,%eax
  mov    %eax,-0x48(%rbp)
  mov    -0x48(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x48(%rbp),%xmm1
  movss  -0x2c(%rbp),%xmm0
  comiss %xmm1,%xmm0
  jbe    L45
  addl   $0x1,-0x48(%rbp)
L45:
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x28(%rbp),%xmm1
  movss  -0x2c(%rbp),%xmm0
  subss  %xmm1,%xmm0
  movss  %xmm0,-0x2c(%rbp)
  movl   $0x0,-0x50(%rbp)
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x4c(%rbp)
  jmp    L204
L75:
  mov    -0x34(%rbp),%eax
  mov    %eax,-0x44(%rbp)
  jmp    L150
L148:
  mov    -0x4c(%rbp),%eax
  imul   -0x5c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x44(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x24(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  cltq
  add    $0x2,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x50(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x50(%rbp)
  movss  (%rcx),%xmm0
  cltq
  movss  %xmm0,-0x20(%rbp,%rax,4)
  addl   $0x1,-0x44(%rbp)
L150:
  mov    -0x44(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jle    L148
  addl   $0x1,-0x4c(%rbp)
L204:
  mov    -0x4c(%rbp),%eax
  cmp    -0x48(%rbp),%eax
  jle    L75
  mov    -0x28(%rbp),%eax
  cmp    -0x48(%rbp),%eax
  jne    L199
  mov    -0x34(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jne    L65
  mov    -0x20(%rbp),%eax
  jmp    L94
L65:
  movss  -0x20(%rbp),%xmm0
  movss  %xmm0,-0x18(%rbp)
  movss  -0x1c(%rbp),%xmm0
  movss  %xmm0,-0x14(%rbp)
  jmp    L70
L199:
  mov    -0x34(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jne    L70
  movss  -0x1c(%rbp),%xmm0
  movss  %xmm0,-0x18(%rbp)
  movss  -0x20(%rbp),%xmm0
  movss  %xmm0,-0x1c(%rbp)
  movss  -0x18(%rbp),%xmm0
  movss  %xmm0,-0x14(%rbp)
L70:
  mov    -0x64(%rbp),%ecx
  movss  -0x2c(%rbp),%xmm0
  mov    -0x38(%rbp),%edx
  lea    -0x20(%rbp),%rax
  mov    %ecx,%esi
  movaps %xmm0,%xmm1
  movd   %edx,%xmm0
  mov    %rax,%rdi
  call   <interp_tri@plt>
  movd   %xmm0,%eax
L94:
  movd   %eax,%xmm0
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L122
  call   <__stack_chk_fail@plt>
L122:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D3
data_type: f32

tool: D3: 0

assistant: ```c
float interp_z(float *verts, int ncols, int nrows, int grid_scheme, float xcol, float yrow) {
  int i, ir, irowa, irowb, mxrow, ic, icola, icolb, mxcol, irc;
  float x, y, z[4];
  if (verts == 0)
    return 0.0;
  mxcol = ncols - 1;
  x = (xcol < 0.0) ? 0.0 : (xcol > (float)mxcol) ? mxcol : xcol;
  icola = icolb = x;
  if (x > (float)icolb)
    icolb++;
  x -= (float)icola;
  mxrow = nrows - 1;
  y = (yrow < 0.0) ? 0.0 : (yrow > (float)mxrow) ? mxrow : yrow;
  irowa = irowb = y;
  if (y > (float)irowb)
    irowb++;
  y -= (float)irowa;
  i = 0;
  for (ir = irowa; ir <= irowb; ir++) {
    for (ic = icola; ic <= icolb; ic++) {
      irc = (ir * ncols) + ic;
      z[i++] = verts[(irc * 3) + 2];
    }
  }
  if (irowa == irowb) {
    if (icola == icolb)
      return z[0];
    z[2] = z[0];
    z[3] = z[1];
  } else if (icola == icolb) {
    z[2] = z[1];
    z[1] = z[0];
    z[3] = z[2];
  }
  return interp_tri(z, x, y, grid_scheme);
}
```