user: Please show me the C implementation that matches the assembly code listed below:

```asm
<sumGTRCATPROT>:
  endbr64
  mov    %edi,%eax
  push   %r13
  mov    %rcx,%rdi
  push   %r12
  push   %rbp
  push   %rbx
  mov    0x28(%rsp),%r10
  movslq 0x30(%rsp),%rbx
  cmp    $0x1,%eax
  je     L97
  cmp    $0x2,%eax
  je     L100
  test   %eax,%eax
  je     L37
  pop    %rbx
  xor    %edi,%edi
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    1050 <assert@plt>
L97:
  test   %ebx,%ebx
  jle    L45
  lea    (%rbx,%rbx,4),%rbp
  mov    %rsi,%rdx
  lea    0x8(%rcx),%rcx
  xor    %r11d,%r11d
  shl    $0x2,%rbp
  mov    $0xa0,%r10d
  xor    %ebx,%ebx
  xchg   %ax,%ax
L29:
  movzbl (%r9),%r12d
  mov    %r12,%rax
  lea    (%r12,%r12,4),%r12d
  lea    (%rax,%rax,4),%rax
  shl    $0x2,%r12d
  shl    $0x5,%rax
  movslq %r12d,%r12
  lea    0x8(%r8,%rax,1),%r13
  cmp    %r13,%rdx
  je     L44
  cmp    %rcx,%rdx
  je     L44
  add    %r8,%rax
  movupd -0x8(%rcx),%xmm4
  movupd (%rax),%xmm0
  mulpd  %xmm4,%xmm0
  movups %xmm0,(%rdx)
  movupd 0x8(%rcx),%xmm5
  movupd 0x10(%rax),%xmm0
  mulpd  %xmm5,%xmm0
  movups %xmm0,0x10(%rdx)
  movupd 0x18(%rcx),%xmm6
  movupd 0x20(%rax),%xmm0
  mulpd  %xmm6,%xmm0
  movups %xmm0,0x20(%rdx)
  movupd 0x30(%rax),%xmm0
  movupd 0x28(%rcx),%xmm7
  mulpd  %xmm7,%xmm0
  movups %xmm0,0x30(%rdx)
  movupd 0x40(%rax),%xmm0
  movupd 0x38(%rcx),%xmm1
  mulpd  %xmm1,%xmm0
  movups %xmm0,0x40(%rdx)
  movupd 0x50(%rax),%xmm0
  movupd 0x48(%rcx),%xmm2
  mulpd  %xmm2,%xmm0
  movups %xmm0,0x50(%rdx)
  movupd 0x60(%rax),%xmm0
  movupd 0x58(%rcx),%xmm3
  mulpd  %xmm3,%xmm0
  movups %xmm0,0x60(%rdx)
  movupd 0x70(%rax),%xmm0
  movupd 0x68(%rcx),%xmm4
  mulpd  %xmm4,%xmm0
  movups %xmm0,0x70(%rdx)
  movupd 0x80(%rax),%xmm0
  movupd 0x78(%rcx),%xmm5
  mulpd  %xmm5,%xmm0
  movups %xmm0,0x80(%rdx)
  movupd 0x90(%rax),%xmm0
  movupd 0x88(%rcx),%xmm6
  mulpd  %xmm6,%xmm0
  movups %xmm0,0x90(%rdx)
L216:
  add    $0x14,%r11
  add    $0x1,%r9
  add    $0xa0,%rdx
  add    $0xa0,%rcx
  sub    $0xa0,%rbx
  add    $0xa0,%r10
  cmp    %rbp,%r11
  jne    L29
L45:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L44:
  lea    (%rbx,%r12,8),%r12
  lea    -0xa0(%r10),%rax
  add    %r8,%r12
  nopw   0x0(%rax,%rax,1)
L124:
  movsd  (%rdi,%rax,1),%xmm0
  mulsd  (%r12,%rax,1),%xmm0
  movsd  %xmm0,(%rsi,%rax,1)
  add    $0x8,%rax
  cmp    %r10,%rax
  jne    L124
  jmp    L216
L37:
  test   %ebx,%ebx
  jle    L45
  mov    %rsi,%rdx
  movslq %ebx,%rdi
  xor    %esi,%esi
  nopw   0x0(%rax,%rax,1)
L65:
  movzbl (%r9,%rsi,1),%eax
  movzbl (%r10,%rsi,1),%r11d
  mov    %rax,%rcx
  lea    (%rax,%rax,4),%ebx
  mov    %r11,%rax
  lea    (%rax,%rax,4),%rax
  lea    (%r11,%r11,4),%r11d
  shl    $0x2,%ebx
  shl    $0x5,%rax
  shl    $0x2,%r11d
  lea    (%rcx,%rcx,4),%rcx
  movslq %ebx,%rbx
  lea    0x8(%r8,%rax,1),%rbp
  movslq %r11d,%r11
  shl    $0x5,%rcx
  cmp    %rbp,%rdx
  je     L74
  lea    0x8(%r8,%rcx,1),%rbp
  cmp    %rbp,%rdx
  je     L74
  add    %r8,%rcx
  add    %r8,%rax
  movupd (%rax),%xmm2
  movupd (%rcx),%xmm0
  mulpd  %xmm2,%xmm0
  movups %xmm0,(%rdx)
  movupd 0x10(%rcx),%xmm3
  movupd 0x10(%rax),%xmm0
  mulpd  %xmm3,%xmm0
  movups %xmm0,0x10(%rdx)
  movupd 0x20(%rax),%xmm0
  movupd 0x20(%rcx),%xmm4
  mulpd  %xmm4,%xmm0
  movups %xmm0,0x20(%rdx)
  movupd 0x30(%rax),%xmm0
  movupd 0x30(%rcx),%xmm5
  mulpd  %xmm5,%xmm0
  movups %xmm0,0x30(%rdx)
  movupd 0x40(%rcx),%xmm0
  movupd 0x40(%rax),%xmm6
  mulpd  %xmm6,%xmm0
  movups %xmm0,0x40(%rdx)
  movupd 0x50(%rcx),%xmm0
  movupd 0x50(%rax),%xmm7
  mulpd  %xmm7,%xmm0
  movups %xmm0,0x50(%rdx)
  movupd 0x60(%rax),%xmm1
  movupd 0x60(%rcx),%xmm0
  mulpd  %xmm1,%xmm0
  movups %xmm0,0x60(%rdx)
  movupd 0x70(%rcx),%xmm0
  movupd 0x70(%rax),%xmm2
  mulpd  %xmm2,%xmm0
  movups %xmm0,0x70(%rdx)
  movupd 0x80(%rcx),%xmm0
  movupd 0x80(%rax),%xmm3
  mulpd  %xmm3,%xmm0
  movups %xmm0,0x80(%rdx)
  movupd 0x90(%rax),%xmm0
  movupd 0x90(%rcx),%xmm1
  mulpd  %xmm1,%xmm0
  movups %xmm0,0x90(%rdx)
L115:
  add    $0x1,%rsi
  add    $0xa0,%rdx
  cmp    %rsi,%rdi
  jne    L65
  jmp    L45
L74:
  lea    (%r8,%rbx,8),%rbx
  lea    (%r8,%r11,8),%rcx
  xor    %eax,%eax
  nopl   0x0(%rax)
L183:
  movsd  (%rcx,%rax,1),%xmm0
  mulsd  (%rbx,%rax,1),%xmm0
  movsd  %xmm0,(%rdx,%rax,1)
  add    $0x8,%rax
  cmp    $0xa0,%rax
  jne    L183
  jmp    L115
L100:
  test   %ebx,%ebx
  jle    L45
  lea    -0x1(%rbx),%eax
  mov    %rdx,%r11
  mov    %rsi,%rdx
  mov    $0xa0,%r9d
  lea    (%rax,%rax,4),%r10
  lea    0x8(%r11),%rcx
  shl    $0x5,%r10
  lea    0x8(%rdi),%r8
  add    $0x140,%r10
  cmp    %rcx,%rdx
  je     L194
  nopl   0x0(%rax)
L157:
  cmp    %r8,%rdx
  je     L194
  movupd -0x8(%r8),%xmm7
  movupd -0x8(%rcx),%xmm0
  mulpd  %xmm7,%xmm0
  movups %xmm0,(%rdx)
  movupd 0x8(%r8),%xmm1
  movupd 0x8(%rcx),%xmm0
  mulpd  %xmm1,%xmm0
  movups %xmm0,0x10(%rdx)
  movupd 0x18(%r8),%xmm2
  movupd 0x18(%rcx),%xmm0
  mulpd  %xmm2,%xmm0
  movups %xmm0,0x20(%rdx)
  movupd 0x28(%rcx),%xmm0
  movupd 0x28(%r8),%xmm3
  mulpd  %xmm3,%xmm0
  movups %xmm0,0x30(%rdx)
  movupd 0x38(%rcx),%xmm0
  movupd 0x38(%r8),%xmm4
  mulpd  %xmm4,%xmm0
  movups %xmm0,0x40(%rdx)
  movupd 0x48(%rcx),%xmm0
  movupd 0x48(%r8),%xmm5
  mulpd  %xmm5,%xmm0
  movups %xmm0,0x50(%rdx)
  movupd 0x58(%rcx),%xmm0
  movupd 0x58(%r8),%xmm6
  mulpd  %xmm6,%xmm0
  movups %xmm0,0x60(%rdx)
  movupd 0x68(%rcx),%xmm0
  movupd 0x68(%r8),%xmm7
  mulpd  %xmm7,%xmm0
  movups %xmm0,0x70(%rdx)
  movupd 0x78(%rcx),%xmm0
  movupd 0x78(%r8),%xmm1
  mulpd  %xmm1,%xmm0
  movups %xmm0,0x80(%rdx)
  movupd 0x88(%rcx),%xmm0
  movupd 0x88(%r8),%xmm2
  mulpd  %xmm2,%xmm0
  movups %xmm0,0x90(%rdx)
L86:
  add    $0xa0,%r9
  add    $0xa0,%rdx
  add    $0xa0,%rcx
  add    $0xa0,%r8
  cmp    %r10,%r9
  je     L45
  cmp    %rcx,%rdx
  jne    L157
L194:
  lea    -0xa0(%r9),%rax
  nop
L206:
  movsd  (%r11,%rax,1),%xmm0
  mulsd  (%rdi,%rax,1),%xmm0
  movsd  %xmm0,(%rsi,%rax,1)
  add    $0x8,%rax
  cmp    %r9,%rax
  jne    L206
  jmp    L86
```

assistant: ```c
void sumGTRCATPROT(int tipCase, double *sumtable, double *x1, double *x2, double *tipVector, unsigned char *tipX1, unsigned char *tipX2, int n) {
  int i, l;
  double *sum, *left, *right;
  switch (tipCase) {
  case 0:
    for (i = 0; i < n; i++) {
      left = &(tipVector[20 * tipX1[i]]);
      right = &(tipVector[20 * tipX2[i]]);
      sum = &sumtable[20 * i];
      for (l = 0; l < 20; l++)
        sum[l] = left[l] * right[l];
    }
    break;
  case 1:
    for (i = 0; i < n; i++) {
      left = &(tipVector[20 * tipX1[i]]);
      right = &x2[20 * i];
      sum = &sumtable[20 * i];
      for (l = 0; l < 20; l++)
        sum[l] = left[l] * right[l];
    }
    break;
  case 2:
    for (i = 0; i < n; i++) {
      left = &x1[20 * i];
      right = &x2[20 * i];
      sum = &sumtable[20 * i];
      for (l = 0; l < 20; l++)
        sum[l] = left[l] * right[l];
    }
    break;
  default:
    assert(0);
  }
}
```