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

```asm
<main>:
  endbr64
  push   %r12
  pxor   %xmm0,%xmm0
  push   %rbp
  push   %rbx
  sub    $0x30,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <rho@plt>
  lea    0x19(%rsp),%rdi
  movabs $0x736e686f4a5f6c41,%rax
  lea    D33(%rip),%rsi
  mov    %rax,0x19(%rsp)
  mov    $0x6d61,%eax
  divsd  D47(%rip),%xmm0
  movl   $0x434346,0x15(%rsp)
  movl   $0x652e6e6f,0x21(%rsp)
  mov    %ax,0x25(%rsp)
  movb   $0x0,0x27(%rsp)
  movsd  %xmm0,0x8(%rsp)
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L28
L36:
  mov    D6(%rip),%rax
  movsd  0x8(%rsp),%xmm1
  xor    %ebx,%ebx
  lea    0x15(%rsp),%r9
  movsd  D0(%rip),%xmm5
  movsd  D32(%rip),%xmm4
  mov    $0x1,%r8d
  mov    $0x2711,%ecx
  movsd  D83(%rip),%xmm3
  movsd  D89(%rip),%xmm0
  mov    %rbp,%rdi
  movq   %rax,%xmm2
  mov    $0x2711,%edx
  lea    D74(%rip),%rsi
  mov    $0x6,%eax
  call   <fprintf@plt>
  lea    D43(%rip),%r12
  nopw   0x0(%rax,%rax,1)
L55:
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebx,%xmm0
  mulsd  0x8(%rsp),%xmm0
  add    $0x1,%ebx
  call   <F@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    $0x1,%eax
  call   <fprintf@plt>
  cmp    $0x2711,%ebx
  jne    L55
  xor    %ebx,%ebx
  nopl   0x0(%rax,%rax,1)
L4:
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebx,%xmm0
  mulsd  D6(%rip),%xmm0
  add    $0x1,%ebx
  call   <rho@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    $0x1,%eax
  call   <fprintf@plt>
  cmp    $0x2711,%ebx
  jne    L4
  xor    %ebx,%ebx
  nopw   0x0(%rax,%rax,1)
L24:
  pxor   %xmm1,%xmm1
  movsd  D6(%rip),%xmm0
  cvtsi2sd %ebx,%xmm1
  add    $0x1,%ebx
  mulsd  %xmm1,%xmm0
  movsd  %xmm1,0x8(%rsp)
  call   <V@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    $0x1,%eax
  movsd  0x8(%rsp),%xmm1
  mulsd  %xmm1,%xmm0
  mulsd  D6(%rip),%xmm0
  call   <fprintf@plt>
  cmp    $0x2711,%ebx
  jne    L24
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L41
  add    $0x30,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L28:
  or     $0xffffffff,%edi
  call   <exit@plt>
  jmp    L36
L41:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D33
type: string
name: retrieve_data
arguments: data_tag: D47
type: f32[2]
name: retrieve_data
arguments: data_tag: D6
type: byte[8]
name: retrieve_data
arguments: data_tag: D0
type: f64
name: retrieve_data
arguments: data_tag: D32
type: f64
name: retrieve_data
arguments: data_tag: D83
type: byte[8]
name: retrieve_data
arguments: data_tag: D89
type: f32[2]
name: retrieve_data
arguments: data_tag: D74
type: string
name: retrieve_data
arguments: data_tag: D43
type: string

tool: D33: w

tool: {"D47": [0.0,6.11041259765625]}

tool: {"D6": [0x05,0xef,0xb9,0x36,0xdf,0x8c,0x50,0x3f]}

tool: D0: 4.041

tool: D32: 26.982

tool: {"D83": [0x15,0xae,0x47,0xe1,0x7a,0x34,0x24,0x40]}

tool: {"D89": [0.0,1.875]}

tool: D74: #-> LAMMPS Potential File in DYNAMO 86 setfl Format <-#
# Zhou Al Acta mater(2001)49:4005
# Implemented by G. Ziegenhain (2007)
%d Al
%d %20.20f %d %20.20f %20.20f
%d %20.20f %20.20f %s


tool: D43: %20.20f


assistant: ```c
int main(void) {
  int Nr = 10001;
  double rmax = 4.041 * 2.5;
  double dr = rmax / (double)Nr;
  int Nrho = 10001;
  double rhomax = rho(0.);
  double drho = rhomax / (double)Nrho;
  int atomic_number = 1;
  double mass = 26.982;
  double lattice_constant = 4.041;
  char lattice_type[] = "FCC";
  int i;
  char LAMMPSFilename[] = "Al_Johnson.eam";
  FILE *LAMMPSFile = fopen(LAMMPSFilename, "w");
  if (!LAMMPSFile)
    exit(-1);
  fprintf(LAMMPSFile,
          "#-> LAMMPS Potential File in DYNAMO 86 setfl Format <-#\n"
          "# Zhou Al Acta mater(2001)49:4005\n"
          "# Implemented by G. Ziegenhain (2007)\n"
          "%d Al\n"
          "%d %20.20f %d %20.20f %20.20f\n"
          "%d %20.20f %20.20f %s\n",
          atomic_number, Nrho, drho, Nr, dr, rmax, atomic_number, mass, lattice_constant, lattice_type);
  for (i = 0; i < Nrho; i++)
    fprintf(LAMMPSFile, "%20.20f\n", F((double)i * drho));
  for (i = 0; i < Nr; i++)
    fprintf(LAMMPSFile, "%20.20f\n", rho((double)i * dr));
  for (i = 0; i < Nr; i++)
    fprintf(LAMMPSFile, "%20.20f\n", V((double)i * dr) * (double)i * dr);
  fclose(LAMMPSFile);
  return (0);
}
```