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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x840,%rsp
  mov    %edi,-0x2834(%rbp)
  mov    %rsi,-0x2840(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    $0x320,%edi
  call   <malloc@plt>
  mov    %rax,-0x2828(%rbp)
  mov    $0x320,%edi
  call   <malloc@plt>
  mov    %rax,-0x2820(%rbp)
  mov    -0x2820(%rbp),%rax
  mov    $0x320,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x2828(%rbp),%rax
  mov    $0x320,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  movq   $0x0,-0x2818(%rbp)
  lea    D59(%rip),%rax
  mov    %rax,%rsi
  lea    D46(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x2818(%rbp)
  cmpq   $0x0,-0x2818(%rbp)
  jne    L7
  lea    D56(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L7:
  movl   $0x0,-0x282c(%rbp)
  movl   $0x0,-0x282c(%rbp)
  jmp    L29
L51:
  mov    -0x2818(%rbp),%rdx
  lea    -0x2810(%rbp),%rax
  mov    $0x2800,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  lea    -0x2810(%rbp),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  movl   $0x0,-0x2830(%rbp)
  jmp    L0
L22:
  mov    -0x2830(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  movslq %eax,%rdx
  mov    -0x282c(%rbp),%eax
  cltq
  add    %rdx,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x2828(%rbp),%rax
  add    %rax,%rdx
  mov    -0x2830(%rbp),%ecx
  mov    %ecx,%eax
  shl    $0x2,%eax
  add    %ecx,%eax
  add    %eax,%eax
  cltq
  lea    -0x2810(%rbp),%rcx
  add    %rcx,%rax
  lea    D0(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  addl   $0x1,-0x2830(%rbp)
L0:
  cmpl   $0x9,-0x2830(%rbp)
  jle    L22
  addl   $0x1,-0x282c(%rbp)
L29:
  cmpl   $0x9,-0x282c(%rbp)
  jle    L51
  mov    -0x2828(%rbp),%rax
  lea    D29(%rip),%rdx
  mov    %rdx,%rcx
  mov    $0xa,%edx
  mov    $0xa,%esi
  mov    %rax,%rdi
  call   <print_matrix@plt>
  mov    -0x2828(%rbp),%rax
  mov    $0x1,%r8d
  mov    $0x6,%ecx
  mov    $0x6,%edx
  mov    $0xa,%esi
  mov    %rax,%rdi
  call   <housholder@plt>
  mov    -0x2828(%rbp),%rax
  lea    D29(%rip),%rdx
  mov    %rdx,%rcx
  mov    $0xa,%edx
  mov    $0xa,%esi
  mov    %rax,%rdi
  call   <print_matrix@plt>
  mov    -0x2828(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x2820(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L20
  call   <__stack_chk_fail@plt>
L20:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D59
type_guessed: string
name: extract_symbolic_data
arguments: tag: D46
type_guessed: string
name: extract_symbolic_data
arguments: tag: D56
type_guessed: string
name: extract_symbolic_data
arguments: tag: D0
type_guessed: string
name: extract_symbolic_data
arguments: tag: D29
type_guessed: string

tool: D59: r

tool: D46: E:\data.txt

tool: D56: cant open file to read!

tool: D0: %lf

tool: D29: P MATRIX

assistant: ```c
int main(int argc, char *args[]) {
  int i;
  double *P = (double *)malloc(sizeof(double) * 10 * 10);
  double *D = (double *)malloc(sizeof(double) * 10 * 10);
  memset(D, 0, sizeof(double) * 10 * 10);
  memset(P, 0, sizeof(double) * 10 * 10);
  FILE *fp = NULL;
  if (!(fp = fopen("E:\\data.txt", "r"))) {
    printf("cant open file to read!\n");
    exit(1);
  }
  int index = 0;
  char buffer[10240];
  for (index = 0; index < 10; index++) {
    fgets(buffer, 10240, fp);
    printf("%s\n", buffer);
    for (i = 0; i < 10; i++) {
      sscanf(buffer + i * 10, "%lf", P + 10 * i + index);
    }
  }
  print_matrix(P, 10, 10, "P MATRIX");
  housholder(P, 10, 6, 6, 1);
  print_matrix(P, 10, 10, "P MATRIX");
  free(P);
  free(D);
}
```