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

```asm
<make_decode_table>:
  endbr64
  push   %r15
  mov    %edi,%r11d
  mov    %rcx,%rdi
  mov    %esi,%ecx
  push   %r14
  xor    %r9d,%r9d
  mov    $0x1,%r10d
  mov    $0x1,%r14d
  push   %r13
  mov    $0x1,%r13d
  push   %r12
  shl    %cl,%r13d
  mov    %esi,%r12d
  push   %rbp
  mov    %r13d,%eax
  push   %rbx
  shr    %eax
  mov    %rdx,%rbx
  mov    %eax,%ebp
  mov    %eax,-0x4(%rsp)
  test   %esi,%esi
  je     L12
L253:
  mov    %r14d,%r8d
  mov    %r10d,%ecx
  xor    %esi,%esi
  shl    %cl,%r8d
  movzwl %r8w,%r8d
  test   %r11d,%r11d
  jne    L108
  jmp    L211
  nopl   (%rax)
L207:
  add    $0x1,%esi
  movzwl %si,%eax
  cmp    %r11d,%eax
  jae    L211
L108:
  movzwl %si,%eax
  cmp    %r10b,(%rbx,%rax,1)
  jne    L207
  movzbl %r10b,%edx
  mov    %r12d,%ecx
  mov    %r9d,%eax
  sub    %edx,%ecx
  shr    %cl,%eax
  mov    %eax,%ecx
  xor    %eax,%eax
  cs nopw 0x0(%rax,%rax,1)
L158:
  mov    %ecx,%r15d
  add    %eax,%eax
  shr    %ecx
  and    $0x1,%r15d
  or     %r15d,%eax
  sub    $0x1,%edx
  jne    L158
  add    %ebp,%r9d
  cmp    %r9d,%r13d
  jb     L127
  mov    %ebp,%edx
  nopl   0x0(%rax)
L111:
  mov    %eax,%ecx
  add    %r8d,%eax
  mov    %si,(%rdi,%rcx,2)
  sub    $0x1,%edx
  jne    L111
  add    $0x1,%esi
  movzwl %si,%eax
  cmp    %r11d,%eax
  jb     L108
L211:
  add    $0x1,%r10d
  shr    %ebp
  movzbl %r10b,%eax
  cmp    %r12d,%eax
  jbe    L253
L12:
  xor    %eax,%eax
  cmp    %r9d,%r13d
  je     L189
  movzwl %r9w,%edx
  mov    %r9d,%r8d
  cmp    %edx,%r13d
  jbe    L128
  nopl   0x0(%rax,%rax,1)
L163:
  mov    %r12d,%ecx
  xor    %eax,%eax
  nopl   (%rax)
L212:
  mov    %edx,%esi
  add    %eax,%eax
  shr    %edx
  and    $0x1,%esi
  or     %esi,%eax
  sub    $0x1,%ecx
  jne    L212
  mov    $0xffffffff,%edx
  add    $0x1,%r8d
  mov    %dx,(%rdi,%rax,2)
  movzwl %r8w,%edx
  cmp    %r13d,%edx
  jb     L163
L128:
  mov    -0x4(%rsp),%eax
  lea    0x1(%r12),%r10d
  cmp    %r11d,%eax
  cmovb  %r11d,%eax
  shl    $0x10,%r9d
  shl    $0x10,%r13d
  mov    %eax,%esi
  cmp    $0x10,%r10b
  ja     L38
  lea    0xf(%r12),%r8d
  movzbl %r10b,%eax
  mov    $0x8000,%ebp
  sub    %eax,%r8d
L87:
  xor    %edx,%edx
  test   %r11d,%r11d
  jne    L66
  jmp    L72
  nop
L244:
  add    $0x1,%edx
  movzwl %dx,%eax
  cmp    %r11d,%eax
  jae    L72
L66:
  movzwl %dx,%eax
  cmp    %r10b,(%rbx,%rax,1)
  jne    L244
  mov    %r9d,%r14d
  mov    %r12d,%ecx
  xor    %eax,%eax
  shr    $0x10,%r14d
  nopl   0x0(%rax)
L6:
  mov    %r14d,%r15d
  add    %eax,%eax
  shr    %r14d
  and    $0x1,%r15d
  or     %r15d,%eax
  sub    $0x1,%ecx
  jne    L6
  cmp    $0xf,%r8d
  je     L210
  mov    $0xf,%ecx
  jmp    L101
  nopl   0x0(%rax)
L232:
  add    %r14d,%r14d
L130:
  mov    %r9d,%eax
  shr    %cl,%eax
  sub    $0x1,%ecx
  and    $0x1,%eax
  or     %r14d,%eax
  cmp    %ecx,%r8d
  je     L210
L101:
  lea    (%rdi,%rax,2),%rax
  movzwl (%rax),%r14d
  cmp    $0xffff,%r14w
  jne    L232
  movzwl %si,%r14d
  add    %r14d,%r14d
  movslq %r14d,%r15
  movw   $0xffff,(%rdi,%r15,2)
  movw   $0xffff,0x2(%rdi,%r15,2)
  mov    %si,(%rax)
  add    $0x1,%esi
  jmp    L130
  cs nopw 0x0(%rax,%rax,1)
L210:
  add    %ebp,%r9d
  mov    %dx,(%rdi,%rax,2)
  cmp    %r9d,%r13d
  jae    L244
L127:
  mov    $0x1,%eax
L189:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L72:
  add    $0x1,%r10d
  shr    %ebp
  sub    $0x1,%r8d
  cmp    $0x11,%r10b
  jne    L87
L38:
  xor    %eax,%eax
  cmp    %r9d,%r13d
  setne  %al
  jmp    L189
```

