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

```asm
<hflip_usmatrix>:
  endbr64
  mov    %rsi,%r11
  mov    %rdi,%r10
  mov    %rdx,%rsi
  movslq %r11d,%rdi
  lea    (%r8,%rcx,1),%edx
  cmp    %rdi,%rsi
  jl     L78
  mov    %rcx,%rax
  movslq %ecx,%rcx
  cmp    %rcx,%r8
  jl     L78
  push   %r15
  shl    $0x3,%rdi
  lea    0x4(,%r8,4),%r11
  push   %r14
  lea    0x0(,%rcx,4),%r14
  push   %r13
  mov    %r8,%r13
  push   %r12
  sub    %rcx,%r13
  push   %rbp
  push   %rbx
  lea    0x8(,%rsi,8),%rbx
  movslq %edx,%rsi
  sub    %rcx,%rsi
  lea    0x0(,%rsi,4),%r15
  mov    %rcx,%rsi
  sub    %r8,%rsi
  lea    -0xc(%r15),%rcx
  mov    %r13,-0x68(%rsp)
  lea    (%r15,%rsi,4),%rbp
  lea    0x1(%r13),%rsi
  mov    %rcx,-0x50(%rsp)
  mov    %rsi,%rcx
  mov    %rsi,-0x60(%rsp)
  and    $0xfffffffffffffffc,%rsi
  shr    $0x2,%rcx
  add    %esi,%eax
  mov    %rsi,-0x58(%rsp)
  shl    $0x4,%rcx
  movslq %eax,%r12
  mov    %r15,-0x10(%rsp)
  mov    %rcx,-0x48(%rsp)
  mov    %r8d,%ecx
  shl    $0x2,%r12
  sub    %esi,%ecx
  mov    %rbx,-0x70(%rsp)
  lea    0x4(%r15),%rbx
  movslq %ecx,%rcx
  lea    0x0(,%rcx,4),%rsi
  mov    %rsi,-0x40(%rsp)
  lea    0x1(%rax),%esi
  add    $0x2,%eax
  movslq %esi,%rcx
  mov    %rcx,-0x38(%rsp)
  lea    0x0(,%rcx,4),%r13
  mov    %edx,%ecx
  sub    %eax,%edx
  sub    %esi,%ecx
  movslq %edx,%rdx
  movslq %ecx,%rcx
  lea    0x0(,%rcx,4),%rsi
  mov    %rsi,-0x30(%rsp)
  movslq %eax,%rsi
  lea    0x0(,%rdx,4),%rax
  mov    %rsi,-0x28(%rsp)
  shl    $0x2,%rsi
  mov    %rsi,-0x20(%rsp)
  mov    %rax,-0x18(%rsp)
  nopl   0x0(%rax)
L46:
  mov    (%r10,%rdi,1),%rsi
  mov    (%r9,%rdi,1),%rcx
  lea    (%rsi,%r11,1),%rdx
  lea    (%rcx,%rbp,1),%r15
  cmp    %rdx,%r15
  lea    (%rsi,%r14,1),%rax
  lea    (%rcx,%rbx,1),%rdx
  setae  %r15b
  cmp    %rdx,%rax
  setae  %dl
  or     %r15b,%dl
  je     L49
  cmpq   $0x2,-0x68(%rsp)
  jbe    L49
  mov    -0x50(%rsp),%rdx
  mov    -0x48(%rsp),%r15
  add    %rcx,%rdx
  add    %rax,%r15
  nopw   0x0(%rax,%rax,1)
L3:
  movdqu (%rax),%xmm1
  add    $0x10,%rax
  sub    $0x10,%rdx
  pshufd $0x1b,%xmm1,%xmm0
  movups %xmm0,0x10(%rdx)
  cmp    %r15,%rax
  jne    L3
  mov    -0x58(%rsp),%rdx
  cmp    %rdx,-0x60(%rsp)
  je     L65
  mov    (%rsi,%r12,1),%eax
  mov    -0x40(%rsp),%rdx
  mov    %eax,(%rcx,%rdx,1)
  cmp    -0x38(%rsp),%r8
  jl     L65
  mov    (%rsi,%r13,1),%eax
  mov    -0x30(%rsp),%rdx
  mov    %eax,(%rcx,%rdx,1)
  cmp    -0x28(%rsp),%r8
  jl     L65
  mov    -0x20(%rsp),%rax
  mov    (%rsi,%rax,1),%eax
  mov    -0x18(%rsp),%rsi
  mov    %eax,(%rcx,%rsi,1)
L65:
  add    $0x8,%rdi
  cmp    -0x70(%rsp),%rdi
  jne    L46
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L49:
  add    -0x10(%rsp),%rcx
  add    %r11,%rsi
  nopl   0x0(%rax,%rax,1)
L62:
  mov    (%rax),%edx
  add    $0x4,%rax
  sub    $0x4,%rcx
  mov    %edx,0x4(%rcx)
  cmp    %rsi,%rax
  jne    L62
  jmp    L65
L78:
  ret
```

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