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

```asm
<Patch_GetFlatness>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  movss  %xmm0,-0x24(%rbp)
  mov    %rdi,-0x30(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  movss  -0x24(%rbp),%xmm0
  mulss  %xmm0,%xmm0
  movss  %xmm0,-0xc(%rbp)
  mov    -0x40(%rbp),%rax
  add    $0x4,%rax
  movl   $0x0,(%rax)
  mov    (%rax),%edx
  mov    -0x40(%rbp),%rax
  mov    %edx,(%rax)
  movl   $0x0,-0x10(%rbp)
  jmp    L27
L29:
  movl   $0x0,-0x14(%rbp)
  jmp    L10
L16:
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  add    $0x2,%eax
  imul   -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%eax
  add    $0x1,%eax
  imul   -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x30(%rbp),%rax
  lea    (%rcx,%rax,1),%rsi
  mov    -0x8(%rbp),%eax
  imul   -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x30(%rbp),%rax
  add    %rax,%rcx
  mov    -0xc(%rbp),%eax
  mov    %rcx,%rdi
  movd   %eax,%xmm0
  call   <Patch_FlatnessTest@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x40(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x4(%rbp),%eax
  cmp    %eax,%edx
  cmovl  %eax,%edx
  mov    -0x40(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x8(%rbp),%eax
  add    %edx,%eax
  add    $0x2,%eax
  imul   -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x38(%rbp),%rax
  mov    (%rax),%ecx
  mov    -0x8(%rbp),%eax
  add    %ecx,%eax
  add    $0x1,%eax
  imul   -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x30(%rbp),%rax
  lea    (%rcx,%rax,1),%rsi
  mov    -0x38(%rbp),%rax
  mov    (%rax),%ecx
  mov    -0x8(%rbp),%eax
  add    %ecx,%eax
  imul   -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x30(%rbp),%rax
  add    %rax,%rcx
  mov    -0xc(%rbp),%eax
  mov    %rcx,%rdi
  movd   %eax,%xmm0
  call   <Patch_FlatnessTest@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x40(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x4(%rbp),%eax
  cmp    %eax,%edx
  cmovl  %eax,%edx
  mov    -0x40(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  lea    (%rax,%rax,1),%edx
  mov    -0x8(%rbp),%eax
  add    %edx,%eax
  add    $0x2,%eax
  imul   -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  lea    (%rax,%rax,1),%ecx
  mov    -0x8(%rbp),%eax
  add    %ecx,%eax
  add    $0x1,%eax
  imul   -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x30(%rbp),%rax
  lea    (%rcx,%rax,1),%rsi
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  lea    (%rax,%rax,1),%ecx
  mov    -0x8(%rbp),%eax
  add    %ecx,%eax
  imul   -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x30(%rbp),%rax
  add    %rax,%rcx
  mov    -0xc(%rbp),%eax
  mov    %rcx,%rdi
  movd   %eax,%xmm0
  call   <Patch_FlatnessTest@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x40(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x4(%rbp),%eax
  cmp    %eax,%edx
  cmovl  %eax,%edx
  mov    -0x40(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  lea    (%rax,%rax,1),%edx
  mov    -0x8(%rbp),%eax
  add    %edx,%eax
  imul   -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x38(%rbp),%rax
  mov    (%rax),%ecx
  mov    -0x8(%rbp),%eax
  add    %ecx,%eax
  imul   -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x30(%rbp),%rax
  lea    (%rcx,%rax,1),%rsi
  mov    -0x8(%rbp),%eax
  imul   -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x30(%rbp),%rax
  add    %rax,%rcx
  mov    -0xc(%rbp),%eax
  mov    %rcx,%rdi
  movd   %eax,%xmm0
  call   <Patch_FlatnessTest@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x40(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%edx
  mov    -0x40(%rbp),%rax
  lea    0x4(%rax),%rcx
  mov    -0x4(%rbp),%eax
  cmp    %eax,%edx
  cmovge %edx,%eax
  mov    %eax,(%rcx)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  lea    (%rax,%rax,1),%edx
  mov    -0x8(%rbp),%eax
  add    %edx,%eax
  add    $0x1,%eax
  imul   -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x38(%rbp),%rax
  mov    (%rax),%ecx
  mov    -0x8(%rbp),%eax
  add    %ecx,%eax
  add    $0x1,%eax
  imul   -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x30(%rbp),%rax
  lea    (%rcx,%rax,1),%rsi
  mov    -0x8(%rbp),%eax
  add    $0x1,%eax
  imul   -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x30(%rbp),%rax
  add    %rax,%rcx
  mov    -0xc(%rbp),%eax
  mov    %rcx,%rdi
  movd   %eax,%xmm0
  call   <Patch_FlatnessTest@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x40(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%edx
  mov    -0x40(%rbp),%rax
  lea    0x4(%rax),%rcx
  mov    -0x4(%rbp),%eax
  cmp    %eax,%edx
  cmovge %edx,%eax
  mov    %eax,(%rcx)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  lea    (%rax,%rax,1),%edx
  mov    -0x8(%rbp),%eax
  add    %edx,%eax
  add    $0x2,%eax
  imul   -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0x38(%rbp),%rax
  mov    (%rax),%ecx
  mov    -0x8(%rbp),%eax
  add    %ecx,%eax
  add    $0x2,%eax
  imul   -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x30(%rbp),%rax
  lea    (%rcx,%rax,1),%rsi
  mov    -0x8(%rbp),%eax
  add    $0x2,%eax
  imul   -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x30(%rbp),%rax
  add    %rax,%rcx
  mov    -0xc(%rbp),%eax
  mov    %rcx,%rdi
  movd   %eax,%xmm0
  call   <Patch_FlatnessTest@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x40(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%edx
  mov    -0x40(%rbp),%rax
  lea    0x4(%rax),%rcx
  mov    -0x4(%rbp),%eax
  cmp    %eax,%edx
  cmovge %edx,%eax
  mov    %eax,(%rcx)
  addl   $0x2,-0x14(%rbp)
L10:
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x14(%rbp)
  jl     L16
  addl   $0x2,-0x10(%rbp)
L27:
  mov    -0x38(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x10(%rbp)
  jl     L29
  nop
  nop
  leave
  ret
```

