user: Translate the below assembly code into C programming language:

```asm
<make_decoder_ref>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    (%rdi),%rbp
  lea    0x10(%rbp),%rax
  mov    %rax,(%rdi)
  cmpb   $0x0,0xf(%rbp)
  jne    L354
  cmpb   $0x0,0xe(%rbp)
  jne    L0
  cmpb   $0x0,0xd(%rbp)
  jne    L295
  cmpb   $0x0,0xc(%rbp)
  jne    L24
  cmpb   $0x0,0xb(%rbp)
  jne    L287
  cmpb   $0x0,0xa(%rbp)
  jne    L303
  cmpb   $0x0,0x9(%rbp)
  jne    L196
  cmpb   $0x0,0x8(%rbp)
  jne    L181
  cmpb   $0x0,0x7(%rbp)
  jne    L39
  cmpb   $0x0,0x6(%rbp)
  jne    L106
  cmpb   $0x0,0x5(%rbp)
  jne    L144
  cmpb   $0x0,0x4(%rbp)
  jne    L377
  cmpb   $0x0,0x3(%rbp)
  jne    L46
  cmpb   $0x0,0x2(%rbp)
  jne    L230
  cmpb   $0x0,0x1(%rbp)
  jne    L304
  cmpb   $0x0,0x0(%rbp)
  jne    L292
  mov    $0x2,%esi
  mov    $0x2,%edi
  call   <calloc@plt>
  lea    D17(%rip),%rsi
  mov    %rax,%rdi
  mov    %rax,%r14
  call   <merror@plt>
  xor    %eax,%eax
  mov    %ax,(%r14)
L145:
  add    $0x8,%rsp
  mov    %r14,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L354:
  mov    $0x10,%r13d
L206:
  mov    %r13d,%ecx
  mov    $0x1,%ebx
  mov    $0x2,%esi
  shl    %cl,%ebx
  lea    0x1(%rbx),%edi
  call   <calloc@plt>
  lea    D17(%rip),%rsi
  mov    %rax,%r14
  mov    %rax,%rdi
  call   <merror@plt>
  mov    %r13w,(%r14)
  lea    0x1(%r13),%r10d
  mov    $0x1,%r9d
  mov    $0x1,%eax
  nopw   0x0(%rax,%rax,1)
L219:
  cmpb   $0x0,-0x1(%rbp,%r9,1)
  je     L38
  mov    %r13d,%ecx
  mov    $0x1,%r8d
  mov    %r9d,%edi
  mov    (%r12),%rsi
  sub    %r9d,%ecx
  shl    $0x8,%edi
  xor    %r11d,%r11d
  shl    %cl,%r8d
  nopl   0x0(%rax)
L120:
  xor    %edx,%edx
L161:
  cmp    %eax,%ebx
  jge    L71
L136:
  add    $0x1,%rsi
  add    $0x1,%r11d
  mov    %rsi,(%r12)
  movzbl -0x1(%rbp,%r9,1),%edx
  cmp    %r11d,%edx
  jg     L120
L38:
  add    $0x1,%r9
  cmp    %r10,%r9
  jne    L219
  jmp    L145
  nopl   0x0(%rax,%rax,1)
L71:
  movzbl (%rsi),%r15d
  lea    0x1(%rax),%ecx
  add    $0x1,%edx
  or     %edi,%r15d
  mov    %r15w,(%r14,%rax,2)
  movslq %ecx,%rax
  cmp    %r8d,%edx
  jne    L161
  jmp    L136
L0:
  mov    $0xf,%r13d
  jmp    L206
L144:
  mov    $0x6,%r13d
  jmp    L206
L106:
  mov    $0x7,%r13d
  jmp    L206
L39:
  mov    $0x8,%r13d
  jmp    L206
L181:
  mov    $0x9,%r13d
  jmp    L206
L196:
  mov    $0xa,%r13d
  jmp    L206
L303:
  mov    $0xb,%r13d
  jmp    L206
L287:
  mov    $0xc,%r13d
  jmp    L206
L24:
  mov    $0xd,%r13d
  jmp    L206
L295:
  mov    $0xe,%r13d
  jmp    L206
L377:
  mov    $0x5,%r13d
  jmp    L206
L46:
  mov    $0x4,%r13d
  jmp    L206
L230:
  mov    $0x3,%r13d
  jmp    L206
L304:
  mov    $0x2,%r13d
  jmp    L206
L292:
  mov    $0x1,%r13d
  jmp    L206
```

tool_calls: name: disassemble_data
arguments: data_label: D17
datatype: string

tool: D17: make_decoder()

assistant: ```c
unsigned short *make_decoder_ref(const unsigned char **source) {
  int max, len, h, i, j;
  const unsigned char *count;
  unsigned short *huff;
  count = (*source += 16) - 17;
  for (max = 16; max && !count[max]; max--)
    ;
  huff = (unsigned short *)calloc(1 + (1 << max), sizeof *huff);
  merror(huff, "make_decoder()");
  huff[0] = max;
  for (h = len = 1; len <= max; len++)
    for (i = 0; i < count[len]; i++, ++*source)
      for (j = 0; j < 1 << (max - len); j++)
        if (h <= 1 << max)
          huff[h++] = len << 8 | **source;
  return huff;
}
```