#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 */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ LC_NUMERIC;
float atof(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ getfield(char *, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int /*<<< orphan*/ *stdin;
char *strdup(char *);
int strlen(char *);
int /*<<< orphan*/ system(char *);
int main(void) {
  int len;
  float fuelcost = 0, totalgal = 0, sodm = 0, fodm;
  setlocale(LC_NUMERIC, "");
  char file_name[25];
  FILE *fp;
  system("ls");
  printf("Enter the name of file you wish to open...\n");
  fgets(file_name, 255, stdin);
  len = strlen(file_name);
  if (file_name[len - 1] == '\n')
    file_name[len - 1] = 0;
  fp = fopen(file_name, "r");
  if (fp == NULL) {
    perror("Error while opening the file.\n");
    printf("%s", file_name);
    exit(EXIT_FAILURE);
  }
  printf("The contents of %s file are :\n", file_name);
  char line[1024];
  while (fgets(line, 1024, fp)) {
    char *tmp = strdup(line);
    if (sodm == 0)
      sodm = atof(getfield(tmp, 2));
    free(tmp);
    tmp = strdup(line);
    fodm = atof(getfield(tmp, 2));
    free(tmp);
    tmp = strdup(line);
    totalgal += atof(getfield(tmp, 3));
    free(tmp);
    tmp = strdup(line);
    fuelcost += atof(getfield(tmp, 4));
    free(tmp);
  }
  printf("Total Gallons Used is %'.2f gal.\n", totalgal);
  printf("Total Fuel Cost is $%'.2f\n", fuelcost);
  printf("Averge dollar cost per gallon is $%'.2f\n", (fuelcost / totalgal));
  printf("Starting Odometer is %'.0f and Final Odometer is %'.0f\n", sodm,
         fodm);
  printf("Miles per gallon is %'.2f\n", ((fodm - sodm) / totalgal));
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x460,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    0x2ddf(%rip),%rax
mov    (%rax),%edi
lea    0xe24(%rip),%rsi
call   10b0 <setlocale@plt>
lea    0xdea(%rip),%rdi
call   1080 <system@plt>
lea    0xde1(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
lea    -0x40(%rbp),%rdi
mov    0x2db4(%rip),%rax
mov    (%rax),%rdx
mov    $0xff,%esi
call   10a0 <fgets@plt>
lea    -0x40(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x40(%rbp,%rax,1),%eax
cmp    $0xa,%eax
jne    1270 <main+0xa0>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
movb   $0x0,-0x40(%rbp,%rax,1)
lea    -0x40(%rbp),%rdi
lea    0xdb4(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    12bb <main+0xeb>
lea    0xd9b(%rip),%rdi
call   10d0 <perror@plt>
lea    -0x40(%rbp),%rsi
lea    0xdaa(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    0x2d1c(%rip),%rax
mov    (%rax),%edi
call   10e0 <exit@plt>
lea    -0x40(%rbp),%rsi
lea    0xd8d(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
lea    -0x450(%rbp),%rdi
mov    -0x48(%rbp),%rdx
mov    $0x400,%esi
call   10a0 <fgets@plt>
cmp    $0x0,%rax
je     1402 <main+0x232>
lea    -0x450(%rbp),%rdi
call   10f0 <strdup@plt>
mov    %rax,-0x458(%rbp)
movss  -0x14(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1333 <main+0x163>
jp     1333 <main+0x163>
mov    -0x458(%rbp),%rdi
mov    $0x2,%esi
call   1040 <getfield@plt>
mov    %eax,%edi
call   1050 <atof@plt>
movss  %xmm0,-0x14(%rbp)
mov    -0x458(%rbp),%rdi
call   1030 <free@plt>
lea    -0x450(%rbp),%rdi
call   10f0 <strdup@plt>
mov    %rax,-0x458(%rbp)
mov    -0x458(%rbp),%rdi
mov    $0x2,%esi
call   1040 <getfield@plt>
mov    %eax,%edi
call   1050 <atof@plt>
movss  %xmm0,-0x18(%rbp)
mov    -0x458(%rbp),%rdi
call   1030 <free@plt>
lea    -0x450(%rbp),%rdi
call   10f0 <strdup@plt>
mov    %rax,-0x458(%rbp)
mov    -0x458(%rbp),%rdi
mov    $0x3,%esi
call   1040 <getfield@plt>
mov    %eax,%edi
call   1050 <atof@plt>
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x458(%rbp),%rdi
call   1030 <free@plt>
lea    -0x450(%rbp),%rdi
call   10f0 <strdup@plt>
mov    %rax,-0x458(%rbp)
mov    -0x458(%rbp),%rdi
mov    $0x4,%esi
call   1040 <getfield@plt>
mov    %eax,%edi
call   1050 <atof@plt>
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x458(%rbp),%rdi
call   1030 <free@plt>
jmp    12cd <main+0xfd>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc60(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc6b(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
movss  -0xc(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc6a(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xc73(%rip),%rdi
mov    $0x2,%al
call   1090 <printf@plt>
movss  -0x18(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc8a(%rip),%rdi
mov    $0x1,%al
call   1090 <printf@plt>
mov    -0x48(%rbp),%rdi
call   1060 <fclose@plt>
xor    %eax,%eax
add    $0x460,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x430,%rsp
mov    0x2ded(%rip),%rax
mov    (%rax),%edi
lea    0xe2b(%rip),%rsi
call   10c0 <setlocale@plt>
lea    0xdfc(%rip),%rdi
call   1090 <system@plt>
lea    0xeef(%rip),%rdi
call   1050 <puts@plt>
mov    0x2dc8(%rip),%rax
mov    (%rax),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xff,%esi
call   10b0 <fgets@plt>
mov    %rbx,%rdi
call   1080 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    124b <main+0x6b>
movb   $0x0,0xf(%rsp,%rax,1)
lea    0xdb5(%rip),%rsi
lea    0x10(%rsp),%rdi
call   10d0 <fopen@plt>
test   %rax,%rax
je     147d <main+0x29d>
mov    %rax,%r14
lea    0xdbc(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0x30(%rsp),%rdi
mov    $0x400,%esi
mov    %r14,%rdx
call   10b0 <fgets@plt>
test   %rax,%rax
je     13c0 <main+0x1e0>
lea    0x30(%rsp),%r15
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rsp)
xorps  %xmm0,%xmm0
movss  %xmm0,(%rsp)
jmp    137c <main+0x19c>
nopw   0x0(%rax,%rax,1)
movss  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1100 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x2,%esi
call   1040 <getfield@plt>
mov    %eax,%edi
call   1060 <atof@plt>
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1100 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x3,%esi
call   1040 <getfield@plt>
mov    %eax,%edi
call   1060 <atof@plt>
movss  (%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1100 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x4,%esi
call   1040 <getfield@plt>
mov    %eax,%edi
call   1060 <atof@plt>
movss  0x4(%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
mov    $0x400,%esi
mov    %r14,%rdx
call   10b0 <fgets@plt>
test   %rax,%rax
je     13b9 <main+0x1d9>
mov    %r15,%rdi
call   1100 <strdup@plt>
mov    %rax,%rbx
movss  0x8(%rsp),%xmm0
ucomiss 0xc6c(%rip),%xmm0
jne    12c0 <main+0xe0>
jp     12c0 <main+0xe0>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <getfield@plt>
mov    %eax,%edi
call   1060 <atof@plt>
jmp    12c0 <main+0xe0>
movss  (%rsp),%xmm0
jmp    13d5 <main+0x1f5>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
movss  %xmm1,0x8(%rsp)
xorps  %xmm1,%xmm1
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xc65(%rip),%rdi
mov    $0x1,%al
call   10a0 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc6f(%rip),%rdi
mov    $0x1,%al
call   10a0 <printf@plt>
movss  0x4(%rsp),%xmm0
divss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc6d(%rip),%rdi
mov    $0x1,%al
call   10a0 <printf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0xc(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xc74(%rip),%rdi
mov    $0x2,%al
call   10a0 <printf@plt>
movss  0xc(%rsp),%xmm0
subss  0x8(%rsp),%xmm0
divss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc89(%rip),%rdi
mov    $0x1,%al
call   10a0 <printf@plt>
mov    %r14,%rdi
call   1070 <fclose@plt>
xor    %eax,%eax
add    $0x430,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xb85(%rip),%rdi
call   10e0 <perror@plt>
lea    0xb98(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    0x2b2d(%rip),%rax
mov    (%rax),%edi
call   10f0 <exit@plt>

LLVM IR (-O0):
@LC_NUMERIC = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [3 x i8] c"ls\00"
@.str.2 = [44 x i8] c"Enter the name of file you wish to open...\0A\00"
@stdin = global i32* null
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [31 x i8] c"Error while opening the file.\0A\00"
@.str.5 = [3 x i8] c"%s\00"
@EXIT_FAILURE = global i32 0
@.str.6 = [31 x i8] c"The contents of %s file are :\0A\00"
@.str.7 = [34 x i8] c"Total Gallons Used is %'.2f gal.\0A\00"
@.str.8 = [27 x i8] c"Total Fuel Cost is $%'.2f\0A\00"
@.str.9 = [41 x i8] c"Averge dollar cost per gallon is $%'.2f\0A\00"
@.str.10 = [56 x i8] c"Starting Odometer is %'.0f and Final Odometer is %'.0f\0A\00"
@.str.11 = [27 x i8] c"Miles per gallon is %'.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca [25 x i8]
%8 = alloca i32*
%9 = alloca [1024 x i8]
%10 = alloca i8*
store i32 0, i32* %1
store float 0.000000e+00, float* %3
store float 0.000000e+00, float* %4
store float 0.000000e+00, float* %5
%11 = load i32, i32* @LC_NUMERIC
%12 = call i32 @setlocale(i32 %11, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%15 = getelementptr inbounds [25 x i8], [25 x i8]* %7, i64 0, i64 0
%16 = load i32*, i32** @stdin
%17 = call i64 @fgets(i8* %15, i32 255, i32* %16)
%18 = getelementptr inbounds [25 x i8], [25 x i8]* %7, i64 0, i64 0
%19 = call i32 @strlen(i8* %18)
store i32 %19, i32* %2
%20 = load i32, i32* %2
%21 = sub nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [25 x i8], [25 x i8]* %7, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 10
br i1 %26, label %27, label %32
27: ; preds = %0
%28 = load i32, i32* %2
%29 = sub nsw i32 %28, 1
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [25 x i8], [25 x i8]* %7, i64 0, i64 %30
store i8 0, i8* %31
br label %32
32: ; preds = %27, %0
%33 = getelementptr inbounds [25 x i8], [25 x i8]* %7, i64 0, i64 0
%34 = call i32* @fopen(i8* %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %34, i32** %8
%35 = load i32*, i32** %8
%36 = icmp eq i32* %35, null
br i1 %36, label %37, label %43
37: ; preds = %32
%38 = call i32 @perror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%39 = getelementptr inbounds [25 x i8], [25 x i8]* %7, i64 0, i64 0
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %39)
%41 = load i32, i32* @EXIT_FAILURE
%42 = call i32 @exit(i32 %41)
unreachable
43: ; preds = %32
%44 = getelementptr inbounds [25 x i8], [25 x i8]* %7, i64 0, i64 0
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i8* %44)
br label %46
46: ; preds = %60, %43
%47 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%48 = load i32*, i32** %8
%49 = call i64 @fgets(i8* %47, i32 1024, i32* %48)
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %88
51: ; preds = %46
%52 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%53 = call i8* @strdup(i8* %52)
store i8* %53, i8** %10
%54 = load float, float* %5
%55 = fcmp oeq float %54, 0.000000e+00
br i1 %55, label %56, label %60
56: ; preds = %51
%57 = load i8*, i8** %10
%58 = call i32 @getfield(i8* %57, i32 2)
%59 = call float @atof(i32 %58)
store float %59, float* %5
br label %60
60: ; preds = %56, %51
%61 = load i8*, i8** %10
%62 = call i32 @free(i8* %61)
%63 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%64 = call i8* @strdup(i8* %63)
store i8* %64, i8** %10
%65 = load i8*, i8** %10
%66 = call i32 @getfield(i8* %65, i32 2)
%67 = call float @atof(i32 %66)
store float %67, float* %6
%68 = load i8*, i8** %10
%69 = call i32 @free(i8* %68)
%70 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%71 = call i8* @strdup(i8* %70)
store i8* %71, i8** %10
%72 = load i8*, i8** %10
%73 = call i32 @getfield(i8* %72, i32 3)
%74 = call float @atof(i32 %73)
%75 = load float, float* %4
%76 = fadd float %75, %74
store float %76, float* %4
%77 = load i8*, i8** %10
%78 = call i32 @free(i8* %77)
%79 = getelementptr inbounds [1024 x i8], [1024 x i8]* %9, i64 0, i64 0
%80 = call i8* @strdup(i8* %79)
store i8* %80, i8** %10
%81 = load i8*, i8** %10
%82 = call i32 @getfield(i8* %81, i32 4)
%83 = call float @atof(i32 %82)
%84 = load float, float* %3
%85 = fadd float %84, %83
store float %85, float* %3
%86 = load i8*, i8** %10
%87 = call i32 @free(i8* %86)
br label %46
88: ; preds = %46
%89 = load float, float* %4
%90 = fpext float %89 to double
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), double %90)
%92 = load float, float* %3
%93 = fpext float %92 to double
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), double %93)
%95 = load float, float* %3
%96 = load float, float* %4
%97 = fdiv float %95, %96
%98 = fpext float %97 to double
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0), double %98)
%100 = load float, float* %5
%101 = fpext float %100 to double
%102 = load float, float* %6
%103 = fpext float %102 to double
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.10, i64 0, i64 0), double %101, double %103)
%105 = load float, float* %6
%106 = load float, float* %5
%107 = fsub float %105, %106
%108 = load float, float* %4
%109 = fdiv float %107, %108
%110 = fpext float %109 to double
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0), double %110)
%112 = load i32*, i32** %8
%113 = call i32 @fclose(i32* %112)
ret i32 0
}

LLVM IR (-O2):
@LC_NUMERIC = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [3 x i8] c"ls\00"
@stdin = global i32* null
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [31 x i8] c"Error while opening the file.\0A\00"
@.str.5 = [3 x i8] c"%s\00"
@EXIT_FAILURE = global i32 0
@.str.6 = [31 x i8] c"The contents of %s file are :\0A\00"
@.str.7 = [34 x i8] c"Total Gallons Used is %'.2f gal.\0A\00"
@.str.8 = [27 x i8] c"Total Fuel Cost is $%'.2f\0A\00"
@.str.9 = [41 x i8] c"Averge dollar cost per gallon is $%'.2f\0A\00"
@.str.10 = [56 x i8] c"Starting Odometer is %'.0f and Final Odometer is %'.0f\0A\00"
@.str.11 = [27 x i8] c"Miles per gallon is %'.2f\0A\00"
@str = [43 x i8] c"Enter the name of file you wish to open...\00"
define i32 @main() {
%1 = alloca [25 x i8]
%2 = alloca [1024 x i8]
%3 = load i32, i32* @LC_NUMERIC
%4 = tail call i32 @setlocale(i32 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%6 = tail call i32 @system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%8 = load i32*, i32** @stdin
%9 = call i64 @fgets(i8* %5, i32 255, i32* %8)
%10 = call i32 @strlen(i8* %5)
%11 = add nsw i32 %10, -1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 10
br i1 %15, label %16, label %17
16: ; preds = %0
store i8 0, i8* %13
br label %17
17: ; preds = %16, %0
%18 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %25
20: ; preds = %17
%21 = call i32 @perror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %5)
%23 = load i32, i32* @EXIT_FAILURE
%24 = call i32 @exit(i32 %23)
unreachable
25: ; preds = %17
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), i8* %5)
%27 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%28 = call i64 @fgets(i8* %27, i32 1024, i32* %18)
%29 = icmp eq i64 %28, 0
br i1 %29, label %58, label %30
30: ; preds = %25, %39
%31 = phi float [ %54, %39 ], [ 0.000000e+00, %25 ]
%32 = phi float [ %40, %39 ], [ 0.000000e+00, %25 ]
%33 = phi float [ %49, %39 ], [ 0.000000e+00, %25 ]
%34 = call i8* @strdup(i8* %27)
%35 = fcmp oeq float %32, 0.000000e+00
br i1 %35, label %36, label %39
36: ; preds = %30
%37 = call i32 @getfield(i8* %34, i32 2)
%38 = call float @atof(i32 %37)
br label %39
39: ; preds = %36, %30
%40 = phi float [ %38, %36 ], [ %32, %30 ]
%41 = call i32 @free(i8* %34)
%42 = call i8* @strdup(i8* %27)
%43 = call i32 @getfield(i8* %42, i32 2)
%44 = call float @atof(i32 %43)
%45 = call i32 @free(i8* %42)
%46 = call i8* @strdup(i8* %27)
%47 = call i32 @getfield(i8* %46, i32 3)
%48 = call float @atof(i32 %47)
%49 = fadd float %33, %48
%50 = call i32 @free(i8* %46)
%51 = call i8* @strdup(i8* %27)
%52 = call i32 @getfield(i8* %51, i32 4)
%53 = call float @atof(i32 %52)
%54 = fadd float %31, %53
%55 = call i32 @free(i8* %51)
%56 = call i64 @fgets(i8* %27, i32 1024, i32* %18)
%57 = icmp eq i64 %56, 0
br i1 %57, label %58, label %30
58: ; preds = %39, %25
%59 = phi float [ 0.000000e+00, %25 ], [ %49, %39 ]
%60 = phi float [ 0.000000e+00, %25 ], [ %40, %39 ]
%61 = phi float [ undef, %25 ], [ %44, %39 ]
%62 = phi float [ 0.000000e+00, %25 ], [ %54, %39 ]
%63 = fpext float %59 to double
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), double %63)
%65 = fpext float %62 to double
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), double %65)
%67 = fdiv float %62, %59
%68 = fpext float %67 to double
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0), double %68)
%70 = fpext float %60 to double
%71 = fpext float %61 to double
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.10, i64 0, i64 0), double %70, double %71)
%73 = fsub float %61, %60
%74 = fdiv float %73, %59
%75 = fpext float %74 to double
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.11, i64 0, i64 0), double %75)
%77 = call i32 @fclose(i32* %18)
ret i32 0
}