user: Please show me the C implementation that matches the assembly code listed below:

```asm
<summation>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  test   %edi,%edi
  mov    $0x1,%eax
  lea    0x18(%rsp),%r13
  cmovg  %edi,%eax
  lea    D4(%rip),%rdi
  lea    0x48(%rsp),%rbx
  mov    %eax,%ebp
  add    $0x64,%eax
  cmp    %esi,%ebp
  cmovg  %eax,%r12d
  call   <puts@plt>
  mov    %ebp,%esi
  lea    D95(%rip),%rdi
  xor    %eax,%eax
  mov    %r12d,%edx
  call   <printf@plt>
  mov    %r12d,%esi
  mov    %ebp,%edi
  call   <addForward@plt>
  lea    D26(%rip),%rdi
  mov    $0x1,%eax
  movsd  %xmm0,0x8(%rsp)
  call   <printf@plt>
  mov    %r12d,%esi
  mov    %ebp,%edi
  call   <addReverse@plt>
  lea    D2(%rip),%rdi
  mov    $0x1,%eax
  movsd  %xmm0,0x18(%rsp)
  call   <printf@plt>
  mov    %r12d,%esi
  mov    %ebp,%edi
  call   <addRecursive@plt>
  lea    D36(%rip),%rdi
  mov    $0x1,%eax
  movsd  %xmm0,0x20(%rsp)
  call   <printf@plt>
  mov    %r12d,%esi
  mov    %ebp,%edi
  call   <addForwardDouble@plt>
  lea    D23(%rip),%rdi
  mov    $0x1,%eax
  movsd  %xmm0,0x28(%rsp)
  call   <printf@plt>
  mov    %r12d,%esi
  mov    %ebp,%edi
  call   <addReverseDouble@plt>
  lea    D60(%rip),%rdi
  mov    $0x1,%eax
  movsd  %xmm0,0x30(%rsp)
  call   <printf@plt>
  mov    %r12d,%esi
  mov    %ebp,%edi
  call   <addRecursiveDouble@plt>
  lea    D28(%rip),%rdi
  mov    $0x1,%eax
  movsd  %xmm0,0x38(%rsp)
  call   <printf@plt>
  mov    %r12d,%esi
  mov    %ebp,%edi
  mov    %r13,%r12
  call   <KahanSummation@plt>
  lea    D14(%rip),%rdi
  mov    $0x1,%eax
  lea    D31(%rip),%rbp
  movsd  %xmm0,0x40(%rsp)
  call   <printf@plt>
  lea    D73(%rip),%rdi
  call   <puts@plt>
  movsd  0x8(%rsp),%xmm3
  movq   %xmm3,%r15
  nopl   0x0(%rax,%rax,1)
L48:
  movsd  0x8(%rsp),%xmm0
  mov    %r13,%r14
  jmp    L9
  nopl   0x0(%rax,%rax,1)
L12:
  movsd  (%r14),%xmm0
  add    $0x8,%r14
L9:
  movq   %r15,%xmm1
  mov    %rbp,%rdi
  mov    $0x1,%eax
  subsd  %xmm0,%xmm1
  movapd %xmm1,%xmm0
  call   <printf@plt>
  cmp    %rbx,%r14
  jne    L12
  mov    $0xa,%edi
  call   <putchar@plt>
  cmp    %rbx,%r12
  je     L14
  movsd  (%r12),%xmm2
  add    $0x8,%r12
  movq   %xmm2,%r15
  jmp    L48
  nopl   0x0(%rax,%rax,1)
L14:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L38
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L38:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D4
type: string
name: retrieve_data
arguments: data_tag: D95
type: string
name: retrieve_data
arguments: data_tag: D26
type: string
name: retrieve_data
arguments: data_tag: D2
type: string
name: retrieve_data
arguments: data_tag: D36
type: string
name: retrieve_data
arguments: data_tag: D23
type: string
name: retrieve_data
arguments: data_tag: D60
type: string
name: retrieve_data
arguments: data_tag: D28
type: string
name: retrieve_data
arguments: data_tag: D14
type: string
name: retrieve_data
arguments: data_tag: D31
type: string
name: retrieve_data
arguments: data_tag: D73
type: string

tool: D4: 
==========Summation==========

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


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


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


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


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


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


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


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


tool: D31: %12.7g	

tool: D73: Differences between results in a matrix:

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");
  }
}
```