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

```asm
<str_of_bn>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  mov    %rdx,%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x8(%rsp)
  movq   $0x0,0x10(%rsp)
  movq   $0x0,(%rsi)
  call   <BN_is_zero@plt>
  test   %rax,%rax
  je     L43
  mov    $0x4,%edi
  call   <malloc@plt>
  mov    %rax,0x0(%rbp)
  mov    $0x0,%edx
  test   %rax,%rax
  je     L98
  mov    %rax,0x8(%rsp)
  lea    0x8(%rsp),%rdi
  mov    $0x0,%esi
  call   <write_u32@plt>
  movq   $0x4,(%r12)
  mov    $0x1,%edx
L98:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L17
  mov    %edx,%eax
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L43:
  mov    %rbx,%rdi
  call   <BN_is_negative@plt>
  mov    $0x0,%edx
  test   %rax,%rax
  jne    L98
  mov    %rbx,%rdi
  call   <BN_num_bytes@plt>
  lea    0x5(%rax),%r13d
  movslq %r13d,%r13
  mov    $0x0,%edx
  cmp    $0x5,%r13
  jbe    L98
  mov    %r13,%rdi
  call   <malloc@plt>
  mov    %rax,0x0(%rbp)
  mov    $0x0,%edx
  test   %rax,%rax
  je     L98
  mov    %rax,0x8(%rsp)
  lea    -0x4(%r13),%rsi
  lea    0x8(%rsp),%rdi
  call   <write_u32@plt>
  mov    0x8(%rsp),%rax
  movb   $0x0,(%rax)
  mov    0x8(%rsp),%rax
  lea    0x1(%rax),%rsi
  mov    %rbx,%rdi
  call   <BN_bn2bin@plt>
  test   %eax,%eax
  jle    L22
  lea    -0x5(%r13),%rbx
  cltq
  cmp    %rbx,%rax
  je     L63
L22:
  mov    0x0(%rbp),%rdi
  call   <free@plt>
  movq   $0x0,0x0(%rbp)
  mov    $0x0,%edx
  jmp    L98
L63:
  mov    0x8(%rsp),%rax
  cmpb   $0x0,0x1(%rax)
  js     L64
  lea    -0x1(%r13),%r14
  mov    %r14,%rdi
  call   <malloc@plt>
  mov    %rax,0x8(%rsp)
  test   %rax,%rax
  je     L97
  mov    %rax,0x10(%rsp)
  lea    0x10(%rsp),%rdi
  mov    %rbx,%rsi
  call   <write_u32@plt>
  mov    0x0(%rbp),%rax
  lea    0x5(%rax),%rsi
  mov    %rbx,%rdx
  mov    0x10(%rsp),%rdi
  call   <memcpy@plt>
  mov    %r13,%rsi
  mov    0x0(%rbp),%rdi
  call   <_explicit_bzero@plt>
  mov    0x0(%rbp),%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rax
  mov    %rax,0x0(%rbp)
  mov    %r14,(%r12)
  mov    $0x1,%edx
  jmp    L98
L64:
  mov    %r13,(%r12)
  mov    $0x1,%edx
  jmp    L98
L97:
  mov    %r13,%rsi
  mov    0x0(%rbp),%rdi
  call   <_explicit_bzero@plt>
  mov    0x0(%rbp),%rdi
  call   <free@plt>
  movq   $0x0,0x0(%rbp)
  mov    $0x0,%edx
  jmp    L98
L17:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int str_of_bn(const BIGNUM *bn, char **dst, size_t *dst_len) {
  int wtn = 0;
  char *ptr = NULL, *ptr2 = NULL;
  size_t len = 0;
  *dst = NULL;
  if (BN_is_zero(bn)) {
    ;
    *dst = (char *)malloc(4);
    if (!*dst)
      return 0;
    ptr = *dst;
    write_u32(&ptr, 0u);
    *dst_len = 4;
    return 1;
  };
  if (BN_is_negative(bn)) {
    ;
    return 0;
  }
  len = 4 + BN_num_bytes(bn) + 1;
  ;
  if (len < 6)
    return 0;
  *dst = (char *)malloc(len);
  if (!*dst) {
    ;
    return 0;
  }
  ptr = *dst;
  write_u32(&ptr, len - 4);
  ptr[0] = 0;
  wtn = BN_bn2bin(bn, (unsigned char *)ptr + 1);
  ;
  if (wtn <= 0 || (size_t)wtn != len - 5) {
    ;
    free(*dst);
    *dst = NULL;
    return 0;
  }
  if ((unsigned char)(ptr[1]) & 0x80) {
    ;
    *dst_len = len;
    return 1;
  };
  ptr = (char *)malloc(len - 1);
  if (!ptr) {
    ;
    _explicit_bzero(*dst, len);
    free(*dst);
    *dst = NULL;
    return 0;
  }
  ptr2 = ptr;
  write_u32(&ptr2, len - 5);
  memcpy(ptr2, *dst + 5, len - 5);
  ;
  _explicit_bzero(*dst, len);
  free(*dst);
  *dst = ptr;
  *dst_len = len - 1;
  return 1;
}
```