user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<reflect2>:
  endbr64
  push   %r15
  mov    %edx,%eax
  push   %r14
  mov    %r8d,%r14d
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  imul   %edx,%r12d
  push   %rbx
  mov    %esi,%ebx
  sub    $0x38,%rsp
  mov    %ecx,0x8(%rsp)
  test   %ecx,%ecx
  jle    L300
  mov    %ecx,%edi
  mov    %r12d,%ecx
  lea    -0x1(%rsi),%ebp
  xor    %edx,%edx
  sub    %esi,%ecx
  test   %r8d,%r8d
  lea    -0x1(%rdi),%r15d
  cmovg  %ecx,%edx
  mov    %edx,0x10(%rsp)
L10:
  test   %r14d,%r14d
  mov    $0xffffffff,%r10d
  lea    -0x1(%r14),%edx
  mov    0x8(%rsp),%esi
  cmovs  %r14d,%r10d
  add    $0x1,%r10d
  test   %r14d,%r14d
  cmovg  %edx,%r10d
  imul   %ebx,%r10d
  test   %esi,%esi
  js     L321
  lea    -0x1(%rbx),%ecx
  mov    %ecx,%edx
  shr    $0x1f,%edx
  add    %ecx,%edx
  sar    %edx
  mov    %edx,0x18(%rsp)
L97:
  test   %r14d,%r14d
  js     L175
  lea    -0x1(%rax),%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  mov    %eax,0x20(%rsp)
L100:
  test   %r12d,%r12d
  jle    L247
  movslq %r12d,%rdx
  mov    %r9,%rdi
  xor    %esi,%esi
  mov    %r10d,0x4(%rsp)
  shl    $0x3,%rdx
  call   <memset@plt>
  mov    0x4(%rsp),%r10d
  mov    %rax,%r9
L247:
  mov    0x70(%rsp),%ecx
  test   %ecx,%ecx
  jne    L315
  sub    0x10(%rsp),%r10d
  mov    %r10d,%eax
  sub    %ebx,%eax
  test   %r14d,%r14d
  cmovg  %eax,%r10d
  test   %r12d,%r12d
  jle    L88
  mov    0x8(%rsp),%edx
  mov    %r15d,%esi
  xor    %eax,%eax
  movslq %ebx,%r15
  sub    %ebp,%esi
  test   %edx,%edx
  mov    $0xfffffffffffffff8,%rdx
  setg   %al
  shl    $0x3,%r15
  xor    %r14d,%r14d
  sub    %eax,%esi
  lea    -0x1(%rbx),%eax
  shl    $0x3,%rax
  mov    %esi,0x4(%rsp)
  sub    %rax,%rdx
  lea    0x8(%r13,%rax,1),%r8
  mov    %ebp,%r13d
  mov    %rdx,0x8(%rsp)
  not    %r13d
  nopl   0x0(%rax,%rax,1)
L1:
  test   %r10d,%r10d
  mov    %r14d,%eax
  cmove  %ebx,%r10d
  add    %ebx,%r14d
  cmp    %r14d,%eax
  jge    L37
  mov    %r10d,%edx
  mov    0x10(%rsp),%eax
  neg    %edx
  cmovs  %r10d,%edx
  sub    %edx,%eax
  mov    0x4(%rsp),%edx
  add    %ebx,%eax
  mov    %eax,%r11d
  neg    %r11d
  cmovs  %eax,%r11d
  mov    0x8(%rsp),%rax
  lea    (%rax,%r8,1),%rcx
  jmp    L99
  nopl   0x0(%rax)
L11:
  mov    %edx,%eax
  neg    %eax
  cmovs  %edx,%eax
  add    $0x1,%edx
L51:
  mov    %ebp,%esi
  sub    %eax,%esi
  add    %r13d,%eax
  lea    0x1(%rsi),%edi
  cmp    $0xffffffff,%esi
  cmovge %edi,%eax
  add    $0x8,%rcx
  add    %r11d,%eax
  cltq
  lea    (%r9,%rax,8),%rax
  movsd  (%rax),%xmm0
  addsd  -0x8(%rcx),%xmm0
  movsd  %xmm0,(%rax)
  cmp    %r8,%rcx
  je     L37
