user: 请将以下的汇编代码转换成C语言代码:

```asm
<repeat>:
  endbr64
  push   %r15
  mov    %ecx,%r11d
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x18,%rsp
  mov    %edx,0x4(%rsp)
  test   %ecx,%ecx
  jle    L326
  lea    -0x1(%rsi),%r12d
  test   %r8d,%r8d
  jle    L313
  mov    0x4(%rsp),%eax
  lea    -0x1(%rax),%r10d
  imul   %esi,%r10d
L328:
  lea    -0x1(%r11),%eax
  mov    %eax,(%rsp)
L112:
  test   %r8d,%r8d
  mov    0x4(%rsp),%ecx
  lea    -0x1(%r8),%eax
  mov    %r10d,0xc(%rsp)
  mov    $0xffffffff,%r13d
  cmovs  %r8d,%r13d
  add    $0x1,%r13d
  test   %r8d,%r8d
  cmovg  %eax,%r13d
  imul   %ebp,%ecx
  imul   %ebp,%r13d
  test   %ecx,%ecx
  jle    L191
  movslq %ecx,%rdx
  xor    %esi,%esi
  mov    %r9,%rdi
  mov    %ecx,0x8(%rsp)
  shl    $0x3,%rdx
  call   <memset@plt>
  mov    0x8(%rsp),%ecx
  mov    %rax,%r9
  mov    0x50(%rsp),%eax
  test   %eax,%eax
  jne    L156
  mov    (%rsp),%eax
  movslq %ebp,%r14
  mov    %ebp,%r11d
  mov    %ecx,%r12d
  shl    $0x3,%r14
  xor    %r15d,%r15d
  sub    %r13d,%r11d
  sub    %ebp,%r12d
  add    %ebp,%eax
  lea    -0x1(%rbp),%r10d
  sub    %r13d,%eax
  mov    %eax,0x4(%rsp)
  nopl   0x0(%rax,%rax,1)
L276:
  lea    (%r11,%r13,1),%eax
  cmp    %eax,%r15d
  jge    L9
  mov    0x4(%rsp),%eax
  mov    (%rsp),%edx
  mov    %rbx,%rsi
  lea    (%rax,%r13,1),%edi
  sub    %r15d,%edi
  nopw   0x0(%rax,%rax,1)
L302:
  xor    %eax,%eax
  test   %r13d,%r13d
  js     L257
  cmp    %r13d,%ecx
  mov    %r13d,%eax
  cmovle %r12d,%eax
L257:
  test   %edx,%edx
  js     L277
  lea    (%rax,%rdx,1),%r8d
  add    %r10d,%eax
  cmp    %edx,%ebp
  cmovg  %r8d,%eax
L277:
  cltq
  add    $0x1,%edx
  add    $0x8,%rsi
  lea    (%r9,%rax,8),%rax
  movsd  (%rax),%xmm0
  addsd  -0x8(%rsi),%xmm0
  movsd  %xmm0,(%rax)
  cmp    %edi,%edx
  jne    L302
L9:
  add    %ebp,%r15d
  add    %ebp,%r13d
  add    %r14,%rbx
  cmp    %r15d,%ecx
  jg     L276
L191:
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L313:
  xor    %r10d,%r10d
  jmp    L328
L156:
  mov    %ebp,%eax
  mov    0xc(%rsp),%r10d
  mov    0x4(%rsp),%esi
  shr    $0x1f,%eax
  add    %ebp,%eax
  mov    %r10d,%r14d
  mov    %r10d,%r15d
  sar    %eax
  mov    %eax,0xc(%rsp)
  mov    %r13d,%eax
  neg    %eax
  cmovs  %r13d,%eax
  sub    %r13d,%r10d
  sub    %ecx,%r15d
  mov    %eax,0x8(%rsp)
  mov    %eax,%edi
  sub    %eax,%r14d
  mov    %esi,%eax
  shr    $0x1f,%eax
  add    %esi,%eax
  sar    %eax
  imul   %ebp,%eax
  cmp    %eax,%r10d
  je     L272
  cmp    %edi,%ecx
  jle    L191
  mov    (%rsp),%eax
  mov    %r12d,%r13d
  mov    %r12d,%esi
  mov    %eax,%r10d
  sub    %eax,%r13d
  neg    %r10d
  cmovs  %eax,%r10d
  sub    %ebp,%esi
L98:
  mov    0x8(%rsp),%eax
  mov    %r12d,%ecx
  sub    %r10d,%ecx
  lea    (%r14,%rax,1),%edi
  cmp    %r13d,0xc(%rsp)
  je     L36
  mov    %edi,%eax
  mov    %r14d,%r8d
  neg    %eax
  cmovns %eax,%edi
  neg    %r8d
  cmovs  %r14d,%r8d
  cmp    %r10d,%ebp
  jle    L323
  nopw   0x0(%rax,%rax,1)
L232:
  lea    (%rcx,%r10,1),%edx
  mov    %edx,%eax
  neg    %eax
  cmovs  %edx,%eax
  add    %edi,%eax
  cltq
  lea    (%r9,%rax,8),%rdx
  mov    %ecx,%eax
  neg    %eax
  movsd  (%rdx),%xmm0
  cmovs  %ecx,%eax
  sub    $0x1,%ecx
  add    %r8d,%eax
  cltq
  addsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%rdx)
  cmp    %esi,%ecx
  jg     L232
L323:
  sub    %ebp,%r14d
  cmp    %r15d,%r14d
  jg     L98
  jmp    L191
L36:
  cmp    %r10d,%ebp
  jle    L323
  mov    %edi,%r11d
  mov    %r14d,%r8d
  neg    %r11d
  cmovs  %edi,%r11d
  neg    %r8d
  cmovs  %r14d,%r8d
  nopl   0x0(%rax)
L49:
  lea    (%rcx,%r10,1),%edx
  mov    %edx,%eax
  neg    %eax
  cmovs  %edx,%eax
  mov    %ecx,%edx
  add    %r11d,%eax
  cltq
  lea    (%r9,%rax,8),%rdi
  movsd  (%rdi),%xmm0
  nopw   0x0(%rax,%rax,1)
L300:
  mov    %edx,%eax
  neg    %eax
  cmovs  %edx,%eax
  sub    $0x1,%edx
  add    %r8d,%eax
  cltq
  addsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%rdi)
  cmp    %esi,%edx
  jg     L300
  sub    $0x1,%ecx
  cmp    %esi,%ecx
  jg     L49
  sub    %ebp,%r14d
  cmp    %r15d,%r14d
  jg     L98
  jmp    L191
L326:
  xor    %r10d,%r10d
  test   %r8d,%r8d
  jle    L85
  mov    0x4(%rsp),%eax
  lea    -0x1(%rax),%r10d
  imul   %esi,%r10d
L85:
  test   %r11d,%r11d
  mov    $0xffffffff,%eax
  cmovns %eax,%r11d
  xor    %r12d,%r12d
  lea    0x1(%r11),%eax
  mov    %eax,(%rsp)
  jmp    L112
L272:
  cmp    0x8(%rsp),%ecx
  jle    L191
  mov    (%rsp),%eax
  mov    %r12d,%edi
  mov    %r14d,0x4(%rsp)
  mov    %r12d,%esi
  mov    0xc(%rsp),%r14d
  sub    %eax,%edi
  mov    %eax,%r10d
  mov    %edi,(%rsp)
  neg    %r10d
  cmovs  %eax,%r10d
  sub    %ebp,%esi
L254:
  mov    0x4(%rsp),%r13d
  mov    0x8(%rsp),%eax
  add    %r13d,%eax
  mov    %eax,%r11d
  neg    %r11d
  cmovs  %eax,%r11d
  nopw   0x0(%rax,%rax,1)
L252:
  mov    %r12d,%ecx
  sub    %r10d,%ecx
  cmp    (%rsp),%r14d
  je     L291
  mov    %r13d,%edi
  neg    %edi
  cmovs  %r13d,%edi
  cmp    %r10d,%ebp
  jle    L263
  nopw   0x0(%rax,%rax,1)
L13:
  lea    (%rcx,%r10,1),%edx
  mov    %edx,%eax
  neg    %eax
  cmovs  %edx,%eax
  add    %r11d,%eax
  cltq
  lea    (%r9,%rax,8),%rdx
  mov    %ecx,%eax
  neg    %eax
  movsd  (%rdx),%xmm0
  cmovs  %ecx,%eax
  sub    $0x1,%ecx
  add    %edi,%eax
  cltq
  addsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%rdx)
  cmp    %esi,%ecx
  jg     L13
L263:
  sub    %ebp,%r13d
  cmp    %r15d,%r13d
  jg     L252
  sub    %ebp,0x4(%rsp)
  mov    0x4(%rsp),%eax
  cmp    %r15d,%eax
  jg     L254
  jmp    L191
  nopl   0x0(%rax)
L291:
  cmp    %r10d,%ebp
  jle    L263
  mov    %r13d,%r8d
  neg    %r8d
  cmovs  %r13d,%r8d
  nopw   0x0(%rax,%rax,1)
L311:
  lea    (%rcx,%r10,1),%edx
  mov    %edx,%eax
  neg    %eax
  cmovs  %edx,%eax
  mov    %ecx,%edx
  add    %r11d,%eax
  cltq
  lea    (%r9,%rax,8),%rdi
  movsd  (%rdi),%xmm0
  nopw   0x0(%rax,%rax,1)
L174:
  mov    %edx,%eax
  neg    %eax
  cmovs  %edx,%eax
  sub    $0x1,%edx
  add    %r8d,%eax
  cltq
  addsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%rdi)
  cmp    %esi,%edx
  jg     L174
  sub    $0x1,%ecx
  cmp    %esi,%ecx
  jg     L311
  jmp    L263
```

