user: Translate the below assembly code into C programming language:

```asm
<cat_hist_output>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %rdx,-0x20(%rbp)
  mov    %rcx,-0x28(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    -0x20(%rbp),%rdx
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  je     L50
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movb   $0x20,(%rax)
  mov    -0x8(%rbp),%rax
  movb   $0x0,(%rax)
L50:
  cmpl   $0x78,-0x14(%rbp)
  je     L155
  cmpl   $0x78,-0x14(%rbp)
  jg     L114
  cmpl   $0x64,-0x14(%rbp)
  je     L155
  cmpl   $0x64,-0x14(%rbp)
  jg     L114
  cmpl   $0x63,-0x14(%rbp)
  je     L159
  cmpl   $0x63,-0x14(%rbp)
  jg     L114
  cmpl   $0x43,-0x14(%rbp)
  je     L122
  cmpl   $0x44,-0x14(%rbp)
  je     L104
  jmp    L114
L159:
  mov    -0x28(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  lea    D60(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L48
L122:
  cmpl   $0x13,-0x18(%rbp)
  jg     L172
  mov    -0x28(%rbp),%rcx
  mov    -0x18(%rbp),%edx
  mov    -0x8(%rbp),%rax
  lea    D45(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L48
L172:
  mov    -0x28(%rbp),%rdx
  mov    -0x8(%rbp),%rax
  lea    D44(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L48
L104:
  cmpl   $0x13,-0x18(%rbp)
  jg     L40
  mov    -0x28(%rbp),%rcx
  mov    -0x18(%rbp),%edx
  mov    -0x8(%rbp),%rax
  lea    D45(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L48
L40:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  sub    $0x14,%eax
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jns    L37
  movl   $0x0,-0xc(%rbp)
L37:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%rax
  lea    D44(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L48
L155:
  mov    -0x28(%rbp),%rcx
  mov    -0x18(%rbp),%edx
  mov    -0x8(%rbp),%rax
  lea    D45(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L48
L114:
  mov    -0x28(%rbp),%rcx
  mov    -0x18(%rbp),%edx
  mov    -0x8(%rbp),%rax
  lea    D69(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  nop
L48:
  nop
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D60
type: string
name: read_data
arguments: tag: D45
type: string
name: read_data
arguments: tag: D44
type: string
name: read_data
arguments: tag: D69
type: string

tool: D60: %s

tool: D45: %-*s

tool: D44: %-20.20s

tool: D69: %*s

assistant: ```c
cat_hist_output(f, w, out, pt) int f;
int w;
char *out;
char *pt;
{
  char *output;
  output = out + strlen(out);
  if (out != output) {
    *output++ = ' ';
    *output = '\0';
  }
  switch (f) {
  case 'c':
    sprintf(output, "%s", pt);
    break;
  case 'C':
    if (w < 20)
      sprintf(output, "%-*s", w, pt);
    else
      sprintf(output, "%-20.20s", pt);
    break;
  case 'D':
    if (w < 20)
      sprintf(output, "%-*s", w, pt);
    else {
      int len;
      len = strlen(pt) - 20;
      if (len < 0)
        len = 0;
      sprintf(output, "%-20.20s", pt + len);
    }
    break;
  case 'd':
  case 'x':
    sprintf(output, "%-*s", w, pt);
    break;
  default:
    sprintf(output, "%*s", w, pt);
    break;
  }
}
```