user: 请将这段汇编代码片段转换成等效的C代码：

```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     L44
  mov    %rdi,%r12
  mov    %rsi,%rbx
  mov    %rdx,%r13
  mov    %rcx,%rbp
  test   %r8d,%r8d
  jle    L75
  mov    $0x80,%eax
  cmp    %eax,%r8d
  cmovle %r8d,%eax
  mov    %eax,%r15d
  mov    %eax,0x4(%rsp)
  lea    0x10(%rsp),%r14
  mov    %eax,%edx
  mov    $0x20,%esi
  mov    %r14,%rdi
  call   <memset@plt>
  mov    %r15d,%edx
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   <BIO_write@plt>
  mov    %rax,%rdx
  mov    $0x0,%eax
  test   %rdx,%rdx
  jle    L138
L41:
  mov    %rbx,%rdx
  lea    D27(%rip),%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <BIO_printf@plt>
  mov    %rax,%rdx
  mov    $0x0,%eax
  test   %rdx,%rdx
  jle    L138
  mov    $0x0,%ebx
  movabs $0x8888888888888889,%r14
  lea    D19(%rip),%r15
  jmp    L84
L75:
  movl   $0x0,0x4(%rsp)
  jmp    L41
L118:
  add    $0x1,%rbx
  cmp    %rbp,%rbx
  lea    D35(%rip),%rcx
  cmove  %r15,%rcx
  movzbl -0x1(%r13,%rbx,1),%edx
  lea    D17(%rip),%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <BIO_printf@plt>
  test   %rax,%rax
  jle    L68
L84:
  cmp    %rbp,%rbx
  je     L121
  mov    %rbx,%rax
  mul    %r14
  shr    $0x3,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  cmp    %rax,%rbx
  jne    L118
  movb   $0xa,0x10(%rsp)
  mov    0x4(%rsp),%eax
  lea    0x4(%rax),%edx
  lea    0x10(%rsp),%rax
  mov    %rax,0x8(%rsp)
  lea    0x11(%rsp),%rdi
  mov    $0x20,%esi
  call   <memset@plt>
  mov    0x4(%rsp),%eax
  lea    0x5(%rax),%edx
  mov    0x8(%rsp),%rsi
  mov    %r12,%rdi
  call   <BIO_write@plt>
  test   %rax,%rax
  jg     L118
  mov    $0x0,%eax
  jmp    L138
L121:
  mov    $0x1,%edx
  lea    D14(%rip),%rsi
  mov    %r12,%rdi
  call   <BIO_write@plt>
  test   %rax,%rax
  setg   %al
  movzbl %al,%eax
L138:
  mov    0x98(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L53
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L44:
  mov    $0x1,%eax
  jmp    L138
L68:
  mov    $0x0,%eax
  jmp    L138
L53:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D27
type_infered: string
name: read_data
arguments: tag: D19
type_infered: string
name: read_data
arguments: tag: D35
type_infered: string
name: read_data
arguments: tag: D17
type_infered: string
name: read_data
arguments: tag: D14
type_infered: string

tool: D27: %s

tool: 

tool: D35: :

tool: D17: %02x%s

tool: D14: 


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