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

```asm
<interp_z>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %ecx,0xc(%rsp)
  mov    %fs:0x28,%rcx
  mov    %rcx,0x28(%rsp)
  xor    %ecx,%ecx
  test   %rdi,%rdi
  je     L5
  movaps %xmm1,%xmm2
  pxor   %xmm1,%xmm1
  mov    %rdi,%rbx
  mov    %esi,%eax
  comiss %xmm0,%xmm1
  ja     L143
  lea    -0x1(%rsi),%ecx
  pxor   %xmm3,%xmm3
  pxor   %xmm4,%xmm4
  cvtsi2ss %ecx,%xmm3
  minss  %xmm0,%xmm3
  cvttss2si %xmm3,%r10d
  movaps %xmm3,%xmm0
  cvtsi2ss %r10d,%xmm4
  lea    0x1(%r10),%r11d
  comiss %xmm4,%xmm0
  subss  %xmm4,%xmm3
  cmovbe %r10d,%r11d
  comiss %xmm2,%xmm1
  ja     L118
L48:
  sub    $0x1,%edx
  pxor   %xmm0,%xmm0
  cvtsi2ss %edx,%xmm0
  minss  %xmm2,%xmm0
  cvttss2si %xmm0,%r15d
  movaps %xmm0,%xmm2
  pxor   %xmm0,%xmm0
  movaps %xmm2,%xmm1
  cvtsi2ss %r15d,%xmm0
  lea    0x1(%r15),%ebp
  comiss %xmm0,%xmm2
  subss  %xmm0,%xmm1
  jbe    L105
L98:
  lea    (%rax,%rax,2),%r14d
  mov    %r11d,%r13d
  lea    0x1(%r11),%r12d
  mov    %r15d,%edi
  imul   %r15d,%eax
  sub    %r10d,%r13d
  xor    %r9d,%r9d
  sub    %r10d,%r12d
  add    $0x1,%r13
  add    %r10d,%eax
  lea    (%rax,%rax,2),%r8d
  cs nopw 0x0(%rax,%rax,1)
L25:
  cmp    %r10d,%r11d
  jl     L8
  movslq %r9d,%rax
  movslq %r8d,%rdx
  lea    0x10(%rsp),%rcx
  lea    (%rbx,%rdx,4),%rdx
  lea    0x0(%r13,%rax,1),%rsi
L128:
  movss  0x8(%rdx),%xmm0
  add    $0xc,%rdx
  movss  %xmm0,(%rcx,%rax,4)
  add    $0x1,%rax
  cmp    %rsi,%rax
  jne    L128
  add    %r12d,%r9d
L8:
  add    $0x1,%edi
  add    %r14d,%r8d
  cmp    %edi,%ebp
  jge    L25
  cmp    %ebp,%r15d
  je     L108
  cmp    %r10d,%r11d
  jne    L147
  movss  0x14(%rsp),%xmm0
  movss  0x10(%rsp),%xmm2
  movss  %xmm0,0x18(%rsp)
  movss  %xmm2,0x14(%rsp)
  movss  %xmm0,0x1c(%rsp)
L147:
  mov    0xc(%rsp),%esi
  lea    0x10(%rsp),%rdi
  movaps %xmm3,%xmm0
  call   <interp_tri@plt>
L78:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L70
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L143:
  xor    %r10d,%r10d
  xor    %r11d,%r11d
  movaps %xmm1,%xmm3
  comiss %xmm2,%xmm1
  jbe    L48
L118:
  xor    %r15d,%r15d
L105:
  mov    %r15d,%ebp
  jmp    L98
L108:
  movss  0x10(%rsp),%xmm0
  cmp    %r10d,%r11d
  je     L78
  mov    0x10(%rsp),%rax
  mov    %rax,0x18(%rsp)
  jmp    L147
L5:
  pxor   %xmm0,%xmm0
  jmp    L78
L70:
  call   <__stack_chk_fail@plt>
```

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);
}
```