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

```asm
<ask_menu_selection>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    D24(%rip),%rdi
  call   <printf@plt>
  lea    D128(%rip),%rdi
  call   <printf@plt>
  lea    D74(%rip),%rdi
  call   <printf@plt>
  lea    D56(%rip),%rdi
  call   <printf@plt>
  lea    D47(%rip),%rdi
  call   <printf@plt>
  lea    D43(%rip),%rdi
  call   <printf@plt>
  lea    D93(%rip),%rdi
  call   <printf@plt>
  lea    D136(%rip),%rdi
  call   <printf@plt>
  lea    D91(%rip),%rdi
  call   <printf@plt>
  lea    D7(%rip),%rdi
  call   <printf@plt>
  lea    D133(%rip),%rdi
  call   <printf@plt>
  mov    %rbx,%rsi
  lea    D0(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  cmpl   $0x5,(%rbx)
  jle    L21
L34:
  cmpl   $0x9,(%rbx)
  je     L29
L3:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L10
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L21:
  lea    D5(%rip),%rdi
  call   <printf@plt>
  lea    0x7(%rsp),%r13
  mov    %r13,%rsi
  lea    D82(%rip),%r12
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    %r13,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  movb   $0x79,0x7(%rsp)
  movl   $0x1,0x0(%rbp)
  mov    %r13,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  jmp    L34
L29:
  movl   $0x1,0x0(%rbp)
  jmp    L3
L10:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D24
type_infered: string
name: retrieve_data
arguments: data_tag: D128
type_infered: string
name: retrieve_data
arguments: data_tag: D74
type_infered: string
name: retrieve_data
arguments: data_tag: D56
type_infered: string
name: retrieve_data
arguments: data_tag: D47
type_infered: string
name: retrieve_data
arguments: data_tag: D43
type_infered: string
name: retrieve_data
arguments: data_tag: D93
type_infered: string
name: retrieve_data
arguments: data_tag: D136
type_infered: string
name: retrieve_data
arguments: data_tag: D91
type_infered: string
name: retrieve_data
arguments: data_tag: D7
type_infered: string
name: retrieve_data
arguments: data_tag: D133
type_infered: string
name: retrieve_data
arguments: data_tag: D0
type_infered: string
name: retrieve_data
arguments: data_tag: D5
type_infered: string
name: retrieve_data
arguments: data_tag: D82
type_infered: string

tool: D24: 
MENU for type of start system and homotopy :


tool: D128:   1. start system is based on total degree;


tool: D74:   2. a linear-product start system will be given;


tool: D56:   3. start system and start solutions are provided;


tool: D47:   4. the homotopy is a cascade to go one level down;


tool: D43:   5. diagonal homotopy to start a cascade;


tool: D93:   6. compute witness set for a hypersurface;


tool: D136:   7. collapse extrinsic diagonal of a witness set;


tool: D91:   8. remove the last slack variable of a witness set;


tool: D7:   9. test the crude path trackers.


tool: D133: Type 1, 2, 3, 4, 5, 6, 7, 8, or 9 to select : 

tool: D0: %d

tool: D5: 
Do you want to monitor progress of solver on screen ? (y/n) 

tool: D82: %c

assistant: ```c
void ask_menu_selection(int *kind, int *monitor) {
  char ans;
  printf("\nMENU for type of start system and homotopy :\n");
  printf("  1. start system is based on total degree;\n");
  printf("  2. a linear-product start system will be given;\n");
  printf("  3. start system and start solutions are provided;\n");
  printf("  4. the homotopy is a cascade to go one level down;\n");
  printf("  5. diagonal homotopy to start a cascade;\n");
  printf("  6. compute witness set for a hypersurface;\n");
  printf("  7. collapse extrinsic diagonal of a witness set;\n");
  printf("  8. remove the last slack variable of a witness set;\n");
  printf("  9. test the crude path trackers.\n");
  printf("Type 1, 2, 3, 4, 5, 6, 7, 8, or 9 to select : ");
  scanf("%d", kind);
  if (*kind < 6) {
    printf("\nDo you want to monitor progress of solver on screen ? (y/n) ");
    scanf("%c", &ans);
    scanf("%c", &ans);
    if (ans = 'y')
      *monitor = 1;
    else
      *monitor = 0;
    scanf("%c", &ans);
  }
  if (*kind == 9)
    *monitor = 1;
}
```