L99:
  test   %edx,%edx
  jne    L11
  mov    $0x2,%edx
  mov    $0x1,%eax
  jmp    L51
  nopl   0x0(%rax)
L37:
  add    %ebx,%r10d
  add    %r15,%r8
  cmp    %r14d,%r12d
  jg     L1
L88:
  add    $0x38,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L315:
  mov    %r10d,%eax
  mov    %r10d,%edi
  mov    0x10(%rsp),%ecx
  mov    %r15d,%esi
  neg    %eax
  cmovns %eax,%edi
  mov    %r15d,%eax
  mov    %ecx,%r11d
  neg    %eax
  cmovns %eax,%esi
  sub    %r12d,%ecx
  mov    %edi,0x24(%rsp)
  sub    %edi,%r11d
  mov    %ecx,0x4(%rsp)
  cmp    %edi,%r12d
  jle    L284
  mov    0x18(%rsp),%eax
  lea    0x0(%rbp,%rsi,1),%edx
  mov    %ebp,0x28(%rsp)
  mov    %ebp,%r10d
  mov    %edx,%ecx
  mov    %r14d,0x2c(%rsp)
  mov    0x24(%rsp),%r12d
  sub    %ebx,%r10d
  add    %eax,%eax
  mov    0x8(%rsp),%r14d
  sub    %eax,%ecx
  sub    %edx,%eax
  lea    -0x1(%rcx),%edi
  lea    0x1(%rbp,%rax,1),%r15d
  mov    %edi,0x1c(%rsp)
  mov    %ebp,%edi
  sub    %esi,%edi
  mov    %edi,0x14(%rsp)
  nopl   0x0(%rax)
L119:
  lea    (%r11,%r12,1),%ebp
  mov    %r11d,%edi
  mov    0x14(%rsp),%edx
  mov    %ebp,%r8d
  neg    %r8d
  cmovs  %ebp,%r8d
  neg    %edi
  cmovs  %r11d,%edi
  cmp    %esi,%ebx
  jle    L91
  nopw   0x0(%rax,%rax,1)
L254:
  lea    (%rdx,%rsi,1),%ecx
  mov    %ecx,%eax
  neg    %eax
  cmovs  %ecx,%eax
  add    %r8d,%eax
  cltq
  lea    (%r9,%rax,8),%rcx
  mov    %edx,%eax
  neg    %eax
  movsd  (%rcx),%xmm0
  cmovs  %edx,%eax
  sub    $0x1,%edx
  add    %edi,%eax
  cltq
  addsd  0x0(%r13,%rax,8),%xmm0
  movsd  %xmm0,(%rcx)
  cmp    %r10d,%edx
  jg     L254
L91:
  test   %r14d,%r14d
  jne    L236
L132:
  sub    %ebx,%r11d
  cmp    0x4(%rsp),%r11d
  jg     L119
  mov    0x28(%rsp),%ebp
  mov    0x2c(%rsp),%r14d
L284:
  test   %r14d,%r14d
  je     L88
  mov    0x20(%rsp),%eax
  mov    0x10(%rsp),%edi
  imul   %ebx,%eax
  mov    %edi,%r11d
  add    %eax,%eax
  sub    %eax,%r11d
  add    0x24(%rsp),%r11d
  sub    %ebx,%r11d
  cmp    0x4(%rsp),%r11d
  jle    L88
  mov    0x18(%rsp),%eax
  lea    (%rsi,%rbp,1),%edx
  mov    %ebp,%r15d
  mov    %ebp,%r10d
  mov    %edx,%ecx
  sub    %r11d,%edi
  sub    %esi,%r15d
  sub    %ebx,%r10d
  add    %eax,%eax
  mov    %edi,%r12d
  sub    %eax,%ecx
  sub    %edx,%eax
  sub    $0x1,%ecx
  lea    0x1(%rbp,%rax,1),%r14d
  mov    %ecx,0x10(%rsp)
  nopl   (%rax)
L12:
  lea    (%r12,%r11,1),%ebp
  mov    %r11d,%edi
  mov    %r15d,%edx
  mov    %ebp,%r8d
  neg    %r8d
  cmovs  %ebp,%r8d
  neg    %edi
  cmovs  %r11d,%edi
  cmp    %esi,%ebx
  jle    L174
  xchg   %ax,%ax
