#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 */
scalar_t__ EOF;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, int *, int *, int *);
int /*<<< orphan*/ print_class(int);
int /*<<< orphan*/ printf(char *, ...);
void print_run(int class_num) {
  FILE *file;
  int class = 0, win = 0, lost = 0, i = 0;
  int win_c = 0, lost_c = 0;
  double winp = 0.00;
  file = fopen("Stats.txt", "r");
  if (class_num != 0) {
    printf("\n __________________________________ \n");
    print_class(class_num);
    printf("\n:__________________________________: \n");
    while (fscanf(file, "%d %d %d", &class, &win, &lost) != EOF) {
      if (class == class_num) {
        win_c += win;
        lost_c += lost;
        printf(" %d : Wins - %4d   Loss - %4d\n", i + 1, win, lost);
        i++;
      }
    }
    winp = ((double)win_c / ((double)win_c + (double)lost_c)) * 100;
    if (win_c + lost_c == 0) {
      winp = 0;
    }
    printf("\n __________________________________ \n");
    printf("    Matches: %4d\n"
           "    Wins:    %4d\n"
           "    Loss:    %4d\n"
           "    Win Percentage: %.2lf %%",
           win_c + lost_c, win_c, lost_c, winp);
    printf("\n __________________________________ \n\n");
  } else {
    printf("\n __________________________________ \n");
    printf(" All Arena Runs");
    printf("\n __________________________________ \n");
    while (fscanf(file, "%d %d %d", &class, &win, &lost) != EOF) {
      win_c += win;
      lost_c += lost;
      print_class(class);
      printf(": Wins - %4d   Loss - %d\n", win, lost);
    }
    winp = ((double)win_c / ((double)win_c + (double)lost_c)) * 100;
    if (win_c + lost_c == 0) {
      winp = 0;
    }
    printf("\n __________________________________ \n");
    printf("    Matches: %4d\n"
           "    Wins:    %4d\n"
           "    Loss:    %4d\n"
           "    Win Percentage: %.2lf %%",
           win_c + lost_c, win_c, lost_c, winp);
    printf("\n __________________________________ \n\n");
  }
  fclose(file);
}


