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

```asm
<p3dReplicatePadding3D_uchar2uchar>:
  endbr64
  push   %r15
  lea    (%r9,%r9,1),%eax
  push   %r14
  lea    (%rax,%rdx,1),%r10d
  push   %r13
  mov    %r10d,%r15d
  push   %r12
  mov    %r9d,%r12d
  push   %rbp
  lea    (%rax,%r8,1),%ebp
  push   %rbx
  lea    (%rax,%rcx,1),%ebx
  xor    %eax,%eax
  sub    $0x138,%rsp
  mov    %rsi,0x10(%rsp)
  call   <p3dZeroPadding3D_uchar2uchar@plt>
  test   %r12d,%r12d
  jle    L121
  mov    %r15d,%r10d
  mov    %r15d,%eax
  lea    -0x1(%r15),%r11d
  mov    %r15d,%edi
  imul   %ebx,%r10d
  not    %eax
  sub    %r12d,%edi
  mov    %r12d,0x64(%rsp)
  mov    %r11d,0xf8(%rsp)
  sub    %r12d,%r11d
  sub    0x64(%rsp),%ebp
  mov    %edi,0x20(%rsp)
  sub    %r10d,%eax
  mov    %r10d,%r14d
  mov    %r10d,%r9d
  mov    %r12d,0xc(%rsp)
  mov    %eax,0x110(%rsp)
  imul   %r12d,%r14d
  lea    0x1(%r15),%eax
  mov    %eax,%esi
  mov    %eax,%edx
  mov    %r10d,0x104(%rsp)
  lea    -0x1(%r12),%r10d
  imul   %r12d,%esi
  mov    %eax,0xfc(%rsp)
  imul   %r10d,%edx
  mov    %r10d,0x44(%rsp)
  mov    %r14d,0x3c(%rsp)
  mov    %esi,0x68(%rsp)
  add    %r14d,%esi
  mov    %esi,0x80(%rsp)
  mov    %r9d,%esi
  imul   %r10d,%r9d
  mov    %edx,%ecx
  mov    %edx,0xb0(%rsp)
  mov    %r11d,%edx
  add    %r9d,%ecx
  mov    %r9d,%r8d
  mov    %r9d,0x58(%rsp)
  mov    %esi,%r9d
  mov    %ecx,0x7c(%rsp)
  mov    $0x1,%ecx
  sub    %r15d,%ecx
  mov    %ecx,0x100(%rsp)
  sub    %esi,%ecx
  mov    %r15d,%esi
  imul   %r12d,%r15d
  mov    %ecx,0x118(%rsp)
  lea    0x1(%rbx),%ecx
  mov    %r15d,%eax
  mov    %r15d,0x24(%rsp)
  imul   %ecx,%eax
  lea    (%rax,%r11,1),%r13d
  mov    %esi,%r11d
  imul   %r10d,%r11d
  mov    %edi,%r10d
  mov    %r13d,0x84(%rsp)
  mov    %esi,%r13d
  mov    %r11d,%eax
  mov    %r11d,0xe4(%rsp)
  imul   %ecx,%eax
  add    %edi,%eax
  mov    0xf8(%rsp),%edi
  mov    %eax,0x6c(%rsp)
  sub    %r9d,%edi
  mov    %edi,0x114(%rsp)
  mov    %ebx,%edi
  sub    %r12d,%edi
  lea    -0x1(%rdi),%eax
  mov    %edi,%esi
  mov    %r13d,%edi
  imul   %r13d,%eax
  mov    %r14d,%r13d
  mov    %eax,0x38(%rsp)
  mov    %r14d,%eax
  mov    0x38(%rsp),%r14d
  add    %r12d,%eax
  add    %eax,%r14d
  mov    %edi,%eax
  mov    %r14d,0x98(%rsp)
  mov    %esi,%r14d
  mov    %edi,%esi
  mov    0x44(%rsp),%edi
  imul   %r14d,%eax
  mov    %esi,0x78(%rsp)
  mov    %eax,%r12d
  add    %eax,%edi
  mov    %eax,0x60(%rsp)
  lea    -0x1(%rbx),%eax
  mov    %eax,%ebx
  lea    -0x1(%rbp),%eax
  mov    %edi,0xb4(%rsp)
  add    %r8d,%edi
  imul   %esi,%ebx
  mov    %ebp,%esi
  mov    %eax,%ebp
  mov    %edi,0x88(%rsp)
  imul   %r9d,%ebp
  mov    %r9d,%eax
  mov    %ebx,%edi
  lea    -0x1(%rbx),%ebx
  mov    %ebx,0x10c(%rsp)
  mov    %r9d,%ebx
  mov    %ebp,0x40(%rsp)
  mov    0x68(%rsp),%r9d
  imul   %esi,%ebx
  add    %ebp,%r9d
  mov    0xfc(%rsp),%ebp
  mov    %ebx,0x50(%rsp)
  add    0xb0(%rsp),%ebx
  sub    %eax,%ebp
  mov    %r9d,0x74(%rsp)
  mov    0x38(%rsp),%r9d
  mov    %ebp,0x128(%rsp)
  mov    0x78(%rsp),%ebp
  mov    %ebx,0x8c(%rsp)
  mov    %eax,%ebx
  lea    (%rdx,%r13,1),%eax
  mov    0x64(%rsp),%r13d
  add    %eax,%r9d
  imul   %ebp,%ecx
  mov    %r8d,%eax
  add    %r12d,%eax
  mov    %r9d,0x90(%rsp)
  mov    %r8d,%r9d
  mov    %r12d,%r8d
  add    %r10d,%eax
  mov    0xb4(%rsp),%r12d
  mov    %eax,0x94(%rsp)
  mov    %ecx,%eax
  lea    -0x1(%rcx),%ecx
  mov    %ecx,0x108(%rsp)
  mov    0x38(%rsp),%ecx
  add    %r13d,%ecx
  mov    %ecx,0xc0(%rsp)
  add    0x40(%rsp),%ecx
  mov    %ecx,0x70(%rsp)
  mov    0x50(%rsp),%ecx
  add    %ecx,%r12d
  mov    %r12d,0x9c(%rsp)
  lea    0x1(%rdi),%r12d
  mov    %r11d,%edi
  add    %r10d,%r11d
  mov    %r12d,0x11c(%rsp)
  lea    (%rdx,%r15,1),%r12d
  add    0x38(%rsp),%edx
  add    %r8d,%r10d
  mov    0x40(%rsp),%r15d
  mov    %r12d,0x5c(%rsp)
  mov    %edx,0xc4(%rsp)
  add    %r15d,%r12d
  add    %r15d,%edx
  mov    %r11d,0xbc(%rsp)
  add    %ecx,%r11d
  mov    %r12d,0xa0(%rsp)
  lea    0x1(%rax),%r12d
  movslq %r13d,%r15
  mov    %edx,0xa8(%rsp)
  mov    %ecx,%edx
  mov    %r10d,0xe0(%rsp)
  add    %ecx,%r10d
  mov    %ebp,%ecx
  not    %ebp
  mov    %r11d,0xa4(%rsp)
  mov    %r12d,0x120(%rsp)
  mov    %r10d,0xac(%rsp)
  mov    %ebp,0x124(%rsp)
  movslq 0xf8(%rsp),%rax
  mov    %r15,0x48(%rsp)
  mov    %rax,%r11
  mov    0x68(%rsp),%eax
  mov    %r9d,0xb8(%rsp)
  sub    %r15,%r11
  mov    %edx,0xe8(%rsp)
  mov    %r11,0xc8(%rsp)
  mov    %r15,%r11
  neg    %r15
  mov    %r15,0xd0(%rsp)
  movslq %ecx,%r15
  mov    %r15,%rcx
  mov    %eax,0x54(%rsp)
  lea    -0x2(%r15),%eax
  sub    %r11,%rcx
  mov    %eax,0x12c(%rsp)
  mov    %rcx,0xd8(%rsp)
  mov    %edi,0xec(%rsp)
  movslq %ebx,%rdi
  nopl   0x0(%rax)
L162:
  mov    0x44(%rsp),%eax
  mov    0x64(%rsp),%r13d
  mov    0xc(%rsp),%r12d
  mov    %eax,0x64(%rsp)
  mov    0x20(%rsp),%eax
  cmp    %r12d,%eax
  jle    L159
  movslq 0x24(%rsp),%rbx
  movslq 0x3c(%rsp),%rdx
  mov    %r13d,%ebp
  mov    %esi,0x30(%rsp)
  movslq 0xb8(%rsp),%r11
  movslq 0x40(%rsp),%r10
  mov    %eax,%esi
  movslq 0xe8(%rsp),%r9
  mov    %rbx,0x28(%rsp)
  add    %rdx,%rbx
  add    0x48(%rsp),%rbx
  add    0x10(%rsp),%rbx
  nopl   0x0(%rax)
L219:
  mov    %rbx,%rax
  mov    %r13d,%r8d
  cmp    %r14d,%r12d
  jge    L209
  mov    %esi,0x18(%rsp)
  nopw   0x0(%rax,%rax,1)
L1:
  movzbl (%rax),%esi
  mov    %rax,%rcx
  add    $0x1,%r8d
  add    %r15,%rax
  sub    %rdx,%rcx
  mov    %sil,(%rcx,%r11,1)
  movzbl (%rcx,%r10,1),%esi
  mov    %sil,(%rcx,%r9,1)
  cmp    %r14d,%r8d
  jne    L1
  mov    0x18(%rsp),%esi
L209:
  add    $0x1,%ebp
  add    $0x1,%rbx
  cmp    %esi,%ebp
  jne    L219
  mov    0x30(%rsp),%esi
  cmp    %r14d,0xc(%rsp)
  jge    L57
L42:
  mov    0x44(%rsp),%eax
  sub    0x12c(%rsp),%eax
  mov    %r15,0xf0(%rsp)
  mov    %r13d,%r12d
  add    0x20(%rsp),%eax
  mov    0x5c(%rsp),%ebp
  mov    0x54(%rsp),%ebx
  mov    0x78(%rsp),%r15d
  mov    %eax,0x28(%rsp)
  movslq 0x3c(%rsp),%rax
  mov    %rax,0x30(%rsp)
  nopl   (%rax)
L134:
  cmp    %esi,0xc(%rsp)
  jge    L118
  mov    0x28(%rsp),%eax
  mov    %ebx,0x18(%rsp)
  lea    -0x1(%rbx),%r9d
  movslq %ebx,%r10
  mov    %r13d,%ecx
  movslq %r9d,%r9
  movslq %ebp,%r11
  lea    (%rax,%rbp,1),%r8d
  mov    0x30(%rsp),%rax
  movslq %r8d,%r8
  add    %r10,%rax
  add    0x10(%rsp),%rax
  nopw   0x0(%rax,%rax,1)
L55:
  movzbl (%rax),%ebx
  mov    %rax,%rdx
  add    $0x1,%ecx
  add    %rdi,%rax
  sub    %r10,%rdx
  mov    %bl,(%rdx,%r9,1)
  movzbl (%rdx,%r11,1),%ebx
  mov    %bl,(%rdx,%r8,1)
  cmp    %esi,%ecx
  jne    L55
  mov    0x18(%rsp),%ebx
L118:
  add    $0x1,%r12d
  add    %r15d,%ebx
  add    %r15d,%ebp
  cmp    %r14d,%r12d
  jl     L134
  movslq 0x24(%rsp),%rax
  mov    0xf0(%rsp),%r15
  movslq 0x3c(%rsp),%rdx
  mov    0xc(%rsp),%ebx
  mov    %rax,0x28(%rsp)
  cmp    %ebx,0x20(%rsp)
  jle    L46
L57:
  mov    %r15,0x30(%rsp)
  mov    0x60(%rsp),%r12d
  mov    %r13d,%ebp
  mov    %r14d,0xf0(%rsp)
  mov    0x10(%rsp),%r15
  mov    0xec(%rsp),%r14d
  nopw   0x0(%rax,%rax,1)
L130:
  cmp    %esi,0xc(%rsp)
  jge    L95
  mov    0x38(%rsp),%eax
  mov    %rdx,0x18(%rsp)
  lea    0x0(%rbp,%r14,1),%ebx
  mov    %r13d,%r8d
  lea    0x0(%rbp,%r12,1),%r10d
  movslq %ebx,%rbx
  lea    0x0(%rbp,%rax,1),%r11d
  mov    0x24(%rsp),%eax
  movslq %r10d,%r10
  movslq %r11d,%r11
  lea    0x0(%rbp,%rax,1),%r9d
  movslq %r9d,%r9
  lea    (%rdx,%r9,1),%rax
  add    %r15,%rax
  nopl   (%rax)
L193:
  movzbl (%rax),%edx
  mov    %rax,%rcx
  add    $0x1,%r8d
  add    %rdi,%rax
  sub    %r9,%rcx
  mov    %dl,(%rcx,%rbx,1)
  movzbl (%rcx,%r11,1),%edx
  mov    %dl,(%rcx,%r10,1)
  cmp    %esi,%r8d
  jne    L193
  mov    0x18(%rsp),%rdx
L95:
  add    $0x1,%ebp
  cmp    0x20(%rsp),%ebp
  jl     L130
  mov    0x48(%rsp),%rax
  mov    0x28(%rsp),%rbp
  movslq 0x38(%rsp),%rbx
  movslq 0x40(%rsp),%r9
  movslq 0x58(%rsp),%rcx
  movslq 0xe4(%rsp),%r10
  mov    %rbp,%r11
  movslq 0x50(%rsp),%r8
  mov    0x30(%rsp),%r15
  add    %rdx,%r11
  add    %r9,%rbp
  mov    %rax,0x30(%rsp)
  mov    0x10(%rsp),%rax
  add    %rbx,%rdx
  add    %rbx,%r9
  lea    (%r10,%rcx,1),%r12
  add    %r8,%r10
  mov    0xf0(%rsp),%r14d
  mov    0x20(%rsp),%ebx
  add    %rax,%r11
  add    %rax,%r12
  add    %rax,%rbp
  add    %rax,%r10
  add    %rax,%rdx
  movslq 0x60(%rsp),%rax
  mov    %rax,0x18(%rsp)
  add    %rax,%rcx
  mov    0x10(%rsp),%rax
  add    0x18(%rsp),%r8
  mov    %esi,0x18(%rsp)
  add    %rax,%rcx
  add    %rax,%r9
  add    %rax,%r8
  mov    0x30(%rsp),%rax
  xchg   %ax,%ax
L142:
  movzbl (%r11,%rax,1),%esi
  mov    %sil,(%r12,%rax,1)
  movzbl 0x0(%rbp,%rax,1),%esi
  mov    %sil,(%r10,%rax,1)
  movzbl (%rdx,%rax,1),%esi
  mov    %sil,(%rcx,%rax,1)
  movzbl (%r9,%rax,1),%esi
  mov    %sil,(%r8,%rax,1)
  add    $0x1,%rax
  cmp    %eax,%ebx
  jg     L142
  mov    0x18(%rsp),%esi
L46:
  cmp    %r14d,0xc(%rsp)
  jge    L44
  mov    0x48(%rsp),%r11
  movslq 0x24(%rsp),%rax
  mov    %rdi,0x28(%rsp)
  mov    %r13d,%edx
  movslq 0x3c(%rsp),%rbx
  movslq 0x40(%rsp),%r9
  mov    %r13d,0x18(%rsp)
  add    %r11,%rax
  mov    %r11,%r10
  movslq 0x58(%rsp),%rcx
  movslq 0x50(%rsp),%r8
  mov    0xd8(%rsp),%r12
  mov    0xd0(%rsp),%r13
  add    %rbx,%rax
  add    0x10(%rsp),%rax
  sub    %r11,%r12
  mov    0xc8(%rsp),%r11
  sub    %rbx,%r12
  mov    %r11,%rbp
  sub    %r10,%rbp
  sub    %rbx,%rbp
  nopw   0x0(%rax,%rax,1)
L12:
  movzbl (%rax),%r10d
  mov    %rax,%rdi
  add    $0x1,%edx
  sub    %rbx,%rdi
  mov    %r10b,-0x1(%rdi,%rcx,1)
  movzbl (%rdi,%r9,1),%r10d
  mov    %r10b,-0x1(%rdi,%r8,1)
  lea    (%rax,%r11,1),%rdi
  movzbl (%rdi,%r13,1),%r10d
  lea    (%r12,%rax,1),%rdi
  mov    %r10b,(%rdi,%rcx,1)
  lea    0x0(%rbp,%rax,1),%r10
  add    %r15,%rax
  movzbl (%r10,%r9,1),%r10d
  mov    %r10b,(%rdi,%r8,1)
  cmp    %r14d,%edx
  jne    L12
  mov    0x18(%rsp),%r13d
  mov    0x28(%rsp),%rdi
L44:
  cmp    %esi,0xc(%rsp)
  jge    L33
  movslq 0x68(%rsp),%rcx
  movslq 0x3c(%rsp),%rdx
  mov    %r14d,0x18(%rsp)
  movslq 0xb0(%rsp),%r12
  movslq 0x5c(%rsp),%rbp
  movslq 0xbc(%rsp),%rbx
  movslq 0xc0(%rsp),%r11
  add    %rcx,%rdx
  movslq 0xb4(%rsp),%r10
  movslq 0xc4(%rsp),%r9
  movslq 0xe0(%rsp),%r8
  add    0x10(%rsp),%rdx
  nopl   0x0(%rax,%rax,1)
L136:
  movzbl (%rdx),%r14d
  mov    %rdx,%rax
  add    $0x1,%r13d
  add    %rdi,%rdx
  sub    %rcx,%rax
  mov    %r14b,(%rax,%r12,1)
  movzbl (%rax,%rbp,1),%r14d
  mov    %r14b,(%rax,%rbx,1)
  movzbl (%rax,%r11,1),%r14d
  mov    %r14b,(%rax,%r10,1)
  movzbl (%rax,%r9,1),%r14d
  mov    %r14b,(%rax,%r8,1)
  cmp    %esi,%r13d
  jne    L136
  mov    0x18(%rsp),%r14d
L33:
  mov    0x10(%rsp),%rbx
  movslq 0x80(%rsp),%rax
  add    $0x1,%esi
  movzbl (%rbx,%rax,1),%edx
  mov    %rax,%rcx
  movslq 0x7c(%rsp),%rax
  mov    %dl,(%rbx,%rax,1)
  mov    %rax,%r11
  movslq 0x84(%rsp),%rax
  movzbl (%rbx,%rax,1),%edx
  mov    %rax,%r9
  movslq 0x6c(%rsp),%rax
  mov    %dl,(%rbx,%rax,1)
  mov    %rax,%r10
  movslq 0x98(%rsp),%rax
  movzbl (%rbx,%rax,1),%edx
  mov    %rax,%r8
  movslq 0x88(%rsp),%rax
  mov    %dl,(%rbx,%rax,1)
  mov    %rax,%rbp
  movslq 0x74(%rsp),%rax
  movzbl (%rbx,%rax,1),%edx
  mov    %rax,%r13
  movslq 0x8c(%rsp),%rax
  mov    %dl,(%rbx,%rax,1)
  mov    %rax,%r12
  movslq 0x90(%rsp),%rax
  movzbl (%rbx,%rax,1),%edx
  movslq 0x94(%rsp),%rax
  mov    %dl,(%rbx,%rax,1)
  movslq 0x70(%rsp),%rax
  movzbl (%rbx,%rax,1),%edx
  movslq 0x9c(%rsp),%rax
  mov    %dl,(%rbx,%rax,1)
  movslq 0xa0(%rsp),%rax
  movzbl (%rbx,%rax,1),%edx
  movslq 0xa4(%rsp),%rax
  mov    %dl,(%rbx,%rax,1)
  movslq 0xa8(%rsp),%rax
  movzbl (%rbx,%rax,1),%edx
  movslq 0xac(%rsp),%rax
  mov    %dl,(%rbx,%rax,1)
  mov    0x110(%rsp),%ebx
  subl   $0x1,0xc(%rsp)
  add    %ebx,%ecx
  add    %ebx,%r11d
  mov    0x118(%rsp),%ebx
  addl   $0x1,0x20(%rsp)
  mov    %ecx,0x80(%rsp)
  add    %ebx,%r9d
  add    %ebx,%r10d
  mov    0x114(%rsp),%ebx
  mov    %r11d,0x7c(%rsp)
  mov    %r9d,0x84(%rsp)
  add    %ebx,%r8d
  add    %ebx,%ebp
  mov    0x10c(%rsp),%ebx
  mov    %r10d,0x6c(%rsp)
  mov    %r8d,0x98(%rsp)
  add    %ebx,%r13d
  add    %ebx,%r12d
  mov    %ebp,0x88(%rsp)
  mov    0x128(%rsp),%ebx
  mov    %r13d,0x74(%rsp)
  add    %ebx,0x90(%rsp)
  add    %ebx,0x94(%rsp)
  mov    0x108(%rsp),%ebx
  mov    %r12d,0x8c(%rsp)
  add    %ebx,0x70(%rsp)
  add    %ebx,0x9c(%rsp)
  mov    0x11c(%rsp),%ebx
  add    %ebx,0xa0(%rsp)
  add    %ebx,0xa4(%rsp)
  mov    0x120(%rsp),%ebx
  add    %ebx,0xa8(%rsp)
  mov    0x104(%rsp),%eax
  add    %ebx,0xac(%rsp)
  mov    0x124(%rsp),%ebx
  sub    %eax,0x3c(%rsp)
  add    %ebx,0x68(%rsp)
  add    %ebx,0xb0(%rsp)
  mov    0x100(%rsp),%ebx
  addq   $0x1,0xc8(%rsp)
  add    %ebx,0x5c(%rsp)
  add    %ebx,0xbc(%rsp)
  mov    0xf8(%rsp),%ebx
  addq   $0x1,0xd0(%rsp)
  add    %ebx,0xc0(%rsp)
  add    %ebx,0xb4(%rsp)
  mov    0xfc(%rsp),%ebx
  addq   $0x1,0xd8(%rsp)
  add    %ebx,0xc4(%rsp)
  add    %ebx,0xe0(%rsp)
  mov    %eax,%ebx
  subq   $0x1,0x48(%rsp)
  add    $0x1,%r14d
  mov    0x78(%rsp),%edx
  sub    %eax,0x58(%rsp)
  add    %eax,0x40(%rsp)
  add    %eax,0x50(%rsp)
  mov    0x54(%rsp),%eax
  sub    %edx,0x24(%rsp)
  sub    %edx,%eax
  sub    %edx,0xe4(%rsp)
  sub    $0x1,%eax
  add    %edx,0x38(%rsp)
  mov    %eax,0x54(%rsp)
  mov    0x44(%rsp),%eax
  add    %edx,0x60(%rsp)
  sub    %ebx,0xb8(%rsp)
  add    %ebx,0xe8(%rsp)
  sub    %edx,0xec(%rsp)
  test   %eax,%eax
  je     L121
  sub    $0x1,%eax
  mov    %eax,0x44(%rsp)
  jmp    L162
L121:
  add    $0x138,%rsp
  mov    $0x2,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L159:
  cmp    %r14d,0xc(%rsp)
  jl     L42
  jmp    L44
```

