user: 请将以下的汇编代码转换成C语言代码：

```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    L45
L38:
  movl   $0x0,-0x14(%rbp)
  jmp    L25
L59:
  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)
L25:
  mov    -0x14(%rbp),%eax
  cltq
  cmp    %rax,-0x38(%rbp)
  jg     L59
  addl   $0x1,-0x18(%rbp)
L45:
  mov    -0x18(%rbp),%eax
  cltq
  cmp    %rax,-0x8(%rbp)
  jg     L38
  mov    -0x8(%rbp),%rax
  mov    %eax,-0x18(%rbp)
  jmp    L71
L22:
  movl   $0x0,-0x14(%rbp)
  jmp    L108
L3:
  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)
L108:
  mov    -0x14(%rbp),%eax
  cltq
  cmp    %rax,-0x38(%rbp)
  jg     L3
  addl   $0x1,-0x18(%rbp)
L71:
  mov    -0x18(%rbp),%eax
  cltq
  cmp    %rax,-0x30(%rbp)
  jg     L22
  movl   $0x0,-0x18(%rbp)
  jmp    L114
L28:
  movl   $0x0,-0x14(%rbp)
  jmp    L103
L69:
  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)
L103:
  mov    -0x14(%rbp),%eax
  cltq
  cmp    %rax,-0x38(%rbp)
  jg     L69
  addl   $0x1,-0x18(%rbp)
L114:
  mov    -0x18(%rbp),%eax
  cltq
  cmp    %rax,-0x30(%rbp)
  jg     L28
  mov    -0x30(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <free_image_array@plt>
  mov    $0x1,%eax
  leave
  ret
```

assistant: ```c
int 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);
  return (1);
}
```