user: 请从给定的汇编指令推导出C源代码:

```asm
<str_of_bn>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x24(%rbp)
  movq   $0x0,-0x20(%rbp)
  movq   $0x0,-0x18(%rbp)
  movq   $0x0,-0x10(%rbp)
  mov    -0x40(%rbp),%rax
  movq   $0x0,(%rax)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <BN_is_zero@plt>
  test   %rax,%rax
  je     L172
  mov    $0x4,%edi
  call   <malloc@plt>
  mov    %rax,%rdx
  mov    -0x40(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L92
  mov    $0x0,%eax
  jmp    L93
L92:
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x20(%rbp)
  lea    -0x20(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <write_u32@plt>
  mov    -0x48(%rbp),%rax
  movq   $0x4,(%rax)
  mov    $0x1,%eax
  jmp    L93
L172:
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <BN_is_negative@plt>
  test   %rax,%rax
  je     L63
  mov    $0x0,%eax
  jmp    L93
L63:
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <BN_num_bytes@plt>
  add    $0x5,%eax
  cltq
  mov    %rax,-0x10(%rbp)
  cmpq   $0x5,-0x10(%rbp)
  ja     L161
  mov    $0x0,%eax
  jmp    L93
L161:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,%rdx
  mov    -0x40(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L26
  mov    $0x0,%eax
  jmp    L93
L26:
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x10(%rbp),%rax
  lea    -0x4(%rax),%rdx
  lea    -0x20(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <write_u32@plt>
  mov    -0x20(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x20(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <BN_bn2bin@plt>
  mov    %eax,-0x24(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  jle    L78
  mov    -0x24(%rbp),%eax
  cltq
  mov    -0x10(%rbp),%rdx
  sub    $0x5,%rdx
  cmp    %rdx,%rax
  je     L42
L78:
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x40(%rbp),%rax
  movq   $0x0,(%rax)
  mov    $0x0,%eax
  jmp    L93
L42:
  mov    -0x20(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jns    L97
  mov    -0x48(%rbp),%rax
  mov    -0x10(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    $0x1,%eax
  jmp    L93
L97:
  mov    -0x10(%rbp),%rax
  sub    $0x1,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  test   %rax,%rax
  jne    L60
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x10(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <_explicit_bzero@plt>
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x40(%rbp),%rax
  movq   $0x0,(%rax)
  mov    $0x0,%eax
  jmp    L93
L60:
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x10(%rbp),%rax
  lea    -0x5(%rax),%rdx
  lea    -0x18(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <write_u32@plt>
  mov    -0x10(%rbp),%rax
  lea    -0x5(%rax),%rdx
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  lea    0x5(%rax),%rcx
  mov    -0x18(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x10(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <_explicit_bzero@plt>
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x20(%rbp),%rdx
  mov    -0x40(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x10(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x48(%rbp),%rax
  mov    %rdx,(%rax)
  mov    $0x1,%eax
L93:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L4
  call   <__stack_chk_fail@plt>
L4:
  leave
  ret
```

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;
}
```