assistant: ```c
int p3dReplicatePadding3D_uchar2uchar(unsigned char *in_rev, unsigned char *out_rev, const int dimx, const int dimy, const int dimz, const int size) {
  int a_dimx, a_dimy, a_dimz;
  int i, j, k, ct;
  a_dimx = dimx + size * 2;
  a_dimy = dimy + size * 2;
  a_dimz = dimz + size * 2;
  p3dZeroPadding3D_uchar2uchar(in_rev, out_rev, dimx, dimy, dimz, size);
  for (ct = size; ct > 0; ct--) {
    for (i = ct; i < (a_dimx - ct); i++)
      for (j = ct; j < (a_dimy - ct); j++) {
        out_rev[((j) * (a_dimx) + (i) + (ct - 1) * (a_dimx) * (a_dimy))] = out_rev[((j) * (a_dimx) + (i) + (ct) * (a_dimx) * (a_dimy))];
        out_rev[((j) * (a_dimx) + (i) + (a_dimz - ct) * (a_dimx) * (a_dimy))] = out_rev[((j) * (a_dimx) + (i) + (a_dimz - 1 - ct) * (a_dimx) * (a_dimy))];
      }
    for (j = ct; j < (a_dimy - ct); j++)
      for (k = ct; k < (a_dimz - ct); k++) {
        out_rev[((j) * (a_dimx) + (ct - 1) + (k) * (a_dimx) * (a_dimy))] = out_rev[((j) * (a_dimx) + (ct) + (k) * (a_dimx) * (a_dimy))];
        out_rev[((j) * (a_dimx) + (a_dimx - ct) + (k) * (a_dimx) * (a_dimy))] = out_rev[((j) * (a_dimx) + (a_dimx - 1 - ct) + (k) * (a_dimx) * (a_dimy))];
      }
    for (i = ct; i < (a_dimx - ct); i++)
      for (k = ct; k < (a_dimz - ct); k++) {
        out_rev[((ct - 1) * (a_dimx) + (i) + (k) * (a_dimx) * (a_dimy))] = out_rev[((ct) * (a_dimx) + (i) + (k) * (a_dimx) * (a_dimy))];
        out_rev[((a_dimy - ct) * (a_dimx) + (i) + (k) * (a_dimx) * (a_dimy))] = out_rev[((a_dimy - 1 - ct) * (a_dimx) + (i) + (k) * (a_dimx) * (a_dimy))];
      }
    for (i = ct; i < (a_dimx - ct); i++) {
      out_rev[((ct - 1) * (a_dimx) + (i) + (ct - 1) * (a_dimx) * (a_dimy))] = out_rev[((ct) * (a_dimx) + (i) + (ct) * (a_dimx) * (a_dimy))];
      out_rev[((ct - 1) * (a_dimx) + (i) + (a_dimz - ct) * (a_dimx) * (a_dimy))] = out_rev[((ct) * (a_dimx) + (i) + (a_dimz - 1 - ct) * (a_dimx) * (a_dimy))];
      out_rev[((a_dimy - ct) * (a_dimx) + (i) + (ct - 1) * (a_dimx) * (a_dimy))] = out_rev[((a_dimy - 1 - ct) * (a_dimx) + (i) + (ct) * (a_dimx) * (a_dimy))];
      out_rev[((a_dimy - ct) * (a_dimx) + (i) + (a_dimz - ct) * (a_dimx) * (a_dimy))] = out_rev[((a_dimy - 1 - ct) * (a_dimx) + (i) + (a_dimz - 1 - ct) * (a_dimx) * (a_dimy))];
    }
    for (j = ct; j < (a_dimy - ct); j++) {
      out_rev[((j) * (a_dimx) + (ct - 1) + (ct - 1) * (a_dimx) * (a_dimy))] = out_rev[((j) * (a_dimx) + (ct) + (ct) * (a_dimx) * (a_dimy))];
      out_rev[((j) * (a_dimx) + (ct - 1) + (a_dimz - ct) * (a_dimx) * (a_dimy))] = out_rev[((j) * (a_dimx) + (ct) + (a_dimz - 1 - ct) * (a_dimx) * (a_dimy))];
      out_rev[((j) * (a_dimx) + (a_dimx - ct) + (ct - 1) * (a_dimx) * (a_dimy))] = out_rev[((j) * (a_dimx) + (a_dimx - 1 - ct) + (ct) * (a_dimx) * (a_dimy))];
      out_rev[((j) * (a_dimx) + (a_dimx - ct) + (a_dimz - ct) * (a_dimx) * (a_dimy))] = out_rev[((j) * (a_dimx) + (a_dimx - 1 - ct) + (a_dimz - 1 - ct) * (a_dimx) * (a_dimy))];
    }
    for (k = ct; k < (a_dimz - ct); k++) {
      out_rev[((ct - 1) * (a_dimx) + (ct - 1) + (k) * (a_dimx) * (a_dimy))] = out_rev[((ct) * (a_dimx) + (ct) + (k) * (a_dimx) * (a_dimy))];
      out_rev[((ct - 1) * (a_dimx) + (a_dimx - ct) + (k) * (a_dimx) * (a_dimy))] = out_rev[((ct) * (a_dimx) + (a_dimx - 1 - ct) + (k) * (a_dimx) * (a_dimy))];
      out_rev[((a_dimy - ct) * (a_dimx) + (ct - 1) + (k) * (a_dimx) * (a_dimy))] = out_rev[((a_dimy - 1 - ct) * (a_dimx) + (ct) + (k) * (a_dimx) * (a_dimy))];
      out_rev[((a_dimy - ct) * (a_dimx) + (a_dimx - ct) + (k) * (a_dimx) * (a_dimy))] = out_rev[((a_dimy - 1 - ct) * (a_dimx) + (a_dimx - 1 - ct) + (k) * (a_dimx) * (a_dimy))];
    }
    out_rev[((ct - 1) * (a_dimx) + (ct - 1) + (ct - 1) * (a_dimx) * (a_dimy))] = out_rev[((ct) * (a_dimx) + (ct) + (ct) * (a_dimx) * (a_dimy))];
    out_rev[((ct - 1) * (a_dimx) + (a_dimx - ct) + (ct - 1) * (a_dimx) * (a_dimy))] = out_rev[((ct) * (a_dimx) + (a_dimx - 1 - ct) + (ct) * (a_dimx) * (a_dimy))];
    out_rev[((a_dimy - ct) * (a_dimx) + (ct - 1) + (ct - 1) * (a_dimx) * (a_dimy))] = out_rev[((a_dimy - 1 - ct) * (a_dimx) + (ct) + (ct) * (a_dimx) * (a_dimy))];
    out_rev[((ct - 1) * (a_dimx) + (ct - 1) + (a_dimz - ct) * (a_dimx) * (a_dimy))] = out_rev[((ct) * (a_dimx) + (ct) + (a_dimz - 1 - ct) * (a_dimx) * (a_dimy))];
    out_rev[((a_dimy - ct) * (a_dimx) + (a_dimx - ct) + (ct - 1) * (a_dimx) * (a_dimy))] = out_rev[((a_dimy - 1 - ct) * (a_dimx) + (a_dimx - 1 - ct) + (ct) * (a_dimx) * (a_dimy))];
    out_rev[((a_dimy - ct) * (a_dimx) + (ct - 1) + (a_dimz - ct) * (a_dimx) * (a_dimy))] = out_rev[((a_dimy - 1 - ct) * (a_dimx) + (ct) + (a_dimz - 1 - ct) * (a_dimx) * (a_dimy))];
    out_rev[((ct - 1) * (a_dimx) + (a_dimx - ct) + (a_dimz - ct) * (a_dimx) * (a_dimy))] = out_rev[((ct) * (a_dimx) + (a_dimx - 1 - ct) + (a_dimz - 1 - ct) * (a_dimx) * (a_dimy))];
    out_rev[((a_dimy - ct) * (a_dimx) + (a_dimx - ct) + (a_dimz - ct) * (a_dimx) * (a_dimy))] = out_rev[((a_dimy - 1 - ct) * (a_dimx) + (a_dimx - 1 - ct) + (a_dimz - 1 - ct) * (a_dimx) * (a_dimy))];
  }
  return 2;
}
```