assistant: ```c
int make_decode_table(unsigned int nsyms, unsigned int nbits, unsigned char *length, unsigned short *table) {
  register unsigned int leaf, reverse, fill;
  register unsigned short sym, next_sym;
  register unsigned char bit_num;
  unsigned int pos = 0;
  unsigned int table_mask = 1 << nbits;
  unsigned int bit_mask = table_mask >> 1;
  for (bit_num = 1; bit_num <= nbits; bit_num++) {
    for (sym = 0; sym < nsyms; sym++) {
      if (length[sym] != bit_num)
        continue;
      fill = length[sym];
      reverse = pos >> (nbits - fill);
      leaf = 0;
      do {
        leaf <<= 1;
        leaf |= reverse & 1;
        reverse >>= 1;
      } while (--fill);
      if ((pos += bit_mask) > table_mask)
        return 1;
      fill = bit_mask;
      next_sym = 1 << bit_num;
      do {
        table[leaf] = sym;
        leaf += next_sym;
      } while (--fill);
    }
    bit_mask >>= 1;
  }
  if (pos == table_mask)
    return 0;
  for (sym = pos; sym < table_mask; sym++) {
    reverse = sym;
    leaf = 0;
    fill = nbits;
    do {
      leaf <<= 1;
      leaf |= reverse & 1;
      reverse >>= 1;
    } while (--fill);
    table[leaf] = 0xFFFF;
  }
  next_sym = ((table_mask >> 1) < nsyms) ? nsyms : (table_mask >> 1);
  pos <<= 16;
  table_mask <<= 16;
  bit_mask = 1 << 15;
  for (bit_num = nbits + 1; bit_num <= (16); bit_num++) {
    for (sym = 0; sym < nsyms; sym++) {
      if (length[sym] != bit_num)
        continue;
      reverse = pos >> 16;
      leaf = 0;
      fill = nbits;
      do {
        leaf <<= 1;
        leaf |= reverse & 1;
        reverse >>= 1;
      } while (--fill);
      for (fill = 0; fill < (bit_num - nbits); fill++) {
        if (table[leaf] == 0xFFFF) {
          table[(next_sym << 1)] = 0xFFFF;
          table[(next_sym << 1) + 1] = 0xFFFF;
          table[leaf] = next_sym++;
        }
        leaf = (table[leaf] << 1) | ((pos >> (15 - fill)) & 1);
      }
      table[leaf] = sym;
      if ((pos += bit_mask) > table_mask)
        return 1;
    }
    bit_mask >>= 1;
  }
  return (pos != table_mask) ? 1 : 0;
}
```