L57:
  lea    (%rdx,%rsi,1),%ecx
  mov    %ecx,%eax
  neg    %eax
  cmovs  %ecx,%eax
  add    %r8d,%eax
  cltq
  lea    (%r9,%rax,8),%rcx
  mov    %edx,%eax
  neg    %eax
  movsd  (%rcx),%xmm0
  cmovs  %edx,%eax
  sub    $0x1,%edx
  add    %edi,%eax
  cltq
  addsd  0x0(%r13,%rax,8),%xmm0
  movsd  %xmm0,(%rcx)
  cmp    %r10d,%edx
  jg     L57
L174:
  mov    0x8(%rsp),%eax
  test   %eax,%eax
  jne    L282
L85:
  sub    %ebx,%r11d
  cmp    0x4(%rsp),%r11d
  jg     L12
  jmp    L88
  nopl   0x0(%rax)
L236:
  mov    0x1c(%rsp),%edx
  cmp    %r10d,%edx
  jle    L132
  mov    %ebp,%r8d
  mov    %r11d,%edi
  neg    %r8d
  cmovs  %ebp,%r8d
  neg    %edi
  cmovs  %r11d,%edi
L222:
  lea    (%r15,%rdx,1),%ecx
  mov    %ecx,%eax
  neg    %eax
  cmovs  %ecx,%eax
  add    %r8d,%eax
  cltq
  lea    (%r9,%rax,8),%rcx
  mov    %edx,%eax
  neg    %eax
  movsd  (%rcx),%xmm0
  cmovs  %edx,%eax
  sub    $0x1,%edx
  add    %edi,%eax
  cltq
  addsd  0x0(%r13,%rax,8),%xmm0
  movsd  %xmm0,(%rcx)
  cmp    %r10d,%edx
  jg     L222
  jmp    L132
  nopl   0x0(%rax,%rax,1)
L282:
  mov    0x10(%rsp),%edx
  cmp    %r10d,%edx
  jle    L85
  mov    %ebp,%r8d
  mov    %r11d,%edi
  neg    %r8d
  cmovs  %ebp,%r8d
  neg    %edi
  cmovs  %r11d,%edi
  nopl   0x0(%rax)
L272:
  lea    (%r14,%rdx,1),%ecx
  mov    %ecx,%eax
  neg    %eax
  cmovs  %ecx,%eax
  add    %r8d,%eax
  cltq
  lea    (%r9,%rax,8),%rcx
  mov    %edx,%eax
  neg    %eax
  movsd  (%rcx),%xmm0
  cmovs  %edx,%eax
  sub    $0x1,%edx
  add    %edi,%eax
  cltq
  addsd  0x0(%r13,%rax,8),%xmm0
  movsd  %xmm0,(%rcx)
  cmp    %r10d,%edx
  jg     L272
  jmp    L85
  nopl   0x0(%rax,%rax,1)
L300:
  mov    0x8(%rsp),%edi
  mov    %r12d,%ecx
  xor    %edx,%edx
  sub    %esi,%ecx
  test   %r8d,%r8d
  mov    $0xffffffff,%esi
  cmovg  %ecx,%edx
  test   %edi,%edi
  cmovs  %edi,%esi
  xor    %ebp,%ebp
  mov    %edx,0x10(%rsp)
  lea    0x1(%rsi),%r15d
  jmp    L10
  nopw   0x0(%rax,%rax,1)
L175:
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,0x20(%rsp)
  jmp    L100
  nopw   0x0(%rax,%rax,1)
L321:
  mov    %ebx,%edx
  shr    $0x1f,%edx
  add    %ebx,%edx
  sar    %edx
  mov    %edx,0x18(%rsp)
  jmp    L97
