#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 */
float atof(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, int *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
main(int argc, char *argv[]) {
  FILE *frun, *fparam;
  int i, j, ncol, nrow;
  int runflag;
  int N;
  char tmpstr[512];
  float factor;
  float param;
  float sum;
  if (argc != 4) {
    fprintf(stderr, "Usage: %s <run mask> <param file> <factor>\n", argv[0]);
    fprintf(stderr,
            "\tThis program sums the parameters divided by factor in the "
            "activated grid cells, and prints the results to stdout.  "
            "Activated cells have values other than 0 in the run mask file.\n");
    exit(0);
  }
  if ((frun = fopen(argv[1], "r")) == NULL) {
    fprintf(stderr, "ERROR: Unable to open %s\n", argv[1]);
    exit(0);
  }
  if ((fparam = fopen(argv[2], "r")) == NULL) {
    fprintf(stderr, "ERROR: Unable to open %s\n", argv[2]);
    exit(0);
  }
  factor = atof(argv[3]);
  for (i = 0; i < 6; i++) {
    fgets(tmpstr, 512, frun);
    fgets(tmpstr, 512, fparam);
    if (i == 0)
      sscanf(tmpstr, "%*s %i", &ncol);
    if (i == 1)
      sscanf(tmpstr, "%*s %i", &nrow);
  }
  sum = 0.;
  N = 0;
  for (i = 0; i < nrow; i++) {
    for (j = 0; j < ncol; j++) {
      fscanf(frun, "%i", &runflag);
      fscanf(fparam, "%f", &param);
      if (runflag != 0) {
        sum += param / factor;
        N++;
      }
    }
  }
  fprintf(stdout, "Parameter Sum = %f\nParameter Average = %f\n", sum,
          sum / (float)N);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x250,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     11cf <main+0x5f>
mov    0x2e46(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe56(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2e28(%rip),%rax
mov    (%rax),%edi
lea    0xe6b(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
xor    %edi,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xf02(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1217 <main+0xa7>
mov    0x2de8(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xed9(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
xor    %edi,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xeba(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    125f <main+0xef>
mov    0x2da0(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xe91(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
xor    %edi,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x244(%rbp)
ff
movl   $0x0,-0x24(%rbp)
cmpl   $0x6,-0x24(%rbp)
jge    1304 <main+0x194>
lea    -0x240(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x200,%esi
call   1050 <fgets@plt>
lea    -0x240(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x200,%esi
call   1050 <fgets@plt>
cmpl   $0x0,-0x24(%rbp)
jne    12d0 <main+0x160>
lea    -0x240(%rbp),%rdi
lea    0xe35(%rip),%rsi
lea    -0x2c(%rbp),%rdx
call   1070 <sscanf@plt>
cmpl   $0x1,-0x24(%rbp)
jne    12f1 <main+0x181>
lea    -0x240(%rbp),%rdi
lea    0xe14(%rip),%rsi
lea    -0x30(%rbp),%rdx
call   1070 <sscanf@plt>
jmp    12f6 <main+0x186>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    127b <main+0x10b>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x24c(%rbp)
ff
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    13c4 <main+0x254>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    13b1 <main+0x241>
mov    -0x18(%rbp),%rdi
lea    0xdb9(%rip),%rsi
lea    -0x34(%rbp),%rdx
mov    $0x0,%al
call   1040 <fscanf@plt>
mov    -0x20(%rbp),%rdi
lea    0xda6(%rip),%rsi
lea    -0x248(%rbp),%rdx
mov    $0x0,%al
call   1040 <fscanf@plt>
cmpl   $0x0,-0x34(%rbp)
je     139e <main+0x22e>
movss  -0x248(%rbp),%xmm0
ff
divss  -0x244(%rbp),%xmm0
ff
addss  -0x24c(%rbp),%xmm0
ff
movss  %xmm0,-0x24c(%rbp)
ff
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    13a3 <main+0x233>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1330 <main+0x1c0>
jmp    13b6 <main+0x246>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    131d <main+0x1ad>
mov    0x2c0d(%rip),%rax
mov    (%rax),%edi
movss  -0x24c(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movss  -0x24c(%rbp),%xmm1
ff
cvtsi2ssl -0x38(%rbp),%xmm2
divss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xd11(%rip),%rsi
mov    $0x2,%al
call   1060 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x250,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x228,%rsp
mov    %rsi,%rbp
cmp    $0x4,%edi
jne    13c0 <main+0x250>
mov    0x8(%rbp),%rdi
lea    0xf48(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     13f2 <main+0x282>
mov    %rax,%r14
mov    0x10(%rbp),%rdi
lea    0xf2c(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     1401 <main+0x291>
mov    %rax,%rbx
mov    0x18(%rbp),%rdi
call   1030 <atof@plt>
movss  %xmm0,0x14(%rsp)
lea    0x20(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x200,%esi
mov    %r14,%rdx
call   1050 <fgets@plt>
mov    %rbp,%rdi
mov    $0x200,%esi
mov    %rbx,%rdx
call   1050 <fgets@plt>
lea    0xefc(%rip),%r15
lea    0xc(%rsp),%rdx
mov    %rbp,%rdi
mov    %r15,%rsi
call   1070 <sscanf@plt>
mov    %rbp,%rdi
mov    $0x200,%esi
mov    %r14,%rdx
call   1050 <fgets@plt>
mov    %rbp,%rdi
mov    $0x200,%esi
mov    %rbx,%rdx
call   1050 <fgets@plt>
lea    0x8(%rsp),%rdx
mov    %rbp,%rdi
mov    %r15,%rsi
call   1070 <sscanf@plt>
mov    %rbp,%rdi
mov    $0x200,%esi
mov    %r14,%rdx
call   1050 <fgets@plt>
mov    %rbp,%rdi
mov    $0x200,%esi
mov    %rbx,%rdx
call   1050 <fgets@plt>
mov    %rbp,%rdi
mov    $0x200,%esi
mov    %r14,%rdx
call   1050 <fgets@plt>
mov    %rbp,%rdi
mov    $0x200,%esi
mov    %rbx,%rdx
call   1050 <fgets@plt>
mov    %rbp,%rdi
mov    $0x200,%esi
mov    %r14,%rdx
call   1050 <fgets@plt>
mov    %rbp,%rdi
mov    $0x200,%esi
mov    %rbx,%rdx
call   1050 <fgets@plt>
mov    %rbp,%rdi
mov    $0x200,%esi
mov    %r14,%rdx
call   1050 <fgets@plt>
mov    %rbp,%rdi
mov    $0x200,%esi
mov    %rbx,%rdx
call   1050 <fgets@plt>
mov    0x8(%rsp),%ecx
xorps  %xmm0,%xmm0
test   %ecx,%ecx
jle    136c <main+0x1fc>
movss  %xmm0,0x4(%rsp)
mov    0xc(%rsp),%eax
lea    0xe23(%rip),%r13
lea    0x18(%rsp),%rbp
xor    %edx,%edx
xor    %r15d,%r15d
jmp    12ff <main+0x18f>
nopl   0x0(%rax)
mov    0x8(%rsp),%ecx
mov    0x10(%rsp),%edx
add    $0x1,%edx
cmp    %ecx,%edx
jge    1375 <main+0x205>
test   %eax,%eax
jle    12f8 <main+0x188>
mov    %edx,0x10(%rsp)
xor    %r12d,%r12d
jmp    131d <main+0x1ad>
nopl   0x0(%rax)
add    $0x1,%r12d
mov    0xc(%rsp),%eax
cmp    %eax,%r12d
jge    12f0 <main+0x180>
mov    %r14,%rdi
lea    0xdd9(%rip),%rsi
lea    0x1c(%rsp),%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
cmpl   $0x0,0x1c(%rsp)
je     1310 <main+0x1a0>
movss  0x18(%rsp),%xmm0
divss  0x14(%rsp),%xmm0
movss  0x4(%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
add    $0x1,%r15d
jmp    1310 <main+0x1a0>
movss  %xmm0,0x4(%rsp)
xor    %r15d,%r15d
mov    0x2c5c(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2ss %r15d,%xmm1
mov    (%rax),%edi
movss  0x4(%rsp),%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
divss  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
lea    0xd61(%rip),%rsi
mov    $0x2,%al
call   1060 <fprintf@plt>
xor    %eax,%eax
add    $0x228,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c19(%rip),%rbx
mov    (%rbx),%edi
mov    0x0(%rbp),%rdx
lea    0xc2c(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rbx),%edi
lea    0xc48(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
xor    %edi,%edi
call   1090 <exit@plt>
mov    0x2be7(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rbp),%rdx
jmp    140e <main+0x29e>
mov    0x2bd8(%rip),%rax
mov    (%rax),%edi
mov    0x10(%rbp),%rdx
lea    0xccd(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
xor    %edi,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"Usage: %s <run mask> <param file> <factor>\0A\00"
@.str.1 = [180 x i8] c"\09This program sums the parameters divided by factor in the activated grid cells, and prints the results to stdout. Activated cells have values other than 0 in the run mask file.\0A\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [26 x i8] c"ERROR: Unable to open %s\0A\00"
@.str.4 = [7 x i8] c"%*s %i\00"
@.str.5 = [3 x i8] c"%i\00"
@.str.6 = [3 x i8] c"%f\00"
@stdout = global i32 0
@.str.7 = [43 x i8] c"Parameter Sum = %f\0AParameter Average = %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca [512 x i8]
%15 = alloca float
%16 = alloca float
%17 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 4
br i1 %19, label %20, label %29
20: ; preds = %2
%21 = load i32, i32* @stderr
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %24)
%26 = load i32, i32* @stderr
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str.1, i64 0, i64 0))
%28 = call i32 @exit(i32 0)
unreachable
29: ; preds = %2
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i32* @fopen(i8* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %33, i32** %6
%34 = icmp eq i32* %33, null
br i1 %34, label %35, label %42
35: ; preds = %29
%36 = load i32, i32* @stderr
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %39)
%41 = call i32 @exit(i32 0)
unreachable
42: ; preds = %29
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 2
%45 = load i8*, i8** %44
%46 = call i32* @fopen(i8* %45, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %46, i32** %7
%47 = icmp eq i32* %46, null
br i1 %47, label %48, label %55
48: ; preds = %42
%49 = load i32, i32* @stderr
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i64 2
%52 = load i8*, i8** %51
%53 = call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %52)
%54 = call i32 @exit(i32 0)
unreachable
55: ; preds = %42
%56 = load i8**, i8*** %5
%57 = getelementptr inbounds i8*, i8** %56, i64 3
%58 = load i8*, i8** %57
%59 = call float @atof(i8* %58)
store float %59, float* %15
store i32 0, i32* %8
br label %60
60: ; preds = %82, %55
%61 = load i32, i32* %8
%62 = icmp slt i32 %61, 6
br i1 %62, label %63, label %85
63: ; preds = %60
%64 = getelementptr inbounds [512 x i8], [512 x i8]* %14, i64 0, i64 0
%65 = load i32*, i32** %6
%66 = call i32 @fgets(i8* %64, i32 512, i32* %65)
%67 = getelementptr inbounds [512 x i8], [512 x i8]* %14, i64 0, i64 0
%68 = load i32*, i32** %7
%69 = call i32 @fgets(i8* %67, i32 512, i32* %68)
%70 = load i32, i32* %8
%71 = icmp eq i32 %70, 0
br i1 %71, label %72, label %75
72: ; preds = %63
%73 = getelementptr inbounds [512 x i8], [512 x i8]* %14, i64 0, i64 0
%74 = call i32 @sscanf(i8* %73, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32* %10)
br label %75
75: ; preds = %72, %63
%76 = load i32, i32* %8
%77 = icmp eq i32 %76, 1
br i1 %77, label %78, label %81
78: ; preds = %75
%79 = getelementptr inbounds [512 x i8], [512 x i8]* %14, i64 0, i64 0
%80 = call i32 @sscanf(i8* %79, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32* %11)
br label %81
81: ; preds = %78, %75
br label %82
82: ; preds = %81
%83 = load i32, i32* %8
%84 = add nsw i32 %83, 1
store i32 %84, i32* %8
br label %60
85: ; preds = %60
store float 0.000000e+00, float* %17
store i32 0, i32* %13
store i32 0, i32* %8
br label %86
86: ; preds = %115, %85
%87 = load i32, i32* %8
%88 = load i32, i32* %11
%89 = icmp slt i32 %87, %88
br i1 %89, label %90, label %118
90: ; preds = %86
store i32 0, i32* %9
br label %91
91: ; preds = %111, %90
%92 = load i32, i32* %9
%93 = load i32, i32* %10
%94 = icmp slt i32 %92, %93
br i1 %94, label %95, label %114
95: ; preds = %91
%96 = load i32*, i32** %6
%97 = call i32 (i32*, i8*, ...) @fscanf(i32* %96, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %12)
%98 = load i32*, i32** %7
%99 = call i32 (i32*, i8*, ...) @fscanf(i32* %98, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), float* %16)
%100 = load i32, i32* %12
%101 = icmp ne i32 %100, 0
br i1 %101, label %102, label %110
102: ; preds = %95
%103 = load float, float* %16
%104 = load float, float* %15
%105 = fdiv float %103, %104
%106 = load float, float* %17
%107 = fadd float %106, %105
store float %107, float* %17
%108 = load i32, i32* %13
%109 = add nsw i32 %108, 1
store i32 %109, i32* %13
br label %110
110: ; preds = %102, %95
br label %111
111: ; preds = %110
%112 = load i32, i32* %9
%113 = add nsw i32 %112, 1
store i32 %113, i32* %9
br label %91
114: ; preds = %91
br label %115
115: ; preds = %114
%116 = load i32, i32* %8
%117 = add nsw i32 %116, 1
store i32 %117, i32* %8
br label %86
118: ; preds = %86
%119 = load i32, i32* @stdout
%120 = load float, float* %17
%121 = fpext float %120 to double
%122 = load float, float* %17
%123 = load i32, i32* %13
%124 = sitofp i32 %123 to float
%125 = fdiv float %122, %124
%126 = fpext float %125 to double
%127 = call i32 (i32, i8*, ...) @fprintf(i32 %119, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), double %121, double %126)
%128 = load i32, i32* %3
ret i32 %128
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"Usage: %s <run mask> <param file> <factor>\0A\00"
@.str.1 = [180 x i8] c"\09This program sums the parameters divided by factor in the activated grid cells, and prints the results to stdout. Activated cells have values other than 0 in the run mask file.\0A\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [26 x i8] c"ERROR: Unable to open %s\0A\00"
@.str.4 = [7 x i8] c"%*s %i\00"
@.str.5 = [3 x i8] c"%i\00"
@.str.6 = [3 x i8] c"%f\00"
@stdout = global i32 0
@.str.7 = [43 x i8] c"Parameter Sum = %f\0AParameter Average = %f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [512 x i8]
%7 = alloca float
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%12 = bitcast float* %7 to i8*
%13 = icmp eq i32 %0, 4
br i1 %13, label %21, label %14
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = load i8*, i8** %1
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = load i32, i32* @stderr
%19 = tail call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str.1, i64 0, i64 0))
%20 = tail call i32 @exit(i32 0)
unreachable
21: ; preds = %2
%22 = getelementptr inbounds i8*, i8** %1, i64 1
%23 = load i8*, i8** %22
%24 = tail call i32* @fopen(i8* %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%25 = icmp eq i32* %24, null
br i1 %25, label %26, label %31
26: ; preds = %21
%27 = load i32, i32* @stderr
%28 = load i8*, i8** %22
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %28)
%30 = tail call i32 @exit(i32 0)
unreachable
31: ; preds = %21
%32 = getelementptr inbounds i8*, i8** %1, i64 2
%33 = load i8*, i8** %32
%34 = tail call i32* @fopen(i8* %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%35 = icmp eq i32* %34, null
br i1 %35, label %36, label %43
36: ; preds = %31
%37 = load i32, i32* @stderr
%38 = load i8*, i8** %32
%39 = tail call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %38)
%40 = tail call i32 @exit(i32 0)
unreachable
41: ; preds = %43
%42 = load i32, i32* %3
br label %63
43: ; preds = %31
%44 = getelementptr inbounds i8*, i8** %1, i64 3
%45 = load i8*, i8** %44
%46 = tail call float @atof(i8* %45)
%47 = call i32 @fgets(i8* %11, i32 512, i32* %24)
%48 = call i32 @fgets(i8* %11, i32 512, i32* %34)
%49 = call i32 @sscanf(i8* %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32* %3)
%50 = call i32 @fgets(i8* %11, i32 512, i32* %24)
%51 = call i32 @fgets(i8* %11, i32 512, i32* %34)
%52 = call i32 @sscanf(i8* %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32* %4)
%53 = call i32 @fgets(i8* %11, i32 512, i32* %24)
%54 = call i32 @fgets(i8* %11, i32 512, i32* %34)
%55 = call i32 @fgets(i8* %11, i32 512, i32* %24)
%56 = call i32 @fgets(i8* %11, i32 512, i32* %34)
%57 = call i32 @fgets(i8* %11, i32 512, i32* %24)
%58 = call i32 @fgets(i8* %11, i32 512, i32* %34)
%59 = call i32 @fgets(i8* %11, i32 512, i32* %24)
%60 = call i32 @fgets(i8* %11, i32 512, i32* %34)
%61 = load i32, i32* %4
%62 = icmp sgt i32 %61, 0
br i1 %62, label %41, label %98
63: ; preds = %41, %91
%64 = phi i32 [ %92, %91 ], [ %61, %41 ]
%65 = phi i32 [ %93, %91 ], [ %42, %41 ]
%66 = phi float [ %95, %91 ], [ 0.000000e+00, %41 ]
%67 = phi i32 [ %96, %91 ], [ 0, %41 ]
%68 = phi i32 [ %94, %91 ], [ 0, %41 ]
%69 = icmp sgt i32 %65, 0
br i1 %69, label %70, label %91
70: ; preds = %63, %83
%71 = phi float [ %85, %83 ], [ %66, %63 ]
%72 = phi i32 [ %84, %83 ], [ %68, %63 ]
%73 = phi i32 [ %86, %83 ], [ 0, %63 ]
%74 = call i32 (i32*, i8*, ...) @fscanf(i32* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %5)
%75 = call i32 (i32*, i8*, ...) @fscanf(i32* %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), float* %7)
%76 = load i32, i32* %5
%77 = icmp eq i32 %76, 0
br i1 %77, label %83, label %78
78: ; preds = %70
%79 = load float, float* %7
%80 = fdiv float %79, %46
%81 = fadd float %71, %80
%82 = add nsw i32 %72, 1
br label %83
83: ; preds = %70, %78
%84 = phi i32 [ %82, %78 ], [ %72, %70 ]
%85 = phi float [ %81, %78 ], [ %71, %70 ]
%86 = add nuw nsw i32 %73, 1
%87 = load i32, i32* %3
%88 = icmp slt i32 %86, %87
br i1 %88, label %70, label %89
89: ; preds = %83
%90 = load i32, i32* %4
br label %91
91: ; preds = %89, %63
%92 = phi i32 [ %64, %63 ], [ %90, %89 ]
%93 = phi i32 [ %65, %63 ], [ %87, %89 ]
%94 = phi i32 [ %68, %63 ], [ %84, %89 ]
%95 = phi float [ %66, %63 ], [ %85, %89 ]
%96 = add nuw nsw i32 %67, 1
%97 = icmp slt i32 %96, %92
br i1 %97, label %63, label %98
98: ; preds = %91, %43
%99 = phi i32 [ 0, %43 ], [ %94, %91 ]
%100 = phi float [ 0.000000e+00, %43 ], [ %95, %91 ]
%101 = load i32, i32* @stdout
%102 = fpext float %100 to double
%103 = sitofp i32 %99 to float
%104 = fdiv float %100, %103
%105 = fpext float %104 to double
%106 = call i32 (i32, i8*, ...) @fprintf(i32 %101, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), double %102, double %105)
ret i32 0
}