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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x118,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  lea    D114(%rip),%rsi
  lea    D433(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  lea    D372(%rip),%rsi
  lea    D229(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,0x48(%rsp)
  test   %rbp,%rbp
  je     L149
L245:
  pxor   %xmm4,%xmm4
  movsd  %xmm4,0x40(%rsp)
  movsd  %xmm4,0x38(%rsp)
  mov    $0x0,%ebx
  lea    D68(%rip),%r15
  lea    D431(%rip),%r14
  lea    0x58(%rsp),%r13
  lea    D111(%rip),%r12
  jmp    L81
L149:
  lea    D270(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  jmp    L245
L123:
  lea    0xd0(%rsp),%rcx
  lea    0x90(%rsp),%rdx
  mov    %r13,%r9
  lea    0x50(%rsp),%r8
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <fscanf@plt>
  movsd  0x38(%rsp),%xmm4
  addsd  0x50(%rsp),%xmm4
  movsd  %xmm4,0x38(%rsp)
  movsd  0x40(%rsp),%xmm5
  addsd  0x58(%rsp),%xmm5
  movsd  %xmm5,0x40(%rsp)
  add    $0x1,%ebx
  cmp    $0x64,%ebx
  je     L41
L81:
  mov    %rbp,%rdi
  call   <feof@plt>
  test   %rax,%rax
  je     L123
  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    L123
L41:
  mov    %rbp,%rdi
  call   <fclose@plt>
  lea    D114(%rip),%rsi
  lea    D25(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L107
L145:
  pxor   %xmm5,%xmm5
  movsd  %xmm5,0x30(%rsp)
  movsd  %xmm5,0x28(%rsp)
  mov    $0x0,%ebx
  lea    D68(%rip),%r15
  lea    D431(%rip),%r14
  lea    0x68(%rsp),%r13
  lea    D111(%rip),%r12
  jmp    L196
L107:
  lea    D114(%rip),%rsi
  lea    D433(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  jne    L145
  lea    D388(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  jmp    L145
L259:
  lea    0xd0(%rsp),%rcx
  lea    0x90(%rsp),%rdx
  mov    %r13,%r9
  lea    0x60(%rsp),%r8
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <fscanf@plt>
  movsd  0x28(%rsp),%xmm6
  addsd  0x60(%rsp),%xmm6
  movsd  %xmm6,0x28(%rsp)
  movsd  0x30(%rsp),%xmm7
  addsd  0x68(%rsp),%xmm7
  movsd  %xmm7,0x30(%rsp)
  add    $0x1,%ebx
  cmp    $0x64,%ebx
  je     L198
L196:
  mov    %rbp,%rdi
  call   <feof@plt>
  test   %rax,%rax
  je     L259
  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    L259
L198:
  mov    %rbp,%rdi
  call   <fclose@plt>
  lea    D114(%rip),%rsi
  lea    D37(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L9
L136:
  pxor   %xmm6,%xmm6
  movsd  %xmm6,0x20(%rsp)
  movsd  %xmm6,0x18(%rsp)
  mov    $0x0,%ebx
  lea    D68(%rip),%r15
  lea    D431(%rip),%r14
  lea    0x78(%rsp),%r13
  lea    D111(%rip),%r12
  jmp    L154
L9:
  lea    D114(%rip),%rsi
  lea    D433(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  jne    L136
  lea    D388(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  jmp    L136
L12:
  lea    0xd0(%rsp),%rcx
  lea    0x90(%rsp),%rdx
  mov    %r13,%r9
  lea    0x70(%rsp),%r8
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <fscanf@plt>
  movsd  0x18(%rsp),%xmm1
  addsd  0x70(%rsp),%xmm1
  movsd  %xmm1,0x18(%rsp)
  movsd  0x20(%rsp),%xmm2
  addsd  0x78(%rsp),%xmm2
  movsd  %xmm2,0x20(%rsp)
  add    $0x1,%ebx
  cmp    $0x64,%ebx
  je     L137
L154:
  mov    %rbp,%rdi
  call   <feof@plt>
  test   %rax,%rax
  je     L12
  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    L12
L137:
  mov    %rbp,%rdi
  call   <fclose@plt>
  lea    D114(%rip),%rsi
  lea    D375(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L212
L203:
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x10(%rsp)
  movsd  %xmm7,0x8(%rsp)
  mov    $0x0,%ebx
  lea    D68(%rip),%r15
  lea    D431(%rip),%r14
  lea    0x88(%rsp),%r13
  lea    D111(%rip),%r12
  jmp    L220
L212:
  lea    D114(%rip),%rsi
  lea    D433(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  jne    L203
  lea    D388(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  jmp    L203
L266:
  lea    0xd0(%rsp),%rcx
  lea    0x90(%rsp),%rdx
  mov    %r13,%r9
  lea    0x80(%rsp),%r8
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <fscanf@plt>
  movsd  0x8(%rsp),%xmm3
  addsd  0x80(%rsp),%xmm3
  movsd  %xmm3,0x8(%rsp)
  movsd  0x10(%rsp),%xmm0
  addsd  0x88(%rsp),%xmm0
  movsd  %xmm0,0x10(%rsp)
  add    $0x1,%ebx
  cmp    $0x64,%ebx
  je     L161
L220:
  mov    %rbp,%rdi
  call   <feof@plt>
  test   %rax,%rax
  je     L266
  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    L266
L161:
  movsd  0x38(%rsp),%xmm0
  divsd  D335(%rip),%xmm0
  divsd  D335(%rip),%xmm3
  movsd  0x18(%rsp),%xmm2
  divsd  D335(%rip),%xmm2
  movsd  0x28(%rsp),%xmm1
  divsd  D335(%rip),%xmm1
  lea    D350(%rip),%rsi
  mov    0x48(%rsp),%rbx
  mov    %rbx,%rdi
  call   <fprintf@plt>
  movsd  0x40(%rsp),%xmm4
  divsd  D335(%rip),%xmm4
  movapd %xmm4,%xmm0
  movsd  0x10(%rsp),%xmm5
  divsd  D335(%rip),%xmm5
  movapd %xmm5,%xmm3
  movsd  0x20(%rsp),%xmm6
  divsd  D335(%rip),%xmm6
  movapd %xmm6,%xmm2
  movsd  0x30(%rsp),%xmm7
  divsd  D335(%rip),%xmm7
  movapd %xmm7,%xmm1
  lea    D221(%rip),%rsi
  mov    %rbx,%rdi
  call   <fprintf@plt>
  movsd  0x8(%rsp),%xmm3
  addsd  0x10(%rsp),%xmm3
  movsd  0x18(%rsp),%xmm2
  addsd  0x20(%rsp),%xmm2
  movsd  0x28(%rsp),%xmm1
  addsd  0x30(%rsp),%xmm1
  movsd  0x38(%rsp),%xmm0
  addsd  0x40(%rsp),%xmm0
  divsd  D335(%rip),%xmm0
  divsd  D335(%rip),%xmm3
  divsd  D335(%rip),%xmm2
  divsd  D335(%rip),%xmm1
  lea    D252(%rip),%rsi
  mov    %rbx,%rdi
  call   <fprintf@plt>
  mov    %rbx,%rdi
  call   <fclose@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    0x108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L235
  mov    $0x0,%eax
  add    $0x118,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L235:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D114
type_infered: string
name: unpack_data
arguments: data_label: D433
type_infered: string
name: unpack_data
arguments: data_label: D372
type_infered: string
name: unpack_data
arguments: data_label: D229
type_infered: string
name: unpack_data
arguments: data_label: D68
type_infered: string
name: unpack_data
arguments: data_label: D431
type_infered: string
name: unpack_data
arguments: data_label: D111
type_infered: string
name: unpack_data
arguments: data_label: D270
type_infered: string
name: unpack_data
arguments: data_label: D25
type_infered: string
name: unpack_data
arguments: data_label: D388
type_infered: string
name: unpack_data
arguments: data_label: D37
type_infered: string
name: unpack_data
arguments: data_label: D375
type_infered: string
name: unpack_data
arguments: data_label: D335
type_infered: f64
name: unpack_data
arguments: data_label: D350
type_infered: string
name: unpack_data
arguments: data_label: D221
type_infered: string
name: unpack_data
arguments: data_label: D252
type_infered: string

tool: D114: r

tool: D433: orig.txt

tool: D372: w

tool: D229: output.txt

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


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


tool: D111: %s %s %lf %lf


tool: D270: ERROR opening input file orig.txt

tool: D25: opt.txt

tool: D388: ERROR opening input file opt.txt

tool: D37: bst.txt

tool: D375: combine.txt

tool: D335: 100

tool: D350: append() %lf %lf %lf %lf


tool: D221: findName() %lf %lf %lf %lf


tool: D252: TimeSum %lf %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("bst.txt", "r");
  if (!fp) {
    fp = fopen("orig.txt", "r");
    if (!fp) {
      printf("ERROR opening input file opt.txt\n");
      exit(0);
    }
  }
  double bst_sum_a = 0.0, bst_sum_f = 0.0, bst_a, bst_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, &bst_a, &bst_f);
    bst_sum_a += bst_a;
    bst_sum_f += bst_f;
  }
  fclose(fp);
  fp = fopen("combine.txt", "r");
  if (!fp) {
    fp = fopen("orig.txt", "r");
    if (!fp) {
      printf("ERROR opening input file opt.txt\n");
      exit(0);
    }
  }
  double combine_sum_a = 0.0, combine_sum_f = 0.0, combine_a, combine_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, &combine_a, &combine_f);
    combine_sum_a += combine_a;
    combine_sum_f += combine_f;
  }
  fprintf(output, "append() %lf %lf %lf %lf\n", orig_sum_a / 100.0, opt_sum_a / 100.0, bst_sum_a / 100.0, combine_sum_a / 100.0);
  fprintf(output, "findName() %lf %lf %lf %lf\n", orig_sum_f / 100.0, opt_sum_f / 100.0, bst_sum_f / 100.0, combine_sum_f / 100.0);
  fprintf(output, "TimeSum %lf %lf %lf %lf", (orig_sum_a + orig_sum_f) / 100.0, (opt_sum_a + opt_sum_f) / 100.0, (bst_sum_a + bst_sum_f) / 100.0, (combine_sum_a + combine_sum_f) / 100.0);
  fclose(output);
  fclose(fp);
  return 0;
}
```