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

```asm
<main>:
  endbr64
  push   %r15
  xor    %edi,%edi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  lea    D51(%rip),%rbp
  push   %rbx
  lea    D50(%rip),%rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  movl   $0xffffffff,(%rsp)
  mov    $0xffffffff,%eax
  jmp    L2
  nopl   0x0(%rax)
L34:
  cmp    $0x1,%eax
  je     L128
  mov    (%rsp),%eax
  test   %eax,%eax
  je     L87
L2:
  cmp    $0xffffffff,%eax
  jne    L34
L25:
  xor    %eax,%eax
  call   <menu@plt>
  mov    %rsp,%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  mov    (%rsp),%eax
  test   %eax,%eax
  jne    L2
L87:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L123
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L128:
  xor    %eax,%eax
  mov    $0x9,%r14d
  lea    0x4(%rsp),%r13
  call   <rand@plt>
  mov    $0x64,%ecx
  lea    D18(%rip),%r15
  cltd
  idiv   %ecx
  mov    %edx,%r12d
  jmp    L10
  nopl   (%rax)
L119:
  jg     L143
L78:
  sub    $0x1,%r14d
L74:
  test   %r14d,%r14d
  je     L33
  cmp    %r12d,0x4(%rsp)
  je     L103
L10:
  mov    %r14d,%ecx
  mov    $0x64,%edx
  xor    %esi,%esi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  mov    0x4(%rsp),%eax
  cmp    $0x64,%eax
  ja     L74
  cmp    %r12d,%eax
  jge    L119
  mov    %r15,%rdi
  call   <puts@plt>
  jmp    L78
  nopl   0x0(%rax)
L143:
  lea    D5(%rip),%rdi
  call   <puts@plt>
  jmp    L78
L33:
  mov    %r12d,%esi
  lea    D36(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L1:
  movl   $0xffffffff,(%rsp)
  jmp    L25
L103:
  lea    D44(%rip),%rdi
  call   <puts@plt>
  jmp    L1
L123:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D51
data_type: string
name: unpack_data
arguments: label: D50
data_type: string
name: unpack_data
arguments: label: D18
data_type: string
name: unpack_data
arguments: label: D5
data_type: string
name: unpack_data
arguments: label: D36
data_type: string
name: unpack_data
arguments: label: D44
data_type: string

tool: D51: Try a value [%d - %d], %d lives remaining :


tool: D50: %d

tool: D18: Try more (+) !


tool: D5: Try less (-) !


tool: D36: You loose, mystery number was %d


tool: D44: Congratulations, you win !

assistant: ```c
int main(void) {
  srand(time(NULL));
  int menu_choice = -1;
  while (menu_choice) {
    if (menu_choice == -1) {
      menu();
      scanf("%d", &menu_choice);
    } else if (menu_choice == 1) {
      int mystery_num = rand() % (100 - 0) + 0;
      int try;
      int lives = 9;
      do {
        printf("Try a value [%d - %d], %d lives remaining :\n", 0, 100, lives);
        scanf("%d", &try);
        if (try < 0 || try > 100) {
          continue;
        } else {
          if (try < mystery_num) {
            printf("Try more (+) !\n\n");
          } else if (try > mystery_num) {
            printf("Try less (-) !\n\n");
          }
          lives--;
        }
      } while (lives != 0 && try != mystery_num);
      if (!lives) {
        printf("You loose, mystery number was %d\n", mystery_num);
      } else {
        printf("Congratulations, you win !\n");
      }
      menu_choice = -1;
    }
  }
  return 0;
}
```