user: 这段汇编代码用C语言表示是什么样的：

```asm
<HuffmanCodeLengthsToCodes>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x90,%rsp
  mov    %rdi,%rbp
  mov    %esi,%ebx
  mov    %rdx,%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  movq   $0x0,(%rsp)
  movq   $0x0,0x8(%rsp)
  movq   $0x0,0x10(%rsp)
  movq   $0x0,0x18(%rsp)
  movq   $0x0,0x20(%rsp)
  movq   $0x0,0x28(%rsp)
  movq   $0x0,0x30(%rsp)
  movq   $0x0,0x38(%rsp)
  movq   $0x0,0x40(%rsp)
  movq   $0x0,0x48(%rsp)
  movq   $0x0,0x50(%rsp)
  movq   $0x0,0x58(%rsp)
  movq   $0x0,0x60(%rsp)
  movq   $0x0,0x68(%rsp)
  movq   $0x0,0x70(%rsp)
  movq   $0x0,0x78(%rsp)
  test   %rdi,%rdi
  setne  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  test   %ebx,%ebx
  setg   %dil
  movzbl %dil,%edi
  call   <assert@plt>
  test   %r12,%r12
  setne  %dil
  movzbl %dil,%edi
  call   <assert@plt>
  test   %ebx,%ebx
  jle    L39
  mov    %rbp,%rsi
  lea    -0x1(%rbx),%eax
  lea    0x4(%rbp,%rax,4),%rdi
  mov    %rbp,%rax
  mov    $0x0,%ecx
L47:
  mov    (%rax),%edx
  cmp    %edx,%ecx
  cmovl  %edx,%ecx
  add    $0x4,%rax
  cmp    %rdi,%rax
  jne    L47
  mov    $0x0,%eax
  cmp    $0xf,%ecx
  jg     L100
L118:
  movslq (%rsi),%rax
  addl   $0x1,(%rsp,%rax,4)
  add    $0x4,%rsi
  cmp    %rdi,%rsi
  jne    L118
  movl   $0x0,(%rsp)
  movl   $0xffffffff,0x40(%rsp)
  mov    %ecx,%esi
  mov    $0x0,%edx
  mov    $0x0,%eax
  test   %ecx,%ecx
  jle    L36
L35:
  add    (%rsp,%rdx,4),%eax
  add    %eax,%eax
  mov    %eax,0x44(%rsp,%rdx,4)
  add    $0x1,%rdx
  cmp    %rsi,%rdx
  jne    L35
L36:
  mov    %ebx,%ebx
  mov    $0x0,%eax
  jmp    L48
L117:
  movl   $0xffffffff,(%r12,%rax,4)
L27:
  add    $0x1,%rax
  cmp    %rbx,%rax
  je     L59
L48:
  mov    0x0(%rbp,%rax,4),%edx
  test   %edx,%edx
  jle    L117
  movslq %edx,%rdx
  mov    0x40(%rsp,%rdx,4),%ecx
  lea    0x1(%rcx),%esi
  mov    %esi,0x40(%rsp,%rdx,4)
  mov    %ecx,(%r12,%rax,4)
  jmp    L27
L59:
  mov    $0x1,%eax
L100:
  mov    0x88(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L90
  add    $0x90,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L39:
  mov    $0x1,%eax
  jmp    L100
L90:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int HuffmanCodeLengthsToCodes(const int *const code_lengths, int code_lengths_size, int *const huff_codes) {
  int symbol;
  int code_len;
  int code_length_hist[15 + 1] = {0};
  int curr_code;
  int next_codes[15 + 1] = {0};
  int max_code_length = 0;
  assert(code_lengths != NULL);
  assert(code_lengths_size > 0);
  assert(huff_codes != NULL);
  for (symbol = 0; symbol < code_lengths_size; ++symbol) {
    if (code_lengths[symbol] > max_code_length) {
      max_code_length = code_lengths[symbol];
    }
  }
  if (max_code_length > 15)
    return 0;
  for (symbol = 0; symbol < code_lengths_size; ++symbol) {
    ++code_length_hist[code_lengths[symbol]];
  }
  code_length_hist[0] = 0;
  curr_code = 0;
  next_codes[0] = -1;
  for (code_len = 1; code_len <= max_code_length; ++code_len) {
    curr_code = (curr_code + code_length_hist[code_len - 1]) << 1;
    next_codes[code_len] = curr_code;
  }
  for (symbol = 0; symbol < code_lengths_size; ++symbol) {
    if (code_lengths[symbol] > 0) {
      huff_codes[symbol] = next_codes[code_lengths[symbol]]++;
    } else {
      huff_codes[symbol] = (-1);
    }
  }
  return 1;
}
```