user: What would the C source look like for the assembly code provided here?

```asm
<flip_image_array>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  xor    %eax,%eax
  push   %r14
  mov    %rdi,%r14
  mov    %r15,%rdi
  push   %r13
  push   %r12
  push   %rbp
  mov    %r15,%rbp
  push   %rbx
  shr    $0x3f,%rbp
  mov    %rdx,%rbx
  add    %r15,%rbp
  sar    %rbp
  sub    $0x38,%rsp
  mov    %rsi,0x20(%rsp)
  mov    %rdx,%rsi
  call   <allocate_image_array@plt>
  movslq %eax,%rsi
  mov    %rsi,0x28(%rsp)
  cmp    $0x1,%r15
  jle    L229
  test   %rbx,%rbx
  jle    L174
  mov    %rbx,%r13
  lea    -0x8(%rsi,%r15,8),%r11
  mov    %rbx,%rdi
  mov    %rbx,%r15
  and    $0xfffffffffffffff8,%r13
  shr    $0x3,%rdi
  lea    -0x1(%rbx),%rsi
  lea    (%rbx,%rbx,1),%r12
  sub    %r13,%r15
  shl    $0x4,%rdi
  mov    %r13d,0x10(%rsp)
  xor    %r8d,%r8d
  lea    -0x1(%r15),%rax
  mov    %rdi,0x8(%rsp)
  mov    %rax,0x18(%rsp)
L340:
  mov    (%r14,%r8,8),%rax
  mov    (%r11),%rdx
  lea    0x2(%rax),%r9
  mov    %rdx,%rcx
  sub    %r9,%rcx
  cmp    $0xc,%rcx
  jbe    L403
  cmp    $0x2,%rsi
  jbe    L403
  cmp    $0x6,%rsi
  jbe    L43
  mov    0x8(%rsp),%rdi
  xor    %ecx,%ecx
  cs nopw 0x0(%rax,%rax,1)
L333:
  movdqu (%rax,%rcx,1),%xmm1
  movups %xmm1,(%rdx,%rcx,1)
  add    $0x10,%rcx
  cmp    %rdi,%rcx
  jne    L333
  mov    %rdi,0x8(%rsp)
  cmp    %r13,%rbx
  je     L211
  cmpq   $0x2,0x18(%rsp)
  mov    %r15,%r10
  jbe    L58
  mov    0x10(%rsp),%ecx
  mov    %r13,%r9
L278:
  movq   (%rax,%r9,2),%xmm0
  movq   %xmm0,(%rdx,%r9,2)
  mov    %r10,%r9
  and    $0xfffffffffffffffc,%r9
  add    %r9d,%ecx
  cmp    %r9,%r10
  je     L211
L97:
  movslq %ecx,%r10
  movzwl (%rax,%r10,2),%edi
  lea    (%r10,%r10,1),%r9
  mov    %di,(%rdx,%r10,2)
  lea    0x1(%rcx),%r10d
  movslq %r10d,%r10
  cmp    %r10,%rbx
  jle    L211
  movzwl 0x2(%rax,%r9,1),%r10d
  add    $0x2,%ecx
  movslq %ecx,%rcx
  mov    %r10w,0x2(%rdx,%r9,1)
  cmp    %rcx,%rbx
  jle    L211
  movzwl 0x4(%rax,%r9,1),%eax
  mov    %ax,0x4(%rdx,%r9,1)
L211:
  add    $0x1,%r8
  sub    $0x8,%r11
  cmp    %r8,%rbp
  jg     L340
  movslq %ebp,%rax
  movslq %ebp,%rbp
  cmp    %rbp,0x20(%rsp)
  jle    L147
L0:
  lea    (%r14,%rax,8),%rdi
  mov    0x20(%rsp),%rax
  mov    %rbx,%rbp
  mov    %rbx,%r8
  and    $0xfffffffffffffff8,%rbp
  mov    %rbx,%r15
  shr    $0x3,%r8
  mov    %r14,0x18(%rsp)
  lea    (%r14,%rax,8),%r12
  mov    0x28(%rsp),%rax
  sub    %rbp,%r15
  shl    $0x4,%r8
  mov    %r8,0x8(%rsp)
  lea    (%rbx,%rbx,1),%r11
  mov    %ebp,%r14d
  lea    -0x8(%r12,%rax,1),%r13
  lea    -0x1(%r15),%rax
  mov    %rax,0x10(%rsp)
  nopl   0x0(%rax,%rax,1)
L477:
  mov    %r13,%rdx
  mov    (%rdi),%rax
  sub    %rdi,%rdx
  mov    (%rdx),%rdx
  lea    0x2(%rax),%r9
  mov    %rdx,%rcx
  sub    %r9,%rcx
  cmp    $0xc,%rcx
  jbe    L228
  cmp    $0x2,%rsi
  jbe    L228
  cmp    $0x6,%rsi
  jbe    L112
  mov    0x8(%rsp),%r8
  xor    %ecx,%ecx
  nopl   0x0(%rax,%rax,1)
L361:
  movdqu (%rax,%rcx,1),%xmm2
  movups %xmm2,(%rdx,%rcx,1)
  add    $0x10,%rcx
  cmp    %r8,%rcx
  jne    L361
  mov    %r8,0x8(%rsp)
  cmp    %rbp,%rbx
  je     L487
  cmpq   $0x2,0x10(%rsp)
  mov    %r15,%r10
  jbe    L468
  mov    %rbp,%r9
  mov    %r14d,%ecx
L407:
  movq   (%rax,%r9,2),%xmm0
  movq   %xmm0,(%rdx,%r9,2)
  mov    %r10,%r9
  and    $0xfffffffffffffffc,%r9
  add    %r9d,%ecx
  cmp    %r9,%r10
  je     L487
L105:
  movslq %ecx,%r10
  movzwl (%rax,%r10,2),%r8d
  lea    (%r10,%r10,1),%r9
  mov    %r8w,(%rdx,%r10,2)
  lea    0x1(%rcx),%r10d
  movslq %r10d,%r10
  cmp    %rbx,%r10
  jge    L487
  movzwl 0x2(%rax,%r9,1),%r10d
  add    $0x2,%ecx
  movslq %ecx,%rcx
  mov    %r10w,0x2(%rdx,%r9,1)
  cmp    %rcx,%rbx
  jle    L487
  movzwl 0x4(%rax,%r9,1),%eax
  mov    %ax,0x4(%rdx,%r9,1)
L487:
  add    $0x8,%rdi
  cmp    %r12,%rdi
  jne    L477
  cmpq   $0x0,0x20(%rsp)
  mov    0x18(%rsp),%r14
  jle    L96
L129:
  mov    0x28(%rsp),%rax
  mov    %rbx,%r12
  mov    0x20(%rsp),%rdi
  mov    %rbx,%r8
  and    $0xfffffffffffffff8,%r12
  shr    $0x3,%r8
  lea    (%rbx,%rbx,1),%rbp
  sub    %rax,%r14
  lea    (%rax,%rdi,8),%r13
  shl    $0x4,%r8
  mov    %rax,%rdi
  mov    %r14,%r11
  mov    %rbx,%r14
  mov    %r8,0x8(%rsp)
  mov    %r12d,%r15d
  sub    %r12,%r14
  lea    -0x1(%r14),%rax
  mov    %rax,0x10(%rsp)
  xchg   %ax,%ax
L35:
  mov    (%rdi),%rax
  mov    (%r11,%rdi,1),%rdx
  lea    0x2(%rax),%r9
  mov    %rdx,%rcx
  sub    %r9,%rcx
  cmp    $0xc,%rcx
  jbe    L86
  cmp    $0x2,%rsi
  jbe    L86
  cmp    $0x6,%rsi
  jbe    L214
  mov    0x8(%rsp),%r8
  xor    %ecx,%ecx
  cs nopw 0x0(%rax,%rax,1)
L170:
  movdqu (%rax,%rcx,1),%xmm3
  movups %xmm3,(%rdx,%rcx,1)
  add    $0x10,%rcx
  cmp    %r8,%rcx
  jne    L170
  mov    %r8,0x8(%rsp)
  cmp    %rbx,%r12
  je     L514
  cmpq   $0x2,0x10(%rsp)
  mov    %r14,%r10
  mov    %r15d,%ecx
  jbe    L389
  mov    %r12,%r9
L499:
  movq   (%rax,%r9,2),%xmm0
  movq   %xmm0,(%rdx,%r9,2)
  mov    %r10,%r9
  and    $0xfffffffffffffffc,%r9
  add    %r9d,%ecx
  cmp    %r10,%r9
  je     L514
L389:
  movslq %ecx,%r10
  movzwl (%rax,%r10,2),%r8d
  lea    (%r10,%r10,1),%r9
  mov    %r8w,(%rdx,%r10,2)
  lea    0x1(%rcx),%r10d
  movslq %r10d,%r10
  cmp    %rbx,%r10
  jge    L514
  movzwl 0x2(%rax,%r9,1),%r10d
  add    $0x2,%ecx
  movslq %ecx,%rcx
  mov    %r10w,0x2(%rdx,%r9,1)
  cmp    %rcx,%rbx
  jle    L514
  movzwl 0x4(%rax,%r9,1),%eax
  mov    %ax,0x4(%rdx,%r9,1)
L514:
  add    $0x8,%rdi
  cmp    %r13,%rdi
  jne    L35
L96:
  mov    0x20(%rsp),%rsi
  mov    0x28(%rsp),%rdi
  xor    %eax,%eax
  call   <free_image_array@plt>
  add    $0x38,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L86:
  mov    0x8(%rsp),%r8
  xor    %ecx,%ecx
  nopw   0x0(%rax,%rax,1)
L249:
  movzwl (%rax,%rcx,1),%r9d
  mov    %r9w,(%rdx,%rcx,1)
  add    $0x2,%rcx
  cmp    %rcx,%rbp
  jne    L249
  mov    %r8,0x8(%rsp)
  jmp    L514
  nopw   0x0(%rax,%rax,1)
L228:
  mov    0x8(%rsp),%r8
  xor    %ecx,%ecx
  nopw   0x0(%rax,%rax,1)
L264:
  movzwl (%rax,%rcx,1),%r9d
  mov    %r9w,(%rdx,%rcx,1)
  add    $0x2,%rcx
  cmp    %r11,%rcx
  jne    L264
  mov    %r8,0x8(%rsp)
  jmp    L487
  nopl   (%rax)
L403:
  mov    0x8(%rsp),%rdi
  xor    %ecx,%ecx
  nopw   0x0(%rax,%rax,1)
L491:
  movzwl (%rax,%rcx,1),%r9d
  mov    %r9w,(%rdx,%rcx,1)
  add    $0x2,%rcx
  cmp    %rcx,%r12
  jne    L491
  mov    %rdi,0x8(%rsp)
  jmp    L211
L43:
  mov    %rbx,%r10
  xor    %r9d,%r9d
  xor    %ecx,%ecx
  jmp    L278
L112:
  mov    %rbx,%r10
  xor    %r9d,%r9d
  xor    %ecx,%ecx
  jmp    L407
L214:
  mov    %rbx,%r10
  xor    %ecx,%ecx
  xor    %r9d,%r9d
  jmp    L499
L468:
  mov    %r14d,%ecx
  jmp    L105
L58:
  mov    0x10(%rsp),%ecx
  jmp    L97
L229:
  movslq %ebp,%rax
  movslq %ebp,%rbp
  cmp    %rbp,0x20(%rsp)
  jle    L414
  test   %rbx,%rbx
  jle    L96
  lea    -0x1(%rbx),%rsi
  jmp    L0
L174:
  movslq %ebp,%rbp
  cmp    %rbp,0x20(%rsp)
  jg     L96
L414:
  cmpq   $0x0,0x20(%rsp)
  jle    L96
L147:
  test   %rbx,%rbx
  jle    L96
  lea    -0x1(%rbx),%rsi
  jmp    L129
```

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);
}
```