user: Translate the below assembly code into C programming language:

```asm
<Patch_GetFlatness>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbp
  mov    %esi,%ebx
  mov    %rdx,%r14
  mov    %rcx,%r13
  mulss  %xmm0,%xmm0
  movss  %xmm0,0x18(%rsp)
  movl   $0x0,0x4(%rcx)
  movl   $0x0,(%rcx)
  movl   $0x0,0x1c(%rsp)
  cmpl   $0x1,0x4(%rdx)
  jg     L22
L43:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L15:
  imul   0x1c(%rsp),%r12d
  add    %r15d,%r12d
  lea    0x2(%r12),%eax
  imul   %ebx,%eax
  movslq %eax,%rdx
  lea    0x0(%rbp,%rdx,4),%rdi
  sub    %ebx,%eax
  movslq %eax,%rdx
  lea    0x0(%rbp,%rdx,4),%rcx
  sub    %ebx,%eax
  cltq
  lea    0x0(%rbp,%rax,4),%rax
  mov    %rdi,(%rsp)
  mov    %rdi,%rdx
  mov    %rcx,0x8(%rsp)
  mov    %rcx,%rsi
  mov    %rax,0x10(%rsp)
  mov    %rax,%rdi
  movss  0x18(%rsp),%xmm0
  call   <Patch_FlatnessTest@plt>
  mov    %eax,%edx
  mov    0x0(%r13),%eax
  cmp    %edx,%eax
  cmovl  %edx,%eax
  mov    %eax,0x0(%r13)
  mov    %r12d,%eax
  add    (%r14),%eax
  add    $0x2,%eax
  imul   %ebx,%eax
  mov    %eax,%ecx
  sub    %ebx,%ecx
  mov    %ecx,%edx
  cltq
  lea    0x0(%rbp,%rax,4),%rax
  movslq %ecx,%rcx
  lea    0x0(%rbp,%rcx,4),%rsi
  sub    %ebx,%edx
  movslq %edx,%rdx
  lea    0x0(%rbp,%rdx,4),%rdi
  mov    %rax,%rdx
  movss  0x18(%rsp),%xmm0
  call   <Patch_FlatnessTest@plt>
  mov    %eax,%edx
  mov    0x0(%r13),%eax
  cmp    %edx,%eax
  cmovl  %edx,%eax
  mov    %eax,0x0(%r13)
  mov    (%r14),%eax
  lea    0x2(%r12,%rax,2),%edx
  imul   %ebx,%edx
  mov    %edx,%eax
  sub    %ebx,%eax
  movslq %edx,%rdx
  lea    0x0(%rbp,%rdx,4),%rdx
  movslq %eax,%rcx
  lea    0x0(%rbp,%rcx,4),%rsi
  sub    %ebx,%eax
  cltq
  lea    0x0(%rbp,%rax,4),%rdi
  movss  0x18(%rsp),%xmm0
  call   <Patch_FlatnessTest@plt>
  mov    %eax,%edx
  mov    0x0(%r13),%eax
  cmp    %edx,%eax
  cmovl  %edx,%eax
  mov    %eax,0x0(%r13)
  mov    (%r14),%ecx
  lea    (%r12,%rcx,2),%eax
  mov    %eax,%edx
  imul   %ebx,%edx
  movslq %edx,%rdx
  lea    0x0(%rbp,%rdx,4),%rdx
  sub    %ecx,%eax
  imul   %ebx,%eax
  cltq
  lea    0x0(%rbp,%rax,4),%rsi
  mov    0x10(%rsp),%rdi
  movss  0x18(%rsp),%xmm0
  call   <Patch_FlatnessTest@plt>
  mov    %eax,%edx
  mov    0x4(%r13),%eax
  cmp    %edx,%eax
  cmovl  %edx,%eax
  mov    %eax,0x4(%r13)
  mov    (%r14),%ecx
  lea    (%r12,%rcx,2),%eax
  lea    0x1(%rax),%edx
  imul   %ebx,%edx
  movslq %edx,%rdx
  lea    0x0(%rbp,%rdx,4),%rdx
  sub    %ecx,%eax
  add    $0x1,%eax
  imul   %ebx,%eax
  cltq
  lea    0x0(%rbp,%rax,4),%rsi
  mov    0x8(%rsp),%rdi
  movss  0x18(%rsp),%xmm0
  call   <Patch_FlatnessTest@plt>
  mov    %eax,%edx
  mov    0x4(%r13),%eax
  cmp    %edx,%eax
  cmovl  %edx,%eax
  mov    %eax,0x4(%r13)
  mov    (%r14),%ecx
  lea    (%r12,%rcx,2),%eax
  lea    0x2(%rax),%edx
  imul   %ebx,%edx
  movslq %edx,%rdx
  lea    0x0(%rbp,%rdx,4),%rdx
  sub    %ecx,%eax
  add    $0x2,%eax
  imul   %ebx,%eax
  cltq
  lea    0x0(%rbp,%rax,4),%rsi
  mov    (%rsp),%rdi
  movss  0x18(%rsp),%xmm0
  call   <Patch_FlatnessTest@plt>
  mov    %eax,%edx
  mov    0x4(%r13),%eax
  cmp    %edx,%eax
  cmovl  %edx,%eax
  mov    %eax,0x4(%r13)
  add    $0x2,%r15d
  mov    (%r14),%r12d
  lea    -0x1(%r12),%eax
  cmp    %r15d,%eax
  jg     L15
L34:
  addl   $0x2,0x1c(%rsp)
  mov    0x1c(%rsp),%edi
  mov    0x4(%r14),%eax
  sub    $0x1,%eax
  cmp    %edi,%eax
  jle    L43
L22:
  mov    (%r14),%r12d
  mov    $0x0,%r15d
  cmp    $0x1,%r12d
  jg     L15
  jmp    L34
```

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