user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<sumGAMMAPROT>:
  endbr64
  mov    %edi,%eax
  push   %r13
  mov    %rdx,%rdi
  mov    %rcx,%rdx
  push   %r12
  push   %rbp
  push   %rbx
  mov    0x28(%rsp),%rbx
  movslq 0x30(%rsp),%r13
  cmp    $0x1,%eax
  je     L70
  cmp    $0x2,%eax
  je     L24
  test   %eax,%eax
  je     L132
  pop    %rbx
  xor    %edi,%edi
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    1050 <assert@plt>
L70:
  test   %r13d,%r13d
  jle    L118
  lea    -0x1(%r13),%eax
  mov    %r9,%r10
  xor    %ebx,%ebx
  mov    $0xa0,%ebp
  lea    0x1(%r9,%rax,1),%r12
  xor    %r9d,%r9d
  xchg   %ax,%ax
L46:
  movzbl (%r10),%eax
  mov    %rbp,%rdi
  lea    0x50(%r9),%r11
  sub    %rbx,%rdi
  lea    (%rax,%rax,4),%eax
  shl    $0x2,%eax
  cltq
  lea    (%rbx,%rax,8),%rcx
  add    %r8,%rcx
L29:
  lea    0x0(,%r9,8),%rax
  nopl   (%rax)
L27:
  movsd  (%rcx,%rax,1),%xmm0
  mulsd  (%rdx,%rax,1),%xmm0
  movsd  %xmm0,(%rsi,%rax,1)
  add    $0x8,%rax
  cmp    %rax,%rdi
  jne    L27
  add    $0x14,%r9
  sub    $0xa0,%rcx
  add    $0xa0,%rdi
  cmp    %r9,%r11
  jne    L29
  add    $0x1,%r10
  sub    $0x280,%rbx
  cmp    %r10,%r12
  je     L118
  mov    %r11,%r9
  jmp    L46
L132:
  test   %r13d,%r13d
  jle    L118
  mov    %rsi,%r12
  xor    %ebp,%ebp
  xor    %esi,%esi
  nopl   0x0(%rax)
L84:
  movzbl (%r9,%rsi,1),%eax
  mov    %r12,%rdx
  mov    %rbp,%r10
  lea    (%rax,%rax,4),%eax
  shl    $0x2,%eax
  cltq
  lea    (%r8,%rax,8),%rdi
  movzbl (%rbx,%rsi,1),%eax
  add    $0x1,%rsi
  lea    (%rsi,%rsi,4),%r11
  lea    (%rax,%rax,4),%eax
  shl    $0x4,%r11
  shl    $0x2,%eax
  cltq
  lea    (%r8,%rax,8),%rcx
L143:
  xor    %eax,%eax
  nopl   (%rax)
L163:
  movsd  (%rdi,%rax,1),%xmm0
  mulsd  (%rcx,%rax,1),%xmm0
  movsd  %xmm0,(%rdx,%rax,1)
  add    $0x8,%rax
  cmp    $0xa0,%rax
  jne    L163
  add    $0x14,%r10
  add    $0xa0,%rdx
  cmp    %r10,%r11
  jne    L143
  add    $0x50,%rbp
  add    $0x280,%r12
  cmp    %r13,%rsi
  jne    L84
L118:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L24:
  test   %r13d,%r13d
  jle    L118
  lea    0x0(%r13,%r13,4),%r11
  mov    $0xa0,%r10d
  xor    %r8d,%r8d
  shl    $0x4,%r11
  nopl   0x0(%rax)
L110:
  mov    %r10,%rcx
  lea    0x50(%r8),%r9
L10:
  lea    0x0(,%r8,8),%rax
  nopw   0x0(%rax,%rax,1)
L53:
  movsd  (%rdi,%rax,1),%xmm0
  mulsd  (%rdx,%rax,1),%xmm0
  movsd  %xmm0,(%rsi,%rax,1)
  add    $0x8,%rax
  cmp    %rax,%rcx
  jne    L53
  add    $0x14,%r8
  add    $0xa0,%rcx
  cmp    %r8,%r9
  jne    L10
  add    $0x280,%r10
  cmp    %r11,%r9
  je     L118
  mov    %r9,%r8
  jmp    L110
```

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);
  }
}
```