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

```asm
<moral_regla7>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r12
  push   %rbx
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x28(%rbp),%rax
  mov    $0x4,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  cmpq   $0x2,-0x18(%rbp)
  jbe    L34
  cmpl   $0x0,-0x34(%rbp)
  je     L63
  mov    -0x30(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %eax,%r12d
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %eax,%ebx
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %r12d,%r8d
  mov    %ebx,%ecx
  mov    %rax,%rsi
  lea    D14(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L63:
  mov    -0x30(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %eax,%r12d
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %eax,%ebx
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  mov    %r12d,%r9d
  mov    %ebx,%r8d
  mov    %edx,%ecx
  lea    D21(%rip),%rdx
  mov    $0x4,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  jmp    L13
L34:
  cmpq   $0x2,-0x18(%rbp)
  jne    L46
  cmpl   $0x0,-0x34(%rbp)
  je     L68
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %eax,%ebx
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %ebx,%ecx
  mov    %rax,%rsi
  lea    D40(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L68:
  mov    -0x30(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %eax,%ebx
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  mov    %ebx,%r8d
  mov    %edx,%ecx
  lea    D8(%rip),%rdx
  mov    $0x4,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  jmp    L13
L46:
  cmpl   $0x0,-0x34(%rbp)
  je     L29
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %rax,%rsi
  lea    D31(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L29:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %eax,%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,%ecx
  lea    D7(%rip),%rdx
  mov    $0x4,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
L13:
  mov    -0x28(%rbp),%rax
  add    $0x30,%rsp
  pop    %rbx
  pop    %r12
  pop    %rbp
  ret
```

tool_calls: name: parse_data
arguments: tag: D14
type_infered: string
name: parse_data
arguments: tag: D21
type_infered: string
name: parse_data
arguments: tag: D40
type_infered: string
name: parse_data
arguments: tag: D8
type_infered: string
name: parse_data
arguments: tag: D31
type_infered: string
name: parse_data
arguments: tag: D7
type_infered: string

tool: D14: Aplicando regla 7:
	%-20s %c%c%c


tool: D21: %c%c%c

tool: D40: Aplicando regla 7, y regla 8 (agregando una X al final de la clave):
	%-20s %c%c


tool: D8: %c%cX

tool: D31: Aplicando regla 7, y regla 8 (agregando dos letras X al final de la clave):
	%-20s %c


tool: D7: %cXX

assistant: ```c
char *moral_regla7(char *result, const char *palabra, const int verbose) {
  const size_t len = strlen(palabra);
  memset(result, 0, 4);
  if (len >= 3) {
    if (verbose)
      printf("Aplicando regla 7:\n\t%-20s %c%c%c\n", palabra, toupper(*palabra), toupper(*(palabra + 1)), toupper(*(palabra + 2)));
    snprintf(result, 4, "%c%c%c", toupper(*palabra), toupper(*(palabra + 1)), toupper(*(palabra + 2)));
  } else if (len == 2) {
    if (verbose)
      printf("Aplicando regla 7, y regla 8 (agregando una X al final de la clave):\n\t%-20s %c%c\n", palabra, toupper(*palabra), toupper(*(palabra + 1)));
    snprintf(result, 4, "%c%cX", toupper(*palabra), toupper(*(palabra + 1)));
  } else {
    if (verbose)
      printf("Aplicando regla 7, y regla 8 (agregando dos letras X al final de la clave):\n\t%-20s %c\n", palabra, toupper(*palabra));
    snprintf(result, 4, "%cXX", toupper(*palabra));
  }
  return result;
}
```