user: Converte this assembly snippet into its equivalent C code:

```asm
<print_bin>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xa8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  test   %rdx,%rdx
  je     L87
  mov    %rdi,%rbp
  mov    %rsi,%r14
  mov    %rdx,%r13
  mov    %rcx,%rbx
  test   %r8d,%r8d
  jle    L93
  mov    $0x80,%eax
  lea    0x10(%rsp),%r15
  mov    $0x20,%esi
  cmp    %eax,%r8d
  mov    %r15,%rdi
  cmovle %r8d,%eax
  mov    %eax,%r12d
  mov    %eax,%edx
  call   <memset@plt>
  mov    %r12d,%edx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <BIO_write@plt>
  test   %rax,%rax
  jle    L50
L51:
  xor    %eax,%eax
  mov    %r14,%rdx
  lea    D19(%rip),%rsi
  mov    %rbp,%rdi
  call   <BIO_printf@plt>
  test   %rax,%rax
  jle    L50
  xor    %r14d,%r14d
  lea    D33(%rip),%r15
  jmp    L53
  nopl   0x0(%rax)
L102:
  add    $0x1,%r14
  cmp    %rbx,%r14
  je     L62
  movzbl -0x1(%r13,%r14,1),%edx
  lea    D9(%rip),%rcx
L67:
  xor    %eax,%eax
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <BIO_printf@plt>
  test   %rax,%rax
  jle    L50
L53:
  cmp    %rbx,%r14
  je     L71
  movabs $0xeeeeeeeeeeeeeeef,%rax
  movabs $0x1111111111111111,%rsi
  imul   %r14,%rax
  cmp    %rsi,%rax
  ja     L102
  lea    0x4(%r12),%edx
  lea    0x10(%rsp),%r9
  mov    $0x20,%esi
  movb   $0xa,0x10(%rsp)
  lea    0x11(%rsp),%rdi
  mov    %r9,0x8(%rsp)
  call   <memset@plt>
  mov    0x8(%rsp),%rsi
  lea    0x5(%r12),%edx
  mov    %rbp,%rdi
  call   <BIO_write@plt>
  test   %rax,%rax
  jg     L102
L50:
  xor    %eax,%eax
L54:
  mov    0x98(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L36
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L93:
  xor    %r12d,%r12d
  jmp    L51
  nopl   0x0(%rax,%rax,1)
L62:
  movzbl -0x1(%r13,%r14,1),%edx
  lea    D28(%rip),%rcx
  jmp    L67
  nopw   0x0(%rax,%rax,1)
L71:
  mov    $0x1,%edx
  lea    D45(%rip),%rsi
  mov    %rbp,%rdi
  call   <BIO_write@plt>
  test   %rax,%rax
  setg   %al
  movzbl %al,%eax
  jmp    L54
  nopw   0x0(%rax,%rax,1)
L87:
  mov    $0x1,%eax
  jmp    L54
L36:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D19
type_infered: string
name: retrieve_data
arguments: data_label: D33
type_infered: string
name: retrieve_data
arguments: data_label: D9
type_infered: string
name: retrieve_data
arguments: data_label: D28
type_infered: string
name: retrieve_data
arguments: data_label: D45
type_infered: string

tool: D19: %s

tool: D33: %02x%s

tool: D9: :

tool: 

tool: D45: 


assistant: ```c
int print_bin(BIO *fp, const char *name, const unsigned char *buf, size_t len, int off) {
  size_t i;
  char str[128 + 1 + 4];
  if (buf == NULL)
    return 1;
  if (off > 0) {
    if (off > 128)
      off = 128;
    memset(str, ' ', off);
    if (BIO_write(fp, str, off) <= 0)
      return 0;
  } else {
    off = 0;
  }
  if (BIO_printf(fp, "%s", name) <= 0)
    return 0;
  for (i = 0; i < len; i++) {
    if ((i % 15) == 0) {
      str[0] = '\n';
      memset(&(str[1]), ' ', off + 4);
      if (BIO_write(fp, str, off + 1 + 4) <= 0)
        return 0;
    }
    if (BIO_printf(fp, "%02x%s", buf[i], ((i + 1) == len) ? "" : ":") <= 0)
      return 0;
  }
  if (BIO_write(fp, "\n", 1) <= 0)
    return 0;
  return 1;
}
```