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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D98(%rip),%rax
  mov    %rax,%rsi
  lea    D52(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x68(%rbp)
  cmpq   $0x0,-0x68(%rbp)
  jne    L46
  lea    D79(%rip),%rax
  mov    %rax,%rdi
  call   <nrerror@plt>
L46:
  mov    -0x68(%rbp),%rdx
  lea    -0x60(%rbp),%rax
  mov    $0x50,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  jmp    L41
L47:
  mov    -0x68(%rbp),%rdx
  lea    -0x60(%rbp),%rax
  mov    $0x50,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  mov    -0x68(%rbp),%rax
  mov    %rax,%rdi
  call   <feof@plt>
  test   %rax,%rax
  je     L41
  lea    D129(%rip),%rax
  mov    %rax,%rdi
  call   <nrerror@plt>
L41:
  lea    -0x60(%rbp),%rax
  mov    $0xd,%edx
  lea    D46(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L47
  lea    -0x7c(%rbp),%rdx
  mov    -0x68(%rbp),%rax
  lea    D38(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  lea    -0x60(%rbp),%rax
  mov    %rax,%rsi
  lea    D90(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D59(%rip),%r8
  lea    D39(%rip),%rax
  mov    %rax,%rcx
  lea    D34(%rip),%rax
  mov    %rax,%rdx
  lea    D61(%rip),%rax
  mov    %rax,%rsi
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x1,-0x6c(%rbp)
  jmp    L17
L49:
  lea    -0x78(%rbp),%rsi
  lea    -0x70(%rbp),%rcx
  lea    -0x74(%rbp),%rdx
  mov    -0x68(%rbp),%rax
  mov    %rsi,%r8
  lea    D60(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  movss  -0x70(%rbp),%xmm0
  mov    -0x74(%rbp),%eax
  movaps %xmm0,%xmm1
  movd   %eax,%xmm0
  call   <beta@plt>
  movq   %xmm0,%rdx
  movss  -0x78(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movss  -0x70(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  movss  -0x74(%rbp),%xmm2
  pxor   %xmm4,%xmm4
  cvtss2sd %xmm2,%xmm4
  movq   %xmm4,%rax
  movq   %rdx,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  lea    D22(%rip),%rax
  mov    %rax,%rdi
  mov    $0x4,%eax
  call   <printf@plt>
  addl   $0x1,-0x6c(%rbp)
L17:
  mov    -0x7c(%rbp),%eax
  cmp    %eax,-0x6c(%rbp)
  jle    L49
  mov    -0x68(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L4
  call   <__stack_chk_fail@plt>
L4:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D98
datatype: string
name: disassemble_data
arguments: data_label: D52
datatype: string
name: disassemble_data
arguments: data_label: D79
datatype: string
name: disassemble_data
arguments: data_label: D129
datatype: string
name: disassemble_data
arguments: data_label: D46
datatype: string
name: disassemble_data
arguments: data_label: D38
datatype: string
name: disassemble_data
arguments: data_label: D90
datatype: string
name: disassemble_data
arguments: data_label: D59
datatype: string
name: disassemble_data
arguments: data_label: D39
datatype: string
name: disassemble_data
arguments: data_label: D34
datatype: string
name: disassemble_data
arguments: data_label: D61
datatype: string
name: disassemble_data
arguments: data_label: D8
datatype: string
name: disassemble_data
arguments: data_label: D60
datatype: string
name: disassemble_data
arguments: data_label: D22
datatype: string

tool: D98: r

tool: D52: fncval.dat

tool: D79: Data file fncval.dat not found


tool: D129: Data not found in fncval.dat


tool: D46: Beta Function

tool: D38: %d %*s

tool: D90: 
%s


tool: D59: beta(w,z)

tool: D39: actual

tool: D34: z

tool: D61: w

tool: D8: %5s %6s %16s %20s


tool: D60: %f %f %f

tool: D22: %6.2f %6.2f %18.6e %18.6e


assistant: ```c
int main(void) {
  char txt[80];
  int i, nval;
  float val, w, z;
  FILE *fp;
  if ((fp = fopen("fncval.dat", "r")) == NULL)
    nrerror("Data file fncval.dat not found\n");
  fgets(txt, 80, fp);
  while (strncmp(txt, "Beta Function", 13)) {
    fgets(txt, 80, fp);
    if (feof(fp))
      nrerror("Data not found in fncval.dat\n");
  }
  fscanf(fp, "%d %*s", &nval);
  printf("\n%s\n", txt);
  printf("%5s %6s %16s %20s\n", "w", "z", "actual", "beta(w,z)");
  for (i = 1; i <= nval; i++) {
    fscanf(fp, "%f %f %f", &w, &z, &val);
    printf("%6.2f %6.2f %18.6e %18.6e\n", w, z, val, beta(w, z));
  }
  fclose(fp);
  return 0;
}
```