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

```asm
<sumCATMULT>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    %r8,-0x48(%rbp)
  mov    %r9,-0x50(%rbp)
  cmpl   $0x2,-0x24(%rbp)
  je     L130
  cmpl   $0x2,-0x24(%rbp)
  jg     L88
  cmpl   $0x0,-0x24(%rbp)
  je     L79
  cmpl   $0x1,-0x24(%rbp)
  je     L14
  jmp    L88
L79:
  mov    0x20(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  jmp    L120
L46:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %ecx,%eax
  shl    $0x2,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x14(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %ecx,%eax
  shl    $0x2,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x8(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm1
  mov    -0x8(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm1
  mov    -0x8(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  cltq
  add    $0x2,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm1
  mov    -0x8(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm0
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  cltq
  add    $0x3,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x18(%rbp)
L120:
  mov    -0x18(%rbp),%eax
  cmp    0x28(%rbp),%eax
  jl     L46
  jmp    L40
L14:
  mov    0x20(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  jmp    L65
L76:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  shl    $0x4,%eax
  mov    %eax,%ecx
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  add    %ecx,%eax
  shl    $0x2,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x8(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm1
  mov    -0x8(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm1
  mov    -0x8(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  cltq
  add    $0x2,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm1
  mov    -0x8(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm0
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  cltq
  add    $0x3,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x18(%rbp)
L65:
  mov    -0x18(%rbp),%eax
  cmp    0x28(%rbp),%eax
  jl     L76
  jmp    L40
L130:
  mov    0x20(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  jmp    L33
L123:
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x8(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm1
  mov    -0x8(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm0
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm1
  mov    -0x8(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm0
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  cltq
  add    $0x2,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x10(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm1
  mov    -0x8(%rbp),%rax
  add    $0x18,%rax
  movsd  (%rax),%xmm0
  mov    -0x18(%rbp),%eax
  shl    $0x2,%eax
  cltq
  add    $0x3,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x18(%rbp)
L33:
  mov    -0x18(%rbp),%eax
  cmp    0x28(%rbp),%eax
  jl     L123
  jmp    L40
L88:
  mov    $0x0,%edi
  call   <assert@plt>
  nop
L40:
  nop
  leave
  ret
```

assistant: ```c
void sumCATMULT(int tipCase, double *sum, double *x1_start, double *x2_start, double *tipVector, char *tipX1, char *tipX2, int *modelptr, int loopStart, int n) {
  double *x1, *x2;
  int i, model;
  switch (tipCase) {
  case 0:
    for (i = loopStart; i < n; i++) {
      model = modelptr[i];
      x1 = &(tipVector[model * 64 + tipX1[i] * 4]);
      x2 = &(tipVector[model * 64 + tipX2[i] * 4]);
      sum[i * 4] = x1[0] * x2[0];
      sum[i * 4 + 1] = x1[1] * x2[1];
      sum[i * 4 + 2] = x1[2] * x2[2];
      sum[i * 4 + 3] = x1[3] * x2[3];
    }
    break;
  case 1:
    for (i = loopStart; i < n; i++) {
      model = modelptr[i];
      x1 = &(tipVector[model * 64 + 4 * tipX1[i]]);
      x2 = &x2_start[4 * i];
      sum[i * 4] = x1[0] * x2[0];
      sum[i * 4 + 1] = x1[1] * x2[1];
      sum[i * 4 + 2] = x1[2] * x2[2];
      sum[i * 4 + 3] = x1[3] * x2[3];
    }
    break;
  case 2:
    for (i = loopStart; i < n; i++) {
      x1 = &x1_start[4 * i];
      x2 = &x2_start[4 * i];
      sum[i * 4] = x1[0] * x2[0];
      sum[i * 4 + 1] = x1[1] * x2[1];
      sum[i * 4 + 2] = x1[2] * x2[2];
      sum[i * 4 + 3] = x1[3] * x2[3];
    }
    break;
  default:
    assert(0);
  }
}
```