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

```asm
<main>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  cmp    $0x3,%edi
  je     L13
  lea    D74(%rip),%rdi
  lea    D103(%rip),%rsi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L13:
  mov    0x8(%rbx),%rdi
  lea    D44(%rip),%rsi
  lea    D92(%rip),%r12
  call   <fopen@plt>
  mov    0x10(%rbx),%rdi
  lea    D194(%rip),%rsi
  mov    %rax,%rbp
  call   <fopen@plt>
  lea    0xc(%rsp),%rdx
  mov    %rbp,%rdi
  mov    %r12,%rsi
  call   <fscanf@plt>
  mov    0xc(%rsp),%esi
  lea    D140(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x10(%rsp),%rdx
  mov    %rbp,%rdi
  mov    %r12,%rsi
  call   <fscanf@plt>
  mov    0x10(%rsp),%esi
  lea    D88(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x14(%rsp),%rdx
  mov    %rbp,%rdi
  mov    %r12,%rsi
  call   <fscanf@plt>
  mov    0x14(%rsp),%esi
  lea    D75(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x18(%rsp),%rdx
  mov    %rbp,%rdi
  mov    %r12,%rsi
  call   <fscanf@plt>
  mov    0x18(%rsp),%esi
  lea    D133(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x1c(%rsp),%rdx
  mov    %rbp,%rdi
  mov    %r12,%rsi
  call   <fscanf@plt>
  mov    0x1c(%rsp),%esi
  lea    D21(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x20(%rsp),%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <fscanf@plt>
  lea    D168(%rip),%rdi
  call   <puts@plt>
  lea    D79(%rip),%rdi
  call   <puts@plt>
  lea    D154(%rip),%rdi
  call   <puts@plt>
  lea    D182(%rip),%rdi
  call   <puts@plt>
  lea    D157(%rip),%rdi
  call   <puts@plt>
  mov    0x20(%rsp),%esi
  lea    D31(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x24(%rsp),%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <fscanf@plt>
  lea    D97(%rip),%rdi
  call   <puts@plt>
  lea    D197(%rip),%rdi
  call   <puts@plt>
  lea    D17(%rip),%rdi
  call   <puts@plt>
  mov    0x24(%rsp),%esi
  lea    D4(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x14(%rsp),%edx
  mov    0x10(%rsp),%eax
  lea    (%rax,%rdx,1),%ebp
  imul   0x18(%rsp),%ebp
  imul   %edx,%eax
  xor    %edi,%edi
  add    %eax,%ebp
  call   <time@plt>
  mov    %eax,%edi
  call   <srand@plt>
  push   0x10(%rbx)
  push   0x8(%rbx)
  mov    0x34(%rsp),%eax
  push   %rax
  push   %rbp
  mov    0x40(%rsp),%r9d
  mov    0x3c(%rsp),%r8d
  mov    0x38(%rsp),%ecx
  mov    0x34(%rsp),%edx
  mov    0x30(%rsp),%esi
  mov    0x2c(%rsp),%edi
  call   <feedback@plt>
  add    $0x20,%rsp
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0x30,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L5:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D74
datatype: string
name: read_data
arguments: label: D103
datatype: string
name: read_data
arguments: label: D44
datatype: string
name: read_data
arguments: label: D92
datatype: string
name: read_data
arguments: label: D194
datatype: string
name: read_data
arguments: label: D140
datatype: string
name: read_data
arguments: label: D88
datatype: string
name: read_data
arguments: label: D75
datatype: string
name: read_data
arguments: label: D133
datatype: string
name: read_data
arguments: label: D21
datatype: string
name: read_data
arguments: label: D168
datatype: string
name: read_data
arguments: label: D79
datatype: string
name: read_data
arguments: label: D154
datatype: string
name: read_data
arguments: label: D182
datatype: string
name: read_data
arguments: label: D157
datatype: string
name: read_data
arguments: label: D31
datatype: string
name: read_data
arguments: label: D97
datatype: string
name: read_data
arguments: label: D197
datatype: string
name: read_data
arguments: label: D17
datatype: string
name: read_data
arguments: label: D4
datatype: string

tool: D74: 
%s



tool: D103: Usage: ts_feedback input_file output_file

tool: D44: r

tool: D92: %d

tool: D194: w

tool: D140: The number of the internal states for the given plant (A, B, C) n = %d


tool: D88: The system's input dimension m = %d.


tool: D75: The system's output dimension p = %d.


tool: D133: The number of the internal states for the dynamic compensators q = %d.


tool: D21: Give the number of maps wanted (<0 for all) : %d 

tool: D168: 
Type 0, 1, 2, or 3 to select output level :

tool: D79:   0. no intermediate output;

tool: D154:   1. only final determinant validation;

tool: D182:   2. + validation of all intermediate determinants;

tool: D157:   3. + intermediate output of all path trackers.

tool: D31: The amount of the intermediate output: %d


tool: D97: 
Type 1, 2 to select input

tool: D197: Type 1 for the interactive input

tool: D17: Type 2 for the random input

tool: D4: The selected input is: %d


assistant: ```c
int main(int argc, char **argv) {
  int n, m, p, q, nb, level, nn, dimpts, dimpla, i, input;
  double *points, *planes;
  FILE *ifp, *ofp;
  if (argc != 3) {
    printf("\n%s\n\n", "Usage: ts_feedback input_file output_file");
    exit(1);
  }
  ifp = fopen(argv[1], "r");
  ofp = fopen(argv[2], "w");
  fscanf(ifp, "%d", &n);
  printf("The number of the internal states for the given plant (A, B, C) n = %d\n", n);
  fscanf(ifp, "%d", &m);
  printf("The system's input dimension m = %d.\n", m);
  fscanf(ifp, "%d", &p);
  printf("The system's output dimension p = %d.\n", p);
  fscanf(ifp, "%d", &q);
  printf("The number of the internal states for the dynamic compensators q = %d.\n", q);
  fscanf(ifp, "%d", &nb);
  printf("Give the number of maps wanted (<0 for all) : %d ", nb);
  fscanf(ifp, "%d", &level);
  printf("\nType 0, 1, 2, or 3 to select output level :\n");
  printf("  0. no intermediate output;\n");
  printf("  1. only final determinant validation;\n");
  printf("  2. + validation of all intermediate determinants;\n");
  printf("  3. + intermediate output of all path trackers.\n");
  printf("The amount of the intermediate output: %d\n", level);
  fscanf(ifp, "%d", &input);
  printf("\nType 1, 2 to select input\n");
  printf("Type 1 for the interactive input\n");
  printf("Type 2 for the random input\n");
  printf("The selected input is: %d\n", input);
  nn = m * p + q * (m + p);
  srand(time(NULL));
  feedback(n, m, p, q, nb, level, nn, input, argv[1], argv[2]);
  return 0;
}
```