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

```asm
<moral_regla12>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %rdi,%rbx
  call   <strlen@plt>
  cmp    $0x1,%rax
  je     L112
  mov    %rax,%rsi
  mov    %rbx,%rdi
  mov    %rax,%r12
  call   <strndup@plt>
  mov    %rbx,%rdi
  lea    0x1(%r12),%rdx
  xor    %esi,%esi
  mov    %rax,%r14
  call   <memset@plt>
  movsbl (%r14),%edi
  test   %dil,%dil
  je     L227
  test   %ebp,%ebp
  jne    L4
L98:
  call   <isalnum@plt>
  add    $0x1,%r14
  test   %rax,%rax
  je     L344
L54:
  movzbl -0x1(%r14),%edx
  movsbl (%r14),%edi
  lea    0x1(%rbx),%rax
  add    $0x1,%ebp
  mov    %dl,(%rbx)
  test   %dil,%dil
  je     L127
  mov    %rax,%rbx
  add    $0x1,%r14
  call   <isalnum@plt>
  test   %rax,%rax
  jne    L54
L344:
  movsbl (%r14),%edi
  test   %dil,%dil
  jne    L98
  mov    %rbx,%rax
L127:
  movslq %ebp,%rbp
  mov    %rax,%r13
  sub    %rbp,%r13
L248:
  movb   $0x0,(%rax)
  mov    %r14,%rdi
  sub    %r12,%rdi
  call   <free@plt>
L95:
  pop    %rbx
  mov    %r13,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopw   0x0(%rax,%rax,1)
L112:
  movsbl (%rbx),%edi
  call   <isalnum@plt>
  test   %rax,%rax
  je     L250
L284:
  mov    %rbx,%r13
  pop    %rbx
  pop    %rbp
  mov    %r13,%rax
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L4:
  xor    %ebp,%ebp
  lea    D123(%rip),%r13
L339:
  call   <isalnum@plt>
  add    $0x1,%r14
  test   %rax,%rax
  je     L252
L279:
  movzbl -0x1(%r14),%edx
  movsbl (%r14),%edi
  lea    0x1(%rbx),%rax
  add    $0x1,%ebp
  mov    %dl,(%rbx)
  test   %dil,%dil
  je     L127
  mov    %rax,%rbx
  add    $0x1,%r14
  call   <isalnum@plt>
  test   %rax,%rax
  jne    L279
L252:
  movsbl -0x1(%r14),%esi
  mov    %r13,%rdi
  call   <printf@plt>
  movsbl (%r14),%edi
  test   %dil,%dil
  jne    L339
  mov    %rbx,%rax
  jmp    L127
  nopl   (%rax)
L250:
  lea    D173(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L284
  test   %ebp,%ebp
  jne    L152
  movzbl (%rbx),%eax
  lea    D52(%rip),%r13
  cmp    $0x40,%al
  je     L95
  sub    $0x21,%eax
  cmp    $0xe,%al
  ja     L284
  lea    D69(%rip),%rdx
  movzbl %al,%eax
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  nopl   0x0(%rax)
L227:
  mov    %rbx,%r13
  mov    %rbx,%rax
  jmp    L248
  mov    $0x2f,%eax
  lea    D113(%rip),%r13
  nop
L180:
  test   %ebp,%ebp
  je     L95
L304:
  movsbl %al,%esi
  mov    %r13,%rdx
  lea    D80(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L95
  mov    $0x2e,%eax
  lea    D117(%rip),%r13
  jmp    L180
  mov    $0x2d,%eax
  lea    D29(%rip),%r13
  jmp    L180
  mov    $0x2b,%eax
  lea    D45(%rip),%r13
  jmp    L180
  mov    $0x29,%eax
  lea    D176(%rip),%r13
  jmp    L180
  mov    $0x28,%eax
  lea    D198(%rip),%r13
  jmp    L180
  mov    $0x25,%eax
  lea    D5(%rip),%r13
  jmp    L180
  mov    $0x24,%eax
  lea    D124(%rip),%r13
  jmp    L180
  mov    $0x23,%eax
  lea    D54(%rip),%r13
  jmp    L180
  mov    $0x22,%eax
  lea    D78(%rip),%r13
  jmp    L180
  mov    $0x21,%eax
  lea    D30(%rip),%r13
  jmp    L180
  lea    D154(%rip),%r13
  jmp    L95
  nopl   (%rax)
L152:
  lea    D20(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  movzbl (%rbx),%eax
  cmp    $0x40,%al
  je     L299
  lea    -0x21(%rax),%edx
  cmp    $0xe,%dl
  ja     L284
  lea    D115(%rip),%rcx
  movzbl %dl,%edx
  movslq (%rcx,%rdx,4),%rdx
  add    %rcx,%rdx
  notrack jmp *%rdx
  lea    D154(%rip),%r13
  jmp    L304
L299:
  lea    D52(%rip),%r13
  jmp    L304
```

