user: 请将以下的汇编代码转换成C语言代码:

```asm
<ERR_put_error>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %edx,-0x2c(%rbp)
  mov    %rcx,-0x38(%rbp)
  mov    %r8d,-0x30(%rbp)
  mov    $0x0,%eax
  call   <ERR_get_state@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%edx
  mov    D2(%rip),%rax
  mov    (%rax),%ecx
  mov    %edx,%eax
  cltd
  idiv   %ecx
  mov    -0x18(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x18(%rbp),%rax
  mov    0x4(%rax),%eax
  cmp    %eax,%edx
  jne    L29
  mov    -0x18(%rbp),%rax
  mov    0x4(%rax),%eax
  lea    0x1(%rax),%edx
  mov    D2(%rip),%rax
  mov    (%rax),%ecx
  mov    %edx,%eax
  cltd
  idiv   %ecx
  mov    -0x18(%rbp),%rax
  mov    %edx,0x4(%rax)
L29:
  mov    -0x18(%rbp),%rax
  mov    0x28(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  cltq
  shl    $0x2,%rax
  lea    (%rdx,%rax,1),%rbx
  mov    -0x2c(%rbp),%edx
  mov    -0x28(%rbp),%ecx
  mov    -0x24(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <ERR_PACK@plt>
  mov    %eax,(%rbx)
  mov    -0x18(%rbp),%rax
  mov    0x8(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  cltq
  shl    $0x3,%rax
  add    %rax,%rdx
  mov    -0x38(%rbp),%rax
  mov    %rax,(%rdx)
  mov    -0x18(%rbp),%rax
  mov    0x10(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  cltq
  shl    $0x2,%rax
  add    %rax,%rdx
  mov    -0x30(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x18(%rbp),%rax
  mov    0x20(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L8
  mov    -0x18(%rbp),%rax
  mov    0x18(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    D26(%rip),%rax
  mov    (%rax),%eax
  and    %edx,%eax
  test   %eax,%eax
  je     L8
  mov    -0x18(%rbp),%rax
  mov    0x20(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <Free@plt>
  mov    -0x18(%rbp),%rax
  mov    0x20(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movq   $0x0,(%rax)
L8:
  mov    -0x18(%rbp),%rax
  mov    0x18(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  nop
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
void ERR_put_error(int lib, int func, int reason, const char *file, int line) {
  ERR_STATE *es;
  es = ERR_get_state();
  es->top = (es->top + 1) % ERR_NUM_ERRORS;
  if (es->top == es->bottom)
    es->bottom = (es->bottom + 1) % ERR_NUM_ERRORS;
  es->err_buffer[es->top] = ERR_PACK(lib, func, reason);
  es->err_file[es->top] = file;
  es->err_line[es->top] = line;
  if (((es)->err_data[es->top] != NULL) && (es)->err_data_flags[es->top] & ERR_TXT_MALLOCED) {
    Free((es)->err_data[es->top]);
    (es)->err_data[es->top] = NULL;
  }
  (es)->err_data_flags[es->top] = 0;
  ;
}
```