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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    $0x28,%esi
  mov    $0x1,%edi
  call   <vector@plt>
  mov    %rax,-0x10(%rbp)
L41:
  lea    D94(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x28,%esi
  lea    D83(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x2c(%rbp),%rax
  mov    %rax,%rsi
  lea    D47(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    -0x2c(%rbp),%eax
  test   %eax,%eax
  jle    L60
  mov    -0x2c(%rbp),%eax
  cmp    $0x28,%eax
  jg     L60
  lea    D98(%rip),%rax
  mov    %rax,%rcx
  lea    D54(%rip),%rax
  mov    %rax,%rdx
  lea    D82(%rip),%rax
  mov    %rax,%rsi
  lea    D5(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0xfffffff8,-0x24(%rbp)
  jmp    L5
L30:
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x24(%rbp),%xmm0
  movsd  D40(%rip),%xmm1
  divsd  %xmm1,%xmm0
  cvtsd2ss %xmm0,%xmm0
  movss  %xmm0,-0x18(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0x28(%rbp)
  movss  D25(%rip),%xmm0
  movss  %xmm0,-0x1c(%rbp)
  movl   $0x1,-0x20(%rbp)
  jmp    L17
L76:
  movss  -0x18(%rbp),%xmm0
  movss  D37(%rip),%xmm1
  xorps  %xmm1,%xmm0
  movss  -0x1c(%rbp),%xmm1
  mulss  %xmm1,%xmm0
  movss  %xmm0,-0x1c(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2ssl -0x20(%rbp),%xmm1
  movss  -0x1c(%rbp),%xmm0
  divss  %xmm1,%xmm0
  movss  %xmm0,-0x14(%rbp)
  mov    -0x10(%rbp),%rdx
  mov    -0x20(%rbp),%esi
  mov    -0x14(%rbp),%ecx
  lea    -0x28(%rbp),%rax
  movd   %ecx,%xmm0
  mov    %rax,%rdi
  call   <eulsum@plt>
  addl   $0x1,-0x20(%rbp)
L17:
  mov    -0x2c(%rbp),%eax
  cmp    %eax,-0x20(%rbp)
  jle    L76
  movss  -0x28(%rbp),%xmm0
  pxor   %xmm3,%xmm3
  cvtss2sd %xmm0,%xmm3
  movsd  %xmm3,-0x38(%rbp)
  pxor   %xmm1,%xmm1
  cvtss2sd -0x18(%rbp),%xmm1
  movsd  D112(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <log@plt>
  movq   %xmm0,%rdx
  pxor   %xmm4,%xmm4
  cvtss2sd -0x18(%rbp),%xmm4
  movq   %xmm4,%rax
  movsd  -0x38(%rbp),%xmm2
  movq   %rdx,%xmm1
  movq   %rax,%xmm0
  lea    D104(%rip),%rax
  mov    %rax,%rdi
  mov    $0x3,%eax
  call   <printf@plt>
  addl   $0x1,-0x24(%rbp)
L5:
  cmpl   $0x8,-0x24(%rbp)
  jle    L30
  jmp    L41
L60:
  mov    -0x10(%rbp),%rax
  mov    $0x28,%edx
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <free_vector@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L69
  call   <__stack_chk_fail@plt>
L69:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D94
data_type: string
name: disassemble_data
arguments: label: D83
data_type: string
name: disassemble_data
arguments: label: D47
data_type: string
name: disassemble_data
arguments: label: D98
data_type: string
name: disassemble_data
arguments: label: D54
data_type: string
name: disassemble_data
arguments: label: D82
data_type: string
name: disassemble_data
arguments: label: D5
data_type: string
name: disassemble_data
arguments: label: D40
data_type: f64
name: disassemble_data
arguments: label: D25
data_type: byte[4]
name: disassemble_data
arguments: label: D37
data_type: byte[4]
name: disassemble_data
arguments: label: D112
data_type: f64
name: disassemble_data
arguments: label: D104
data_type: string

tool: D94: 
How many terms in polynomial?

tool: D83: Enter n between 1 and %2d. (n=0 to end) 

tool: D47: %d

tool: D98: polynomial

tool: D54: actual

tool: D82: x

tool: D5: %9s %14s %14s


tool: D40: 10

tool: {"D25": [0x00,0x00,0x80,0xbf]}

tool: {"D37": [0x00,0x00,0x00,0x80]}

tool: D112: 1

tool: D104: %12.6f %12.6f %12.6f


assistant: ```c
int main(void) {
  int i, j, mval;
  float sum, term, x, xpower, *wksp;
  wksp = vector(1, 40);
  for (;;) {
    printf("\nHow many terms in polynomial?\n");
    printf("Enter n between 1 and %2d. (n=0 to end) ", 40);
    scanf("%d", &mval);
    printf("\n");
    if ((mval <= 0) || (mval > 40))
      break;
    printf("%9s %14s %14s\n", "x", "actual", "polynomial");
    for (i = -8; i <= 8; i++) {
      x = i / 10.0;
      sum = 0.0;
      xpower = -1;
      for (j = 1; j <= mval; j++) {
        xpower *= (-x);
        term = xpower / j;
        eulsum(&sum, term, j, wksp);
      }
      printf("%12.6f %12.6f %12.6f\n", x, log(1.0 + x), sum);
    }
  }
  free_vector(wksp, 1, 40);
  return 0;
}
```