user: Converte this assembly snippet into its equivalent C code:

```asm
<oncopy_4>:
  endbr64
  push   %r15
  mov    %rdx,%r9
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %esi,-0x28(%rsp)
  sar    $0x2,%esi
  mov    %edi,-0x24(%rsp)
  mov    %ecx,-0xc(%rsp)
  mov    %esi,-0x10(%rsp)
  test   %esi,%esi
  jle    L35
  mov    %edi,%r14d
  and    $0x3,%edi
  movslq %ecx,%rdx
  mov    %esi,%ebx
  sar    $0x2,%r14d
  mov    %edi,%r13d
  mov    %rdx,%r15
  mov    %r9,-0x8(%rsp)
  lea    -0x1(%r14),%eax
  lea    0x0(,%rdx,8),%r12
  mov    %r9,%r10
  shl    $0x4,%r15
  add    $0x1,%rax
  lea    0x0(,%rcx,4),%ebp
  lea    (%rdx,%rdx,2),%rdx
  mov    %rax,%r11
  shl    $0x7,%rax
  movslq %ebp,%rbp
  lea    0x0(,%rdx,8),%rdi
  mov    %rax,-0x20(%rsp)
  lea    -0x1(%r13),%eax
  shl    $0x5,%r11
  shl    $0x3,%rbp
  add    $0x1,%rax
  add    %r9,%r11
  mov    %rdi,%r9
  lea    0x0(,%rax,8),%rsi
  shl    $0x5,%rax
  mov    %rsi,-0x30(%rsp)
  mov    %rax,-0x18(%rsp)
  jmp    L160
  nopl   (%rax)
L73:
  test   %r13d,%r13d
  jne    L148
L69:
  add    %rbp,%r11
  sub    $0x1,%ebx
  je     L191
L160:
  lea    (%r12,%r10,1),%rcx
  lea    (%r10,%r15,1),%rsi
  mov    %r10,%rdx
  lea    (%r10,%r9,1),%rdi
  add    %rbp,%r10
  test   %r14d,%r14d
  jle    L73
  mov    %r8,%rax
  nop
L124:
  movsd  (%rdx),%xmm15
  movsd  0x8(%rdx),%xmm11
  add    $0x20,%rdx
  add    $0x20,%rcx
  movsd  (%rsi),%xmm13
  movsd  0x8(%rsi),%xmm9
  add    $0x20,%rdi
  add    $0x20,%rsi
  movsd  -0x10(%rdx),%xmm7
  movsd  -0x8(%rdx),%xmm3
  sub    $0xffffffffffffff80,%rax
  movsd  -0x20(%rcx),%xmm14
  movsd  -0x18(%rcx),%xmm10
  movsd  -0x10(%rcx),%xmm6
  movsd  -0x8(%rcx),%xmm2
  movsd  -0x10(%rsi),%xmm5
  movsd  -0x8(%rsi),%xmm1
  movsd  -0x20(%rdi),%xmm12
  movsd  -0x18(%rdi),%xmm8
  movsd  -0x10(%rdi),%xmm4
  movsd  -0x8(%rdi),%xmm0
  movsd  %xmm15,-0x80(%rax)
  movsd  %xmm14,-0x78(%rax)
  movsd  %xmm13,-0x70(%rax)
  movsd  %xmm12,-0x68(%rax)
  movsd  %xmm11,-0x60(%rax)
  movsd  %xmm10,-0x58(%rax)
  movsd  %xmm9,-0x50(%rax)
  movsd  %xmm8,-0x48(%rax)
  movsd  %xmm7,-0x40(%rax)
  movsd  %xmm6,-0x38(%rax)
  movsd  %xmm5,-0x30(%rax)
  movsd  %xmm4,-0x28(%rax)
  movsd  %xmm3,-0x20(%rax)
  movsd  %xmm2,-0x18(%rax)
  movsd  %xmm1,-0x10(%rax)
  movsd  %xmm0,-0x8(%rax)
  cmp    %r11,%rdx
  jne    L124
  lea    (%r12,%rdx,1),%rcx
  add    -0x20(%rsp),%r8
  lea    (%r12,%rcx,1),%rsi
  lea    (%r12,%rsi,1),%rdi
  test   %r13d,%r13d
  je     L69
L148:
  xor    %eax,%eax
L128:
  movsd  (%rdx,%rax,1),%xmm3
  movsd  (%rcx,%rax,1),%xmm2
  movsd  (%rsi,%rax,1),%xmm1
  movsd  (%rdi,%rax,1),%xmm0
  movsd  %xmm3,(%r8,%rax,4)
  movsd  %xmm2,0x8(%r8,%rax,4)
  movsd  %xmm1,0x10(%r8,%rax,4)
  movsd  %xmm0,0x18(%r8,%rax,4)
  add    $0x8,%rax
  cmp    -0x30(%rsp),%rax
  jne    L128
  add    -0x18(%rsp),%r8
  add    %rbp,%r11
  sub    $0x1,%ebx
  jne    L160
L191:
  movslq -0x10(%rsp),%rax
  mov    -0x8(%rsp),%r9
  imul   %rbp,%rax
  add    %rax,%r9
L35:
  testb  $0x2,-0x28(%rsp)
  je     L136
  movslq -0xc(%rsp),%rcx
  mov    -0x24(%rsp),%edi
  shl    $0x3,%rcx
  sar    $0x2,%edi
  lea    (%r9,%rcx,1),%r10
  add    %r10,%rcx
  test   %edi,%edi
  jle    L60
  movslq %edi,%rdi
  mov    %r8,%rax
  mov    %r10,%rdx
  mov    %rdi,%r11
  shl    $0x5,%r11
  lea    (%r9,%r11,1),%rsi
  nopl   0x0(%rax)
L54:
  movsd  (%r9),%xmm7
  movsd  0x8(%r9),%xmm5
  add    $0x20,%r9
  add    $0x20,%rdx
  movsd  -0x10(%r9),%xmm3
  movsd  -0x8(%r9),%xmm1
  add    $0x40,%rax
  movsd  -0x20(%rdx),%xmm6
  movsd  -0x18(%rdx),%xmm4
  movsd  -0x10(%rdx),%xmm2
  movsd  -0x8(%rdx),%xmm0
  movsd  %xmm7,-0x40(%rax)
  movsd  %xmm6,-0x38(%rax)
  movsd  %xmm5,-0x30(%rax)
  movsd  %xmm4,-0x28(%rax)
  movsd  %xmm3,-0x20(%rax)
  movsd  %xmm2,-0x18(%rax)
  movsd  %xmm1,-0x10(%rax)
  movsd  %xmm0,-0x8(%rax)
  cmp    %rsi,%r9
  jne    L54
  shl    $0x6,%rdi
  add    %r11,%r10
  add    %rdi,%r8
L60:
  mov    -0x24(%rsp),%eax
  and    $0x3,%eax
  je     L189
  movslq %eax,%rdx
  xor    %eax,%eax
  lea    0x0(,%rdx,8),%rsi
L165:
  movsd  (%r9,%rax,1),%xmm1
  movsd  (%r10,%rax,1),%xmm0
  movsd  %xmm1,(%r8,%rax,2)
  movsd  %xmm0,0x8(%r8,%rax,2)
  add    $0x8,%rax
  cmp    %rsi,%rax
  jne    L165
  mov    %rdx,%rax
  mov    %rcx,%r9
  shl    $0x4,%rax
  add    %rax,%r8
L136:
  testb  $0x1,-0x28(%rsp)
  je     L49
  mov    -0x24(%rsp),%eax
  sar    $0x2,%eax
  test   %eax,%eax
  jle    L123
  movslq %eax,%rcx
  mov    %r8,%rax
  shl    $0x5,%rcx
  lea    (%r9,%rcx,1),%rdx
  nop
L87:
  movsd  (%r9),%xmm3
  movsd  0x8(%r9),%xmm2
  add    $0x20,%r9
  add    $0x20,%rax
  movsd  -0x10(%r9),%xmm1
  movsd  -0x8(%r9),%xmm0
  movsd  %xmm3,-0x20(%rax)
  movsd  %xmm2,-0x18(%rax)
  movsd  %xmm1,-0x10(%rax)
  movsd  %xmm0,-0x8(%rax)
  cmp    %rdx,%r9
  jne    L87
  add    %rcx,%r8
L123:
  mov    -0x24(%rsp),%eax
  and    $0x3,%eax
  je     L49
  cltq
  xor    %edx,%edx
L161:
  movsd  (%r9,%rdx,8),%xmm0
  movsd  %xmm0,(%r8,%rdx,8)
  add    $0x1,%rdx
  cmp    %rax,%rdx
  jne    L161
L49:
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L189:
  mov    %rcx,%r9
  jmp    L136
```

