user: Converte this assembly snippet into its equivalent C code:

```asm
<vflip1_smatrix>:
  endbr64
  push   %r15
  mov    %rcx,%rax
  lea    (%rsi,%rdx,1),%ecx
  movslq %esi,%rsi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,-0x48(%rsp)
  mov    %r8,-0x50(%rsp)
  cmp    %rsi,%rdx
  jl     L4
  movslq %eax,%rbp
  mov    %eax,-0xc(%rsp)
  mov    %r8,%rbx
  cmp    %rbp,%r8
  jl     L4
  mov    %rdi,%r10
  movslq %ecx,%rcx
  lea    (%rdi,%rsi,8),%rdi
  sub    %rbp,%rbx
  lea    0x8(%r10,%rdx,8),%rdx
  lea    0x0(%rbp,%rbp,1),%r10
  mov    %rdx,-0x40(%rsp)
  lea    0x0(,%rcx,8),%rdx
  lea    0x1(%rbx),%rcx
  mov    %rdx,-0x38(%rsp)
  mov    %r8,%rdx
  mov    %rcx,%r8
  lea    0x10(%rbp,%rbp,1),%r11
  mov    %rcx,-0x30(%rsp)
  and    $0xfffffffffffffff8,%rcx
  shr    $0x3,%r8
  lea    0x2(%rdx,%rdx,1),%r12
  add    %ecx,%eax
  shl    $0x4,%r8
  mov    %r10,-0x18(%rsp)
  mov    %rcx,%r13
  mov    %eax,-0x10(%rsp)
  mov    %rbx,%rax
  sub    %rcx,%rax
  mov    %r8,-0x58(%rsp)
  mov    %rax,-0x28(%rsp)
  add    $0x1,%rax
  mov    %rax,-0x20(%rsp)
  nopw   0x0(%rax,%rax,1)
L37:
  mov    -0x38(%rsp),%rax
  mov    -0x48(%rsp),%rdx
  sub    %rdi,%rax
  mov    (%rax,%rdx,2),%rax
  mov    (%rdi),%rdx
  lea    (%rax,%r10,1),%rcx
  lea    (%rdx,%r11,1),%r9
  cmp    %r9,%rcx
  lea    (%rdx,%r10,1),%rsi
  lea    (%rax,%r11,1),%r9
  setae  %r14b
  cmp    %r9,%rsi
  setae  %r9b
  or     %r14b,%r9b
  je     L20
  cmp    $0x2,%rbx
  jbe    L20
  cmp    $0x6,%rbx
  jbe    L17
  mov    -0x58(%rsp),%r8
  xor    %r9d,%r9d
  nop
L86:
  movdqu (%rcx,%r9,1),%xmm0
  movdqu (%rsi,%r9,1),%xmm1
  movups %xmm1,(%rcx,%r9,1)
  movups %xmm0,(%rsi,%r9,1)
  add    $0x10,%r9
  cmp    %r8,%r9
  jne    L86
  mov    %r8,-0x58(%rsp)
  cmp    %r13,-0x30(%rsp)
  je     L131
  cmpq   $0x2,-0x28(%rsp)
  mov    -0x20(%rsp),%r14
  jbe    L114
  mov    -0x10(%rsp),%ecx
  mov    %r13,%rsi
L30:
  add    %rbp,%rsi
  add    %rsi,%rsi
  lea    (%rax,%rsi,1),%r9
  add    %rdx,%rsi
  movq   (%rsi),%xmm0
  mov    (%r9),%r15
  movq   %xmm0,(%r9)
  mov    %r15,(%rsi)
  mov    %r14,%rsi
  and    $0xfffffffffffffffc,%rsi
  add    %esi,%ecx
  cmp    %rsi,%r14
  je     L131
L10:
  movslq %ecx,%rsi
  add    %rsi,%rsi
  lea    (%rdx,%rsi,1),%r9
  lea    (%rax,%rsi,1),%r14
  movzwl (%r9),%r8d
  movzwl (%r14),%r15d
  mov    %r8w,(%r14)
  mov    %r15w,(%r9)
  lea    0x1(%rcx),%r9d
  movslq %r9d,%r9
  cmp    %r9,-0x50(%rsp)
  jl     L131
  lea    0x2(%rsi),%r9
  add    $0x2,%ecx
  lea    (%rax,%r9,1),%r14
  add    %rdx,%r9
  movslq %ecx,%rcx
  movzwl (%r14),%r15d
  movzwl (%r9),%r8d
  mov    %r8w,(%r14)
  mov    %r15w,(%r9)
  cmp    %rcx,-0x50(%rsp)
  jl     L131
  add    $0x4,%rsi
  add    %rsi,%rax
  add    %rdx,%rsi
  movzwl (%rax),%ecx
  movzwl (%rsi),%edx
  mov    %dx,(%rax)
  mov    %cx,(%rsi)
L131:
  add    $0x8,%rdi
  cmp    -0x40(%rsp),%rdi
  jne    L37
L4:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L20:
  mov    -0x18(%rsp),%rcx
  mov    -0x58(%rsp),%r8
  nopw   0x0(%rax,%rax,1)
L62:
  movzwl (%rax,%rcx,1),%esi
  movzwl (%rdx,%rcx,1),%r9d
  mov    %r9w,(%rax,%rcx,1)
  mov    %si,(%rdx,%rcx,1)
  add    $0x2,%rcx
  cmp    %rcx,%r12
  jne    L62
  mov    %r8,-0x58(%rsp)
  jmp    L131
L17:
  mov    -0x30(%rsp),%r14
  mov    -0xc(%rsp),%ecx
  xor    %esi,%esi
  jmp    L30
L114:
  mov    -0x10(%rsp),%ecx
  jmp    L10
```

assistant: ```c
void vflip1_smatrix(short **S, long nrl, long nrh, long ncl, long nch) {
  int i, j, n = nrl + nrh;
  short t;
  for (i = nrl; i <= nrh; i++) {
    for (j = ncl; j <= nch; j++) {
      t = S[n - i][j];
      S[n - i][j] = S[i][j];
      S[i][j] = t;
    }
  }
}
```