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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %edi,-0x54(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x48(%rbp)
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x40(%rbp),%rax
  mov    %rax,%rsi
  lea    D78(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  lea    D43(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x44(%rbp),%rax
  mov    %rax,%rsi
  lea    D78(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  movl   $0x2,-0x4c(%rbp)
  jmp    L28
L10:
  mov    -0x4c(%rbp),%eax
  cltq
  movzbl -0x40(%rbp,%rax,1),%eax
  movsbl %al,%esi
  mov    -0x4c(%rbp),%eax
  sub    $0x1,%eax
  cltq
  movzbl -0x40(%rbp,%rax,1),%eax
  movsbl %al,%ecx
  mov    -0x4c(%rbp),%eax
  sub    $0x2,%eax
  cltq
  movzbl -0x40(%rbp,%rax,1),%eax
  movsbl %al,%edx
  mov    -0x4c(%rbp),%eax
  mov    %esi,%r8d
  mov    %eax,%esi
  lea    D70(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x4c(%rbp),%eax
  sub    $0x2,%eax
  cltq
  movzbl -0x40(%rbp,%rax,1),%edx
  movzbl -0x44(%rbp),%eax
  cmp    %al,%dl
  jne    L50
  mov    -0x4c(%rbp),%eax
  sub    $0x1,%eax
  cltq
  movzbl -0x40(%rbp,%rax,1),%edx
  movzbl -0x43(%rbp),%eax
  cmp    %al,%dl
  jne    L50
  mov    -0x4c(%rbp),%eax
  cltq
  movzbl -0x40(%rbp,%rax,1),%edx
  movzbl -0x42(%rbp),%eax
  cmp    %al,%dl
  jne    L50
  addl   $0x1,-0x48(%rbp)
L50:
  addl   $0x1,-0x4c(%rbp)
L28:
  mov    -0x4c(%rbp),%eax
  cltq
  movzbl -0x40(%rbp,%rax,1),%eax
  test   %al,%al
  jne    L10
  lea    -0x40(%rbp),%rax
  mov    %rax,%rsi
  lea    D76(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x44(%rbp),%rax
  mov    %rax,%rsi
  lea    D52(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x48(%rbp),%eax
  mov    %eax,%esi
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L37
  call   <__stack_chk_fail@plt>
L37:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D2
data_type: string
name: parse_data
arguments: data_tag: D78
data_type: string
name: parse_data
arguments: data_tag: D43
data_type: string
name: parse_data
arguments: data_tag: D70
data_type: string
name: parse_data
arguments: data_tag: D76
data_type: string
name: parse_data
arguments: data_tag: D52
data_type: string
name: parse_data
arguments: data_tag: D1
data_type: string

tool: D2: Digite a palavra: 

tool: D78: %s

tool: D43: Digite o texto a ser procurado: 

tool: D70: %d = %c%c%c


tool: D76: Palavra: %s


tool: D52: Texto para procura: %s


tool: D1: Ocorrencias: %d


assistant: ```c
int main(int argc, char const *argv[]) {
  char A[51];
  char B[4];
  int i, ocorrencias = 0;
  printf("Digite a palavra: ");
  scanf("%s", A);
  printf("Digite o texto a ser procurado: ");
  scanf("%s", B);
  for (i = 2; A[i] != '\0'; i++) {
    printf("%d = %c%c%c\n", i, A[i - 2], A[i - 1], A[i]);
    if (A[i - 2] == B[0] && A[i - 1] == B[1] && A[i] == B[2]) {
      ocorrencias++;
    }
  }
  printf("Palavra: %s\n", A);
  printf("Texto para procura: %s\n", B);
  printf("Ocorrencias: %d\n", ocorrencias);
  return 0;
}
```