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

```asm
<create_letter_distribution_diagram>:
  endbr64
  push   %r13
  mov    $0xd,%ecx
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  sub    $0xa8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  lea    0x70(%rsp),%rbx
  lea    0x8a(%rsp),%rsi
  mov    %rbp,%rdi
  rep stos %rax,%es:(%rdi)
  mov    $0x61,%ecx
  mov    %rbx,%rax
  sub    %ebx,%ecx
  nopl   0x0(%rax)
L135:
  lea    (%rcx,%rax,1),%edx
  add    $0x1,%rax
  mov    %dl,-0x1(%rax)
  cmp    %rsi,%rax
  jne    L135
  mov    %r12,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L182
  sub    $0x1,%eax
  mov    %r12,%rdx
  lea    0x1(%r12,%rax,1),%rsi
  jmp    L169
L24:
  movsbq %cl,%rcx
  addl   $0x1,(%rsp,%rcx,4)
L28:
  add    $0x1,%rdx
  cmp    %rsi,%rdx
  je     L182
L169:
  movzbl (%rdx),%eax
  lea    -0x61(%rax),%ecx
  cmp    $0x19,%cl
  jbe    L24
  sub    $0x41,%eax
  cmp    $0x19,%al
  ja     L28
  movsbq %al,%rax
  add    $0x1,%rdx
  addl   $0x1,(%rsp,%rax,4)
  cmp    %rsi,%rdx
  jne    L169
L182:
  mov    %rbx,%r9
  mov    %rbp,%r8
  xor    %edi,%edi
  mov    (%r8),%r10d
  movzbl (%r9),%r11d
  movslq %edi,%rsi
  cmp    $0x19,%rdi
  je     L29
  nopl   0x0(%rax)
L46:
  add    $0x1,%rdi
  mov    %r10d,%ecx
  mov    %rdi,%rax
  nopw   0x0(%rax,%rax,1)
L170:
  mov    0x0(%rbp,%rax,4),%edx
  cmp    %ecx,%edx
  jle    L87
  mov    %edx,%ecx
  movslq %eax,%rsi
L87:
  add    $0x1,%rax
  cmp    $0x1a,%eax
  jne    L170
  movzbl 0x70(%rsp,%rsi,1),%eax
  mov    %ecx,(%r8)
  add    $0x1,%r9
  add    $0x4,%r8
  mov    %r10d,(%rsp,%rsi,4)
  mov    (%r8),%r10d
  mov    %al,-0x1(%r9)
  mov    %r11b,0x70(%rsp,%rsi,1)
  movslq %edi,%rsi
  movzbl (%r9),%r11d
  cmp    $0x19,%rdi
  jne    L46
L29:
  mov    %r10d,0x64(%rsp)
  mov    $0x1a,%r8d
  lea    0x68(%rbp),%rcx
  mov    %r11b,0x89(%rsp)
  nopw   0x0(%rax,%rax,1)
L113:
  mov    %rbx,%rdx
  mov    %rbp,%rax
  jmp    L12
L163:
  add    $0x4,%rax
  add    $0x1,%rdx
  cmp    %rax,%rcx
  je     L125
L12:
  mov    0x4(%rax),%edi
  cmp    %edi,(%rax)
  jne    L163
  movzbl (%rdx),%esi
  movzbl 0x1(%rdx),%edi
  cmp    %dil,%sil
  jle    L163
  add    $0x4,%rax
  mov    %dil,(%rdx)
  add    $0x1,%rdx
  mov    %sil,(%rdx)
  cmp    %rax,%rcx
  jne    L12
  nopl   0x0(%rax,%rax,1)
L125:
  sub    $0x1,%r8d
  jne    L113
  xor    %r12d,%r12d
  lea    D3(%rip),%r13
  nopl   0x0(%rax,%rax,1)
L2:
  mov    0x0(%rbp,%r12,4),%edx
  movsbl (%rbx,%r12,1),%esi
  mov    %r13,%rdi
  add    $0x1,%r12
  call   <printf@plt>
  cmp    $0x1a,%r12
  jne    L2
  mov    0x98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L117
  add    $0xa8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L117:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D3
type_infered: string

tool: D3: %c: %d


assistant: ```c
int create_letter_distribution_diagram(char *string) {
  int counter, num[26], length, position, max, help;
  char letters[26], helpchar;
  for (counter = 0; counter < 26; counter++)
    num[counter] = 0;
  for (counter = 0; counter < 26; counter++)
    letters[counter] = counter + 'a';
  length = strlen(string);
  for (counter = 0; counter < length; counter++) {
    if (string[counter] >= 'a' && string[counter] <= 'z')
      num[string[counter] - 'a']++;
    if (string[counter] >= 'A' && string[counter] <= 'Z')
      num[string[counter] - 'A']++;
  }
  for (position = 0; position < 26; position++) {
    max = position;
    for (counter = position + 1; counter < 26; counter++) {
      if (num[counter] > num[max])
        max = counter;
    }
    help = num[position];
    num[position] = num[max];
    num[max] = help;
    helpchar = letters[position];
    letters[position] = letters[max];
    letters[max] = helpchar;
  }
  for (counter = 0; counter < 26; counter++) {
    for (position = 0; position < 26; position++) {
      if (position < 26) {
        if (num[position] == num[position + 1]) {
          if (letters[position] > letters[position + 1]) {
            help = num[position];
            num[position] = num[position + 1];
            num[position + 1] = help;
            helpchar = letters[position];
            letters[position] = letters[position + 1];
            letters[position + 1] = helpchar;
          }
        }
      }
    }
  }
  for (position = 0; position < 26; position++)
    printf("%c: %d\n", letters[position], num[position]);
  return 0;
}
```