user: Please show me the C implementation that matches the assembly code listed below:

```asm
<create_letter_distribution_diagram>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x140,%rsp
  mov    %rdi,-0x138(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x138(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x124(%rbp)
  movl   $0x0,-0x120(%rbp)
  jmp    L86
L170:
  mov    -0x120(%rbp),%eax
  cltq
  movl   $0x0,-0x100(%rbp,%rax,4)
  addl   $0x1,-0x120(%rbp)
L86:
  cmpl   $0x19,-0x120(%rbp)
  jle    L170
  movl   $0x0,-0x120(%rbp)
  jmp    L209
L49:
  mov    -0x120(%rbp),%eax
  lea    0x61(%rax),%edx
  mov    -0x120(%rbp),%eax
  cltq
  mov    %edx,-0x80(%rbp,%rax,4)
  addl   $0x1,-0x120(%rbp)
L209:
  cmpl   $0x19,-0x120(%rbp)
  jle    L49
  subl   $0x1,-0x124(%rbp)
  jmp    L28
L208:
  movl   $0x41,-0x11c(%rbp)
  movl   $0x61,-0x118(%rbp)
  jmp    L224
L57:
  mov    -0x124(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x138(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    %eax,-0x11c(%rbp)
  jne    L20
  mov    -0x11c(%rbp),%eax
  sub    $0x41,%eax
  mov    %eax,-0x120(%rbp)
  mov    -0x120(%rbp),%eax
  cltq
  mov    -0x100(%rbp,%rax,4),%eax
  lea    0x1(%rax),%edx
  mov    -0x120(%rbp),%eax
  cltq
  mov    %edx,-0x100(%rbp,%rax,4)
L20:
  mov    -0x124(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x138(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    %eax,-0x118(%rbp)
  jne    L187
  mov    -0x118(%rbp),%eax
  sub    $0x61,%eax
  mov    %eax,-0x120(%rbp)
  mov    -0x120(%rbp),%eax
  cltq
  mov    -0x100(%rbp,%rax,4),%eax
  lea    0x1(%rax),%edx
  mov    -0x120(%rbp),%eax
  cltq
  mov    %edx,-0x100(%rbp,%rax,4)
L187:
  addl   $0x1,-0x11c(%rbp)
  addl   $0x1,-0x118(%rbp)
L224:
  cmpl   $0x5a,-0x11c(%rbp)
  jg     L127
  cmpl   $0x7a,-0x118(%rbp)
  jle    L57
L127:
  subl   $0x1,-0x124(%rbp)
L28:
  cmpl   $0x0,-0x124(%rbp)
  jns    L208
  movl   $0x0,-0x120(%rbp)
  jmp    L84
L88:
  mov    -0x120(%rbp),%eax
  mov    %eax,-0x114(%rbp)
  mov    -0x120(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x110(%rbp)
  jmp    L236
L206:
  mov    -0x114(%rbp),%eax
  cltq
  mov    -0x100(%rbp,%rax,4),%edx
  mov    -0x110(%rbp),%eax
  cltq
  mov    -0x100(%rbp,%rax,4),%eax
  cmp    %eax,%edx
  jge    L123
  mov    -0x110(%rbp),%eax
  mov    %eax,-0x114(%rbp)
L123:
  addl   $0x1,-0x110(%rbp)
L236:
  cmpl   $0x19,-0x110(%rbp)
  jle    L206
  mov    -0x114(%rbp),%eax
  cltq
  mov    -0x100(%rbp,%rax,4),%eax
  mov    %eax,-0x104(%rbp)
  mov    -0x120(%rbp),%eax
  cltq
  mov    -0x100(%rbp,%rax,4),%edx
  mov    -0x114(%rbp),%eax
  cltq
  mov    %edx,-0x100(%rbp,%rax,4)
  mov    -0x120(%rbp),%eax
  cltq
  mov    -0x104(%rbp),%edx
  mov    %edx,-0x100(%rbp,%rax,4)
  mov    -0x114(%rbp),%eax
  cltq
  mov    -0x80(%rbp,%rax,4),%eax
  mov    %eax,-0x104(%rbp)
  mov    -0x120(%rbp),%eax
  cltq
  mov    -0x80(%rbp,%rax,4),%edx
  mov    -0x114(%rbp),%eax
  cltq
  mov    %edx,-0x80(%rbp,%rax,4)
  mov    -0x120(%rbp),%eax
  cltq
  mov    -0x104(%rbp),%edx
  mov    %edx,-0x80(%rbp,%rax,4)
  addl   $0x1,-0x120(%rbp)
L84:
  cmpl   $0x19,-0x120(%rbp)
  jle    L88
  movl   $0x0,-0x120(%rbp)
  jmp    L2
L144:
  mov    -0x120(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x10c(%rbp)
  jmp    L174
L27:
  mov    -0x120(%rbp),%eax
  cltq
  mov    -0x100(%rbp,%rax,4),%edx
  mov    -0x10c(%rbp),%eax
  cltq
  mov    -0x100(%rbp,%rax,4),%eax
  cmp    %eax,%edx
  jne    L38
  mov    -0x120(%rbp),%eax
  cltq
  mov    -0x80(%rbp,%rax,4),%edx
  mov    -0x10c(%rbp),%eax
  cltq
  mov    -0x80(%rbp,%rax,4),%eax
  cmp    %eax,%edx
  jle    L38
  mov    -0x120(%rbp),%eax
  cltq
  mov    -0x80(%rbp,%rax,4),%eax
  mov    %eax,-0x108(%rbp)
  mov    -0x10c(%rbp),%eax
  cltq
  mov    -0x80(%rbp,%rax,4),%edx
  mov    -0x120(%rbp),%eax
  cltq
  mov    %edx,-0x80(%rbp,%rax,4)
  mov    -0x10c(%rbp),%eax
  cltq
  mov    -0x108(%rbp),%edx
  mov    %edx,-0x80(%rbp,%rax,4)
L38:
  addl   $0x1,-0x10c(%rbp)
L174:
  cmpl   $0x19,-0x10c(%rbp)
  jle    L27
  addl   $0x1,-0x120(%rbp)
L2:
  cmpl   $0x19,-0x120(%rbp)
  jle    L144
  movl   $0x0,-0x120(%rbp)
  jmp    L66
L188:
  mov    -0x120(%rbp),%eax
  cltq
  mov    -0x100(%rbp,%rax,4),%edx
  mov    -0x120(%rbp),%eax
  cltq
  mov    -0x80(%rbp,%rax,4),%eax
  mov    %eax,%esi
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  addl   $0x1,-0x120(%rbp)
L66:
  cmpl   $0x19,-0x120(%rbp)
  jle    L188
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L102
  call   <__stack_chk_fail@plt>
L102:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D3
type: string

tool: D3: %c %d


assistant: ```c
int create_letter_distribution_diagram(char sentence[1000]) {
  int length = strlen(sentence);
  int letters[30];
  int count = 0;
  int ascii_letters[30];
  for (; count < 26; count++) {
    letters[count] = 0;
  }
  for (count = 0; count < 26; count++) {
    ascii_letters[count] = count + 97;
  }
  for (length--; length >= 0; length--) {
    int ascii_uppercase = 65;
    int ascii_lowercase = 97;
    for (; ascii_uppercase < 91 && ascii_lowercase < 123; ascii_uppercase++, ascii_lowercase++) {
      if (sentence[length] == ascii_uppercase) {
        count = ascii_uppercase - 65;
        letters[count]++;
      }
      if (sentence[length] == ascii_lowercase) {
        count = ascii_lowercase - 97;
        letters[count]++;
      }
    }
  }
  for (count = 0; count < 26; count++) {
    int min = count;
    int helper;
    int help_sort;
    for (helper = count + 1; helper < 26; helper++)
      if (letters[min] < letters[helper])
        min = helper;
    help_sort = letters[min];
    letters[min] = letters[count];
    letters[count] = help_sort;
    help_sort = ascii_letters[min];
    ascii_letters[min] = ascii_letters[count];
    ascii_letters[count] = help_sort;
  }
  for (count = 0; count < 26; count++) {
    int helper;
    for (helper = count + 1; helper < 26; helper++)
      if (letters[count] == letters[helper] && ascii_letters[count] > ascii_letters[helper]) {
        int help_sort = ascii_letters[count];
        ascii_letters[count] = ascii_letters[helper];
        ascii_letters[helper] = help_sort;
      }
  }
  for (count = 0; count < 26; count++) {
    printf("%c %d\n", ascii_letters[count], letters[count]);
  }
  return 0;
}
```