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

```asm
<test>:
  endbr64
  push   %r15
  mov    %edi,%eax
  push   %r14
  mov    %esi,%r14d
  push   %r13
  mov    %edi,%r13d
  push   %r12
  mov    %edx,%r12d
  mov    %esi,%edx
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  neg    %eax
  cmovs  %edi,%eax
  neg    %edx
  cmovs  %esi,%edx
  cmp    %edx,%eax
  cmovl  %edx,%eax
  mov    %eax,%edx
  shl    $0x8,%edx
  lea    0xc(%rax,%rdx,1),%r8d
  mov    %r12d,%eax
  neg    %eax
  cmovs  %r12d,%eax
  add    %eax,%r8d
  lea    0x0(,%r8,8),%edi
  mov    %r8d,0x4(%rsp)
  call   <__builtin_alloca@plt>
  mov    0x4(%rsp),%r8d
  mov    %rax,0x20(%rsp)
  mov    %rax,%rdx
  xor    %eax,%eax
  nopl   (%rax)
L85:
  pxor   %xmm0,%xmm0
  add    $0x8,%rdx
  cvtsi2sd %eax,%xmm0
  add    $0x1,%eax
  movsd  %xmm0,-0x8(%rdx)
  cmp    %eax,%r8d
  jne    L85
  mov    $0x6,%eax
  mov    %eax,%r10d
  sub    %r12d,%r10d
  test   %r12d,%r12d
  cmovns %eax,%r10d
  mov    $0x0,%eax
  cmovs  %eax,%r12d
  lea    0x6(%r12),%eax
  mov    %eax,0x4(%rsp)
  test   %r13d,%r13d
  js     L20
  test   %r14d,%r14d
  js     L114
  movslq 0x4(%rsp),%rax
  mov    0x20(%rsp),%rcx
  mov    %r8d,0x10(%rsp)
  mov    %r10d,0x8(%rsp)
  mov    %rax,0x28(%rsp)
  lea    (%rcx,%rax,8),%rsi
  movslq %r10d,%rax
  lea    (%rcx,%rax,8),%rdi
L41:
  mov    %r14d,%ecx
  mov    %r13d,%edx
  xor    %ebx,%ebx
  mov    $0x1,%r15d
  call   <f@plt>
  mov    0x8(%rsp),%r10d
  mov    0x10(%rsp),%r8d
L264:
  mov    0x20(%rsp),%rcx
  movslq %ebx,%rax
  movslq %r15d,%rsi
  xor    %ebp,%ebp
  shl    $0x3,%rsi
  lea    (%rcx,%rax,8),%rdx
  movslq %r14d,%rax
  lea    0x0(,%rax,8),%r12
  jmp    L9
  nopw   0x0(%rax,%rax,1)
L124:
  add    %r15d,%ebx
  add    %rsi,%rdx
  cmp    %ebx,%r8d
  je     L179
L9:
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebx,%xmm0
  cmp    $0x101,%ebp
  je     L143
  mov    %r13d,%eax
  imul   %ebp,%eax
  add    %r10d,%eax
  cmp    %ebx,%eax
  je     L183
L143:
  ucomisd (%rdx),%xmm0
  jp     L289
  je     L124
L289:
  xor    %eax,%eax
  mov    %rsi,0x18(%rsp)
  add    %r15d,%ebx
  mov    %r10d,0x14(%rsp)
  mov    %r8d,0x10(%rsp)
  mov    %rdx,0x8(%rsp)
  call   <abort@plt>
  mov    0x8(%rsp),%rdx
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%r8d
  mov    0x14(%rsp),%r10d
  add    %rsi,%rdx
  cmp    %ebx,%r8d
  jne    L9
L179:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L114:
  mov    %r14d,%eax
  mov    0x20(%rsp),%rdi
  mov    %r8d,0x10(%rsp)
  shl    $0x8,%eax
  sub    %eax,0x4(%rsp)
  movslq 0x4(%rsp),%rax
  mov    %r10d,0x8(%rsp)
  lea    (%rdi,%rax,8),%rsi
  mov    %rax,0x28(%rsp)
  movslq %r10d,%rax
  lea    (%rdi,%rax,8),%rdi
  jmp    L41
  nopl   0x0(%rax,%rax,1)
L183:
  test   %r13d,%r13d
  je     L273
  mov    %r14d,%r11d
  imul   %ebp,%r11d
  add    0x4(%rsp),%r11d
  test   %r13d,%r13d
  js     L256
  cmp    %ebx,%r11d
  setl   %al
L237:
  test   %al,%al
  je     L137
  mov    0x20(%rsp),%rax
  movslq %r11d,%r11
  addsd  (%rax,%r11,8),%xmm0
L72:
  ucomisd (%rdx),%xmm0
  jp     L98
  jne    L98
L252:
  add    $0x1,%ebp
  jmp    L124
L137:
  pxor   %xmm1,%xmm1
  cvtsi2sd %r11d,%xmm1
  addsd  %xmm1,%xmm0
  jmp    L72
  nopl   (%rax)
L256:
  cmp    %ebx,%r11d
  setg   %al
  jmp    L237
  nopl   0x0(%rax,%rax,1)
L273:
  cmp    $0x100,%ebp
  jg     L143
  mov    %r14d,%r11d
  mov    0x4(%rsp),%eax
  mov    0x20(%rsp),%rcx
  imul   %ebp,%r11d
  add    %r11d,%eax
  movslq %r11d,%r11
  add    0x28(%rsp),%r11
  lea    (%rcx,%r11,8),%r11
  jmp    L138
  nopl   (%rax)
L82:
  addsd  (%r11),%xmm0
L271:
  add    $0x1,%ebp
  add    %r14d,%eax
  add    %r12,%r11
  cmp    $0x101,%ebp
  je     L143
L138:
  cmp    %ebx,%eax
  jl     L82
  je     L191
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  addsd  %xmm1,%xmm0
  jmp    L271
  xchg   %ax,%ax
L191:
  addsd  %xmm0,%xmm0
  jmp    L271
  cs nopw 0x0(%rax,%rax,1)
L98:
  xor    %eax,%eax
  mov    %rsi,0x18(%rsp)
  mov    %r10d,0x14(%rsp)
  mov    %r8d,0x10(%rsp)
  mov    %rdx,0x8(%rsp)
  call   <abort@plt>
  mov    0x18(%rsp),%rsi
  mov    0x14(%rsp),%r10d
  mov    0x10(%rsp),%r8d
  mov    0x8(%rsp),%rdx
  jmp    L252
  nopl   0x0(%rax)
L20:
  mov    %r13d,%eax
  shl    $0x8,%eax
  sub    %eax,%r10d
  test   %r14d,%r14d
  js     L174
  movslq 0x4(%rsp),%rax
  mov    0x20(%rsp),%rcx
  mov    %r8d,0x10(%rsp)
  mov    %r10d,0x8(%rsp)
  mov    %rax,0x28(%rsp)
  lea    (%rcx,%rax,8),%rsi
  movslq %r10d,%rax
  lea    (%rcx,%rax,8),%rdi
L144:
  mov    %r14d,%ecx
  mov    %r13d,%edx
  mov    $0xffffffff,%r15d
  call   <f@plt>
  mov    0x10(%rsp),%r8d
  mov    0x8(%rsp),%r10d
  lea    -0x1(%r8),%ebx
  mov    $0xffffffff,%r8d
  jmp    L264
  nopl   0x0(%rax)
L174:
  mov    %r14d,%eax
  mov    0x20(%rsp),%rdi
  mov    %r8d,0x10(%rsp)
  shl    $0x8,%eax
  sub    %eax,0x4(%rsp)
  movslq 0x4(%rsp),%rax
  mov    %r10d,0x8(%rsp)
  lea    (%rdi,%rax,8),%rsi
  mov    %rax,0x28(%rsp)
  movslq %r10d,%rax
  lea    (%rdi,%rax,8),%rdi
  jmp    L144
```

