user: What is the c source code of the assembly code below?

```asm
<flip_image_array>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    -0x38(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <allocate_image_array@plt>
  cltq
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdx
  shr    $0x3f,%rdx
  add    %rdx,%rax
  sar    %rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L117
L13:
  movl   $0x0,-0x14(%rbp)
  jmp    L100
L55:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  add    %rax,%rax
  add    %rdx,%rax
  mov    -0x30(%rbp),%rdx
  lea    -0x1(%rdx),%rcx
  mov    -0x18(%rbp),%edx
  movslq %edx,%rsi
  sub    %rsi,%rcx
  mov    %rcx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x10(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  add    %rdx,%rdx
  add    %rcx,%rdx
  movzwl (%rax),%eax
  mov    %ax,(%rdx)
  addl   $0x1,-0x14(%rbp)
L100:
  mov    -0x14(%rbp),%eax
  cltq
  cmp    %rax,-0x38(%rbp)
  jg     L55
  addl   $0x1,-0x18(%rbp)
L117:
  mov    -0x18(%rbp),%eax
  cltq
  cmp    %rax,-0x8(%rbp)
  jg     L13
  mov    -0x8(%rbp),%rax
  mov    %eax,-0x18(%rbp)
  jmp    L38
L101:
  movl   $0x0,-0x14(%rbp)
  jmp    L2
L97:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  add    %rax,%rax
  add    %rdx,%rax
  mov    -0x30(%rbp),%rdx
  lea    -0x1(%rdx),%rcx
  mov    -0x18(%rbp),%edx
  movslq %edx,%rsi
  sub    %rsi,%rcx
  mov    %rcx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x10(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  add    %rdx,%rdx
  add    %rcx,%rdx
  movzwl (%rax),%eax
  mov    %ax,(%rdx)
  addl   $0x1,-0x14(%rbp)
L2:
  mov    -0x14(%rbp),%eax
  cltq
  cmp    %rax,-0x38(%rbp)
  jg     L97
  addl   $0x1,-0x18(%rbp)
L38:
  mov    -0x18(%rbp),%eax
  cltq
  cmp    %rax,-0x30(%rbp)
  jg     L101
  movl   $0x0,-0x18(%rbp)
  jmp    L6
L22:
  movl   $0x0,-0x14(%rbp)
  jmp    L51
L118:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  add    %rax,%rax
  add    %rdx,%rax
  mov    -0x18(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  add    %rdx,%rdx
  add    %rcx,%rdx
  movzwl (%rax),%eax
  mov    %ax,(%rdx)
  addl   $0x1,-0x14(%rbp)
L51:
  mov    -0x14(%rbp),%eax
  cltq
  cmp    %rax,-0x38(%rbp)
  jg     L118
  addl   $0x1,-0x18(%rbp)
L6:
  mov    -0x18(%rbp),%eax
  cltq
  cmp    %rax,-0x30(%rbp)
  jg     L22
  mov    -0x30(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <free_image_array@plt>
  nop
  leave
  ret
```

assistant: ```c
flip_image_array(the_image, rows, cols) long cols, rows;
short **the_image;
{
  int i, j;
  long rd2;
  short **temp;
  temp = allocate_image_array(rows, cols);
  rd2 = rows / 2;
  for (i = 0; i < rd2; i++) {
    for (j = 0; j < cols; j++) {
      temp[rows - 1 - i][j] = the_image[i][j];
    }
  }
  for (i = rd2; i < rows; i++) {
    for (j = 0; j < cols; j++) {
      temp[rows - 1 - i][j] = the_image[i][j];
    }
  }
  for (i = 0; i < rows; i++)
    for (j = 0; j < cols; j++)
      the_image[i][j] = temp[i][j];
  free_image_array(temp, rows);
}
```