user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xe8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xd8(%rsp)
  xor    %eax,%eax
  lea    D12(%rip),%rsi
  lea    D42(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  lea    D310(%rip),%rsi
  lea    D175(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,0x38(%rsp)
  test   %rbp,%rbp
  je     L75
L15:
  pxor   %xmm2,%xmm2
  movsd  %xmm2,0x30(%rsp)
  movsd  %xmm2,0x28(%rsp)
  mov    $0x0,%ebx
  lea    D88(%rip),%r15
  lea    D187(%rip),%r14
  lea    0x48(%rsp),%r13
  lea    D218(%rip),%r12
  jmp    L205
L75:
  lea    D286(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  jmp    L15
L120:
  lea    0xa0(%rsp),%rcx
  lea    0x60(%rsp),%rdx
  mov    %r13,%r9
  lea    0x40(%rsp),%r8
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <fscanf@plt>
  movsd  0x28(%rsp),%xmm3
  addsd  0x40(%rsp),%xmm3
  movsd  %xmm3,0x28(%rsp)
  movsd  0x30(%rsp),%xmm4
  addsd  0x48(%rsp),%xmm4
  movsd  %xmm4,0x30(%rsp)
  add    $0x1,%ebx
  cmp    $0x64,%ebx
  je     L9
L205:
  mov    %rbp,%rdi
  call   <feof@plt>
  test   %rax,%rax
  je     L120
  mov    %ebx,%esi
  mov    %r15,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r14,%rdi
  call   <puts@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  jmp    L120
L9:
  mov    %rbp,%rdi
  call   <fclose@plt>
  lea    D12(%rip),%rsi
  lea    D281(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L128
L169:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,0x20(%rsp)
  movsd  %xmm0,0x18(%rsp)
  mov    $0x0,%ebx
  lea    D88(%rip),%r15
  lea    D187(%rip),%r12
  lea    0x58(%rsp),%r14
  lea    D218(%rip),%r13
  jmp    L56
L128:
  lea    D12(%rip),%rsi
  lea    D42(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  jne    L169
  lea    D151(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  jmp    L169
L69:
  lea    0xa0(%rsp),%rcx
  lea    0x60(%rsp),%rdx
  mov    %r14,%r9
  lea    0x50(%rsp),%r8
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <fscanf@plt>
  movsd  0x18(%rsp),%xmm5
  addsd  0x50(%rsp),%xmm5
  movsd  %xmm5,0x18(%rsp)
  movsd  0x20(%rsp),%xmm6
  addsd  0x58(%rsp),%xmm6
  movsd  %xmm6,0x20(%rsp)
  add    $0x1,%ebx
  cmp    $0x64,%ebx
  je     L173
L56:
  mov    %rbp,%rdi
  call   <feof@plt>
  test   %rax,%rax
  je     L69
  mov    %ebx,%esi
  mov    %r15,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r12,%rdi
  call   <puts@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  jmp    L69
L173:
  mov    %rbp,%rdi
  call   <fclose@plt>
  lea    D12(%rip),%rsi
  lea    D52(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L182
L33:
  pxor   %xmm2,%xmm2
  movsd  %xmm2,0x10(%rsp)
  movsd  %xmm2,0x8(%rsp)
  mov    $0x0,%ebx
  lea    D88(%rip),%r13
  lea    D187(%rip),%r12
  lea    0x58(%rsp),%r15
  lea    D218(%rip),%r14
  jmp    L190
L182:
  lea    D12(%rip),%rsi
  lea    D42(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  jne    L33
  lea    D39(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  jmp    L33
L102:
  lea    0xa0(%rsp),%rcx
  lea    0x60(%rsp),%rdx
  mov    %r15,%r9
  lea    0x50(%rsp),%r8
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <fscanf@plt>
  movsd  0x8(%rsp),%xmm7
  addsd  0x50(%rsp),%xmm7
  movsd  %xmm7,0x8(%rsp)
  movsd  0x10(%rsp),%xmm1
  addsd  0x58(%rsp),%xmm1
  movsd  %xmm1,0x10(%rsp)
  add    $0x1,%ebx
  cmp    $0x64,%ebx
  je     L99
L190:
  mov    %rbp,%rdi
  call   <feof@plt>
  test   %rax,%rax
  je     L102
  mov    %ebx,%esi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r12,%rdi
  call   <puts@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  jmp    L102
L99:
  movsd  0x28(%rsp),%xmm0
  divsd  D198(%rip),%xmm0
  movapd %xmm7,%xmm2
  divsd  D198(%rip),%xmm2
  movsd  0x18(%rsp),%xmm1
  divsd  D198(%rip),%xmm1
  lea    D28(%rip),%rsi
  mov    0x38(%rsp),%rbx
  mov    %rbx,%rdi
  call   <fprintf@plt>
  movsd  0x30(%rsp),%xmm0
  divsd  D198(%rip),%xmm0
  movsd  0x10(%rsp),%xmm2
  divsd  D198(%rip),%xmm2
  movsd  0x20(%rsp),%xmm1
  divsd  D198(%rip),%xmm1
  lea    D146(%rip),%rsi
  mov    %rbx,%rdi
  call   <fprintf@plt>
  mov    %rbx,%rdi
  call   <fclose@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    0xd8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L22
  mov    $0x0,%eax
  add    $0xe8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L22:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D12
type_infered: string
name: retrieve_data
arguments: data_label: D42
type_infered: string
name: retrieve_data
arguments: data_label: D310
type_infered: string
name: retrieve_data
arguments: data_label: D175
type_infered: string
name: retrieve_data
arguments: data_label: D88
type_infered: string
name: retrieve_data
arguments: data_label: D187
type_infered: string
name: retrieve_data
arguments: data_label: D218
type_infered: string
name: retrieve_data
arguments: data_label: D286
type_infered: string
name: retrieve_data
arguments: data_label: D281
type_infered: string
name: retrieve_data
arguments: data_label: D151
type_infered: string
name: retrieve_data
arguments: data_label: D52
type_infered: string
name: retrieve_data
arguments: data_label: D39
type_infered: string
name: retrieve_data
arguments: data_label: D198
type_infered: f64
name: retrieve_data
arguments: data_label: D28
type_infered: string
name: retrieve_data
arguments: data_label: D146
type_infered: string

tool: D12: r

tool: D42: orig.txt

tool: D310: w

tool: D175: output.txt

tool: D88: ERROR: You need 100 datum instead of %d


tool: D187: run 'make run' longer to get enough information


tool: D218: %s %s %lf %lf


tool: D286: ERROR opening input file orig.txt

tool: D281: opt.txt

tool: D151: ERROR opening input file opt.txt

tool: D52: opt_hash.txt

tool: D39: ERROR opening input file opt_hash.txt

tool: D198: 100

tool: D28: append() %lf %lf %lf


tool: D146: findName() %lf %lf %lf

assistant: ```c
int main(void) {
  FILE *fp = fopen("orig.txt", "r");
  FILE *output = fopen("output.txt", "w");
  if (!fp) {
    printf("ERROR opening input file orig.txt\n");
    exit(0);
  }
  int i = 0;
  char append[50], find[50];
  double orig_sum_a = 0.0, orig_sum_f = 0.0, orig_a, orig_f;
  for (i = 0; i < 100; i++) {
    if (feof(fp)) {
      printf("ERROR: You need 100 datum instead of %d\n", i);
      printf("run 'make run' longer to get enough information\n\n");
      exit(0);
    }
    fscanf(fp, "%s %s %lf %lf\n", append, find, &orig_a, &orig_f);
    orig_sum_a += orig_a;
    orig_sum_f += orig_f;
  }
  fclose(fp);
  fp = fopen("opt.txt", "r");
  if (!fp) {
    fp = fopen("orig.txt", "r");
    if (!fp) {
      printf("ERROR opening input file opt.txt\n");
      exit(0);
    }
  }
  double opt_sum_a = 0.0, opt_sum_f = 0.0, opt_a, opt_f;
  for (i = 0; i < 100; i++) {
    if (feof(fp)) {
      printf("ERROR: You need 100 datum instead of %d\n", i);
      printf("run 'make run' longer to get enough information\n\n");
      exit(0);
    }
    fscanf(fp, "%s %s %lf %lf\n", append, find, &opt_a, &opt_f);
    opt_sum_a += opt_a;
    opt_sum_f += opt_f;
  }
  fclose(fp);
  fp = fopen("opt_hash.txt", "r");
  if (!fp) {
    fp = fopen("orig.txt", "r");
    if (!fp) {
      printf("ERROR opening input file opt_hash.txt\n");
      exit(0);
    }
  }
  double opt_sum_a_hash = 0.0, opt_sum_f_hash = 0.0;
  for (i = 0; i < 100; i++) {
    if (feof(fp)) {
      printf("ERROR: You need 100 datum instead of %d\n", i);
      printf("run 'make run' longer to get enough information\n\n");
      exit(0);
    }
    fscanf(fp, "%s %s %lf %lf\n", append, find, &opt_a, &opt_f);
    opt_sum_a_hash += opt_a;
    opt_sum_f_hash += opt_f;
  }
  fprintf(output, "append() %lf %lf %lf\n", orig_sum_a / 100.0, opt_sum_a / 100.0, opt_sum_a_hash / 100.0);
  fprintf(output, "findName() %lf %lf %lf", orig_sum_f / 100.0, opt_sum_f / 100.0, opt_sum_f_hash / 100.0);
  fclose(output);
  fclose(fp);
  return 0;
}
```