user: 请将以下的汇编代码转换成C语言代码:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xd8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xc8(%rsp)
  xor    %eax,%eax
  lea    D102(%rip),%rsi
  lea    D118(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  lea    D148(%rip),%rsi
  lea    D195(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,0x28(%rsp)
  test   %rbp,%rbp
  je     L94
L66:
  pxor   %xmm6,%xmm6
  movsd  %xmm6,0x20(%rsp)
  movsd  %xmm6,0x18(%rsp)
  mov    $0x0,%ebx
  lea    D16(%rip),%r15
  lea    D76(%rip),%r14
  lea    0x38(%rsp),%r13
  lea    D105(%rip),%r12
  jmp    L49
L94:
  lea    D45(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  jmp    L66
L8:
  lea    0x90(%rsp),%rcx
  lea    0x50(%rsp),%rdx
  mov    %r13,%r9
  lea    0x30(%rsp),%r8
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <fscanf@plt>
  movsd  0x18(%rsp),%xmm2
  addsd  0x30(%rsp),%xmm2
  movsd  %xmm2,0x18(%rsp)
  movsd  0x20(%rsp),%xmm3
  addsd  0x38(%rsp),%xmm3
  movsd  %xmm3,0x20(%rsp)
  add    $0x1,%ebx
  cmp    $0x64,%ebx
  je     L57
L49:
  mov    %rbp,%rdi
  call   <feof@plt>
  test   %rax,%rax
  je     L8
  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    L8
L57:
  lea    D102(%rip),%rsi
  lea    D123(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L52
L22:
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x10(%rsp)
  movsd  %xmm7,0x8(%rsp)
  mov    $0x0,%ebx
  lea    D16(%rip),%r15
  lea    D76(%rip),%r12
  lea    0x48(%rsp),%r14
  lea    D105(%rip),%r13
  jmp    L126
L52:
  lea    D141(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  jmp    L22
L28:
  lea    0x90(%rsp),%rcx
  lea    0x50(%rsp),%rdx
  mov    %r14,%r9
  lea    0x40(%rsp),%r8
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <fscanf@plt>
  movsd  0x8(%rsp),%xmm4
  addsd  0x40(%rsp),%xmm4
  movsd  %xmm4,0x8(%rsp)
  movsd  0x10(%rsp),%xmm5
  addsd  0x48(%rsp),%xmm5
  movsd  %xmm5,0x10(%rsp)
  add    $0x1,%ebx
  cmp    $0x64,%ebx
  je     L101
L126:
  mov    %rbp,%rdi
  call   <feof@plt>
  test   %rax,%rax
  je     L28
  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    L28
L101:
  movsd  0x18(%rsp),%xmm0
  divsd  D194(%rip),%xmm0
  movapd %xmm4,%xmm1
  divsd  D194(%rip),%xmm1
  lea    D44(%rip),%rsi
  mov    0x28(%rsp),%rbx
  mov    %rbx,%rdi
  call   <fprintf@plt>
  movsd  0x20(%rsp),%xmm0
  divsd  D194(%rip),%xmm0
  movsd  0x10(%rsp),%xmm1
  divsd  D194(%rip),%xmm1
  lea    D2(%rip),%rsi
  mov    %rbx,%rdi
  call   <fprintf@plt>
  mov    %rbx,%rdi
  call   <fclose@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  lea    D114(%rip),%rdi
  call   <puts@plt>
  mov    0xc8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L64
  mov    $0x0,%eax
  add    $0xd8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L64:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D102
datatype: string
name: disassemble_data
arguments: tag: D118
datatype: string
name: disassemble_data
arguments: tag: D148
datatype: string
name: disassemble_data
arguments: tag: D195
datatype: string
name: disassemble_data
arguments: tag: D16
datatype: string
name: disassemble_data
arguments: tag: D76
datatype: string
name: disassemble_data
arguments: tag: D105
datatype: string
name: disassemble_data
arguments: tag: D45
datatype: string
name: disassemble_data
arguments: tag: D123
datatype: string
name: disassemble_data
arguments: tag: D141
datatype: string
name: disassemble_data
arguments: tag: D194
datatype: f64
name: disassemble_data
arguments: tag: D44
datatype: string
name: disassemble_data
arguments: tag: D2
datatype: string
name: disassemble_data
arguments: tag: D114
datatype: string

tool: D102: r

tool: D118: orig.txt

tool: D148: w

tool: D195: output.txt

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


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


tool: D105: %s %s %lf %lf


tool: D45: ERROR opening input file orig.txt

tool: D123: opt.txt

tool: D141: ERROR opening input file opt.txt

tool: D194: 100

tool: D44: append() %lf %lf


tool: D2: findName() %lf %lf

tool: D114: 
Finish calculating, run 'make plot' to see the result


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;
  }
  fp = fopen("opt.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;
  }
  fprintf(output, "append() %lf %lf\n", orig_sum_a / 100.0, opt_sum_a / 100.0);
  fprintf(output, "findName() %lf %lf", orig_sum_f / 100.0, opt_sum_f / 100.0);
  fclose(output);
  fclose(fp);
  printf("\nFinish calculating, run 'make plot' to see the result\n\n");
  return 0;
}
```