user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<reflect1>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  mov    %ecx,%esi
  push   %rbx
  mov    %ebp,%eax
  mov    %rdi,%rbx
  imul   %edx,%eax
  sub    $0x28,%rsp
  mov    %ecx,0xc(%rsp)
  mov    %r8d,0x8(%rsp)
  mov    %eax,0x4(%rsp)
  test   %ecx,%ecx
  jle    L27
  sub    %ebp,%eax
  lea    -0x1(%rbp),%r12d
  mov    %r8d,%edi
  mov    %eax,%edx
  xor    %eax,%eax
  test   %r8d,%r8d
  cmovg  %edx,%eax
  sub    %ebp,%esi
  mov    %esi,%ecx
  mov    %eax,(%rsp)
L299:
  mov    %edi,%edx
  mov    $0xffffffff,%eax
  mov    %ebp,%r15d
  mov    %r13d,%r14d
  sub    %r13d,%edx
  test   %edi,%edi
  cmovs  %edi,%eax
  add    $0x1,%eax
  test   %edi,%edi
  cmovg  %edx,%eax
  shr    $0x1f,%r15d
  add    %ebp,%r15d
  shr    $0x1f,%r14d
  imul   %ebp,%eax
  sar    %r15d
  add    %r13d,%r14d
  sar    %r14d
  mov    %eax,0x10(%rsp)
  lea    0x1(%r15),%eax
  mov    %eax,0x18(%rsp)
  lea    0x1(%r14),%eax
  mov    %eax,0x1c(%rsp)
  mov    0x4(%rsp),%eax
  test   %eax,%eax
  jle    L160
  movslq %eax,%rdx
  xor    %esi,%esi
  mov    %r9,%rdi
  mov    %ecx,0x14(%rsp)
  shl    $0x2,%rdx
  call   <memset@plt>
  cmpl   $0x1,0x60(%rsp)
  mov    0x14(%rsp),%ecx
  mov    %rax,%r9
  je     L328
  mov    0x4(%rsp),%r13d
  mov    %ebp,%esi
  xor    %r11d,%r11d
  xor    %eax,%eax
L260:
  cmp    %esi,%eax
  jge    L75
  mov    0x10(%rsp),%r8d
  movslq %eax,%r10
  movslq %r11d,%rdx
  add    %r11d,%eax
  mov    %ecx,%edi
  add    %r11d,%esi
  movslq %ebp,%r14
  add    %rdx,%r10
  sub    %eax,%edi
  sub    %r8d,%r11d
  nopl   (%rax)
L193:
  mov    %r8d,%edx
  mov    (%rsp),%eax
  neg    %edx
  cmovs  %r8d,%edx
  sub    %edx,%eax
  mov    %r10,%rdx
  mov    %eax,%ecx
  neg    %ecx
  cmovs  %eax,%ecx
  nopl   0x0(%rax,%rax,1)
L315:
  lea    (%rdi,%rdx,1),%r15d
  mov    %r15d,%eax
  neg    %eax
  cmovs  %r15d,%eax
  mov    %r12d,%r15d
  sub    %eax,%r15d
  mov    %r15d,%eax
  neg    %eax
  cmovs  %r15d,%eax
  add    %ecx,%eax
  cltq
  lea    (%r9,%rax,4),%rax
  movss  (%rax),%xmm0
  addss  (%rbx,%rdx,4),%xmm0
  add    $0x1,%rdx
  movss  %xmm0,(%rax)
  cmp    %edx,%esi
  jg     L315
  add    %ebp,%r8d
  add    %r14,%r10
  sub    %ebp,%edi
  add    %ebp,%esi
  lea    (%r11,%r8,1),%eax
  cmp    %eax,%r13d
  jg     L193
L75:
  cmpl   $0x1,0x60(%rsp)
  je     L267
L399:
  add    $0x28,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L27:
  mov    0x8(%rsp),%ecx
  mov    %eax,%edx
  xor    %eax,%eax
  mov    %r8d,%edi
  sub    %ebp,%edx
  test   %ecx,%ecx
  cmovg  %edx,%eax
  test   %esi,%esi
  mov    %eax,(%rsp)
  mov    $0xffffffff,%eax
  cmovs  %esi,%eax
  xor    %r12d,%r12d
  lea    0x1(%rax),%ecx
  jmp    L299
