user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %r12
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <adainit@plt>
  lea    D8(%rip),%rdi
  call   <puts@plt>
  lea    0x4(%rsp),%rdi
  lea    0x8(%rsp),%rsi
  call   <ask_menu_selection@plt>
  mov    0x4(%rsp),%edi
  cmp    $0x6,%edi
  je     L30
  cmp    $0x7,%edi
  je     L100
  cmp    $0x8,%edi
  je     L45
  cmp    $0x4,%edi
  jle    L21
  lea    0x18(%rsp),%rcx
  lea    0x14(%rsp),%rdx
  lea    0x10(%rsp),%rsi
  lea    0xc(%rsp),%rdi
  push   %r8
  lea    0x2c(%rsp),%rax
  push   %rax
  lea    0x30(%rsp),%r9
  lea    0x2c(%rsp),%r8
  call   <read_two_witness_sets@plt>
  mov    0x28(%rsp),%esi
  mov    0x24(%rsp),%edi
  call   <create_the_diagonal_homotopy@plt>
  pop    %r9
  pop    %r10
  mov    %eax,%esi
L39:
  test   %esi,%esi
  jle    L74
  lea    D10(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L123:
  xor    %eax,%eax
  xor    %r12d,%r12d
  call   <adafinal@plt>
L93:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L38
  add    $0x30,%rsp
  mov    %r12d,%eax
  pop    %r12
  ret
L21:
  call   <read_file_names@plt>
  mov    0x4(%rsp),%edi
  call   <create_the_homotopy@plt>
  mov    %eax,%esi
  jmp    L39
L74:
  xor    %eax,%eax
  call   <tune_parameters_and_output@plt>
  mov    0x4(%rsp),%edi
  cmp    $0x4,%edi
  je     L124
  mov    0x8(%rsp),%esi
  jg     L25
  call   <run_path_trackers@plt>
  jmp    L123
L25:
  push   %rsi
  mov    0x2c(%rsp),%eax
  push   %rax
  mov    0x30(%rsp),%r9d
  mov    0x2c(%rsp),%r8d
  mov    0x28(%rsp),%ecx
  mov    0x24(%rsp),%edx
  mov    0x20(%rsp),%esi
  mov    0x1c(%rsp),%edi
  call   <intersect_two_witness_sets@plt>
  pop    %rax
  pop    %rdx
  jmp    L123
L30:
  xor    %eax,%eax
  call   <witness_set_for_hypersurface@plt>
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <adafinal@plt>
  jmp    L93
L100:
  xor    %eax,%eax
  call   <collapse_extrinsic_diagonal@plt>
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <adafinal@plt>
  jmp    L93
L45:
  xor    %eax,%eax
  call   <remove_last_slack_variable@plt>
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <adafinal@plt>
  jmp    L93
L124:
  mov    0x8(%rsp),%edi
  call   <run_cascade@plt>
  jmp    L123
L38:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D8
type: string
name: extract_symbolic_data
arguments: label: D10
type: string

tool: D8: 
Calling the path trackers in PHCpack...

tool: D10: creation of homotopy fail = %d, no path tracking ...


assistant: ```c
int main(int argc, char *argv[]) {
  int fail, kind, monitor, n1, n2, a, b, d1, d2, cd;
  adainit();
  printf("\nCalling the path trackers in PHCpack...\n");
  ask_menu_selection(&kind, &monitor);
  if (kind == 6) {
    fail = witness_set_for_hypersurface();
    adafinal();
    return fail;
  }
  if (kind == 7) {
    fail = collapse_extrinsic_diagonal();
    adafinal();
    return fail;
  }
  if (kind == 8) {
    fail = remove_last_slack_variable();
    adafinal();
    return fail;
  }
  if (kind < 5) {
    fail = read_file_names(kind);
    fail = create_the_homotopy(kind);
  } else {
    fail = read_two_witness_sets(&n1, &n2, &a, &b, &d1, &d2, &cd);
    fail = create_the_diagonal_homotopy(a, b);
  }
  if (fail > 0)
    printf("creation of homotopy fail = %d, no path tracking ...\n", fail);
  else {
    fail = tune_parameters_and_output();
    if (kind == 4)
      fail = run_cascade(monitor);
    else if (kind < 5)
      fail = run_path_trackers(kind, monitor);
    else
      fail = intersect_two_witness_sets(n1, n2, a, b, d1, d2, cd, monitor);
  }
  adafinal();
  return 0;
}
```