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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D27(%rip),%rax
  mov    %rax,%rsi
  lea    D43(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x68(%rbp)
  cmpq   $0x0,-0x68(%rbp)
  jne    L68
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <nrerror@plt>
L68:
  mov    -0x68(%rbp),%rdx
  lea    -0x60(%rbp),%rax
  mov    $0x50,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  jmp    L38
L37:
  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     L38
  lea    D0(%rip),%rax
  mov    %rax,%rdi
  call   <nrerror@plt>
L38:
  lea    -0x60(%rbp),%rax
  mov    $0x18,%edx
  lea    D70(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L37
  lea    -0x80(%rbp),%rdx
  mov    -0x68(%rbp),%rax
  lea    D17(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  lea    -0x60(%rbp),%rax
  mov    %rax,%rsi
  lea    D131(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D30(%rip),%r9
  lea    D37(%rip),%r8
  lea    D5(%rip),%rax
  mov    %rax,%rcx
  lea    D86(%rip),%rax
  mov    %rax,%rdx
  lea    D109(%rip),%rax
  mov    %rax,%rsi
  lea    D42(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x1,-0x6c(%rbp)
  jmp    L3
L40:
  lea    -0x70(%rbp),%rdi
  lea    -0x74(%rbp),%rsi
  lea    -0x78(%rbp),%rcx
  lea    -0x7c(%rbp),%rdx
  mov    -0x68(%rbp),%rax
  mov    %rdi,%r9
  mov    %rsi,%r8
  lea    D19(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  movss  -0x74(%rbp),%xmm1
  movss  -0x78(%rbp),%xmm0
  mov    -0x7c(%rbp),%eax
  movaps %xmm1,%xmm2
  movaps %xmm0,%xmm1
  movd   %eax,%xmm0
  call   <betai@plt>
  movq   %xmm0,%rdx
  movss  -0x70(%rbp),%xmm0
  pxor   %xmm2,%xmm2
  cvtss2sd %xmm0,%xmm2
  movss  -0x74(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movss  -0x78(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  movss  -0x7c(%rbp),%xmm3
  pxor   %xmm5,%xmm5
  cvtss2sd %xmm3,%xmm5
  movq   %xmm5,%rax
  movq   %rdx,%xmm4
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  lea    D103(%rip),%rax
  mov    %rax,%rdi
  mov    $0x5,%eax
  call   <printf@plt>
  addl   $0x1,-0x6c(%rbp)
L3:
  mov    -0x80(%rbp),%eax
  cmp    %eax,-0x6c(%rbp)
  jle    L40
  mov    -0x68(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L24
  call   <__stack_chk_fail@plt>
L24:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D27
datatype: string
name: disassemble_data
arguments: data_tag: D43
datatype: string
name: disassemble_data
arguments: data_tag: D12
datatype: string
name: disassemble_data
arguments: data_tag: D0
datatype: string
name: disassemble_data
arguments: data_tag: D70
datatype: string
name: disassemble_data
arguments: data_tag: D17
datatype: string
name: disassemble_data
arguments: data_tag: D131
datatype: string
name: disassemble_data
arguments: data_tag: D30
datatype: string
name: disassemble_data
arguments: data_tag: D37
datatype: string
name: disassemble_data
arguments: data_tag: D5
datatype: string
name: disassemble_data
arguments: data_tag: D86
datatype: string
name: disassemble_data
arguments: data_tag: D109
datatype: string
name: disassemble_data
arguments: data_tag: D42
datatype: string
name: disassemble_data
arguments: data_tag: D19
datatype: string
name: disassemble_data
arguments: data_tag: D103
datatype: string

tool: D27: r

tool: D43: fncval.dat

tool: D12: Data file fncval.dat not found


tool: D0: Data not found in fncval.dat


tool: D70: Incomplete Beta Function

tool: D17: %d %*s

tool: D131: 
%s


tool: D30: betai(x)

tool: D37: actual

tool: D5: x

tool: D86: b

tool: D109: a

tool: D42: %5s %10s %12s %14s %13s 


tool: D19: %f %f %f %f

tool: D103: %6.2f %12.6f %12.6f %12.6f %12.6f


assistant: ```c
int main(void) {
  char txt[80];
  int i, nval;
  float a, b, x, val;
  FILE *fp;
  if ((fp = fopen("fncval.dat", "r")) == NULL)
    nrerror("Data file fncval.dat not found\n");
  fgets(txt, 80, fp);
  while (strncmp(txt, "Incomplete Beta Function", 24)) {
    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 %10s %12s %14s %13s \n", "a", "b", "x", "actual", "betai(x)");
  for (i = 1; i <= nval; i++) {
    fscanf(fp, "%f %f %f %f", &a, &b, &x, &val);
    printf("%6.2f %12.6f %12.6f %12.6f %12.6f\n", a, b, x, val, betai(a, b, x));
  }
  fclose(fp);
  return 0;
}
```