L160:
  cmpl   $0x1,0x60(%rsp)
  jne    L399
L328:
  mov    0x18(%rsp),%esi
  cmp    %esi,0xc(%rsp)
  je     L358
  mov    %r15d,%edx
  xor    %eax,%eax
  mov    %ebp,%esi
  not    %edx
  cmp    0xc(%rsp),%edx
  cmove  %eax,%ecx
  cmove  %r15d,%eax
L261:
  mov    0x1c(%rsp),%edx
  cmp    %edx,0x8(%rsp)
  je     L368
  mov    %r14d,%edx
  mov    0x4(%rsp),%r13d
  xor    %r11d,%r11d
  not    %edx
  cmp    0x8(%rsp),%edx
  je     L80
L326:
  cmp    %r11d,%r13d
  jg     L260
L267:
  mov    0xc(%rsp),%ebx
  mov    %ebx,%eax
  neg    %eax
  cmovs  %ebx,%eax
  cmp    0x18(%rsp),%eax
  je     L302
  test   %ebx,%ebx
  jne    L157
L302:
  mov    0x8(%rsp),%ebx
  mov    %ebx,%eax
  neg    %eax
  cmovs  %ebx,%eax
  cmp    0x1c(%rsp),%eax
  je     L399
  test   %ebx,%ebx
  je     L399
  mov    (%rsp),%ebx
  lea    0x0(%rbp,%rbx,1),%eax
  cmp    %ebx,%eax
  jle    L399
  lea    -0x1(%rbp),%eax
  cmp    $0x2,%eax
  jbe    L392
  movslq %ebx,%rax
  lea    (%r9,%rax,4),%rdx
  mov    %ebp,%eax
  shr    $0x2,%eax
  lea    -0x1(%rax),%ecx
  lea    0x10(%rdx),%rax
  shl    $0x4,%rcx
  add    %rax,%rcx
  jmp    L76
L339:
  add    $0x10,%rax
L76:
  movups (%rdx),%xmm0
  addps  %xmm0,%xmm0
  movups %xmm0,(%rdx)
  mov    %rax,%rdx
  cmp    %rcx,%rax
  jne    L339
  mov    (%rsp),%eax
  mov    %ebp,%edx
  and    $0xfffffffc,%edx
  add    %edx,%eax
  cmp    %edx,%ebp
  je     L399
L243:
  sub    %edx,%ebp
  cmp    $0x1,%ebp
  je     L104
  movslq (%rsp),%rcx
  add    %rcx,%rdx
  lea    (%r9,%rdx,4),%rdx
  movq   (%rdx),%xmm0
  addps  %xmm0,%xmm0
  movlps %xmm0,(%rdx)
  mov    %ebp,%edx
  and    $0xfffffffe,%edx
  add    %edx,%eax
  cmp    %ebp,%edx
  je     L399
L104:
  cltq
  lea    (%r9,%rax,4),%rax
  movss  (%rax),%xmm0
  addss  %xmm0,%xmm0
  movss  %xmm0,(%rax)
  jmp    L399
L157:
  cmp    %r12d,0x4(%rsp)
  jle    L302
  cmp    $0x1,%ebp
  jne    L111
  mov    0x4(%rsp),%ecx
  sub    %r12d,%ecx
  lea    -0x1(%rcx),%eax
  cmp    $0x2,%eax
  jbe    L246
  movslq %r12d,%rax
  lea    (%r9,%rax,4),%rdx
  mov    %ecx,%eax
  shr    $0x2,%eax
  lea    -0x1(%rax),%esi
  lea    0x10(%rdx),%rax
  shl    $0x4,%rsi
  add    %rax,%rsi
  jmp    L281
L142:
  add    $0x10,%rax
L281:
  movups (%rdx),%xmm0
  addps  %xmm0,%xmm0
  movups %xmm0,(%rdx)
  mov    %rax,%rdx
  cmp    %rsi,%rax
  jne    L142
  mov    %ecx,%edx
  and    $0xfffffffc,%edx
  lea    (%rdx,%r12,1),%eax
  cmp    %ecx,%edx
  je     L302
L133:
  sub    %edx,%ecx
  cmp    $0x1,%ecx
  je     L276
  movslq %r12d,%r12
  add    %r12,%rdx
  lea    (%r9,%rdx,4),%rdx
  movq   (%rdx),%xmm0
  addps  %xmm0,%xmm0
  movlps %xmm0,(%rdx)
  mov    %ecx,%edx
  and    $0xfffffffe,%edx
  add    %edx,%eax
  cmp    %edx,%ecx
  je     L302