x86 assembly (clang, -O0):
<print_run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    0xe74(%rip),%rdi
lea    0xe77(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     12c3 <print_run+0x173>
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1060 <print_class@plt>
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xe86(%rip),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
call   1050 <fscanf@plt>
mov    0x2df3(%rip),%rcx
cmp    (%rcx),%rax
je     1244 <print_run+0xf4>
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    123f <print_run+0xef>
mov    -0x18(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%esi
add    $0x1,%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11d2 <print_run+0x82>
cvtsi2sdl -0x24(%rbp),%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
cvtsi2sdl -0x28(%rbp),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  0xd9d(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x24(%rbp),%eax
add    -0x28(%rbp),%eax
cmp    $0x0,%eax
jne    1283 <print_run+0x133>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    0xd8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%esi
add    -0x28(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
movsd  -0x30(%rbp),%xmm0
lea    0xde2(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe24(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13c6 <print_run+0x276>
lea    0xd4a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd2e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xd6b(%rip),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
call   1050 <fscanf@plt>
mov    0x2cd8(%rip),%rcx
cmp    (%rcx),%rax
je     134c <print_run+0x1fc>
mov    -0x18(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%edi
call   1060 <print_class@plt>
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xdd3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12ed <print_run+0x19d>
cvtsi2sdl -0x24(%rbp),%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
cvtsi2sdl -0x28(%rbp),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  0xc95(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x24(%rbp),%eax
add    -0x28(%rbp),%eax
cmp    $0x0,%eax
jne    138b <print_run+0x23b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    0xc82(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%esi
add    -0x28(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
movsd  -0x30(%rbp),%xmm0
lea    0xcda(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xd1c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_run>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edi,%r15d
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
lea    0xe78(%rip),%rdi
lea    0xe7b(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%r14
test   %r15d,%r15d
je     1249 <print_run+0xe9>
lea    0xf2e(%rip),%rdi
call   1030 <puts@plt>
mov    %r15d,%edi
call   1070 <print_class@plt>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xe45(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x4(%rsp),%r8
mov    %r14,%rdi
call   1060 <fscanf@plt>
mov    0x2dfb(%rip),%rcx
xor    %ebx,%ebx
mov    $0x0,%ebp
cmp    (%rcx),%rax
jne    136e <print_run+0x20e>
mov    %ebp,%r15d
xorpd  %xmm1,%xmm1
add    %ebx,%r15d
je     1224 <print_run+0xc4>
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
cvtsi2sd %ebp,%xmm0
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
mulsd  0xddc(%rip),%xmm1
movsd  %xmm1,0x10(%rsp)
lea    0xeac(%rip),%rdi
call   1030 <puts@plt>
lea    0xdff(%rip),%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
jmp    133e <print_run+0x1de>
lea    0xe8d(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe2d(%rip),%rdi
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xd9d(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x4(%rsp),%r8
mov    %r14,%rdi
call   1060 <fscanf@plt>
mov    0x2d53(%rip),%r13
mov    $0x0,%ebx
cmp    0x0(%r13),%rax
je     12f7 <print_run+0x197>
lea    0x8(%rsp),%r15
lea    0x4(%rsp),%r12
xor    %ebx,%ebx
xor    %ebp,%ebp
xchg   %ax,%ax
add    0x8(%rsp),%ebp
add    0x4(%rsp),%ebx
mov    0xc(%rsp),%edi
call   1070 <print_class@plt>
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
lea    0xdcc(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
lea    0xd33(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %r15,%rcx
mov    %r12,%r8
call   1060 <fscanf@plt>
cmp    0x0(%r13),%rax
jne    12b0 <print_run+0x150>
mov    %ebx,%r15d
xorpd  %xmm1,%xmm1
add    %ebp,%r15d
je     131e <print_run+0x1be>
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
cvtsi2sd %ebx,%xmm0
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
mulsd  0xce2(%rip),%xmm1
movsd  %xmm1,0x10(%rsp)
lea    0xdb2(%rip),%rdi
call   1030 <puts@plt>
lea    0xd05(%rip),%rdi
mov    %r15d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
movsd  0x10(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xdb1(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x4(%rsp),%r12
xor    %ebp,%ebp
xor    %ebx,%ebx
xor    %r13d,%r13d
jmp    13ac <print_run+0x24c>
nopl   0x0(%rax)
mov    %r14,%rdi
lea    0xc8a(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %r12,%r8
call   1060 <fscanf@plt>
mov    0x2c45(%rip),%rcx
cmp    (%rcx),%rax
je     11fd <print_run+0x9d>
cmp    %r15d,0xc(%rsp)
jne    1380 <print_run+0x220>
mov    0x8(%rsp),%edx
add    %edx,%ebx
mov    0x4(%rsp),%ecx
add    %ecx,%ebp
add    $0x1,%r13d
lea    0xc53(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1380 <print_run+0x220>

LLVM IR (-O0):
@.str = [10 x i8] c"Stats.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [39 x i8] c"\0A __________________________________ \0A\00"
@.str.3 = [40 x i8] c"\0A:__________________________________: \0A\00"
@.str.4 = [9 x i8] c"%d %d %d\00"
@EOF = global i64 0
@.str.5 = [31 x i8] c" %d : Wins - %4d Loss - %4d\0A\00"
@.str.6 = [80 x i8] c" Matches: %4d\0A Wins: %4d\0A Loss: %4d\0A Win Percentage: %.2lf %%\00"
@.str.7 = [40 x i8] c"\0A __________________________________ \0A\0A\00"
@.str.8 = [16 x i8] c" All Arena Runs\00"
@.str.9 = [26 x i8] c": Wins - %4d Loss - %d\0A\00"
define void @print_run(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double
store i32 %0, i32* %2
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store double 0.000000e+00, double* %10
%11 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %11, i32** %3
%12 = load i32, i32* %2
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %68
14: ; preds = %1
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%16 = load i32, i32* %2
%17 = call i32 @print_class(i32 %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
br label %19
19: ; preds = %42, %14
%20 = load i32*, i32** %3
%21 = call i64 @fscanf(i32* %20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32* %4, i32* %5, i32* %6)
%22 = load i64, i64* @EOF
%23 = icmp ne i64 %21, %22
br i1 %23, label %24, label %43
24: ; preds = %19
%25 = load i32, i32* %4
%26 = load i32, i32* %2
%27 = icmp eq i32 %25, %26
br i1 %27, label %28, label %42
28: ; preds = %24
%29 = load i32, i32* %5
%30 = load i32, i32* %8
%31 = add nsw i32 %30, %29
store i32 %31, i32* %8
%32 = load i32, i32* %6
%33 = load i32, i32* %9
%34 = add nsw i32 %33, %32
store i32 %34, i32* %9
%35 = load i32, i32* %7
%36 = add nsw i32 %35, 1
%37 = load i32, i32* %5
%38 = load i32, i32* %6
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i32 %36, i32 %37, i32 %38)
%40 = load i32, i32* %7
%41 = add nsw i32 %40, 1
store i32 %41, i32* %7
br label %42
42: ; preds = %28, %24
br label %19
43: ; preds = %19
%44 = load i32, i32* %8
%45 = sitofp i32 %44 to double
%46 = load i32, i32* %8
%47 = sitofp i32 %46 to double
%48 = load i32, i32* %9
%49 = sitofp i32 %48 to double
%50 = fadd double %47, %49
%51 = fdiv double %45, %50
%52 = fmul double %51, 1.000000e+02
store double %52, double* %10
%53 = load i32, i32* %8
%54 = load i32, i32* %9
%55 = add nsw i32 %53, %54
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %58
57: ; preds = %43
store double 0.000000e+00, double* %10
br label %58
58: ; preds = %57, %43
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%60 = load i32, i32* %8
%61 = load i32, i32* %9
%62 = add nsw i32 %60, %61
%63 = load i32, i32* %8
%64 = load i32, i32* %9
%65 = load double, double* %10
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.6, i64 0, i64 0), i32 %62, i32 %63, i32 %64, double %65)
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0))
br label %114
68: ; preds = %1
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0))
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
br label %72
72: ; preds = %77, %68
%73 = load i32*, i32** %3
%74 = call i64 @fscanf(i32* %73, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32* %4, i32* %5, i32* %6)
%75 = load i64, i64* @EOF
%76 = icmp ne i64 %74, %75
br i1 %76, label %77, label %89
77: ; preds = %72
%78 = load i32, i32* %5
%79 = load i32, i32* %8
%80 = add nsw i32 %79, %78
store i32 %80, i32* %8
%81 = load i32, i32* %6
%82 = load i32, i32* %9
%83 = add nsw i32 %82, %81
store i32 %83, i32* %9
%84 = load i32, i32* %4
%85 = call i32 @print_class(i32 %84)
%86 = load i32, i32* %5
%87 = load i32, i32* %6
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i32 %86, i32 %87)
br label %72
89: ; preds = %72
%90 = load i32, i32* %8
%91 = sitofp i32 %90 to double
%92 = load i32, i32* %8
%93 = sitofp i32 %92 to double
%94 = load i32, i32* %9
%95 = sitofp i32 %94 to double
%96 = fadd double %93, %95
%97 = fdiv double %91, %96
%98 = fmul double %97, 1.000000e+02
store double %98, double* %10
%99 = load i32, i32* %8
%100 = load i32, i32* %9
%101 = add nsw i32 %99, %100
%102 = icmp eq i32 %101, 0
br i1 %102, label %103, label %104
103: ; preds = %89
store double 0.000000e+00, double* %10
br label %104
104: ; preds = %103, %89
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%106 = load i32, i32* %8
%107 = load i32, i32* %9
%108 = add nsw i32 %106, %107
%109 = load i32, i32* %8
%110 = load i32, i32* %9
%111 = load double, double* %10
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.6, i64 0, i64 0), i32 %108, i32 %109, i32 %110, double %111)
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0))
br label %114
114: ; preds = %104, %58
%115 = load i32*, i32** %3
%116 = call i32 @fclose(i32* %115)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Stats.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.4 = [9 x i8] c"%d %d %d\00"
@EOF = global i64 0
@.str.5 = [31 x i8] c" %d : Wins - %4d Loss - %4d\0A\00"
@.str.6 = [80 x i8] c" Matches: %4d\0A Wins: %4d\0A Loss: %4d\0A Win Percentage: %.2lf %%\00"
@.str.8 = [16 x i8] c" All Arena Runs\00"
@.str.9 = [26 x i8] c": Wins - %4d Loss - %d\0A\00"
@str.14 = [39 x i8] c"\0A:__________________________________: \00"
@str.15 = [38 x i8] c"\0A __________________________________ \00"
@str.16 = [39 x i8] c"\0A __________________________________ \0A\00"
define void @print_run(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%7 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%8 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i32 %0, 0
br i1 %9, label %50, label %10
10: ; preds = %1
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.15, i64 0, i64 0))
%12 = tail call i32 @print_class(i32 %0)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.14, i64 0, i64 0))
%14 = call i64 @fscanf(i32* %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%15 = load i64, i64* @EOF
%16 = icmp eq i64 %14, %15
br i1 %16, label %37, label %17
17: ; preds = %10, %30
%18 = phi i32 [ %33, %30 ], [ 0, %10 ]
%19 = phi i32 [ %32, %30 ], [ 0, %10 ]
%20 = phi i32 [ %31, %30 ], [ 0, %10 ]
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, %0
br i1 %22, label %23, label %30
23: ; preds = %17
%24 = load i32, i32* %3
%25 = add nsw i32 %24, %19
%26 = load i32, i32* %4
%27 = add nsw i32 %26, %18
%28 = add nsw i32 %20, 1
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0), i32 %28, i32 %24, i32 %26)
br label %30
30: ; preds = %23, %17
%31 = phi i32 [ %28, %23 ], [ %20, %17 ]
%32 = phi i32 [ %25, %23 ], [ %19, %17 ]
%33 = phi i32 [ %27, %23 ], [ %18, %17 ]
%34 = call i64 @fscanf(i32* %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%35 = load i64, i64* @EOF
%36 = icmp eq i64 %34, %35
br i1 %36, label %37, label %17
37: ; preds = %30, %10
%38 = phi i32 [ 0, %10 ], [ %32, %30 ]
%39 = phi i32 [ 0, %10 ], [ %33, %30 ]
%40 = sitofp i32 %38 to double
%41 = sitofp i32 %39 to double
%42 = fadd double %40, %41
%43 = fdiv double %40, %42
%44 = fmul double %43, 1.000000e+02
%45 = add nsw i32 %39, %38
%46 = icmp eq i32 %45, 0
%47 = select i1 %46, double 0.000000e+00, double %44
%48 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.15, i64 0, i64 0))
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @.str.6, i64 0, i64 0), i32 %45, i32 %38, i32 %39, double %47)
br label %85
50: ; preds = %1
%51 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.15, i64 0, i64 0))
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0))
%53 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.15, i64 0, i64 0))
%54 = call i64 @fscanf(i32* %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%55 = load i64, i64* @EOF
%56 = icmp eq i64 %54, %55
br i1 %56, label %72, label %57
57: ; preds = %50, %57
%58 = phi i32 [ %63, %57 ], [ 0, %50 ]
%59 = phi i32 [ %61, %57 ], [ 0, %50 ]
%60 = load i32, i32* %3
%61 = add nsw i32 %60, %59
%62 = load i32, i32* %4
%63 = add nsw i32 %62, %58
%64 = load i32, i32* %2
%65 = call i32 @print_class(i32 %64)
%66 = load i32, i32* %3
%67 = load i32, i32* %4
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i32 %66, i32 %67)
%69 = call i64 @fscanf(i32* %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%70 = load i64, i64* @EOF
%71 = icmp eq i64 %69, %70
br i1 %71, label %72, label %57
72: ; preds = %57, %50
%73 = phi i32 [ 0, %50 ], [ %61, %57 ]
%74 = phi i32 [ 0, %50 ], [ %63, %57 ]
%75 = sitofp i32 %73 to double
%76 = sitofp i32 %74 to double
%77 = fadd double %75, %76
%78 = fdiv double %75, %77
%79 = fmul double %78, 1.000000e+02
%80 = add nsw i32 %74, %73
%81 = icmp eq i32 %80, 0
%82 = select i1 %81, double 0.000000e+00, double %79
%83 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.15, i64 0, i64 0))
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @.str.6, i64 0, i64 0), i32 %80, i32 %73, i32 %74, double %82)
br label %85
85: ; preds = %72, %37
%86 = phi i8* [ getelementptr inbounds ([39 x i8], [39 x i8]* @str.16, i64 0, i64 0), %72 ], [ getelementptr inbounds ([39 x i8], [39 x i8]* @str.16, i64 0, i64 0), %37 ]
%87 = call i32 @puts(i8* dereferenceable(1) %86)
%88 = call i32 @fclose(i32* %8)
ret void
}