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

```asm
<decode_refalt_rev>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  mov    %rsi,%r13
  mov    %rdx,%rbp
  mov    %rcx,%r12
  mov    %r8,%r14
  mov    %edi,%eax
  sar    $0x1b,%eax
  and    $0xf,%eax
  mov    %rax,(%rdx)
  mov    %edi,%eax
  sar    $0x17,%eax
  and    $0xf,%eax
  mov    %rax,(%r8)
  cmpq   $0xa,(%rdx)
  ja     L1
  lea    D16(%rip),%rdx
  mov    0x0(%rbp),%rax
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0x3,%esi
  call   <decode_base@plt>
  mov    %al,0x9(%r13)
  mov    $0x5,%esi
  mov    %ebx,%edi
  call   <decode_base@plt>
  mov    %al,0x8(%r13)
  mov    $0x7,%esi
  mov    %ebx,%edi
  call   <decode_base@plt>
  mov    %al,0x7(%r13)
  mov    $0x9,%esi
  mov    %ebx,%edi
  call   <decode_base@plt>
  mov    %al,0x6(%r13)
  mov    $0xb,%esi
  mov    %ebx,%edi
  call   <decode_base@plt>
  mov    %al,0x5(%r13)
  mov    $0xd,%esi
  mov    %ebx,%edi
  call   <decode_base@plt>
  mov    %al,0x4(%r13)
  mov    $0xf,%esi
  mov    %ebx,%edi
  call   <decode_base@plt>
  mov    %al,0x3(%r13)
  mov    $0x11,%esi
  mov    %ebx,%edi
  call   <decode_base@plt>
  mov    %al,0x2(%r13)
  mov    $0x13,%esi
  mov    %ebx,%edi
  call   <decode_base@plt>
  mov    %al,0x1(%r13)
  mov    $0x15,%esi
  mov    %ebx,%edi
  call   <decode_base@plt>
  mov    %al,0x0(%r13)
L1:
  mov    0x0(%rbp),%rax
  movb   $0x0,0x0(%r13,%rax,1)
  mov    0x0(%rbp),%eax
  lea    (%rax,%rax,1),%r13d
  cmpq   $0xa,(%r14)
  ja     L16
  lea    D14(%rip),%rdx
  mov    (%r14),%rax
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  mov    $0x3,%esi
  sub    %r13d,%esi
  mov    %ebx,%edi
  call   <decode_base@plt>
  mov    %al,0x9(%r12)
  mov    $0x5,%esi
  sub    %r13d,%esi
  mov    %ebx,%edi
  call   <decode_base@plt>
  mov    %al,0x8(%r12)
  mov    $0x7,%esi
  sub    %r13d,%esi
  mov    %ebx,%edi
  call   <decode_base@plt>
  mov    %al,0x7(%r12)
  mov    $0x9,%esi
  sub    %r13d,%esi
  mov    %ebx,%edi
  call   <decode_base@plt>
  mov    %al,0x6(%r12)
  mov    $0xb,%esi
  sub    %r13d,%esi
  mov    %ebx,%edi
  call   <decode_base@plt>
  mov    %al,0x5(%r12)
  mov    $0xd,%esi
  sub    %r13d,%esi
  mov    %ebx,%edi
  call   <decode_base@plt>
  mov    %al,0x4(%r12)
  mov    $0xf,%esi
  sub    %r13d,%esi
  mov    %ebx,%edi
  call   <decode_base@plt>
  mov    %al,0x3(%r12)
  mov    $0x11,%esi
  sub    %r13d,%esi
  mov    %ebx,%edi
  call   <decode_base@plt>
  mov    %al,0x2(%r12)
  mov    $0x13,%esi
  sub    %r13d,%esi
  mov    %ebx,%edi
  call   <decode_base@plt>
  mov    %al,0x1(%r12)
  mov    $0x15,%esi
  sub    %r13d,%esi
  mov    %ebx,%edi
  call   <decode_base@plt>
  mov    %al,(%r12)
L16:
  mov    (%r14),%rax
  movb   $0x0,(%r12,%rax,1)
  mov    (%r14),%rax
  add    0x0(%rbp),%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

assistant: ```c
size_t decode_refalt_rev(uint32_t code, char *ref, size_t *sizeref, char *alt, size_t *sizealt) {
  *sizeref = (size_t)((code & 0x78000000) >> 27);
  *sizealt = (size_t)((code & 0x07800000) >> 23);
  switch (*sizeref) {
  case 10:
    ref[9] = decode_base(code, (3 + (2 * 0)));
  case 9:
    ref[8] = decode_base(code, (3 + (2 * 1)));
  case 8:
    ref[7] = decode_base(code, (3 + (2 * 2)));
  case 7:
    ref[6] = decode_base(code, (3 + (2 * 3)));
  case 6:
    ref[5] = decode_base(code, (3 + (2 * 4)));
  case 5:
    ref[4] = decode_base(code, (3 + (2 * 5)));
  case 4:
    ref[3] = decode_base(code, (3 + (2 * 6)));
  case 3:
    ref[2] = decode_base(code, (3 + (2 * 7)));
  case 2:
    ref[1] = decode_base(code, (3 + (2 * 8)));
  case 1:
    ref[0] = decode_base(code, (3 + (2 * 9)));
  }
  ref[*sizeref] = 0;
  uint8_t bitpos = (23 - ((*sizeref) << 1));
  switch (*sizealt) {
  case 10:
    alt[9] = decode_base(code, bitpos - (2 * 10));
  case 9:
    alt[8] = decode_base(code, bitpos - (2 * 9));
  case 8:
    alt[7] = decode_base(code, bitpos - (2 * 8));
  case 7:
    alt[6] = decode_base(code, bitpos - (2 * 7));
  case 6:
    alt[5] = decode_base(code, bitpos - (2 * 6));
  case 5:
    alt[4] = decode_base(code, bitpos - (2 * 5));
  case 4:
    alt[3] = decode_base(code, bitpos - (2 * 4));
  case 3:
    alt[2] = decode_base(code, bitpos - (2 * 3));
  case 2:
    alt[1] = decode_base(code, bitpos - (2 * 2));
  case 1:
    alt[0] = decode_base(code, bitpos - (2 * 1));
  }
  alt[*sizealt] = 0;
  return (*sizeref + *sizealt);
}
```