```

assistant: ```c
int reflect2(filt, x_dim, y_dim, x_pos, y_pos, result, r_or_e)
register double *filt, *result;
register int x_dim;
int y_dim, x_pos, y_pos, r_or_e;
{
  int filt_sz = x_dim * y_dim;
  register int y_filt, x_filt, y_res, x_res;
  register int x_base = (x_pos > 0) ? (x_dim - 1) : 0;
  register int y_base = x_dim * ((y_pos > 0) ? (y_dim - 1) : 0);
  int x_overhang = (x_pos > 0) ? (x_pos - 1) : ((x_pos < 0) ? (x_pos + 1) : 0);
  int y_overhang = x_dim * ((y_pos > 0) ? (y_pos - 1) : ((y_pos < 0) ? (y_pos + 1) : 0));
  int i;
  int mx_pos = (x_pos < 0) ? (x_dim / 2) : ((x_dim - 1) / 2);
  int my_pos = x_dim * ((y_pos < 0) ? (y_dim / 2) : ((y_dim - 1) / 2));
  for (i = 0; i < filt_sz; i++)
    result[i] = 0.0;
  if (r_or_e == 0)
    for (y_filt = 0, y_res = (y_overhang - y_base) - ((y_pos > 0) ? x_dim : 0); y_filt < filt_sz; y_filt += x_dim, y_res += x_dim) {
      if (y_res == 0)
        y_res += x_dim;
      for (x_filt = y_filt, x_res = (x_overhang - x_base) - ((x_pos > 0) ? 1 : 0); x_filt < y_filt + x_dim; x_filt++, x_res++) {
        if (x_res == 0)
          x_res++;
        result[(((y_base - (((y_res) >= 0) ? (y_res) : (-(y_res))) + x_dim) >= 0) ? (y_base - (((y_res) >= 0) ? (y_res) : (-(y_res))) + x_dim) : (-(y_base - (((y_res) >= 0) ? (y_res) : (-(y_res))) + x_dim))) + (((x_base - (((x_res) >= 0) ? (x_res) : (-(x_res))) + 1) >= 0) ? (x_base - (((x_res) >= 0) ? (x_res) : (-(x_res))) + 1) : (-(x_base - (((x_res) >= 0) ? (x_res) : (-(x_res))) + 1)))] += filt[x_filt];
      }
    }
  else {
    y_overhang = (((y_overhang) >= 0) ? (y_overhang) : (-(y_overhang)));
    x_overhang = (((x_overhang) >= 0) ? (x_overhang) : (-(x_overhang)));
    for (y_res = y_base, y_filt = y_base - y_overhang; y_filt > y_base - filt_sz; y_filt -= x_dim, y_res -= x_dim) {
      for (x_res = x_base, x_filt = x_base - x_overhang; x_filt > x_base - x_dim; x_res--, x_filt--)
        result[(((y_res) >= 0) ? (y_res) : (-(y_res))) + (((x_res) >= 0) ? (x_res) : (-(x_res)))] += filt[(((y_filt) >= 0) ? (y_filt) : (-(y_filt))) + (((x_filt) >= 0) ? (x_filt) : (-(x_filt)))];
      if (x_pos != 0)
        for (x_res = x_base, x_filt = x_base - 2 * mx_pos + x_overhang - 1; x_filt > x_base - x_dim; x_res--, x_filt--)
          result[(((y_res) >= 0) ? (y_res) : (-(y_res))) + (((x_res) >= 0) ? (x_res) : (-(x_res)))] += filt[(((y_filt) >= 0) ? (y_filt) : (-(y_filt))) + (((x_filt) >= 0) ? (x_filt) : (-(x_filt)))];
    }
    if (y_pos != 0)
      for (y_res = y_base, y_filt = y_base - 2 * my_pos + y_overhang - x_dim; y_filt > y_base - filt_sz; y_filt -= x_dim, y_res -= x_dim) {
        for (x_res = x_base, x_filt = x_base - x_overhang; x_filt > x_base - x_dim; x_res--, x_filt--)
          result[(((y_res) >= 0) ? (y_res) : (-(y_res))) + (((x_res) >= 0) ? (x_res) : (-(x_res)))] += filt[(((y_filt) >= 0) ? (y_filt) : (-(y_filt))) + (((x_filt) >= 0) ? (x_filt) : (-(x_filt)))];
        if (x_pos != 0)
          for (x_res = x_base, x_filt = x_base - 2 * mx_pos + x_overhang - 1; x_filt > x_base - x_dim; x_res--, x_filt--)
            result[(((y_res) >= 0) ? (y_res) : (-(y_res))) + (((x_res) >= 0) ? (x_res) : (-(x_res)))] += filt[(((y_filt) >= 0) ? (y_filt) : (-(y_filt))) + (((x_filt) >= 0) ? (x_filt) : (-(x_filt)))];
      }
  }
  return (0);
}
```