#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 uint32_t;

/* Variables and functions */
int EXIT_SUCCESS;
int atoi(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ remove_new_line(char *);
float round(float);
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strtok(char *, char *);
int main() {
  char input[100];
  fgets(input, 100, stdin);
  remove_new_line(input);
  uint32_t minute, second;
  uint32_t totalSeconds = 0;
  int gameCount = 0;
  while (strcmp(input, "Quit") != 0) {
    minute = atoi(strtok(input, ":"));
    second = atoi(strtok(NULL, ":"));
    if ((minute >= 0 && minute <= 99) && (second >= 0 && second <= 59)) {
      totalSeconds += (minute * 60) + second;
    }
    gameCount++;
    fgets(input, 100, stdin);
    remove_new_line(input);
  }
  float averageSeconds = totalSeconds / ((float)gameCount);
  averageSeconds = round(averageSeconds);
  if (averageSeconds < 720) {
    printf("Gold Star\n");
  } else if (averageSeconds >= 720 && averageSeconds <= 1440) {
    printf("Silver Star\n");
  } else {
    printf("Bronze Star\n");
  }
  printf("Games - %d \\ Average seconds - %.0f", gameCount, averageSeconds);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    0x2e5b(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1040 <fgets@plt>
lea    -0x70(%rbp),%rdi
call   1090 <remove_new_line@plt>
movl   $0x0,-0x7c(%rbp)
movl   $0x0,-0x80(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xe4d(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     1261 <main+0xf1>
lea    -0x70(%rbp),%rdi
lea    0xe38(%rip),%rsi
call   1060 <strtok@plt>
mov    %eax,%edi
call   1080 <atoi@plt>
mov    %eax,-0x74(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xe1e(%rip),%rsi
call   1060 <strtok@plt>
mov    %eax,%edi
call   1080 <atoi@plt>
mov    %eax,-0x78(%rbp)
cmpl   $0x0,-0x74(%rbp)
jl     1233 <main+0xc3>
cmpl   $0x63,-0x74(%rbp)
jg     1233 <main+0xc3>
cmpl   $0x0,-0x78(%rbp)
jl     1233 <main+0xc3>
cmpl   $0x3b,-0x78(%rbp)
jg     1233 <main+0xc3>
imul   $0x3c,-0x74(%rbp),%eax
add    -0x78(%rbp),%eax
add    -0x7c(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
lea    -0x70(%rbp),%rdi
mov    0x2da1(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1040 <fgets@plt>
lea    -0x70(%rbp),%rdi
call   1090 <remove_new_line@plt>
jmp    11b0 <main+0x40>
cvtsi2ssl -0x7c(%rbp),%xmm0
cvtsi2ssl -0x80(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x84(%rbp)
ff
movss  -0x84(%rbp),%xmm0
ff
call   1070 <round@plt>
movss  %xmm0,-0x84(%rbp)
ff
movss  0xd6c(%rip),%xmm0
ucomiss -0x84(%rbp),%xmm0
jbe    12b4 <main+0x144>
lea    0xd67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1308 <main+0x198>
movss  -0x84(%rbp),%xmm0
ff
movss  0xd3c(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     12f5 <main+0x185>
movss  0xd2f(%rip),%xmm0
ucomiss -0x84(%rbp),%xmm0
jb     12f5 <main+0x185>
lea    0xd31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1303 <main+0x193>
lea    0xd2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1308 <main+0x198>
mov    -0x80(%rbp),%esi
movss  -0x84(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xd16(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2cac(%rip),%rax
mov    (%rax),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    0x2e53(%rip),%r14
mov    (%r14),%edx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1090 <remove_new_line@plt>
lea    0xe4f(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1260 <main+0xe0>
lea    0x10(%rsp),%r15
xor    %ebx,%ebx
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15,%rdi
lea    0xe23(%rip),%r13
mov    %r13,%rsi
call   1070 <strtok@plt>
mov    %eax,%edi
call   1080 <atoi@plt>
mov    %eax,%ebp
xor    %edi,%edi
mov    %r13,%rsi
call   1070 <strtok@plt>
mov    %eax,%edi
call   1080 <atoi@plt>
imul   $0x3c,%ebp,%ecx
add    %eax,%ecx
cmp    $0x3c,%eax
mov    $0x0,%edx
cmovge %edx,%ecx
test   %eax,%eax
cmovs  %edx,%ecx
cmp    $0x64,%ebp
cmovae %edx,%ecx
add    %ecx,%r12d
add    $0x1,%ebx
mov    (%r14),%edx
mov    %r15,%rdi
mov    $0x64,%esi
call   1050 <fgets@plt>
mov    %r15,%rdi
call   1090 <remove_new_line@plt>
mov    %r15,%rdi
lea    0xdb9(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    11e0 <main+0x60>
cvtsi2ss %r12d,%xmm0
jmp    1265 <main+0xe5>
xor    %ebx,%ebx
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm1
divss  %xmm1,%xmm0
call   10a0 <roundf@plt>
movss  %xmm0,0xc(%rsp)
movss  0xd80(%rip),%xmm1
ucomiss %xmm0,%xmm1
lea    0xdb5(%rip),%rax
lea    0xda2(%rip),%rcx
cmovb  %rcx,%rax
movss  0xd67(%rip),%xmm1
ucomiss %xmm1,%xmm0
cmovb  %rcx,%rax
ucomiss %xmm0,%xmm1
lea    0xd9d(%rip),%rdi
cmovbe %rax,%rdi
call   1030 <puts@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd47(%rip),%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1040 <printf@plt>
mov    0x2d00(%rip),%rax
mov    (%rax),%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [5 x i8] c"Quit\00"
@.str.1 = [2 x i8] c":\00"
@.str.2 = [11 x i8] c"Gold Star\0A\00"
@.str.3 = [13 x i8] c"Silver Star\0A\00"
@.str.4 = [13 x i8] c"Bronze Star\0A\00"
@.str.5 = [36 x i8] c"Games - %d \\ Average seconds - %.0f\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
store i32 0, i32* %1
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %8, i32 100, i32 %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%12 = call i32 @remove_new_line(i8* %11)
store i32 0, i32* %5
store i32 0, i32* %6
br label %13
13: ; preds = %41, %0
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%15 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %49
17: ; preds = %13
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%19 = call i32 @strtok(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 @atoi(i32 %19)
store i32 %20, i32* %3
%21 = call i32 @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%22 = call i32 @atoi(i32 %21)
store i32 %22, i32* %4
%23 = load i32, i32* %3
%24 = icmp sge i32 %23, 0
br i1 %24, label %25, label %41
25: ; preds = %17
%26 = load i32, i32* %3
%27 = icmp sle i32 %26, 99
br i1 %27, label %28, label %41
28: ; preds = %25
%29 = load i32, i32* %4
%30 = icmp sge i32 %29, 0
br i1 %30, label %31, label %41
31: ; preds = %28
%32 = load i32, i32* %4
%33 = icmp sle i32 %32, 59
br i1 %33, label %34, label %41
34: ; preds = %31
%35 = load i32, i32* %3
%36 = mul nsw i32 %35, 60
%37 = load i32, i32* %4
%38 = add nsw i32 %36, %37
%39 = load i32, i32* %5
%40 = add nsw i32 %39, %38
store i32 %40, i32* %5
br label %41
41: ; preds = %34, %31, %28, %25, %17
%42 = load i32, i32* %6
%43 = add nsw i32 %42, 1
store i32 %43, i32* %6
%44 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%45 = load i32, i32* @stdin
%46 = call i32 @fgets(i8* %44, i32 100, i32 %45)
%47 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%48 = call i32 @remove_new_line(i8* %47)
br label %13
49: ; preds = %13
%50 = load i32, i32* %5
%51 = sitofp i32 %50 to float
%52 = load i32, i32* %6
%53 = sitofp i32 %52 to float
%54 = fdiv float %51, %53
store float %54, float* %7
%55 = load float, float* %7
%56 = call float @round(float %55)
store float %56, float* %7
%57 = load float, float* %7
%58 = fcmp olt float %57, 7.200000e+02
br i1 %58, label %59, label %61
59: ; preds = %49
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %72
61: ; preds = %49
%62 = load float, float* %7
%63 = fcmp oge float %62, 7.200000e+02
br i1 %63, label %64, label %69
64: ; preds = %61
%65 = load float, float* %7
%66 = fcmp ole float %65, 1.440000e+03
br i1 %66, label %67, label %69
67: ; preds = %64
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
br label %71
69: ; preds = %64, %61
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
br label %71
71: ; preds = %69, %67
br label %72
72: ; preds = %71, %59
%73 = load i32, i32* %6
%74 = load float, float* %7
%75 = fpext float %74 to double
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i32 %73, double %75)
%77 = load i32, i32* @EXIT_SUCCESS
ret i32 %77
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [5 x i8] c"Quit\00"
@.str.1 = [2 x i8] c":\00"
@.str.5 = [36 x i8] c"Games - %d \\ Average seconds - %.0f\00"
@EXIT_SUCCESS = global i32 0
@str = [12 x i8] c"Bronze Star\00"
@str.6 = [12 x i8] c"Silver Star\00"
@str.7 = [10 x i8] c"Gold Star\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 100, i32 %3)
%5 = call i32 @remove_new_line(i8* %2)
%6 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %32, label %8
8: ; preds = %0, %8
%9 = phi i32 [ %24, %8 ], [ 0, %0 ]
%10 = phi i32 [ %23, %8 ], [ 0, %0 ]
%11 = call i32 @strtok(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @atoi(i32 %11)
%13 = call i32 @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @atoi(i32 %13)
%15 = icmp ult i32 %12, 100
%16 = icmp sgt i32 %14, -1
%17 = select i1 %15, i1 %16, i1 false
%18 = icmp slt i32 %14, 60
%19 = select i1 %17, i1 %18, i1 false
%20 = mul nsw i32 %12, 60
%21 = add nsw i32 %14, %20
%22 = select i1 %19, i32 %21, i32 0
%23 = add nsw i32 %22, %10
%24 = add nuw nsw i32 %9, 1
%25 = load i32, i32* @stdin
%26 = call i32 @fgets(i8* %2, i32 100, i32 %25)
%27 = call i32 @remove_new_line(i8* %2)
%28 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %8
30: ; preds = %8
%31 = sitofp i32 %23 to float
br label %32
32: ; preds = %30, %0
%33 = phi float [ 0.000000e+00, %0 ], [ %31, %30 ]
%34 = phi i32 [ 0, %0 ], [ %24, %30 ]
%35 = sitofp i32 %34 to float
%36 = fdiv float %33, %35
%37 = call float @llvm.round.f32(float %36)
%38 = fcmp olt float %37, 7.200000e+02
%39 = fcmp oge float %37, 7.200000e+02
%40 = fcmp ole float %37, 1.440000e+03
%41 = and i1 %39, %40
%42 = select i1 %41, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0)
%43 = select i1 %38, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.7, i64 0, i64 0), i8* %42
%44 = call i32 @puts(i8* dereferenceable(1) %43)
%45 = fpext float %37 to double
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i32 %34, double %45)
%47 = load i32, i32* @EXIT_SUCCESS
ret i32 %47
}