assistant: ```c
int oncopy_4(int m, int n, const double *a, int lda, double *b) {
  int i, j;
  const double *a_offset, *a_offset1, *a_offset2, *a_offset3, *a_offset4;
  double *b_offset;
  double ctemp1, ctemp2, ctemp3, ctemp4;
  double ctemp5, ctemp6, ctemp7, ctemp8;
  double ctemp9, ctemp10, ctemp11, ctemp12;
  double ctemp13, ctemp14, ctemp15, ctemp16;
  a_offset = a;
  b_offset = b;
  j = (n >> 2);
  if (j > 0) {
    do {
      a_offset1 = a_offset;
      a_offset2 = a_offset1 + lda;
      a_offset3 = a_offset2 + lda;
      a_offset4 = a_offset3 + lda;
      a_offset += 4 * lda;
      i = (m >> 2);
      if (i > 0) {
        do {
          ctemp1 = *(a_offset1 + 0);
          ctemp2 = *(a_offset1 + 1);
          ctemp3 = *(a_offset1 + 2);
          ctemp4 = *(a_offset1 + 3);
          ctemp5 = *(a_offset2 + 0);
          ctemp6 = *(a_offset2 + 1);
          ctemp7 = *(a_offset2 + 2);
          ctemp8 = *(a_offset2 + 3);
          ctemp9 = *(a_offset3 + 0);
          ctemp10 = *(a_offset3 + 1);
          ctemp11 = *(a_offset3 + 2);
          ctemp12 = *(a_offset3 + 3);
          ctemp13 = *(a_offset4 + 0);
          ctemp14 = *(a_offset4 + 1);
          ctemp15 = *(a_offset4 + 2);
          ctemp16 = *(a_offset4 + 3);
          *(b_offset + 0) = ctemp1;
          *(b_offset + 1) = ctemp5;
          *(b_offset + 2) = ctemp9;
          *(b_offset + 3) = ctemp13;
          *(b_offset + 4) = ctemp2;
          *(b_offset + 5) = ctemp6;
          *(b_offset + 6) = ctemp10;
          *(b_offset + 7) = ctemp14;
          *(b_offset + 8) = ctemp3;
          *(b_offset + 9) = ctemp7;
          *(b_offset + 10) = ctemp11;
          *(b_offset + 11) = ctemp15;
          *(b_offset + 12) = ctemp4;
          *(b_offset + 13) = ctemp8;
          *(b_offset + 14) = ctemp12;
          *(b_offset + 15) = ctemp16;
          a_offset1 += 4;
          a_offset2 += 4;
          a_offset3 += 4;
          a_offset4 += 4;
          b_offset += 16;
          i--;
        } while (i > 0);
      }
      i = (m & 3);
      if (i > 0) {
        do {
          ctemp1 = *(a_offset1 + 0);
          ctemp5 = *(a_offset2 + 0);
          ctemp9 = *(a_offset3 + 0);
          ctemp13 = *(a_offset4 + 0);
          *(b_offset + 0) = ctemp1;
          *(b_offset + 1) = ctemp5;
          *(b_offset + 2) = ctemp9;
          *(b_offset + 3) = ctemp13;
          a_offset1++;
          a_offset2++;
          a_offset3++;
          a_offset4++;
          b_offset += 4;
          i--;
        } while (i > 0);
      }
      j--;
    } while (j > 0);
  }
  if (n & 2) {
    a_offset1 = a_offset;
    a_offset2 = a_offset1 + lda;
    a_offset += 2 * lda;
    i = (m >> 2);
    if (i > 0) {
      do {
        ctemp1 = *(a_offset1 + 0);
        ctemp2 = *(a_offset1 + 1);
        ctemp3 = *(a_offset1 + 2);
        ctemp4 = *(a_offset1 + 3);
        ctemp5 = *(a_offset2 + 0);
        ctemp6 = *(a_offset2 + 1);
        ctemp7 = *(a_offset2 + 2);
        ctemp8 = *(a_offset2 + 3);
        *(b_offset + 0) = ctemp1;
        *(b_offset + 1) = ctemp5;
        *(b_offset + 2) = ctemp2;
        *(b_offset + 3) = ctemp6;
        *(b_offset + 4) = ctemp3;
        *(b_offset + 5) = ctemp7;
        *(b_offset + 6) = ctemp4;
        *(b_offset + 7) = ctemp8;
        a_offset1 += 4;
        a_offset2 += 4;
        b_offset += 8;
        i--;
      } while (i > 0);
    }
    i = (m & 3);
    if (i > 0) {
      do {
        ctemp1 = *(a_offset1 + 0);
        ctemp5 = *(a_offset2 + 0);
        *(b_offset + 0) = ctemp1;
        *(b_offset + 1) = ctemp5;
        a_offset1++;
        a_offset2++;
        b_offset += 2;
        i--;
      } while (i > 0);
    }
  }
  if (n & 1) {
    a_offset1 = a_offset;
    i = (m >> 2);
    if (i > 0) {
      do {
        ctemp1 = *(a_offset1 + 0);
        ctemp2 = *(a_offset1 + 1);
        ctemp3 = *(a_offset1 + 2);
        ctemp4 = *(a_offset1 + 3);
        *(b_offset + 0) = ctemp1;
        *(b_offset + 1) = ctemp2;
        *(b_offset + 2) = ctemp3;
        *(b_offset + 3) = ctemp4;
        a_offset1 += 4;
        b_offset += 4;
        i--;
      } while (i > 0);
    }
    i = (m & 3);
    if (i > 0) {
      do {
        ctemp1 = *(a_offset1 + 0);
        *(b_offset + 0) = ctemp1;
        a_offset1++;
        b_offset += 1;
        i--;
      } while (i > 0);
    }
  }
  return 0;
}
```