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

```asm
<Arrayswap>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %ecx,%eax
  mov    %r8,-0x40(%rbp)
  mov    %r9,-0x48(%rbp)
  mov    %dx,-0x34(%rbp)
  mov    %ax,-0x38(%rbp)
  mov    -0x40(%rbp),%rax
  sub    -0x28(%rbp),%rax
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  movswq -0x38(%rbp),%rax
  lea    (%rax,%rax,1),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x1,-0x20(%rbp)
  jmp    L1
L9:
  movl   $0x1,-0x1c(%rbp)
  jmp    L12
L29:
  mov    -0x18(%rbp),%rax
  cmp    -0x40(%rbp),%rax
  setb   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  cmp    -0x48(%rbp),%rax
  setb   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rdx
  lea    0x2(%rdx),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  lea    0x2(%rax),%rcx
  mov    %rcx,-0x18(%rbp)
  movzwl (%rdx),%edx
  mov    %dx,(%rax)
  mov    -0x10(%rbp),%rax
  cmp    -0x40(%rbp),%rax
  setb   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  cmp    -0x48(%rbp),%rax
  setb   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rdx
  lea    0x2(%rdx),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x2(%rax),%rcx
  mov    %rcx,-0x10(%rbp)
  movzwl (%rdx),%edx
  mov    %dx,(%rax)
  mov    -0x10(%rbp),%rax
  cmp    -0x40(%rbp),%rax
  setb   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  cmp    -0x48(%rbp),%rax
  setb   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rdx
  lea    0x2(%rdx),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x2(%rax),%rcx
  mov    %rcx,-0x10(%rbp)
  movzwl (%rdx),%edx
  mov    %dx,(%rax)
  mov    -0x18(%rbp),%rax
  cmp    -0x40(%rbp),%rax
  setb   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  cmp    -0x48(%rbp),%rax
  setb   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rdx
  lea    0x2(%rdx),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  lea    0x2(%rax),%rcx
  mov    %rcx,-0x18(%rbp)
  movzwl (%rdx),%edx
  mov    %dx,(%rax)
  addl   $0x1,-0x1c(%rbp)
L12:
  movzwl -0x38(%rbp),%eax
  mov    %eax,%edx
  shr    $0xf,%dx
  add    %edx,%eax
  sar    %ax
  cwtl
  cmp    %eax,-0x1c(%rbp)
  jle    L29
  movswq -0x38(%rbp),%rax
  add    %rax,%rax
  add    %rax,-0x18(%rbp)
  movswq -0x38(%rbp),%rax
  add    %rax,%rax
  add    %rax,-0x10(%rbp)
  addl   $0x1,-0x20(%rbp)
L1:
  movzwl -0x34(%rbp),%eax
  mov    %eax,%edx
  shr    $0xf,%dx
  add    %edx,%eax
  sar    %ax
  cwtl
  cmp    %eax,-0x20(%rbp)
  jle    L9
  mov    -0x18(%rbp),%rax
  cmp    -0x40(%rbp),%rax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  movswq -0x38(%rbp),%rax
  lea    (%rax,%rax,1),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  cmp    %rax,-0x10(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x8(%rbp),%rax
  cmp    -0x48(%rbp),%rax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  nop
  leave
  ret
```

assistant: ```c
void Arrayswap(short *Imptr1, short *Imptr2, short height, short width, short *end1, short *end2) {
  int y, z;
  short *Impt1, *Impt2, *Impt5;
  memset(Imptr1, 0, (end1 - Imptr1) * sizeof(short));
  Impt1 = Imptr1;
  Impt2 = Imptr1 + width;
  Impt5 = Imptr2;
  for (y = 1; y <= height / 2; y++) {
    for (z = 1; z <= width / 2; z++) {
      assert(Impt1 < end1);
      assert(Impt5 < end2);
      *Impt1++ = *Impt5++;
      assert(Impt2 < end1);
      assert(Impt5 < end2);
      *Impt2++ = *Impt5++;
      assert(Impt2 < end1);
      assert(Impt5 < end2);
      *Impt2++ = *Impt5++;
      assert(Impt1 < end1);
      assert(Impt5 < end2);
      *Impt1++ = *Impt5++;
    };
    Impt1 += width;
    Impt2 += width;
  }
  assert(Impt1 == end1);
  assert(Impt2 == end1 + width);
  assert(Impt5 == end2);
}
```