assistant: ```c
int repeat(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;
{
  register int y_filt, x_filt, y_res, x_res, y_tmp, x_tmp;
  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 filt_sz = x_dim * y_dim;
  int mx_pos = (x_dim / 2);
  int my_pos = x_dim * (y_dim / 2);
  int i;
  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_filt < filt_sz; y_filt += x_dim, y_res += x_dim)
      for (x_filt = y_filt, x_res = x_overhang; 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];
  else {
    if ((y_base - y_overhang) != my_pos)
      for (y_res = y_base, y_filt = y_base - (((y_overhang) >= 0) ? (y_overhang) : (-(y_overhang))); y_filt > y_base - filt_sz; y_filt -= x_dim, y_res -= x_dim)
        if ((x_base - x_overhang) != mx_pos)
          for (x_res = x_base, x_filt = x_base - (((x_overhang) >= 0) ? (x_overhang) : (-(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)))];
        else
          for (x_res = x_base, x_filt = x_base - (((x_overhang) >= 0) ? (x_overhang) : (-(x_overhang))); x_filt > x_base - x_dim; x_filt--, x_res--)
            for (x_tmp = x_filt; x_tmp > x_base - x_dim; x_tmp--)
              result[(((y_res) >= 0) ? (y_res) : (-(y_res))) + (((x_res) >= 0) ? (x_res) : (-(x_res)))] += filt[(((y_filt) >= 0) ? (y_filt) : (-(y_filt))) + (((x_tmp) >= 0) ? (x_tmp) : (-(x_tmp)))];
    else
      for (y_res = y_base, y_filt = y_base - (((y_overhang) >= 0) ? (y_overhang) : (-(y_overhang))); y_filt > y_base - filt_sz; y_filt -= x_dim, y_res -= x_dim)
        for (y_tmp = y_filt; y_tmp > y_base - filt_sz; y_tmp -= x_dim)
          if ((x_base - x_overhang) != mx_pos)
            for (x_res = x_base, x_filt = x_base - (((x_overhang) >= 0) ? (x_overhang) : (-(x_overhang))); x_filt > x_base - x_dim; x_filt--, x_res--)
              result[(((y_res) >= 0) ? (y_res) : (-(y_res))) + (((x_res) >= 0) ? (x_res) : (-(x_res)))] += filt[(((y_tmp) >= 0) ? (y_tmp) : (-(y_tmp))) + (((x_filt) >= 0) ? (x_filt) : (-(x_filt)))];
          else
            for (x_res = x_base, x_filt = x_base - (((x_overhang) >= 0) ? (x_overhang) : (-(x_overhang))); x_filt > x_base - x_dim; x_filt--, x_res--)
              for (x_tmp = x_filt; x_tmp > x_base - x_dim; x_tmp--)
                result[(((y_res) >= 0) ? (y_res) : (-(y_res))) + (((x_res) >= 0) ? (x_res) : (-(x_res)))] += filt[(((y_tmp) >= 0) ? (y_tmp) : (-(y_tmp))) + (((x_tmp) >= 0) ? (x_tmp) : (-(x_tmp)))];
  }
  return (0);
}
```