assistant: ```c
void __attribute__((weak, optimize("no-tree-vectorize"))) test(int n, int m, int offset) {
  int abs_n = (n < 0 ? -n : n);
  int abs_m = (m < 0 ? -m : m);
  int max_i = (abs_n > abs_m ? abs_n : abs_m);
  int abs_offset = (offset < 0 ? -offset : offset);
  int size = 6 * 2 + max_i * 257 + abs_offset;
  double *array = (double *)__builtin_alloca(size * sizeof(double));
  for (int i = 0; i < size; ++i)
    array[i] = i;
  int base_x = offset < 0 ? 6 - offset : 6;
  int base_y = offset < 0 ? 6 : 6 + offset;
  int start_x = n < 0 ? base_x - n * (257 - 1) : base_x;
  int start_y = m < 0 ? base_y - m * (257 - 1) : base_y;
  f(&array[start_x], &array[start_y], n, m);
  int j = 0;
  int start = (n < 0 ? size - 1 : 0);
  int end = (n < 0 ? -1 : size);
  int inc = (n < 0 ? -1 : 1);
  for (int i = start; i != end; i += inc) {
    if (j == 257 || i != start_x + j * n) {
      if (array[i] != i)
        abort();
    } else if (n == 0) {
      double sum = i;
      for (; j < 257; j++) {
        int next_y = start_y + j * m;
        if (n >= 0 ? next_y < i : next_y > i)
          sum += array[next_y];
        else if (next_y == i)
          sum += sum;
        else
          sum += next_y;
      }
      if (array[i] != sum)
        abort();
    } else {
      int next_y = start_y + j * m;
      double base = i;
      if (n >= 0 ? next_y < i : next_y > i)
        base += array[next_y];
      else
        base += next_y;
      if (array[i] != base)
        abort();
      j += 1;
    }
  }
}
```