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

```asm
<sumGAMMAPROT>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%eax
  mov    %rdx,%rdi
  mov    %rcx,%rdx
  mov    0x30(%rsp),%rbx
  cmp    $0x1,%eax
  je     L186
  cmp    $0x2,%eax
  je     L83
  test   %eax,%eax
  je     L86
  mov    $0x0,%edi
  call   <assert@plt>
L128:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L83:
  cmpl   $0x0,0x38(%rsp)
  jle    L128
  mov    0x38(%rsp),%eax
  lea    (%rax,%rax,4),%r11
  shl    $0x4,%r11
  mov    $0xa0,%r10d
  mov    $0x0,%r9d
  jmp    L41
L186:
  cmpl   $0x0,0x38(%rsp)
  jle    L128
  mov    %r9,%rbx
  mov    0x38(%rsp),%eax
  lea    -0x1(%rax),%eax
  lea    0x1(%r9,%rax,1),%r12
  mov    $0x0,%r10d
  mov    $0x0,%r11d
  mov    $0xa0,%ebp
  jmp    L169
L86:
  cmpl   $0x0,0x38(%rsp)
  jle    L128
  mov    %rsi,%r12
  mov    0x38(%rsp),%r13d
  mov    $0x0,%ebp
  mov    $0x0,%esi
  jmp    L208
L34:
  add    $0x50,%rbp
  add    $0x280,%r12
  cmp    %rsi,%r13
  je     L128
L208:
  movzbl (%r9,%rsi,1),%eax
  lea    (%rax,%rax,4),%eax
  shl    $0x2,%eax
  cltq
  lea    (%r8,%rax,8),%rdi
  movzbl (%rbx,%rsi,1),%eax
  lea    (%rax,%rax,4),%eax
  shl    $0x2,%eax
  cltq
  lea    (%r8,%rax,8),%rcx
  add    $0x1,%rsi
  lea    (%rsi,%rsi,4),%r11
  shl    $0x4,%r11
  mov    %r12,%rdx
  mov    %rbp,%r10
L48:
  mov    $0x0,%eax
L26:
  movsd  (%rdi,%rax,1),%xmm0
  mulsd  (%rcx,%rax,1),%xmm0
  movsd  %xmm0,(%rdx,%rax,1)
  add    $0x8,%rax
  cmp    $0xa0,%rax
  jne    L26
  add    $0x14,%r10
  add    $0xa0,%rdx
  cmp    %r11,%r10
  jne    L48
  jmp    L34
L206:
  add    $0x1,%rbx
  sub    $0x280,%r11
  cmp    %r12,%rbx
  je     L128
L169:
  movzbl (%rbx),%eax
  lea    (%rax,%rax,4),%eax
  shl    $0x2,%eax
  cltq
  lea    (%r11,%rax,8),%rcx
  add    %r8,%rcx
  mov    %rbp,%rdi
  sub    %r11,%rdi
  mov    %r10,%r9
  add    $0x50,%r10
L162:
  lea    0x0(,%r9,8),%rax
L17:
  movsd  (%rcx,%rax,1),%xmm0
  mulsd  (%rdx,%rax,1),%xmm0
  movsd  %xmm0,(%rsi,%rax,1)
  add    $0x8,%rax
  cmp    %rdi,%rax
  jne    L17
  sub    $0xa0,%rcx
  add    $0x14,%r9
  add    $0xa0,%rdi
  cmp    %r10,%r9
  jne    L162
  jmp    L206
L176:
  add    $0x280,%r10
  cmp    %r9,%r11
  je     L128
L41:
  mov    %r10,%rcx
  mov    %r9,%r8
  add    $0x50,%r9
L2:
  lea    0x0(,%r8,8),%rax
L113:
  movsd  (%rdi,%rax,1),%xmm0
  mulsd  (%rdx,%rax,1),%xmm0
  movsd  %xmm0,(%rsi,%rax,1)
  add    $0x8,%rax
  cmp    %rcx,%rax
  jne    L113
  add    $0x14,%r8
  add    $0xa0,%rcx
  cmp    %r9,%r8
  jne    L2
  jmp    L176
```

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