user: What is the c source code of the assembly code below?

```asm
<ERR_error_string_n>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xf8,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%rbx
  mov    %rdx,%r13
  mov    %fs:0x28,%rax
  mov    %rax,0xe8(%rsp)
  xor    %eax,%eax
  call   <ERR_GET_LIB@plt>
  mov    %rax,0x8(%rsp)
  mov    %rbp,%rdi
  call   <ERR_GET_FUNC@plt>
  mov    %rax,0x10(%rsp)
  mov    %rbp,%rdi
  call   <ERR_GET_REASON@plt>
  mov    %rax,0x18(%rsp)
  mov    %rbp,%rdi
  call   <ERR_lib_error_string@plt>
  mov    %rax,%r12
  mov    %rbp,%rdi
  call   <ERR_func_error_string@plt>
  mov    %rax,%r14
  mov    %rbp,%rdi
  call   <ERR_reason_error_string@plt>
  mov    %rax,%r15
  test   %r12,%r12
  je     L16
L90:
  test   %r14,%r14
  je     L103
  test   %r15,%r15
  je     L138
L57:
  lea    0x20(%rsp),%rax
  test   %r12,%r12
  cmove  %rax,%r12
  sub    $0x8,%rsp
  push   %r15
  mov    %r14,%r9
  mov    %r12,%r8
  mov    %rbp,%rcx
  lea    D5(%rip),%rdx
  mov    %r13,%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <BIO_snprintf@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  lea    -0x1(%r13),%rdx
  add    $0x10,%rsp
  cmp    $0x4,%r13
  jbe    L47
  cmp    %rdx,%rax
  je     L51
L47:
  mov    0xe8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L159
  add    $0xf8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L16:
  lea    0x20(%rsp),%rdi
  mov    0x8(%rsp),%rcx
  lea    D14(%rip),%rdx
  mov    $0x40,%esi
  mov    $0x0,%eax
  call   <BIO_snprintf@plt>
  jmp    L90
L103:
  lea    0x60(%rsp),%rdi
  mov    0x10(%rsp),%rcx
  lea    D36(%rip),%rdx
  mov    $0x40,%esi
  mov    $0x0,%eax
  call   <BIO_snprintf@plt>
  test   %r15,%r15
  je     L138
  lea    0x60(%rsp),%r14
  jmp    L57
L138:
  lea    0xa0(%rsp),%rdi
  mov    0x18(%rsp),%rcx
  lea    D33(%rip),%rdx
  mov    $0x40,%esi
  mov    $0x0,%eax
  call   <BIO_snprintf@plt>
  lea    0xa0(%rsp),%r15
  test   %r14,%r14
  jne    L57
  lea    0xa0(%rsp),%r15
  lea    0x60(%rsp),%r14
  jmp    L57
L51:
  lea    -0x5(%rbx,%r13,1),%rbp
  lea    (%rbx,%rdx,1),%r12
  jmp    L128
L83:
  mov    %rbp,%rax
  movb   $0x3a,0x0(%rbp)
L110:
  lea    0x1(%rax),%rbx
  add    $0x1,%rbp
  cmp    %r12,%rbp
  je     L47
L128:
  mov    $0x3a,%esi
  mov    %rbx,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L83
  cmp    %rbp,%rax
  jbe    L110
  jmp    L83
L159:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D5
type_guessed: string
name: unpack_data
arguments: tag: D14
type_guessed: string
name: unpack_data
arguments: tag: D36
type_guessed: string
name: unpack_data
arguments: tag: D33
type_guessed: string

tool: D5: error:%08lX:%s:%s:%s

tool: D14: lib(%lu)

tool: D36: func(%lu)

tool: D33: reason(%lu)

assistant: ```c
void ERR_error_string_n(unsigned long e, char *buf, size_t len) {
  char lsbuf[64], fsbuf[64], rsbuf[64];
  const char *ls, *fs, *rs;
  unsigned long l, f, r;
  l = ERR_GET_LIB(e);
  f = ERR_GET_FUNC(e);
  r = ERR_GET_REASON(e);
  ls = ERR_lib_error_string(e);
  fs = ERR_func_error_string(e);
  rs = ERR_reason_error_string(e);
  if (ls == NULL)
    BIO_snprintf(lsbuf, sizeof(lsbuf), "lib(%lu)", l);
  if (fs == NULL)
    BIO_snprintf(fsbuf, sizeof(fsbuf), "func(%lu)", f);
  if (rs == NULL)
    BIO_snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)", r);
  BIO_snprintf(buf, len, "error:%08lX:%s:%s:%s", e, ls ? ls : lsbuf, fs ? fs : fsbuf, rs ? rs : rsbuf);
  if (strlen(buf) == len - 1) {
    if (len > 4) {
      int i;
      char *s = buf;
      for (i = 0; i < 4; i++) {
        char *colon = strchr(s, ':');
        if (colon == NULL || colon > &buf[len - 1] - 4 + i) {
          colon = &buf[len - 1] - 4 + i;
          *colon = ':';
        }
        s = colon + 1;
      }
    }
  }
}
```