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

```asm
<repeat>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  mov    %esi,%eax
  mov    %edx,-0x34(%rbp)
  mov    %ecx,-0x38(%rbp)
  mov    %r8d,-0x3c(%rbp)
  mov    %r9,%rsi
  mov    %eax,%edx
  imul   -0x34(%rbp),%edx
  mov    %edx,-0x2c(%rbp)
  cmpl   $0x0,-0x38(%rbp)
  jle    L45
  mov    -0x38(%rbp),%edx
  sub    $0x1,%edx
  jmp    L165
L45:
  mov    -0x38(%rbp),%edx
  mov    $0xffffffff,%ecx
  test   %edx,%edx
  cmovns %ecx,%edx
  add    $0x1,%edx
L165:
  mov    %edx,-0x28(%rbp)
  cmpl   $0x0,-0x3c(%rbp)
  jle    L247
  mov    -0x3c(%rbp),%edx
  sub    $0x1,%edx
  jmp    L104
L247:
  mov    -0x3c(%rbp),%edx
  mov    $0xffffffff,%ecx
  test   %edx,%edx
  cmovns %ecx,%edx
  add    $0x1,%edx
L104:
  imul   %eax,%edx
  mov    %edx,-0x24(%rbp)
  movl   $0x0,-0x30(%rbp)
  jmp    L49
L21:
  mov    -0x30(%rbp),%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  add    %rsi,%rdx
  pxor   %xmm0,%xmm0
  movss  %xmm0,(%rdx)
  addl   $0x1,-0x30(%rbp)
L49:
  mov    -0x30(%rbp),%edx
  cmp    -0x2c(%rbp),%edx
  jl     L21
  mov    $0x0,%r13d
  mov    -0x24(%rbp),%ebx
  jmp    L160
L185:
  mov    %r13d,%r14d
  mov    -0x28(%rbp),%r12d
  jmp    L153
L115:
  test   %ebx,%ebx
  js     L89
  cmp    -0x2c(%rbp),%ebx
  jl     L242
  mov    -0x2c(%rbp),%edx
  mov    %edx,%ecx
  sub    %eax,%ecx
  jmp    L56
L242:
  mov    %ebx,%ecx
  jmp    L56
L89:
  mov    $0x0,%ecx
L56:
  test   %r12d,%r12d
  js     L112
  cmp    %eax,%r12d
  jl     L4
  lea    -0x1(%rax),%edx
  jmp    L176
L4:
  mov    %r12d,%edx
  jmp    L176
L112:
  mov    $0x0,%edx
L176:
  add    %ecx,%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  add    %rsi,%rdx
  movss  (%rdx),%xmm1
  movslq %r14d,%rdx
  shl    $0x2,%rdx
  add    %rdi,%rdx
  movss  (%rdx),%xmm0
  test   %ebx,%ebx
  js     L72
  cmp    -0x2c(%rbp),%ebx
  jl     L166
  mov    -0x2c(%rbp),%edx
  mov    %edx,%ecx
  sub    %eax,%ecx
  jmp    L170
L166:
  mov    %ebx,%ecx
  jmp    L170
L72:
  mov    $0x0,%ecx
L170:
  test   %r12d,%r12d
  js     L214
  cmp    %eax,%r12d
  jl     L169
  lea    -0x1(%rax),%edx
  jmp    L101
L169:
  mov    %r12d,%edx
  jmp    L101
L214:
  mov    $0x0,%edx
L101:
  add    %ecx,%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  add    %rsi,%rdx
  addss  %xmm1,%xmm0
  movss  %xmm0,(%rdx)
  add    $0x1,%r14d
  add    $0x1,%r12d
L153:
  lea    0x0(%r13,%rax,1),%edx
  cmp    %edx,%r14d
  jl     L115
  add    %eax,%r13d
  add    %eax,%ebx
L160:
  cmp    -0x2c(%rbp),%r13d
  jl     L185
  nop
  nop
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %rbp
  ret
```

assistant: ```c
void repeat(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;
{
  register int y_filt, x_filt, y_res, x_res;
  int filt_sz = x_dim * y_dim;
  int x_start = ((x_pos > 0) ? (x_pos - 1) : ((x_pos < 0) ? (x_pos + 1) : 0));
  int y_start = x_dim * ((y_pos > 0) ? (y_pos - 1) : ((y_pos < 0) ? (y_pos + 1) : 0));
  int i;
  for (i = 0; i < filt_sz; i++)
    result[i] = 0.0;
  for (y_filt = 0, y_res = y_start; y_filt < filt_sz; y_filt += x_dim, y_res += x_dim)
    for (x_filt = y_filt, x_res = x_start; x_filt < y_filt + x_dim; x_filt++, x_res++)
      result[((y_res >= 0) ? ((y_res < filt_sz) ? y_res : (filt_sz - x_dim)) : 0) + ((x_res >= 0) ? ((x_res < x_dim) ? x_res : (x_dim - 1)) : 0)] += filt[x_filt];
}
```