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

```asm
<interp_z>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %ecx,%r15d
  mov    %fs:0x28,%rcx
  mov    %rcx,0x18(%rsp)
  xor    %ecx,%ecx
  test   %rdi,%rdi
  je     L123
  mov    %rdi,%r11
  mov    %esi,%eax
  pxor   %xmm2,%xmm2
  comiss %xmm0,%xmm2
  ja     L11
  lea    -0x1(%rsi),%ecx
  pxor   %xmm2,%xmm2
  cvtsi2ss %ecx,%xmm2
  minss  %xmm0,%xmm2
  movaps %xmm2,%xmm0
  cvttss2si %xmm2,%r9d
  pxor   %xmm2,%xmm2
  cvtsi2ss %r9d,%xmm2
  lea    0x1(%r9),%r10d
  comiss %xmm2,%xmm0
  cmovbe %r9d,%r10d
L32:
  subss  %xmm2,%xmm0
  pxor   %xmm2,%xmm2
  comiss %xmm1,%xmm2
  ja     L59
  sub    $0x1,%edx
  pxor   %xmm2,%xmm2
  cvtsi2ss %edx,%xmm2
  minss  %xmm1,%xmm2
  movaps %xmm2,%xmm1
  cvttss2si %xmm2,%r14d
  pxor   %xmm2,%xmm2
  cvtsi2ss %r14d,%xmm2
  comiss %xmm2,%xmm1
  jbe    L180
  lea    0x1(%r14),%ebx
  subss  %xmm2,%xmm1
  jmp    L17
L11:
  mov    $0x0,%r9d
  pxor   %xmm0,%xmm0
  movaps %xmm0,%xmm2
  mov    $0x0,%r10d
  jmp    L32
L53:
  movslq %r8d,%rax
  movslq %edi,%rdx
  lea    (%r11,%rdx,4),%rdx
  lea    (%r12,%rax,1),%rcx
L5:
  movss  0x8(%rdx),%xmm2
  movss  %xmm2,(%rsp,%rax,4)
  add    $0x1,%rax
  add    $0xc,%rdx
  cmp    %rcx,%rax
  jne    L5
  add    %ebp,%r8d
L90:
  add    $0x1,%esi
  add    %r13d,%edi
  cmp    %ebx,%esi
  jg     L77
L96:
  cmp    %r9d,%r10d
  jge    L53
  jmp    L90
L77:
  cmp    %ebx,%r14d
  je     L21
  cmp    %r9d,%r10d
  je     L134
L122:
  mov    %rsp,%rdi
  mov    %r15d,%esi
  call   <interp_tri@plt>
L108:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L117
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L21:
  cmp    %r9d,%r10d
  je     L93
  movss  (%rsp),%xmm2
  movss  %xmm2,0x8(%rsp)
  movss  0x4(%rsp),%xmm2
  movss  %xmm2,0xc(%rsp)
  jmp    L122
L93:
  movss  (%rsp),%xmm0
  jmp    L108
L134:
  movss  0x4(%rsp),%xmm2
  movss  %xmm2,0x8(%rsp)
  movss  (%rsp),%xmm3
  movss  %xmm3,0x4(%rsp)
  movss  %xmm2,0xc(%rsp)
  jmp    L122
L123:
  pxor   %xmm0,%xmm0
  jmp    L108
L59:
  pxor   %xmm1,%xmm1
  movaps %xmm1,%xmm2
  mov    $0x0,%r14d
L180:
  subss  %xmm2,%xmm1
  mov    %r14d,%ebx
L17:
  lea    (%rax,%rax,2),%r13d
  imul   %r14d,%eax
  add    %r9d,%eax
  lea    (%rax,%rax,2),%edi
  mov    %r14d,%esi
  mov    $0x0,%r8d
  mov    %r10d,%r12d
  sub    %r9d,%r12d
  add    $0x1,%r12
  lea    0x1(%r10),%ebp
  sub    %r9d,%ebp
  jmp    L96
L117:
  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);
}
```