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

```asm
<quatVectLoopf>:
  endbr64
  push   %r15
  mov    %rsi,%r10
  mov    %rcx,%rax
  push   %r14
  xor    %r14d,%r14d
  push   %r13
  mov    %r9d,%r13d
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0xa8,%rsp
  mov    %fs:0x28,%rdx
  mov    %rdx,0x98(%rsp)
  xor    %edx,%edx
  cmp    $0x1,%rcx
  setne  %r14b
  lea    0x0(,%r14,4),%rdx
  cmp    $0x1,%r8
  je     L163
  cmp    $0x1,%rcx
  jbe    L119
  cmp    $0x1,%r8
  jbe    L119
  movq   $0x3,0x8(%rsp)
  cmp    %r8,%rcx
  cmovbe %rcx,%r8
  mov    %r8,(%rsp)
L153:
  mov    %r10,0x20(%rsp)
  lea    0x50(%rsp),%rbp
  xor    %r8d,%r8d
  xor    %r9d,%r9d
  mov    %r13d,0x2c(%rsp)
  lea    0x0(,%rdx,4),%rax
  lea    0x30(%rsp),%r15
  mov    %rbp,%rdx
  mov    %rax,0x10(%rsp)
  mov    (%rsp),%rax
  mov    %r8,%r13
  mov    %r9,%rbp
  lea    0x70(%rsp),%r14
  lea    (%rax,%rax,2),%rax
  mov    %rax,0x18(%rsp)
  xchg   %ax,%ax
L11:
  mov    0x20(%rsp),%rax
  lea    (%rax,%r13,4),%rcx
  xor    %eax,%eax
L70:
  pxor   %xmm0,%xmm0
  cvtss2sd (%rcx,%rax,4),%xmm0
  movsd  %xmm0,(%r15,%rax,8)
  add    $0x1,%rax
  cmp    $0x3,%rax
  jne    L70
  xor    %eax,%eax
L144:
  pxor   %xmm0,%xmm0
  cvtss2sd (%r12,%rax,4),%xmm0
  movsd  %xmm0,(%r14,%rax,8)
  add    $0x1,%rax
  cmp    $0x4,%rax
  jne    L144
  mov    0x2c(%rsp),%ecx
  mov    %r15,%rsi
  mov    %r14,%rdi
  mov    %rdx,(%rsp)
  call   <quatVector@plt>
  mov    (%rsp),%rdx
  xor    %eax,%eax
L61:
  pxor   %xmm0,%xmm0
  cvtsd2ss (%rdx,%rax,8),%xmm0
  movss  %xmm0,(%rbx,%rax,4)
  add    $0x1,%rax
  cmp    $0x3,%rax
  jne    L61
  add    $0x3,%rbp
  add    $0xc,%rbx
  add    0x10(%rsp),%r12
  add    0x8(%rsp),%r13
  cmp    0x18(%rsp),%rbp
  jne    L11
L47:
  mov    0x98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L36
  add    $0xa8,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L163:
  movq   $0x0,0x8(%rsp)
L177:
  cmp    %r8,%rax
  mov    %r8,%rsi
  cmovae %rax,%rsi
  cmp    $0x1,%rsi
  mov    %rsi,(%rsp)
  seta   %cl
  cmp    $0x1,%rax
  jne    L213
  test   %cl,%cl
  je     L213
  mov    0x8(%rsp),%rax
  pxor   %xmm0,%xmm0
  lea    0x30(%rsp),%r15
  xor    %r8d,%r8d
  cvtss2sd (%r12),%xmm0
  movsd  %xmm0,0x70(%rsp)
  pxor   %xmm0,%xmm0
  lea    0x50(%rsp),%rbp
  shl    $0x2,%rax
  mov    %r13d,0x10(%rsp)
  lea    0x70(%rsp),%r14
  mov    %rbp,%r13
  cvtss2sd 0x4(%r12),%xmm0
  mov    %rax,0x8(%rsp)
  mov    %r15,%rbp
  mov    %rbx,%r15
  movsd  %xmm0,0x78(%rsp)
  pxor   %xmm0,%xmm0
  mov    %r8,%rbx
  cvtss2sd 0x8(%r12),%xmm0
  movsd  %xmm0,0x80(%rsp)
  pxor   %xmm0,%xmm0
  cvtss2sd 0xc(%r12),%xmm0
  mov    %r10,%r12
  movsd  %xmm0,0x88(%rsp)
  nopl   (%rax)
L88:
  xor    %eax,%eax
L146:
  pxor   %xmm0,%xmm0
  cvtss2sd (%r12,%rax,4),%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,8)
  add    $0x1,%rax
  cmp    $0x3,%rax
  jne    L146
  mov    0x10(%rsp),%ecx
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <quatVector@plt>
  xor    %eax,%eax
L164:
  pxor   %xmm0,%xmm0
  cvtsd2ss 0x0(%r13,%rax,8),%xmm0
  movss  %xmm0,(%r15,%rax,4)
  add    $0x1,%rax
  cmp    $0x3,%rax
  jne    L164
  add    $0x1,%rbx
  add    $0xc,%r15
  add    0x8(%rsp),%r12
  cmp    %rbx,(%rsp)
  ja     L88
  jmp    L47
L213:
  cmp    $0x1,%r8
  jne    L90
  test   %cl,%cl
  je     L90
  pxor   %xmm0,%xmm0
  lea    0x0(,%rdx,4),%rax
  lea    0x50(%rsp),%rbp
  xor    %r8d,%r8d
  cvtss2sd (%r10),%xmm0
  mov    %rax,0x8(%rsp)
  lea    0x70(%rsp),%r14
  lea    0x30(%rsp),%r15
  movsd  %xmm0,0x30(%rsp)
  pxor   %xmm0,%xmm0
  cvtss2sd 0x4(%r10),%xmm0
  movsd  %xmm0,0x38(%rsp)
  pxor   %xmm0,%xmm0
  mov    %r13d,0x10(%rsp)
  cvtss2sd 0x8(%r10),%xmm0
  mov    %rbp,%r13
  mov    %r14,%rbp
  movsd  %xmm0,0x40(%rsp)
  mov    %rbx,%r14
  mov    %r8,%rbx
  nopl   0x0(%rax)
L65:
  xor    %eax,%eax
L219:
  pxor   %xmm0,%xmm0
  cvtss2sd (%r12,%rax,4),%xmm0
  movsd  %xmm0,0x0(%rbp,%rax,8)
  add    $0x1,%rax
  cmp    $0x4,%rax
  jne    L219
  mov    0x10(%rsp),%ecx
  mov    %r13,%rdx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <quatVector@plt>
  xor    %eax,%eax
L202:
  pxor   %xmm0,%xmm0
  cvtsd2ss 0x0(%r13,%rax,8),%xmm0
  movss  %xmm0,(%r14,%rax,4)
  add    $0x1,%rax
  cmp    $0x3,%rax
  jne    L202
  add    $0x1,%rbx
  add    $0xc,%r14
  add    0x8(%rsp),%r12
  cmp    %rbx,(%rsp)
  ja     L65
  jmp    L47
L119:
  movq   $0x3,0x8(%rsp)
  jmp    L177
L90:
  cmpq   $0x0,(%rsp)
  je     L47
  jmp    L153
L36:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int quatVectLoopf(float *q, float *v, float *vout, unsigned long long nq, unsigned long long nv, int p) {
  unsigned long long i, j, qstep, vstep, voutstep, n, istep;
  int trash;
  double qtemp[4], vtemp[3], vouttemp[3];
  voutstep = 3;
  qstep = (nq == 1) ? 0 : 4;
  vstep = (nv == 1) ? 0 : 3;
  if ((nq > 1) && (nv > 1)) {
    n = (nq <= nv) ? nq : nv;
  } else {
    n = (nq >= nv) ? nq : nv;
  }
  if ((nq == 1) && (n > 1)) {
#pragma omp parallel shared(q, v, vout) private(i, j, trash, qtemp, vtemp, vouttemp) firstprivate(qstep, vstep, voutstep, n, p)
    {
      for (j = 0; j < 4; j++)
        qtemp[j] = (double)q[j];
#pragma omp for schedule(static) nowait
      for (i = 0; i < n; i++) {
        for (j = 0; j < 3; j++)
          vtemp[j] = (double)v[i * vstep + j];
        trash = quatVector(qtemp, vtemp, vouttemp, p);
        for (j = 0; j < 3; j++)
          vout[i * voutstep + j] = (float)vouttemp[j];
      }
    }
  } else if ((nv == 1) && n > 1) {
#pragma omp parallel shared(q, v, vout) private(i, j, trash, qtemp, vtemp, vouttemp) firstprivate(qstep, vstep, voutstep, n, p)
    {
      for (j = 0; j < 3; j++)
        vtemp[j] = (double)v[j];
#pragma omp for schedule(static) nowait
      for (i = 0; i < n; i++) {
        for (j = 0; j < 4; j++)
          qtemp[j] = (double)q[i * qstep + j];
        trash = quatVector(qtemp, vtemp, vouttemp, p);
        for (j = 0; j < 3; j++)
          vout[i * voutstep + j] = (float)vouttemp[j];
      }
    }
  } else {
#pragma omp parallel shared(q, v, vout) private(i, j, trash, qtemp, vtemp, vouttemp) firstprivate(qstep, vstep, voutstep, n, p)
    {
#pragma omp for schedule(static) nowait
      for (i = 0; i < n; i++) {
        for (j = 0; j < 3; j++) {
          vtemp[j] = (double)v[i * vstep + j];
        }
        for (j = 0; j < 4; j++) {
          qtemp[j] = (double)q[i * qstep + j];
        }
        trash = quatVector(qtemp, vtemp, vouttemp, p);
        for (j = 0; j < 3; j++)
          vout[i * voutstep + j] = (float)vouttemp[j];
      }
    }
  }
  return 1;
}
```