user: What would the C source look like for the assembly code provided here?

```asm
<BRBase58CheckEncode>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %rcx,-0x60(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  movq   $0x0,-0x40(%rbp)
  mov    -0x60(%rbp),%rax
  add    $0x20,%rax
  mov    %rax,-0x38(%rbp)
  cmpq   $0x1000,-0x38(%rbp)
  ja     L132
  mov    -0x38(%rbp),%rax
  jmp    L102
L132:
  mov    $0x0,%eax
L102:
  mov    %rax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x30(%rbp)
  mov    %rax,%r10
  mov    $0x0,%r11d
  mov    %rax,%r8
  mov    $0x0,%r9d
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L28:
  cmp    %rdx,%rsp
  je     L12
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L28
L12:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L36
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L36:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x28(%rbp)
  cmpq   $0x1000,-0x38(%rbp)
  ja     L131
  mov    -0x28(%rbp),%rax
  jmp    L25
L131:
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <malloc@plt>
L25:
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  cmpq   $0x0,-0x58(%rbp)
  jne    L72
  cmpq   $0x0,-0x60(%rbp)
  jne    L1
L72:
  mov    $0x1,%eax
  jmp    L133
L1:
  mov    $0x0,%eax
L133:
  mov    %eax,%edi
  call   <assert@plt>
  cmpq   $0x0,-0x58(%rbp)
  jne    L70
  cmpq   $0x0,-0x60(%rbp)
  jne    L83
L70:
  mov    -0x60(%rbp),%rdx
  mov    -0x58(%rbp),%rcx
  mov    -0x20(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x60(%rbp),%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x60(%rbp),%rdx
  mov    -0x58(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <BRSHA256_2@plt>
  mov    -0x60(%rbp),%rax
  lea    0x4(%rax),%rcx
  mov    -0x20(%rbp),%rdx
  mov    -0x50(%rbp),%rsi
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <BRBase58Encode@plt>
  mov    %rax,-0x40(%rbp)
L83:
  mov    -0x38(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <mem_clean@plt>
  mov    -0x28(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  je     L91
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L91:
  mov    -0x40(%rbp),%rax
  mov    %rbx,%rsp
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L53
  call   <__stack_chk_fail@plt>
L53:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
size_t BRBase58CheckEncode(char *str, size_t strLen, const uint8_t *data, size_t dataLen) {
  size_t len = 0, bufLen = dataLen + 256 / 8;
  uint8_t _buf[(bufLen <= 0x1000) ? bufLen : 0], *buf = (bufLen <= 0x1000) ? _buf : malloc(bufLen);
  assert(buf != NULL);
  assert(data != NULL || dataLen == 0);
  if (data || dataLen == 0) {
    memcpy(buf, data, dataLen);
    BRSHA256_2(&buf[dataLen], data, dataLen);
    len = BRBase58Encode(str, strLen, buf, dataLen + 4);
  }
  mem_clean(buf, bufLen);
  if (buf != _buf)
    free(buf);
  return len;
}
```