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

```asm
<reflect2>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %esi,%ebp
  mov    %edx,%eax
  test   %ecx,%ecx
  jle    L25
  lea    -0x1(%rsi),%r11d
  test   %r8d,%r8d
  jle    L61
  lea    -0x1(%rdx),%edx
  imul   %esi,%edx
  mov    %edx,-0xc(%rsp)
  lea    (%rsi,%rdx,1),%r15d
L54:
  sub    %ebp,%ecx
  lea    -0x1(%rcx),%ebx
  mov    %ebx,-0x10(%rsp)
L50:
  mov    %r8d,%edx
  sub    %eax,%edx
  lea    -0x1(%rdx),%eax
  lea    0x1(%r8),%ebx
  test   %r8d,%r8d
  cmovg  %eax,%ebx
  imul   %ebp,%ebx
  test   %r15d,%r15d
  jle    L58
  mov    %r9,%rax
  lea    -0x1(%r15),%edx
  lea    0x8(%r9,%rdx,8),%rdx
L111:
  movq   $0x0,(%rax)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L111
  movslq %ebp,%rax
  shl    $0x3,%rax
  mov    %rax,-0x20(%rsp)
  lea    -0x1(%rbp),%eax
  lea    0x8(%rdi,%rax,8),%r8
  mov    $0x0,%r14d
  not    %rax
  shl    $0x3,%rax
  mov    %rax,-0x8(%rsp)
  mov    $0x1,%r13d
  mov    %r11d,%r12d
  not    %r12d
  mov    %r15d,-0x14(%rsp)
  jmp    L28
L60:
  test   %edx,%edx
  cmove  %r13d,%edx
  mov    %edx,%eax
  neg    %eax
  cmovs  %edx,%eax
  mov    %r11d,%esi
  sub    %eax,%esi
  lea    0x1(%rsi),%edi
  add    %r12d,%eax
  cmp    $0xffffffff,%esi
  cmovge %edi,%eax
  add    %r10d,%eax
  cltq
  lea    (%r9,%rax,8),%rax
  movsd  (%rax),%xmm0
  addsd  (%rcx),%xmm0
  movsd  %xmm0,(%rax)
  add    $0x1,%edx
  add    $0x8,%rcx
  cmp    %r8,%rcx
  jne    L60
L6:
  add    %ebp,%ebx
  add    -0x20(%rsp),%r8
  cmp    %r15d,-0x14(%rsp)
  jle    L58
L28:
  mov    %r14d,%eax
  test   %ebx,%ebx
  cmove  %ebp,%ebx
  add    %ebp,%r14d
  mov    %r14d,%r15d
  cmp    %r14d,%eax
  jge    L6
  mov    -0x8(%rsp),%rax
  lea    (%rax,%r8,1),%rcx
  mov    -0x10(%rsp),%edx
  mov    %ebx,%esi
  neg    %esi
  cmovs  %ebx,%esi
  mov    -0xc(%rsp),%eax
  sub    %esi,%eax
  add    %ebp,%eax
  mov    %eax,%r10d
  neg    %r10d
  cmovs  %eax,%r10d
  jmp    L60
L61:
  mov    %esi,%r15d
  imul   %edx,%r15d
  movl   $0x0,-0xc(%rsp)
  jmp    L54
L86:
  mov    %ebp,%r15d
  imul   %eax,%r15d
  movl   $0x0,-0xc(%rsp)
  jmp    L79
L25:
  test   %r8d,%r8d
  jle    L86
  lea    -0x1(%rdx),%edx
  imul   %esi,%edx
  mov    %edx,-0xc(%rsp)
  lea    (%rdx,%rsi,1),%r15d
L79:
  lea    0x1(%rcx),%ebx
  mov    %ebx,-0x10(%rsp)
  mov    $0x0,%r11d
  jmp    L50
L58:
  mov    $0x0,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
int reflect2(filt, x_dim, y_dim, x_pos, y_pos, result, f_or_e)
register double *filt, *result;
register int x_dim;
int y_dim, x_pos, y_pos, f_or_e;
{
  register int y_filt, x_filt, y_edge, x_edge;
  register int x_base = (x_pos > 0) ? (x_dim - 1) : 0;
  register int y_base = (y_pos > 0) ? (x_dim * (y_dim - 1)) : 0;
  int filt_sz = x_dim * y_dim;
  int x_edge_dist = (x_pos > 0) ? (x_pos - x_dim - 1) : (x_pos + 1);
  int y_edge_dist = x_dim * ((y_pos > 0) ? (y_pos - y_dim - 1) : (y_pos + 1));
  int i;
  for (i = 0; i < filt_sz; i++)
    result[i] = 0.0;
  for (y_filt = 0, y_edge = y_edge_dist; y_filt < filt_sz; y_filt += x_dim, y_edge += x_dim) {
    if (y_edge == 0)
      y_edge += x_dim;
    for (x_filt = y_filt, x_edge = x_edge_dist; x_filt < y_filt + x_dim; x_filt++, x_edge++) {
      if (x_edge == 0)
        x_edge++;
      result[(((y_base - (((y_edge) >= 0) ? (y_edge) : (-(y_edge))) + x_dim) >= 0) ? (y_base - (((y_edge) >= 0) ? (y_edge) : (-(y_edge))) + x_dim) : (-(y_base - (((y_edge) >= 0) ? (y_edge) : (-(y_edge))) + x_dim))) + (((x_base - (((x_edge) >= 0) ? (x_edge) : (-(x_edge))) + 1) >= 0) ? (x_base - (((x_edge) >= 0) ? (x_edge) : (-(x_edge))) + 1) : (-(x_base - (((x_edge) >= 0) ? (x_edge) : (-(x_edge))) + 1)))] += filt[x_filt];
    }
  }
  return (0);
}
```