L276:
  cltq
  lea    (%r9,%rax,4),%rax
  movss  (%rax),%xmm0
  addss  %xmm0,%xmm0
  movss  %xmm0,(%rax)
  jmp    L302
L80:
  mov    %r14d,%r11d
  movl   $0x0,0x10(%rsp)
  imul   %ebp,%r11d
  jmp    L326
L368:
  add    $0x1,%r13d
  xor    %r11d,%r11d
  mov    %r13d,%edx
  shr    $0x1f,%edx
  add    %edx,%r13d
  sar    %r13d
  imul   %ebp,%r13d
  cmp    %r11d,%r13d
  jg     L260
  jmp    L267
L358:
  lea    0x1(%rbp),%eax
  mov    %eax,%esi
  shr    $0x1f,%esi
  add    %eax,%esi
  xor    %eax,%eax
  sar    %esi
  jmp    L261
L111:
  movslq %ebp,%rax
  movslq %r12d,%r12
L232:
  movss  (%r9,%r12,4),%xmm0
  addss  %xmm0,%xmm0
  movss  %xmm0,(%r9,%r12,4)
  add    %rax,%r12
  cmp    %r12d,0x4(%rsp)
  jg     L232
  jmp    L302
L392:
  mov    %ebx,%eax
  xor    %edx,%edx
  jmp    L243
L246:
  mov    %r12d,%eax
  xor    %edx,%edx
  jmp    L133
```

assistant: ```c
reflect1(filt, x_dim, y_dim, x_pos, y_pos, result, f_or_e) register float *filt, *result;
register int x_dim;
int y_dim, x_pos, y_pos, f_or_e;
{
  int filt_sz = x_dim * y_dim;
  register int x_start = 0, y_start = 0, x_stop = x_dim, y_stop = filt_sz;
  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 x_edge_dist = (x_pos > 0) ? (x_pos - x_dim) : ((x_pos < -1) ? (x_pos + 1) : 0);
  int y_edge_dist = x_dim * ((y_pos > 0) ? (y_pos - y_dim) : ((y_pos < -1) ? (y_pos + 1) : 0));
  int i;
  int mx_pos = (x_dim / 2) + 1;
  int my_pos = (y_dim / 2) + 1;
  for (i = 0; i < filt_sz; i++)
    result[i] = 0.0;
  if (f_or_e == 1) {
    if (x_pos == mx_pos)
      x_stop = (x_dim + 1) / 2;
    else if (x_pos == -mx_pos) {
      x_start = x_dim / 2;
      x_edge_dist = 0;
    }
    if (y_pos == my_pos)
      y_stop = x_dim * ((y_dim + 1) / 2);
    else if (y_pos == -my_pos) {
      y_start = x_dim * (y_dim / 2);
      y_edge_dist = 0;
    }
  }
  for (y_filt = y_start, y_edge = y_edge_dist; y_filt < y_stop; y_filt += x_dim, y_edge += x_dim)
    for (x_filt = y_filt + x_start, x_edge = x_edge_dist; x_filt < y_filt + x_stop; x_filt++, x_edge++)
      result[(y_base - (y_edge >= 0 ? y_edge : -(y_edge)) >= 0 ? y_base - (y_edge >= 0 ? y_edge : -(y_edge)) : -(y_base - (y_edge >= 0 ? y_edge : -(y_edge)))) + (x_base - (x_edge >= 0 ? x_edge : -(x_edge)) >= 0 ? x_base - (x_edge >= 0 ? x_edge : -(x_edge)) : -(x_base - (x_edge >= 0 ? x_edge : -(x_edge))))] += filt[x_filt];
  if (f_or_e == 1) {
    if (((x_pos >= 0 ? x_pos : -(x_pos)) != mx_pos) && (x_pos != 0))
      for (y_filt = x_base; y_filt < filt_sz; y_filt += x_dim)
        result[y_filt] += result[y_filt];
    if (((y_pos >= 0 ? y_pos : -(y_pos)) != my_pos) && (y_pos != 0))
      for (x_filt = y_base; x_filt < y_base + x_dim; x_filt++)
        result[x_filt] += result[x_filt];
  }
}
```