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

```asm
<main>:
  endbr64
  push   %r15
  lea    D92(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    0x20(%rsp),%r15
  call   <printf@plt>
  mov    %r15,%rsi
  lea    D66(%rip),%rdi
  call   <scanf@plt>
  mov    %r15,%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%edi
  mov    %eax,0xc(%rsp)
  mov    %eax,%r14d
  call   <malloc@plt>
  movslq 0xc(%rsp),%rbp
  mov    %rax,%rbx
  test   %r14d,%r14d
  jle    L11
  mov    %rbp,%rdx
  mov    $0x2a,%esi
  mov    %rax,%rdi
  call   <memset@plt>
L11:
  movb   $0x0,(%rbx,%rbp,1)
  xor    %r12d,%r12d
  xor    %ebp,%ebp
  nop
L9:
  mov    $0x19,%r13d
  cs nopw 0x0(%rax,%rax,1)
L289:
  mov    $0xa,%edi
  call   <putchar@plt>
  sub    $0x1,%r13d
  jne    L289
  mov    %r12d,%edi
  call   <hangman@plt>
  cmp    $0x6,%r12d
  je     L191
  mov    %rbx,%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L229
  mov    %rbx,%rsi
  lea    D53(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D109(%rip),%rdi
  xor    %eax,%eax
  lea    0x15(%rsp),%r14
  call   <printf@plt>
  lea    D2(%rip),%r13
L239:
  mov    %r13,%rdi
  mov    %r14,%rsi
  call   <scanf@plt>
  movsbl 0x15(%rsp),%edi
  cmp    $0x20,%dil
  je     L239
  cmp    $0xa,%dil
  je     L239
  call   <isalpha@plt>
  test   %eax,%eax
  je     L133
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jle    L41
  mov    0xc(%rsp),%eax
  mov    %r15,%r9
  xor    %edi,%edi
  sub    %rbx,%r9
  sub    $0x1,%eax
  lea    0x1(%rbx,%rax,1),%r10
  mov    %rbx,%rax
  jmp    L267
  xchg   %ax,%ax
L124:
  movsbl %cl,%esi
  lea    0x20(%rsi),%r8d
  cmp    %r8d,%edx
  je     L212
  sub    $0x20,%esi
  cmp    %esi,%edx
  je     L212
  add    $0x1,%rax
  cmp    %r10,%rax
  je     L236
L267:
  movzbl (%r9,%rax,1),%ecx
  movsbl 0x15(%rsp),%edx
  cmp    %dl,%cl
  jne    L124
L212:
  mov    %cl,(%rax)
  add    $0x1,%rax
  mov    $0x1,%edi
  cmp    %r10,%rax
  jne    L267
L236:
  test   %ebp,%ebp
  je     L54
L92:
  movsbl 0x15(%rsp),%r8d
  lea    -0x1(%rbp),%eax
  lea    0x16(%rsp),%rdx
  xor    %ecx,%ecx
  lea    0x17(%rsp,%rax,1),%r9
  mov    $0x1,%r10d
  mov    %r8d,%esi
  jmp    L185
  xchg   %ax,%ax
L227:
  lea    0x20(%rax),%r11d
  cmp    %r11d,%r8d
  je     L99
  sub    $0x20,%eax
  cmp    %eax,%r8d
  cmove  %r10d,%ecx
  add    $0x1,%rdx
  cmp    %r9,%rdx
  je     L277
L185:
  movsbl (%rdx),%eax
  cmp    %al,%sil
  jne    L227
L99:
  add    $0x1,%rdx
  mov    $0x1,%ecx
  cmp    %r9,%rdx
  jne    L185
L277:
  test   %ecx,%ecx
  jne    L13
L54:
  test   %edi,%edi
  jne    L3
L242:
  lea    D21(%rip),%rdi
  add    $0x1,%r12d
  call   <puts@plt>
L15:
  movzbl 0x15(%rsp),%edx
  movslq %ebp,%rax
  add    $0x1,%ebp
  mov    %dl,0x16(%rsp,%rax,1)
  jmp    L9
  xchg   %ax,%ax
L3:
  lea    D99(%rip),%rdi
  call   <puts@plt>
  jmp    L15
L133:
  lea    D64(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L239
L13:
  lea    D54(%rip),%rdi
  call   <puts@plt>
  jmp    L9
L41:
  xor    %edi,%edi
  test   %ebp,%ebp
  jne    L92
  jmp    L242
L229:
  mov    %r15,%rsi
  lea    D93(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L147:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L168
  add    $0x48,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L191:
  mov    %r15,%rsi
  lea    D65(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L147
L168:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D92
type: string
name: parse_data
arguments: data_tag: D66
type: string
name: parse_data
arguments: data_tag: D53
type: string
name: parse_data
arguments: data_tag: D109
type: string
name: parse_data
arguments: data_tag: D2
type: string
name: parse_data
arguments: data_tag: D21
type: string
name: parse_data
arguments: data_tag: D99
type: string
name: parse_data
arguments: data_tag: D64
type: string
name: parse_data
arguments: data_tag: D54
type: string
name: parse_data
arguments: data_tag: D93
type: string
name: parse_data
arguments: data_tag: D65
type: string

tool: D92: Enter the secret word: 

tool: D66: %s

tool: D53: 
Hidden word: %s


tool: D109: Guess a letter: 

tool: D2: %c

tool: D21: Wrong...

tool: D99: Bravo!

tool: D64: That isn't a letter, try again: 

tool: D54: That letter has already been used, try again: 

tool: D93: Congratulations you guessed the secret world: %s


tool: D65: You lost...
The secret word was: %s


assistant: ```c
int main(void) {
  int i, j, n, flag, fl_used, wordLength;
  char word[21], *visibleWord, letter, usedLetters[10];
  printf("Enter the secret word: ");
  scanf("%s", word);
  wordLength = strlen(word);
  n = j = 0;
  visibleWord = (char *)malloc((wordLength + 1) * sizeof(char));
  for (i = 0; i < wordLength; i++) {
    visibleWord[i] = '*';
  }
  visibleWord[wordLength] = '\0';
  while (1) {
    for (i = 0; i < 25; i++)
      printf("\n");
    hangman(n);
    if (n == 6) {
      flag = 0;
      break;
    }
    if (!strcmp(word, visibleWord)) {
      flag = 1;
      break;
    }
    flag = 0;
    printf("\nHidden word: %s\n", visibleWord);
    printf("Guess a letter: ");
    while (1) {
      scanf("%c", &letter);
      if (letter == ' ' || letter == '\n')
        continue;
      if (!isalpha(letter)) {
        printf("That isn't a letter, try again: ");
        continue;
      } else
        break;
    }
    for (i = 0; i < wordLength; i++) {
      if (letter == word[i] || letter == word[i] + ('a' - 'A') || letter == word[i] - ('a' - 'A')) {
        visibleWord[i] = word[i];
        flag = 1;
      }
    }
    for (fl_used = 0, i = 0; i < j; i++) {
      if (letter == usedLetters[i] || letter == usedLetters[i] + ('a' - 'A') || letter == usedLetters[i] - ('a' - 'A')) {
        fl_used = 1;
      }
    }
    if (fl_used) {
      printf("That letter has already been used, try again: \n");
      continue;
    }
    if (!flag) {
      printf("Wrong...\n");
      n++;
    } else
      printf("Bravo!\n");
    usedLetters[j++] = letter;
  }
  if (flag) {
    printf("Congratulations you guessed the secret world: %s\n", word);
  } else {
    printf("You lost...\nThe secret word was: %s\n", word);
  }
  return 0;
}
```