#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
double F(double);
double V(double);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double, ...);
int /*<<< orphan*/ printf(char *, ...);
double rho(double);
int main(void) {
  int Nr = 10001;
  double rmax = 12.;
  double dr = rmax / (double)Nr;
  int Nrho = 10001;
  double rhomax = 2.5;
  double drho = rhomax / (double)Nrho;
  int atomic_number = 1;
  double mass = 63.55;
  double lattice_constant = 3.615;
  char lattice_type[] = "FCC";
  int i;
  char LAMMPSFilename[] = "EAM2.eam";
  FILE *LAMMPSFile = fopen(LAMMPSFilename, "w");
  if (!LAMMPSFile)
    exit(-1);
  fprintf(LAMMPSFile,
          "#-> LAMMPS Potential File in DYNAMO 86 setfl Format <-#\n"
          "# Mishin EAM1\n"
          "# One more comment line\n"
          "%d Cu\n"
          "%d %f %d %f %f\n"
          "%d %f %f %s\n",
          atomic_number, Nrho, drho, Nr, dr, 4.961, atomic_number, mass,
          lattice_constant, lattice_type);
  for (i = 0; i < Nrho; i++)
    fprintf(LAMMPSFile, "%f\n", F((double)i * drho));
  for (i = 0; i < Nr; i++)
    fprintf(LAMMPSFile, "%f\n", rho((double)i * dr));
  for (i = 0; i < Nr; i++)
    fprintf(LAMMPSFile, "%f\n", V((double)i * dr) * (double)i * dr);
  printf("#Pair Potential\n");
  for (i = 0; i < Nr; i++)
    printf("%f %f\n", (double)i * dr, V((double)i * dr));
  printf("#Embedding Function\n");
  for (i = 0; i < Nrho; i++)
    printf("%f %f\n", (double)i * drho, F((double)i * drho));
  printf("#Density Function\n");
  for (i = 0; i < Nr; i++)
    printf("%f %f\n", (double)i * dr, rho((double)i * dr));
  fclose(LAMMPSFile);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2711,-0x8(%rbp)
movsd  0xe77(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x2711,-0x1c(%rbp)
movsd  0xe48(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
cvtsi2sdl -0x1c(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x1,-0x34(%rbp)
movsd  0xe19(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe04(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    0xe21(%rip),%eax
mov    %eax,-0x4c(%rbp)
mov    0xe1b(%rip),%rax
mov    %rax,-0x59(%rbp)
mov    0xe19(%rip),%al
mov    %al,-0x51(%rbp)
lea    -0x59(%rbp),%rdi
lea    0xe0c(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
jne    1247 <main+0xc7>
mov    $0xffffffff,%edi
call   10a0 <exit@plt>
mov    -0x68(%rbp),%rdi
cvtsi2sdl -0x34(%rbp),%xmm0
mov    -0x1c(%rbp),%edx
movsd  -0x30(%rbp),%xmm1
mov    -0x8(%rbp),%ecx
movsd  -0x18(%rbp),%xmm2
mov    -0x34(%rbp),%r8d
movsd  -0x40(%rbp),%xmm4
movsd  -0x48(%rbp),%xmm5
lea    -0x4c(%rbp),%r9
lea    0xdbe(%rip),%rsi
movsd  0xd9f(%rip),%xmm3
mov    $0x6,%al
call   1070 <fprintf@plt>
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    12d2 <main+0x152>
mov    -0x68(%rbp),%rax
mov    %rax,-0x70(%rbp)
cvtsi2sdl -0x50(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1030 <F@plt>
mov    -0x70(%rbp),%rdi
lea    0xe0e(%rip),%rsi
mov    $0x1,%al
call   1070 <fprintf@plt>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    128f <main+0x10f>
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    131c <main+0x19c>
mov    -0x68(%rbp),%rax
mov    %rax,-0x78(%rbp)
cvtsi2sdl -0x50(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1080 <rho@plt>
mov    -0x78(%rbp),%rdi
lea    0xdc4(%rip),%rsi
mov    $0x1,%al
call   1070 <fprintf@plt>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    12d9 <main+0x159>
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1374 <main+0x1f4>
mov    -0x68(%rbp),%rax
mov    %rax,-0x80(%rbp)
cvtsi2sdl -0x50(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1040 <V@plt>
mov    -0x80(%rbp),%rdi
cvtsi2sdl -0x50(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  -0x18(%rbp),%xmm0
lea    0xd6c(%rip),%rsi
mov    $0x1,%al
call   1070 <fprintf@plt>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1323 <main+0x1a3>
lea    0xd3c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    13dd <main+0x25d>
cvtsi2sdl -0x50(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
cvtsi2sdl -0x50(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1040 <V@plt>
movaps %xmm0,%xmm1
movsd  -0x88(%rbp),%xmm0
ff
lea    0xd00(%rip),%rdi
mov    $0x2,%al
call   1060 <printf@plt>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1389 <main+0x209>
lea    0xceb(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1446 <main+0x2c6>
cvtsi2sdl -0x50(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
cvtsi2sdl -0x50(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1030 <F@plt>
movaps %xmm0,%xmm1
movsd  -0x90(%rbp),%xmm0
ff
lea    0xc97(%rip),%rdi
mov    $0x2,%al
call   1060 <printf@plt>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    13f2 <main+0x272>
lea    0xc97(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    14af <main+0x32f>
cvtsi2sdl -0x50(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
cvtsi2sdl -0x50(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1080 <rho@plt>
movaps %xmm0,%xmm1
movsd  -0x98(%rbp),%xmm0
ff
lea    0xc2e(%rip),%rdi
mov    $0x2,%al
call   1060 <printf@plt>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    145b <main+0x2db>
mov    -0x68(%rbp),%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
movl   $0x434346,0x1c(%rsp)
movabs $0x6d61652e324d4145,%rax
65 61 6d
mov    %rax,0x20(%rsp)
movb   $0x0,0x28(%rsp)
lea    0xe7e(%rip),%rsi
lea    0x20(%rsp),%rdi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1477 <main+0x2e7>
mov    %rax,%rbx
lea    0xe63(%rip),%rsi
movsd  0xe20(%rip),%xmm0
movsd  0xe20(%rip),%xmm1
mov    $0x2711,%ebp
movsd  0xe1b(%rip),%xmm2
movsd  0xe1b(%rip),%xmm3
movsd  0xe1b(%rip),%xmm4
movsd  0xe1b(%rip),%xmm5
lea    0x1c(%rsp),%r9
mov    %rax,%rdi
mov    $0x2711,%edx
mov    $0x2711,%ecx
mov    $0x1,%r8d
mov    $0x6,%al
call   1080 <fprintf@plt>
xorpd  %xmm0,%xmm0
lea    0xe87(%rip),%r14
nopw   0x0(%rax,%rax,1)
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xdb4(%rip),%xmm0
call   1040 <F@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%al
call   1080 <fprintf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xd8c(%rip),%xmm0
add    $0xffffffff,%ebp
jne    1240 <main+0xb0>
xorpd  %xmm2,%xmm2
mov    $0x2711,%ebp
lea    0xe35(%rip),%r14
movsd  0xd7f(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  %xmm2,0x8(%rsp)
movapd %xmm2,%xmm0
mulsd  %xmm1,%xmm0
call   1090 <rho@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%al
call   1080 <fprintf@plt>
movsd  0x8(%rsp),%xmm2
movsd  0xd42(%rip),%xmm1
addsd  0xd2a(%rip),%xmm2
add    $0xffffffff,%ebp
jne    12a0 <main+0x110>
xorpd  %xmm0,%xmm0
mov    $0x2711,%ebp
lea    0xdd3(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0xd0c(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1050 <V@plt>
mulsd  0x8(%rsp),%xmm0
mulsd  0xcf5(%rip),%xmm0
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%al
call   1080 <fprintf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xcca(%rip),%xmm0
add    $0xffffffff,%ebp
jne    12f0 <main+0x160>
lea    0xd80(%rip),%rdi
call   1030 <puts@plt>
xorpd  %xmm0,%xmm0
mov    $0x2711,%ebp
lea    0xd64(%rip),%r14
nopw   0x0(%rax,%rax,1)
movsd  %xmm0,0x8(%rsp)
mulsd  0xca2(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
call   1050 <V@plt>
movapd %xmm0,%xmm1
mov    %r14,%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x2,%al
call   1070 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xc65(%rip),%xmm0
add    $0xffffffff,%ebp
jne    1360 <main+0x1d0>
lea    0xd2b(%rip),%rdi
call   1030 <puts@plt>
xorpd  %xmm1,%xmm1
mov    $0x2711,%ebp
lea    0xcff(%rip),%r14
nopl   0x0(%rax)
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
mulsd  0xc36(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
call   1040 <F@plt>
movapd %xmm0,%xmm1
mov    %r14,%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x2,%al
call   1070 <printf@plt>
movsd  0x8(%rsp),%xmm1
addsd  0xc01(%rip),%xmm1
add    $0xffffffff,%ebp
jne    13c0 <main+0x230>
lea    0xcdb(%rip),%rdi
call   1030 <puts@plt>
xorpd  %xmm1,%xmm1
mov    $0x2711,%ebp
lea    0xc9b(%rip),%r14
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
mulsd  0xbde(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
call   1090 <rho@plt>
movapd %xmm0,%xmm1
mov    %r14,%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x2,%al
call   1070 <printf@plt>
movsd  0x8(%rsp),%xmm1
addsd  0xba1(%rip),%xmm1
add    $0xffffffff,%ebp
jne    1420 <main+0x290>
mov    %rbx,%rdi
call   1060 <fclose@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    $0xffffffff,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@__const.main.lattice_type = [4 x i8] c"FCC\00"
@__const.main.LAMMPSFilename = [9 x i8] c"EAM2.eam\00"
@.str = [2 x i8] c"w\00"
@.str.1 = [128 x i8] c"#-> LAMMPS Potential File in DYNAMO 86 setfl Format <-#\0A# Mishin EAM1\0A# One more comment line\0A%d Cu\0A%d %f %d %f %f\0A%d %f %f %s\0A\00"
@.str.2 = [4 x i8] c"%f\0A\00"
@.str.3 = [17 x i8] c"#Pair Potential\0A\00"
@.str.4 = [7 x i8] c"%f %f\0A\00"
@.str.5 = [21 x i8] c"#Embedding Function\0A\00"
@.str.6 = [19 x i8] c"#Density Function\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%9 = alloca double
%10 = alloca double
%11 = alloca [4 x i8]
%12 = alloca i32
%13 = alloca [9 x i8]
%14 = alloca i32*
store i32 0, i32* %1
store i32 10001, i32* %2
store double 1.200000e+01, double* %3
%15 = load double, double* %3
%16 = load i32, i32* %2
%17 = sitofp i32 %16 to double
%18 = fdiv double %15, %17
store double %18, double* %4
store i32 10001, i32* %5
store double 2.500000e+00, double* %6
%19 = load double, double* %6
%20 = load i32, i32* %5
%21 = sitofp i32 %20 to double
%22 = fdiv double %19, %21
store double %22, double* %7
store i32 1, i32* %8
store double 6.355000e+01, double* %9
store double 3.615000e+00, double* %10
%23 = bitcast [4 x i8]* %11 to i8*
%24 = bitcast [9 x i8]* %13 to i8*
%25 = getelementptr inbounds [9 x i8], [9 x i8]* %13, i64 0, i64 0
%26 = call i32* @fopen(i8* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %26, i32** %14
%27 = load i32*, i32** %14
%28 = icmp ne i32* %27, null
br i1 %28, label %31, label %29
29: ; preds = %0
%30 = call i32 @exit(i32 -1)
unreachable
31: ; preds = %0
%32 = load i32*, i32** %14
%33 = load i32, i32* %8
%34 = sitofp i32 %33 to double
%35 = load i32, i32* %5
%36 = load double, double* %7
%37 = load i32, i32* %2
%38 = load double, double* %4
%39 = load i32, i32* %8
%40 = load double, double* %9
%41 = load double, double* %10
%42 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 0
%43 = call i32 (i32*, i8*, double, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str.1, i64 0, i64 0), double %34, i32 %35, double %36, i32 %37, double %38, double 4.961000e+00, i32 %39, double %40, double %41, i8* %42)
store i32 0, i32* %12
br label %44
44: ; preds = %56, %31
%45 = load i32, i32* %12
%46 = load i32, i32* %5
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %59
48: ; preds = %44
%49 = load i32*, i32** %14
%50 = load i32, i32* %12
%51 = sitofp i32 %50 to double
%52 = load double, double* %7
%53 = fmul double %51, %52
%54 = call double @F(double %53)
%55 = call i32 (i32*, i8*, double, ...) @fprintf(i32* %49, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %54)
br label %56
56: ; preds = %48
%57 = load i32, i32* %12
%58 = add nsw i32 %57, 1
store i32 %58, i32* %12
br label %44
59: ; preds = %44
store i32 0, i32* %12
br label %60
60: ; preds = %72, %59
%61 = load i32, i32* %12
%62 = load i32, i32* %2
%63 = icmp slt i32 %61, %62
br i1 %63, label %64, label %75
64: ; preds = %60
%65 = load i32*, i32** %14
%66 = load i32, i32* %12
%67 = sitofp i32 %66 to double
%68 = load double, double* %4
%69 = fmul double %67, %68
%70 = call double @rho(double %69)
%71 = call i32 (i32*, i8*, double, ...) @fprintf(i32* %65, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %70)
br label %72
72: ; preds = %64
%73 = load i32, i32* %12
%74 = add nsw i32 %73, 1
store i32 %74, i32* %12
br label %60
75: ; preds = %60
store i32 0, i32* %12
br label %76
76: ; preds = %93, %75
%77 = load i32, i32* %12
%78 = load i32, i32* %2
%79 = icmp slt i32 %77, %78
br i1 %79, label %80, label %96
80: ; preds = %76
%81 = load i32*, i32** %14
%82 = load i32, i32* %12
%83 = sitofp i32 %82 to double
%84 = load double, double* %4
%85 = fmul double %83, %84
%86 = call double @V(double %85)
%87 = load i32, i32* %12
%88 = sitofp i32 %87 to double
%89 = fmul double %86, %88
%90 = load double, double* %4
%91 = fmul double %89, %90
%92 = call i32 (i32*, i8*, double, ...) @fprintf(i32* %81, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %91)
br label %93
93: ; preds = %80
%94 = load i32, i32* %12
%95 = add nsw i32 %94, 1
store i32 %95, i32* %12
br label %76
96: ; preds = %76
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %12
br label %98
98: ; preds = %113, %96
%99 = load i32, i32* %12
%100 = load i32, i32* %2
%101 = icmp slt i32 %99, %100
br i1 %101, label %102, label %116
102: ; preds = %98
%103 = load i32, i32* %12
%104 = sitofp i32 %103 to double
%105 = load double, double* %4
%106 = fmul double %104, %105
%107 = load i32, i32* %12
%108 = sitofp i32 %107 to double
%109 = load double, double* %4
%110 = fmul double %108, %109
%111 = call double @V(double %110)
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double %106, double %111)
br label %113
113: ; preds = %102
%114 = load i32, i32* %12
%115 = add nsw i32 %114, 1
store i32 %115, i32* %12
br label %98
116: ; preds = %98
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %12
br label %118
118: ; preds = %133, %116
%119 = load i32, i32* %12
%120 = load i32, i32* %5
%121 = icmp slt i32 %119, %120
br i1 %121, label %122, label %136
122: ; preds = %118
%123 = load i32, i32* %12
%124 = sitofp i32 %123 to double
%125 = load double, double* %7
%126 = fmul double %124, %125
%127 = load i32, i32* %12
%128 = sitofp i32 %127 to double
%129 = load double, double* %7
%130 = fmul double %128, %129
%131 = call double @F(double %130)
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double %126, double %131)
br label %133
133: ; preds = %122
%134 = load i32, i32* %12
%135 = add nsw i32 %134, 1
store i32 %135, i32* %12
br label %118
136: ; preds = %118
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %12
br label %138
138: ; preds = %153, %136
%139 = load i32, i32* %12
%140 = load i32, i32* %2
%141 = icmp slt i32 %139, %140
br i1 %141, label %142, label %156
142: ; preds = %138
%143 = load i32, i32* %12
%144 = sitofp i32 %143 to double
%145 = load double, double* %4
%146 = fmul double %144, %145
%147 = load i32, i32* %12
%148 = sitofp i32 %147 to double
%149 = load double, double* %4
%150 = fmul double %148, %149
%151 = call double @rho(double %150)
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double %146, double %151)
br label %153
153: ; preds = %142
%154 = load i32, i32* %12
%155 = add nsw i32 %154, 1
store i32 %155, i32* %12
br label %138
156: ; preds = %138
%157 = load i32*, i32** %14
%158 = call i32 @fclose(i32* %157)
ret i32 0
}

LLVM IR (-O2):
@__const.main.LAMMPSFilename = [9 x i8] c"EAM2.eam\00"
@.str = [2 x i8] c"w\00"
@.str.1 = [128 x i8] c"#-> LAMMPS Potential File in DYNAMO 86 setfl Format <-#\0A# Mishin EAM1\0A# One more comment line\0A%d Cu\0A%d %f %d %f %f\0A%d %f %f %s\0A\00"
@.str.2 = [4 x i8] c"%f\0A\00"
@.str.4 = [7 x i8] c"%f %f\0A\00"
@str = [16 x i8] c"#Pair Potential\00"
@str.7 = [20 x i8] c"#Embedding Function\00"
@str.8 = [18 x i8] c"#Density Function\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i8]
%3 = bitcast i32* %1 to i8*
store i32 4408134, i32* %1
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %0
%10 = call i32 (i32*, i8*, double, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str.1, i64 0, i64 0), double 1.000000e+00, i32 10001, double 0x3F3061E275E6DD02, i32 10001, double 0x3F53A8A95A483C69, double 4.961000e+00, i32 1, double 6.355000e+01, double 3.615000e+00, i32* %1)
br label %11
11: ; preds = %9, %11
%12 = phi i32 [ 0, %9 ], [ %17, %11 ]
%13 = sitofp i32 %12 to double
%14 = fmul double %13, 0x3F3061E275E6DD02
%15 = call double @F(double %14)
%16 = call i32 (i32*, i8*, double, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %15)
%17 = add nuw nsw i32 %12, 1
%18 = icmp eq i32 %17, 10001
br i1 %18, label %19, label %11
19: ; preds = %11, %19
%20 = phi i32 [ %25, %19 ], [ 0, %11 ]
%21 = sitofp i32 %20 to double
%22 = fmul double %21, 0x3F53A8A95A483C69
%23 = call double @rho(double %22)
%24 = call i32 (i32*, i8*, double, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %23)
%25 = add nuw nsw i32 %20, 1
%26 = icmp eq i32 %25, 10001
br i1 %26, label %27, label %19
27: ; preds = %19, %27
%28 = phi i32 [ %35, %27 ], [ 0, %19 ]
%29 = sitofp i32 %28 to double
%30 = fmul double %29, 0x3F53A8A95A483C69
%31 = call double @V(double %30)
%32 = fmul double %31, %29
%33 = fmul double %32, 0x3F53A8A95A483C69
%34 = call i32 (i32*, i8*, double, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %33)
%35 = add nuw nsw i32 %28, 1
%36 = icmp eq i32 %35, 10001
br i1 %36, label %37, label %27
37: ; preds = %27
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %39
39: ; preds = %37, %39
%40 = phi i32 [ 0, %37 ], [ %45, %39 ]
%41 = sitofp i32 %40 to double
%42 = fmul double %41, 0x3F53A8A95A483C69
%43 = call double @V(double %42)
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double %42, double %43)
%45 = add nuw nsw i32 %40, 1
%46 = icmp eq i32 %45, 10001
br i1 %46, label %47, label %39
47: ; preds = %39
%48 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.7, i64 0, i64 0))
br label %49
49: ; preds = %47, %49
%50 = phi i32 [ 0, %47 ], [ %55, %49 ]
%51 = sitofp i32 %50 to double
%52 = fmul double %51, 0x3F3061E275E6DD02
%53 = call double @F(double %52)
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double %52, double %53)
%55 = add nuw nsw i32 %50, 1
%56 = icmp eq i32 %55, 10001
br i1 %56, label %57, label %49
57: ; preds = %49
%58 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.8, i64 0, i64 0))
br label %59
59: ; preds = %57, %59
%60 = phi i32 [ 0, %57 ], [ %65, %59 ]
%61 = sitofp i32 %60 to double
%62 = fmul double %61, 0x3F53A8A95A483C69
%63 = call double @rho(double %62)
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), double %62, double %63)
%65 = add nuw nsw i32 %60, 1
%66 = icmp eq i32 %65, 10001
br i1 %66, label %67, label %59
67: ; preds = %59
%68 = call i32 @fclose(i32* %5)
ret i32 0
}