user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbx
  lea    D16(%rip),%rdi
  sub    $0xb0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xa8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbx
  mov    %rbx,%rsi
  call   <scanf@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L151
  sub    $0x1,%eax
  mov    %rbx,%rdx
  xor    %esi,%esi
  lea    0x1(%rsp,%rax,1),%rcx
  xchg   %ax,%ax
L297:
  movzbl (%rdx),%eax
  cmp    $0x61,%al
  je     L105
  cmp    $0x64,%al
  je     L105
  cmp    $0x67,%al
  jne    L310
  nop
L105:
  add    $0x1,%esi
L280:
  add    $0x1,%rdx
  cmp    %rcx,%rdx
  jne    L297
L300:
  lea    D1(%rip),%rdi
  call   <printf@plt>
  mov    0xa8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L282
  add    $0xb0,%rsp
  xor    %eax,%eax
  pop    %rbx
  ret
L310:
  cmp    $0x6a,%al
  je     L105
  cmp    $0x6d,%al
  je     L105
  cmp    $0x70,%al
  je     L105
  cmp    $0x74,%al
  je     L105
  cmp    $0x77,%al
  je     L105
  cmp    $0x20,%al
  je     L105
  cmp    $0x62,%al
  jne    L121
  cs nopw 0x0(%rax,%rax,1)
L269:
  add    $0x2,%esi
  jmp    L280
L121:
  cmp    $0x65,%al
  je     L269
  cmp    $0x68,%al
  je     L269
  cmp    $0x6b,%al
  je     L269
  cmp    $0x6e,%al
  je     L269
  cmp    $0x71,%al
  je     L269
  cmp    $0x75,%al
  je     L269
  cmp    $0x78,%al
  je     L269
  cmp    $0x63,%al
  jne    L114
  nopl   (%rax)
L317:
  add    $0x3,%esi
  jmp    L280
L114:
  cmp    $0x66,%al
  je     L317
  cmp    $0x69,%al
  je     L317
  cmp    $0x6c,%al
  je     L317
  cmp    $0x6f,%al
  je     L317
  cmp    $0x72,%al
  je     L317
  cmp    $0x76,%al
  je     L317
  cmp    $0x79,%al
  je     L317
  cmp    $0x73,%al
  jne    L115
L147:
  add    $0x4,%esi
  jmp    L280
L115:
  cmp    $0x7a,%al
  je     L147
  jmp    L280
L151:
  xor    %esi,%esi
  jmp    L300
L282:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D16
datatype: string
name: extract_symbolic_data
arguments: data_label: D1
datatype: string

tool: D16: %[^
]s

tool: D1: button klicks = %d 


assistant: ```c
int main() {
  char n[160];
  int l, i, button = 0;
  scanf("%[^\n]s", n);
  l = strlen(n);
  for (i = 0; i < l; i++) {
    if (n[i] == 'a')
      button = button + 1;
    if (n[i] == 'd')
      button = button + 1;
    if (n[i] == 'g')
      button = button + 1;
    if (n[i] == 'j')
      button = button + 1;
    if (n[i] == 'm')
      button = button + 1;
    if (n[i] == 'p')
      button = button + 1;
    if (n[i] == 't')
      button = button + 1;
    if (n[i] == 'w')
      button = button + 1;
    if (n[i] == ' ')
      button = button + 1;
    if (n[i] == 'b')
      button = button + 2;
    if (n[i] == 'e')
      button = button + 2;
    if (n[i] == 'h')
      button = button + 2;
    if (n[i] == 'k')
      button = button + 2;
    if (n[i] == 'n')
      button = button + 2;
    if (n[i] == 'q')
      button = button + 2;
    if (n[i] == 'u')
      button = button + 2;
    if (n[i] == 'x')
      button = button + 2;
    if (n[i] == 'c')
      button = button + 3;
    if (n[i] == 'f')
      button = button + 3;
    if (n[i] == 'i')
      button = button + 3;
    if (n[i] == 'l')
      button = button + 3;
    if (n[i] == 'o')
      button = button + 3;
    if (n[i] == 'r')
      button = button + 3;
    if (n[i] == 'v')
      button = button + 3;
    if (n[i] == 'y')
      button = button + 3;
    if (n[i] == 's')
      button = button + 4;
    if (n[i] == 'z')
      button = button + 4;
  }
  printf("button klicks = %d \n", button);
  return 0;
}
```