assistant: ```c
void Patch_GetFlatness(float maxflat, const float *points, int comp, const int *patch_cp, int *flat) {
  int i, p, u, v;
  float maxflat2 = maxflat * maxflat;
  flat[0] = flat[1] = 0;
  for (v = 0; v < patch_cp[1] - 1; v += 2) {
    for (u = 0; u < patch_cp[0] - 1; u += 2) {
      p = v * patch_cp[0] + u;
      i = Patch_FlatnessTest(maxflat2, &points[p * comp], &points[(p + 1) * comp], &points[(p + 2) * comp]);
      flat[0] = ((flat[0]) > (i) ? (flat[0]) : (i));
      i = Patch_FlatnessTest(maxflat2, &points[(p + patch_cp[0]) * comp], &points[(p + patch_cp[0] + 1) * comp], &points[(p + patch_cp[0] + 2) * comp]);
      flat[0] = ((flat[0]) > (i) ? (flat[0]) : (i));
      i = Patch_FlatnessTest(maxflat2, &points[(p + 2 * patch_cp[0]) * comp], &points[(p + 2 * patch_cp[0] + 1) * comp], &points[(p + 2 * patch_cp[0] + 2) * comp]);
      flat[0] = ((flat[0]) > (i) ? (flat[0]) : (i));
      i = Patch_FlatnessTest(maxflat2, &points[p * comp], &points[(p + patch_cp[0]) * comp], &points[(p + 2 * patch_cp[0]) * comp]);
      flat[1] = ((flat[1]) > (i) ? (flat[1]) : (i));
      i = Patch_FlatnessTest(maxflat2, &points[(p + 1) * comp], &points[(p + patch_cp[0] + 1) * comp], &points[(p + 2 * patch_cp[0] + 1) * comp]);
      flat[1] = ((flat[1]) > (i) ? (flat[1]) : (i));
      i = Patch_FlatnessTest(maxflat2, &points[(p + 2) * comp], &points[(p + patch_cp[0] + 2) * comp], &points[(p + 2 * patch_cp[0] + 2) * comp]);
      flat[1] = ((flat[1]) > (i) ? (flat[1]) : (i));
    }
  }
}
```