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

```asm
<average_overlay>:
  endbr64
  test   %rdx,%rdx
  jle    L19
  push   %r15
  mov    %rsi,%r9
  mov    %rdx,%r8
  push   %r14
  mov    %rcx,%r14
  push   %r13
  and    $0xfffffffffffffff8,%r14
  push   %r12
  lea    0x1(%r14),%eax
  mov    %rcx,%r12
  movslq %r14d,%r15
  push   %rbp
  cltq
  mov    %rcx,%rbp
  shr    $0x3,%r12
  push   %rbx
  lea    (%rax,%rax,1),%rcx
  shl    $0x4,%r12
  add    %r15,%r15
  lea    0x0(%rbp,%rbp,1),%r13
  xor    %ebx,%ebx
  sub    $0x88,%rsp
  mov    %rax,0x10(%rsp)
  lea    0x2(%r14),%eax
  cltq
  mov    %r14,0x8(%rsp)
  mov    %rax,0x18(%rsp)
  lea    (%rax,%rax,1),%r10
  lea    0x3(%r14),%eax
  cltq
  mov    %rax,0x40(%rsp)
  add    %rax,%rax
  mov    %rax,0x48(%rsp)
  lea    0x4(%r14),%eax
  cltq
  mov    %rax,0x50(%rsp)
  add    %rax,%rax
  mov    %rax,0x58(%rsp)
  lea    0x5(%r14),%eax
  cltq
  mov    %rax,0x60(%rsp)
  add    %rax,%rax
  mov    %rax,0x68(%rsp)
  lea    0x6(%r14),%eax
  mov    %rcx,%r14
  mov    %rdi,%rcx
  cltq
  mov    %rax,0x70(%rsp)
  add    %rax,%rax
  mov    %rax,0x78(%rsp)
  nopl   0x0(%rax,%rax,1)
L33:
  imul   $0xcccccccd,%ebx,%eax
  mov    %ebx,%esi
  ror    %eax
  cmp    $0x19999999,%eax
  jbe    L53
L96:
  test   %rbp,%rbp
  jle    L59
  mov    (%rcx,%rbx,8),%rdx
  mov    (%r9,%rbx,8),%rax
  lea    0x2(%rdx),%rdi
  mov    %rax,%rsi
  sub    %rdi,%rsi
  cmp    $0xc,%rsi
  jbe    L144
  lea    -0x1(%rbp),%rsi
  cmp    $0x6,%rsi
  jbe    L144
  xor    %esi,%esi
  pxor   %xmm5,%xmm5
  pxor   %xmm4,%xmm4
  nopw   0x0(%rax,%rax,1)
L110:
  movdqu (%rdx,%rsi,1),%xmm2
  movdqu (%rax,%rsi,1),%xmm1
  movdqa %xmm5,%xmm6
  movdqa %xmm5,%xmm3
  pcmpgtw %xmm2,%xmm6
  pcmpgtw %xmm1,%xmm3
  movdqa %xmm2,%xmm7
  movdqa %xmm1,%xmm0
  punpckhwd %xmm6,%xmm2
  punpcklwd %xmm6,%xmm7
  punpcklwd %xmm3,%xmm0
  punpckhwd %xmm3,%xmm1
  paddd  %xmm7,%xmm0
  paddd  %xmm2,%xmm1
  movdqa %xmm4,%xmm2
  pcmpgtd %xmm0,%xmm2
  psubd  %xmm2,%xmm0
  movdqa %xmm4,%xmm2
  pcmpgtd %xmm1,%xmm2
  psrad  $0x1,%xmm0
  psubd  %xmm2,%xmm1
  movdqa %xmm0,%xmm2
  psrad  $0x1,%xmm1
  punpcklwd %xmm1,%xmm0
  punpckhwd %xmm1,%xmm2
  movdqa %xmm0,%xmm1
  punpcklwd %xmm2,%xmm0
  punpckhwd %xmm2,%xmm1
  punpcklwd %xmm1,%xmm0
  movups %xmm0,(%rax,%rsi,1)
  add    $0x10,%rsi
  cmp    %r12,%rsi
  jne    L110
  cmp    0x8(%rsp),%rbp
  je     L59
  lea    (%rax,%r15,1),%r11
  movswl (%rdx,%r15,1),%esi
  movswl (%r11),%edi
  add    %esi,%edi
  mov    %edi,%esi
  shr    $0x1f,%esi
  add    %edi,%esi
  sar    %esi
  mov    %si,(%r11)
  cmp    0x10(%rsp),%rbp
  jle    L59
  lea    (%rax,%r14,1),%r11
  movswl (%rdx,%r14,1),%esi
  movswl (%r11),%edi
  add    %esi,%edi
  mov    %edi,%esi
  shr    $0x1f,%esi
  add    %edi,%esi
  sar    %esi
  mov    %si,(%r11)
  cmp    0x18(%rsp),%rbp
  jle    L59
  lea    (%rax,%r10,1),%r11
  movswl (%rdx,%r10,1),%esi
  movswl (%r11),%edi
  add    %esi,%edi
  mov    %edi,%esi
  shr    $0x1f,%esi
  add    %edi,%esi
  sar    %esi
  mov    %si,(%r11)
  cmp    0x40(%rsp),%rbp
  jle    L59
  mov    0x48(%rsp),%rdi
  lea    (%rax,%rdi,1),%r11
  movswl (%rdx,%rdi,1),%esi
  movswl (%r11),%edi
  add    %esi,%edi
  mov    %edi,%esi
  shr    $0x1f,%esi
  add    %edi,%esi
  sar    %esi
  mov    %si,(%r11)
  cmp    0x50(%rsp),%rbp
  jle    L59
  mov    0x58(%rsp),%rdi
  lea    (%rax,%rdi,1),%r11
  movswl (%rdx,%rdi,1),%esi
  movswl (%r11),%edi
  add    %esi,%edi
  mov    %edi,%esi
  shr    $0x1f,%esi
  add    %edi,%esi
  sar    %esi
  mov    %si,(%r11)
  cmp    0x60(%rsp),%rbp
  jle    L59
  mov    0x68(%rsp),%rdi
  lea    (%rax,%rdi,1),%r11
  movswl (%rdx,%rdi,1),%esi
  movswl (%r11),%edi
  add    %esi,%edi
  mov    %edi,%esi
  shr    $0x1f,%esi
  add    %edi,%esi
  sar    %esi
  mov    %si,(%r11)
  cmp    0x70(%rsp),%rbp
  jle    L59
  mov    0x78(%rsp),%rdi
  add    %rdi,%rax
  movswl (%rdx,%rdi,1),%esi
  movswl (%rax),%edx
  add    %edx,%esi
  mov    %esi,%edx
  shr    $0x1f,%edx
  add    %esi,%edx
  sar    %edx
  mov    %dx,(%rax)
L59:
  add    $0x1,%rbx
  cmp    %rbx,%r8
  jne    L33
  add    $0x88,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L53:
  lea    D7(%rip),%rdi
  xor    %eax,%eax
  mov    %r8,0x38(%rsp)
  mov    %r9,0x30(%rsp)
  mov    %rcx,0x28(%rsp)
  mov    %r10,0x20(%rsp)
  call   <printf@plt>
  mov    0x38(%rsp),%r8
  mov    0x30(%rsp),%r9
  mov    0x28(%rsp),%rcx
  mov    0x20(%rsp),%r10
  jmp    L96
  nopl   0x0(%rax,%rax,1)
L144:
  xor    %esi,%esi
  nopw   0x0(%rax,%rax,1)
L136:
  movswl (%rdx,%rsi,1),%edi
  movswl (%rax,%rsi,1),%r11d
  add    %edi,%r11d
  mov    %r11d,%edi
  shr    $0x1f,%edi
  add    %r11d,%edi
  sar    %edi
  mov    %di,(%rax,%rsi,1)
  add    $0x2,%rsi
  cmp    %r13,%rsi
  jne    L136
  jmp    L59
L19:
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D7
type: string

tool: D7:  %d

assistant: ```c
average_overlay(the_image, out_image, rows, cols) short **the_image, **out_image;
long cols, rows;
{
  int i, j;
  for (i = 0; i < rows; i++) {
    if ((i % 10) == 0)
      printf(" %d", i);
    for (j = 0; j < cols; j++) {
      out_image[i][j] = (the_image[i][j] + out_image[i][j]) / 2;
    }
  }
}
```