tool_calls: name: retrieve_data
arguments: data_tag: D123
type_infered: string
name: retrieve_data
arguments: data_tag: D173
type_infered: string
name: retrieve_data
arguments: data_tag: D52
type_infered: string
name: retrieve_data
arguments: data_tag: D113
type_infered: string
name: retrieve_data
arguments: data_tag: D80
type_infered: string
name: retrieve_data
arguments: data_tag: D117
type_infered: string
name: retrieve_data
arguments: data_tag: D29
type_infered: string
name: retrieve_data
arguments: data_tag: D45
type_infered: string
name: retrieve_data
arguments: data_tag: D176
type_infered: string
name: retrieve_data
arguments: data_tag: D198
type_infered: string
name: retrieve_data
arguments: data_tag: D5
type_infered: string
name: retrieve_data
arguments: data_tag: D124
type_infered: string
name: retrieve_data
arguments: data_tag: D54
type_infered: string
name: retrieve_data
arguments: data_tag: D78
type_infered: string
name: retrieve_data
arguments: data_tag: D30
type_infered: string
name: retrieve_data
arguments: data_tag: D154
type_infered: string
name: retrieve_data
arguments: data_tag: D20
type_infered: string

tool: D123: moral_regla12: Eliminando de la palabra el caracter '%c'.


tool: D173: &

tool: D52: ARROBA

tool: D113: DIAGONAL

tool: D80:  caracter %c interpretado como: %s


tool: D117: PUNTO

tool: D29: GUION

tool: D45: SUMA

tool: D176: CIERRA PARENTESIS

tool: D198: ABRE PARENTESIS

tool: D5: PORCIENTO

tool: D124: PESOS

tool: D54: NUMERO

tool: D78: COMILLAS

tool: D30: ADMIRACION

tool: D154: APOSTROFE

tool: D20: moral_regla12: Aplicando regla 12. Interpretando caracteres individuales...

assistant: ```c
char *moral_regla12(char *palabra, const int verbose) {
  const size_t len = strlen(palabra);
  if (len == 1) {
    if (isalnum(*palabra) || strcmp(palabra, "&") == 0) {
      return palabra;
    } else {
      char *nombre = NULL;
      if (verbose)
        printf("moral_regla12: Aplicando regla 12. Interpretando caracteres individuales...");
      if (*palabra == '@')
        nombre = "ARROBA";
      else if (*palabra == '\'')
        nombre = "APOSTROFE";
      else if (*palabra == '%')
        nombre = "PORCIENTO";
      else if (*palabra == '#')
        nombre = "NUMERO";
      else if (*palabra == '!')
        nombre = "ADMIRACION";
      else if (*palabra == '.')
        nombre = "PUNTO";
      else if (*palabra == '$')
        nombre = "PESOS";
      else if (*palabra == '"')
        nombre = "COMILLAS";
      else if (*palabra == '-')
        nombre = "GUION";
      else if (*palabra == '/')
        nombre = "DIAGONAL";
      else if (*palabra == '+')
        nombre = "SUMA";
      else if (*palabra == '(')
        nombre = "ABRE PARENTESIS";
      else if (*palabra == ')')
        nombre = "CIERRA PARENTESIS";
      if (nombre) {
        if (verbose)
          printf(" caracter %c interpretado como: %s\n", *palabra, nombre);
        palabra = nombre;
      }
    }
  } else {
    int i = 0;
    char *copy = strndup(palabra, len);
    memset(palabra, 0, len + 1);
    while (*copy) {
      if (!isalnum(*copy)) {
        if (verbose)
          printf("moral_regla12: Eliminando de la palabra el caracter '%c'.\n", *copy);
        copy++;
        continue;
      }
      *palabra++ = *copy++;
      i++;
    }
    *palabra = 0;
    palabra -= i;
    copy -= len;
    free(copy);
  }
  return palabra;
}
```