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

```asm
<reverse_vertically_uint8_buffer_inplace>:
  endbr64
  push   %r15
  mov    %edx,%eax
  shr    $0x1f,%edx
  push   %r14
  add    %eax,%edx
  push   %r13
  sar    %edx
  push   %r12
  push   %rbp
  push   %rbx
  mov    %esi,-0x3c(%rsp)
  mov    %edx,-0xc(%rsp)
  cmp    $0x1,%eax
  jle    L149
  test   %esi,%esi
  jle    L149
  mov    %ecx,%r13d
  test   %ecx,%ecx
  jle    L149
  sub    $0x1,%eax
  movslq %ecx,%r15
  lea    -0x1(%rcx),%ebx
  movl   $0x0,-0x1c(%rsp)
  imul   %esi,%eax
  mov    %ebx,-0x2c(%rsp)
  movl   $0x0,-0x20(%rsp)
  mov    %eax,-0x10(%rsp)
  lea    0x0(,%r15,4),%rax
  mov    %rax,-0x38(%rsp)
  mov    %ecx,%eax
  shr    $0x2,%eax
  lea    -0x1(%rax),%r10d
  mov    %ecx,%eax
  and    $0xfffffffc,%eax
  add    $0x1,%r10
  mov    %eax,-0x28(%rsp)
  mov    %ebx,%eax
  mov    %ecx,%ebx
  shl    $0x4,%r10
  and    $0x3,%ebx
  lea    0x4(%rdi,%rax,4),%rax
  mov    %ebx,-0x24(%rsp)
  mov    %rax,-0x18(%rsp)
  nopl   0x0(%rax,%rax,1)
L15:
  mov    -0x1c(%rsp),%eax
  mov    -0x10(%rsp),%edx
  xor    %r12d,%r12d
  imul   %r13d,%eax
  imul   %r13d,%edx
  movslq %eax,%rbx
  sub    %edx,%eax
  movslq %edx,%r11
  lea    0x0(,%rbx,4),%r9
  mov    %eax,-0x30(%rsp)
  lea    0x0(,%r11,4),%rsi
  nop
L4:
  mov    -0x30(%rsp),%eax
  lea    (%rax,%rdx,1),%r8d
  lea    0x10(%r9),%rax
  cmp    %rsi,%rax
  lea    0x10(%rsi),%rax
  setle  %cl
  cmp    %rax,%r9
  setge  %al
  or     %cl,%al
  je     L138
  cmp    $0x1,%r13d
  je     L138
  cmpl   $0x2,-0x2c(%rsp)
  jbe    L42
  lea    (%rdi,%rsi,1),%rbp
  lea    (%rdi,%r9,1),%rcx
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L85:
  movdqu 0x0(%rbp,%rax,1),%xmm0
  movdqu (%rcx,%rax,1),%xmm2
  movups %xmm2,0x0(%rbp,%rax,1)
  movups %xmm0,(%rcx,%rax,1)
  add    $0x10,%rax
  cmp    %r10,%rax
  jne    L85
  mov    -0x28(%rsp),%eax
  cmp    %eax,%r13d
  je     L132
  mov    -0x24(%rsp),%ecx
  mov    %ecx,%r14d
  cmp    $0x1,%ecx
  je     L68
  mov    %eax,%ecx
L41:
  lea    (%r11,%rcx,1),%rbp
  add    %rbx,%rcx
  lea    (%rdi,%rcx,4),%rcx
  lea    (%rdi,%rbp,4),%rbp
  movq   (%rcx),%xmm1
  movq   0x0(%rbp),%xmm0
  movq   %xmm1,0x0(%rbp)
  movq   %xmm0,(%rcx)
  mov    %r14d,%ecx
  and    $0xfffffffe,%ecx
  add    %ecx,%eax
  cmp    %ecx,%r14d
  je     L132
L68:
  lea    (%rdx,%rax,1),%ecx
  add    %r8d,%eax
  movslq %ecx,%rcx
  cltq
  lea    (%rdi,%rcx,4),%rcx
  lea    (%rdi,%rax,4),%rax
  mov    (%rcx),%ebp
  mov    (%rax),%r8d
  mov    %r8d,(%rcx)
  mov    %ebp,(%rax)
L132:
  mov    -0x38(%rsp),%rax
  add    $0x1,%r12d
  add    %r13d,%edx
  add    %r15,%rbx
  add    %r15,%r11
  add    %rax,%r9
  add    %rax,%rsi
  cmp    %r12d,-0x3c(%rsp)
  jne    L4
  mov    -0x3c(%rsp),%esi
  addl   $0x1,-0x20(%rsp)
  add    %esi,-0x1c(%rsp)
  mov    -0x20(%rsp),%eax
  sub    %esi,-0x10(%rsp)
  cmp    -0xc(%rsp),%eax
  jl     L15
L149:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L138:
  mov    -0x18(%rsp),%rcx
  lea    (%rdi,%rsi,1),%rax
  lea    (%rcx,%rsi,1),%rbp
  mov    %rbx,%rcx
  sub    %r11,%rcx
  nopl   0x0(%rax,%rax,1)
L27:
  mov    (%rax),%r8d
  mov    (%rax,%rcx,4),%r14d
  mov    %r14d,(%rax)
  mov    %r8d,(%rax,%rcx,4)
  add    $0x4,%rax
  cmp    %rbp,%rax
  jne    L27
  jmp    L132
L42:
  mov    %r13d,%r14d
  xor    %ecx,%ecx
  xor    %eax,%eax
  jmp    L41
```

assistant: ```c
void reverse_vertically_uint8_buffer_inplace(uint8_t *buff, int w, int h, int nch) {
  for (int j = 0; j < h / 2; j++)
    for (int i = 0; i < w; i++)
      for (int c = 0; c < nch; c++) {
        {
          uint8_t t = buff[nch * (i + (h - j - 1) * w) + c];
          buff[nch * (i + (h - j - 1) * w) + c] = buff[nch * (i + j * w) + c];
          buff[nch * (i + j * w) + c] = t;
        };
      }
}
```