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

```asm
<paintv>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  movslq %esi,%r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,-0x48(%rbp)
  lea    D55(%rip),%rdi
  mov    %r12d,-0x4c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  call   <puts@plt>
  mov    %r12d,%esi
  mov    %r14,%rdi
  call   <getpeak@plt>
  mov    %rsp,%rcx
  mov    %eax,%esi
  lea    0xf(,%r12,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L157
L187:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L187
L157:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L19
L153:
  mov    -0x4c(%rbp),%ecx
  mov    %rsp,%r13
  test   %ecx,%ecx
  jle    L45
  xor    %ecx,%ecx
  xchg   %ax,%ax
L57:
  mov    -0x48(%rbp),%rax
  mov    (%rax,%rcx,4),%eax
  lea    (%rax,%rax,4),%eax
  shl    $0x2,%eax
  cltd
  idiv   %esi
  mov    %eax,0x0(%r13,%rcx,4)
  add    $0x1,%rcx
  cmp    %rcx,%r12
  jne    L57
L45:
  mov    $0x14,%ebx
  lea    D39(%rip),%r14
  nopw   0x0(%rax,%rax,1)
L112:
  mov    -0x4c(%rbp),%eax
  xor    %r15d,%r15d
  test   %eax,%eax
  jg     L40
  jmp    L129
  nopl   0x0(%rax)
L144:
  mov    $0x2b,%esi
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <printf@plt>
L17:
  add    $0x1,%r15
  cmp    %r12,%r15
  je     L129
L40:
  cmp    %ebx,0x0(%r13,%r15,4)
  je     L70
  jg     L144
  mov    $0x20,%esi
  mov    %r14,%rdi
  xor    %eax,%eax
  add    $0x1,%r15
  call   <printf@plt>
  cmp    %r12,%r15
  jne    L40
L129:
  mov    $0xa,%edi
  call   <putchar@plt>
  sub    $0x1,%ebx
  jae    L112
  mov    -0x4c(%rbp),%edx
  xor    %ebx,%ebx
  lea    D4(%rip),%r12
  test   %edx,%edx
  jle    L146
L188:
  mov    %r12,%rdi
  xor    %eax,%eax
  mov    %ebx,%r13d
  call   <printf@plt>
  lea    0x1(%rbx),%ebx
  cmp    %ebx,-0x4c(%rbp)
  jne    L188
  mov    $0xa,%edi
  lea    D10(%rip),%rbx
  call   <putchar@plt>
  xor    %esi,%esi
  lea    0x1(%rsi),%r12d
  cmp    %r13d,%esi
  mov    %r12d,%esi
  je     L198
  nopl   0x0(%rax)
L140:
  xor    %eax,%eax
  mov    %rbx,%rdi
  call   <printf@plt>
  mov    %r12d,%esi
  lea    0x1(%rsi),%r12d
  cmp    %r13d,%esi
  mov    %r12d,%esi
  jne    L140
L198:
  lea    D0(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L85:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L55
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L70:
  mov    -0x48(%rbp),%rax
  lea    D10(%rip),%rdi
  mov    (%rax,%r15,4),%esi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L17
L19:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L153
L146:
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L85
L55:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D55
type: string
name: parse_data
arguments: data_tag: D39
type: string
name: parse_data
arguments: data_tag: D4
type: string
name: parse_data
arguments: data_tag: D10
type: string
name: parse_data
arguments: data_tag: D0
type: string

tool: D55: 
Vertical histogram:


tool: D39: %-5c

tool: D4: =====

tool: D10: %-5d

tool: D0: >=%-5d

assistant: ```c
void paintv(int counts[], int len) {
  printf("\nVertical histogram:\n\n");
  int peak = getpeak(counts, len);
  int i, j, h = 20;
  int bars[len];
  for (i = 0; i < len; i++) {
    bars[i] = counts[i] * h / peak;
  }
  for (i = 0; i <= h; i++) {
    for (j = 0; j < len; j++) {
      if (h - i == bars[j]) {
        printf("%-5d", counts[j]);
      } else if (h - i < bars[j]) {
        printf("%-5c", '+');
      } else {
        printf("%-5c", ' ');
      }
    }
    printf("\n");
  }
  for (i = 0; i < len; i++) {
    printf("=====");
  }
  printf("\n");
  for (i = 0; i < len; i++) {
    char *format = "%-5d";
    if (i == len - 1) {
      format = ">=%-5d";
    }
    printf(format, i + 1);
  }
  printf("\n");
}
```