user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<summation>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x40,%rsp
  mov    %esi,%ebp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  test   %edi,%edi
  mov    $0x1,%eax
  cmovg  %edi,%eax
  mov    %eax,%ebx
  lea    0x64(%rax),%eax
  cmp    %esi,%ebx
  cmovg  %eax,%ebp
  lea    D43(%rip),%rdi
  call   <puts@plt>
  mov    %ebp,%edx
  mov    %ebx,%esi
  lea    D21(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %ebp,%esi
  mov    %ebx,%edi
  call   <addForward@plt>
  movsd  %xmm0,(%rsp)
  lea    D102(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    %ebp,%esi
  mov    %ebx,%edi
  call   <addReverse@plt>
  movsd  %xmm0,0x8(%rsp)
  lea    D34(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    %ebp,%esi
  mov    %ebx,%edi
  call   <addRecursive@plt>
  movsd  %xmm0,0x10(%rsp)
  lea    D61(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    %ebp,%esi
  mov    %ebx,%edi
  call   <addForwardDouble@plt>
  movsd  %xmm0,0x18(%rsp)
  lea    D25(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    %ebp,%esi
  mov    %ebx,%edi
  call   <addReverseDouble@plt>
  movsd  %xmm0,0x20(%rsp)
  lea    D23(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    %ebp,%esi
  mov    %ebx,%edi
  call   <addRecursiveDouble@plt>
  movsd  %xmm0,0x28(%rsp)
  lea    D77(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  mov    %ebp,%esi
  mov    %ebx,%edi
  call   <KahanSummation@plt>
  movsd  %xmm0,0x30(%rsp)
  lea    D84(%rip),%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  lea    D71(%rip),%rdi
  call   <puts@plt>
  mov    %rsp,%r14
  lea    0x38(%rsp),%r12
  mov    %r14,%rbp
  lea    D40(%rip),%r13
L22:
  mov    %r14,%rbx
L28:
  movsd  0x0(%rbp),%xmm0
  subsd  (%rbx),%xmm0
  mov    %r13,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
  add    $0x8,%rbx
  cmp    %r12,%rbx
  jne    L28
  mov    $0xa,%edi
  call   <putchar@plt>
  add    $0x8,%rbp
  cmp    %r12,%rbp
  jne    L22
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  add    $0x40,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L7:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D43
datatype: string
name: read_data
arguments: tag: D21
datatype: string
name: read_data
arguments: tag: D102
datatype: string
name: read_data
arguments: tag: D34
datatype: string
name: read_data
arguments: tag: D61
datatype: string
name: read_data
arguments: tag: D25
datatype: string
name: read_data
arguments: tag: D23
datatype: string
name: read_data
arguments: tag: D77
datatype: string
name: read_data
arguments: tag: D84
datatype: string
name: read_data
arguments: tag: D71
datatype: string
name: read_data
arguments: tag: D40
datatype: string

tool: D43: 
==========Summation==========

tool: D21: The sum of the series 1/i, with i running from %d to %d is


tool: D102: Forward summation with floats:		%2.17g


tool: D34: Reverse summation with floats:		%2.17g


tool: D61: Recursive summation with floats:	%2.17g


tool: D25: Forward summation with doubles:		%2.17g


tool: D23: Reverse summation with doubles:		%2.17g


tool: D77: Recursive summation with doubles:	%2.17g


tool: D84: Kahan summation with floats:		%2.17g


tool: D71: Differences between results in a matrix:

tool: D40: %12.7g	

assistant: ```c
void summation(int from, int to) {
  int i;
  int j;
  double sum[7];
  if (from < 1)
    from = 1;
  if (to < from)
    to = from + 100;
  printf("\n==========Summation==========\n");
  printf("The sum of the series 1/i, with i running from %d to %d is\n", from, to);
  printf("Forward summation with floats:\t\t%2.17g\n", sum[0] = addForward(from, to));
  printf("Reverse summation with floats:\t\t%2.17g\n", sum[1] = addReverse(from, to));
  printf("Recursive summation with floats:\t%2.17g\n", sum[2] = addRecursive(from, to));
  printf("Forward summation with doubles:\t\t%2.17g\n", sum[3] = addForwardDouble(from, to));
  printf("Reverse summation with doubles:\t\t%2.17g\n", sum[4] = addReverseDouble(from, to));
  printf("Recursive summation with doubles:\t%2.17g\n", sum[5] = addRecursiveDouble(from, to));
  printf("Kahan summation with floats:\t\t%2.17g\n", sum[6] = KahanSummation(from, to));
  printf("Differences between results in a matrix:\n");
  for (i = 0; i < 7; i++) {
    for (j = 0; j < 7; j++) {
      printf("%12.7g\t", sum[i] - sum[j]);
    }
    printf("\n");
  }
}
```