user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x90,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D56(%rip),%rax
  mov    %rax,%rsi
  lea    D35(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x68(%rbp)
  cmpq   $0x0,-0x68(%rbp)
  jne    L3
  lea    D121(%rip),%rax
  mov    %rax,%rdi
  call   <nrerror@plt>
L3:
  mov    -0x68(%rbp),%rdx
  lea    -0x60(%rbp),%rax
  mov    $0x50,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  jmp    L50
L26:
  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     L50
  lea    D85(%rip),%rax
  mov    %rax,%rdi
  call   <nrerror@plt>
L50:
  lea    -0x60(%rbp),%rax
  mov    $0x1a,%edx
  lea    D14(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L26
  lea    -0x8c(%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    D43(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  sub    $0x8,%rsp
  lea    D88(%rip),%rax
  push   %rax
  lea    D29(%rip),%r9
  lea    D159(%rip),%r8
  lea    D168(%rip),%rax
  mov    %rax,%rcx
  lea    D120(%rip),%rax
  mov    %rax,%rdx
  lea    D113(%rip),%rax
  mov    %rax,%rsi
  lea    D31(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x10,%rsp
  movl   $0x1,-0x70(%rbp)
  jmp    L19
L37:
  lea    -0x80(%rbp),%rsi
  lea    -0x84(%rbp),%rcx
  lea    -0x88(%rbp),%rdx
  mov    -0x68(%rbp),%rax
  mov    %rsi,%r8
  lea    D80(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  movss  -0x88(%rbp),%xmm1
  movss  D10(%rip),%xmm0
  subss  %xmm1,%xmm0
  movss  %xmm0,-0x6c(%rbp)
  mov    -0x84(%rbp),%eax
  lea    -0x74(%rbp),%rdx
  lea    -0x78(%rbp),%rsi
  lea    -0x7c(%rbp),%rcx
  movss  -0x6c(%rbp),%xmm0
  mov    %rcx,%rdi
  movaps %xmm0,%xmm1
  movd   %eax,%xmm0
  call   <sncndn@plt>
  movss  -0x88(%rbp),%xmm1
  movss  -0x7c(%rbp),%xmm0
  mulss  %xmm0,%xmm1
  movss  -0x7c(%rbp),%xmm0
  mulss  %xmm0,%xmm1
  movss  -0x74(%rbp),%xmm2
  movss  -0x74(%rbp),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm1,%xmm0
  pxor   %xmm4,%xmm4
  cvtss2sd %xmm0,%xmm4
  movss  -0x7c(%rbp),%xmm1
  movss  -0x7c(%rbp),%xmm0
  mulss  %xmm0,%xmm1
  movss  -0x78(%rbp),%xmm2
  movss  -0x78(%rbp),%xmm0
  mulss  %xmm2,%xmm0
  addss  %xmm1,%xmm0
  pxor   %xmm3,%xmm3
  cvtss2sd %xmm0,%xmm3
  movss  -0x7c(%rbp),%xmm0
  pxor   %xmm2,%xmm2
  cvtss2sd %xmm0,%xmm2
  movss  -0x80(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movss  -0x84(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  pxor   %xmm6,%xmm6
  cvtss2sd -0x6c(%rbp),%xmm6
  movq   %xmm6,%rax
  movapd %xmm4,%xmm5
  movapd %xmm3,%xmm4
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  lea    D86(%rip),%rax
  mov    %rax,%rdi
  mov    $0x6,%eax
  call   <printf@plt>
  addl   $0x1,-0x70(%rbp)
L19:
  mov    -0x8c(%rbp),%eax
  cmp    %eax,-0x70(%rbp)
  jle    L37
  mov    -0x68(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L5
  call   <__stack_chk_fail@plt>
L5:
  leave
  ret
```

tool_calls: name: parse_data
arguments: label: D56
data_type: string
name: parse_data
arguments: label: D35
data_type: string
name: parse_data
arguments: label: D121
data_type: string
name: parse_data
arguments: label: D85
data_type: string
name: parse_data
arguments: label: D14
data_type: string
name: parse_data
arguments: label: D38
data_type: string
name: parse_data
arguments: label: D43
data_type: string
name: parse_data
arguments: label: D88
data_type: string
name: parse_data
arguments: label: D29
data_type: string
name: parse_data
arguments: label: D159
data_type: string
name: parse_data
arguments: label: D168
data_type: string
name: parse_data
arguments: label: D120
data_type: string
name: parse_data
arguments: label: D113
data_type: string
name: parse_data
arguments: label: D31
data_type: string
name: parse_data
arguments: label: D80
data_type: string
name: parse_data
arguments: label: D10
data_type: f32
name: parse_data
arguments: label: D86
data_type: string

tool: D56: r

tool: D35: fncval.dat

tool: D121: Data file fncval.dat not found


tool: D85: Data not found in fncval.dat


tool: D14: Jacobian Elliptic Function

tool: D38: %d %*s

tool: D43: 
%s


tool: D88: (mc)*(sn^2)+dn^2

tool: D29: sn^2+cn^2

tool: D159: sn

tool: D168: actual

tool: D120: u

tool: D113: mc

tool: D31: %4s %8s %16s %13s %15s %18s


tool: D80: %f %f %f

tool: D10: 1

tool: D86: %5.2f %8.2f %15.5f %15.5f %12.5f %14.5f


assistant: ```c
int main(void) {
  char txt[80];
  int i, nval;
  float em, emmc, uu, val, sn, cn, dn;
  FILE *fp;
  if ((fp = fopen("fncval.dat", "r")) == NULL)
    nrerror("Data file fncval.dat not found\n");
  fgets(txt, 80, fp);
  while (strncmp(txt, "Jacobian Elliptic Function", 26)) {
    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("%4s %8s %16s %13s %15s %18s\n", "mc", "u", "actual", "sn", "sn^2+cn^2", "(mc)*(sn^2)+dn^2");
  for (i = 1; i <= nval; i++) {
    fscanf(fp, "%f %f %f", &em, &uu, &val);
    emmc = 1.0 - em;
    sncndn(uu, emmc, &sn, &cn, &dn);
    printf("%5.2f %8.2f %15.5f %15.5f %12.5f %14.5f\n", emmc, uu, val, sn, (sn * sn + cn * cn), (em * sn * sn + dn * dn));
  }
  fclose(fp);
  return 0;
}
```