#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 */

/* Variables and functions */
int printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, c = 0, s = 0;
  for (;;) {
    scanf("%d", &n);
    if (0 <= n && n <= 100) {
      s += n;
      c++;
      continue;
    }
    return 0 * printf("합계 : %d점\n평균 : %.1lf점\n", s, s / (c + 0.0));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jg     1179 <main+0x59>
cmpl   $0x64,-0x8(%rbp)
jg     1179 <main+0x59>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
mov    -0x10(%rbp),%esi
cvtsi2sdl -0x10(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
xorps  %xmm2,%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edx
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
imul   $0x0,%eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xed2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
xor    %ebx,%ebx
cmp    $0x64,%eax
ja     117f <main+0x5f>
lea    0xeb6(%rip),%r14
lea    0x4(%rsp),%r15
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    %eax,%ebx
add    $0x1,%ebp
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x65,%eax
jb     1160 <main+0x40>
cvtsi2sd %ebp,%xmm0
jmp    1183 <main+0x63>
xorpd  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edx
lea    0xe6d(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [34 x i8] c"\ED\95\A9\EA\B3\84 : %d\EC\A0\90\0A\ED\8F\89\EA\B7\A0 : %.1lf\EC\A0\90\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %12, %0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = icmp sle i32 0, %7
br i1 %8, label %9, label %18
9: ; preds = %5
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 100
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load i32, i32* %2
%14 = load i32, i32* %4
%15 = add nsw i32 %14, %13
store i32 %15, i32* %4
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %5
18: ; preds = %9, %5
%19 = load i32, i32* %4
%20 = load i32, i32* %4
%21 = sitofp i32 %20 to double
%22 = load i32, i32* %3
%23 = sitofp i32 %22 to double
%24 = fadd double %23, 0.000000e+00
%25 = fdiv double %21, %24
%26 = fptosi double %25 to i32
%27 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %19, i32 %26)
%28 = mul nsw i32 0, %27
ret i32 %28
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [34 x i8] c"\ED\95\A9\EA\B3\84 : %d\EC\A0\90\0A\ED\8F\89\EA\B7\A0 : %.1lf\EC\A0\90\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp ult i32 %4, 101
br i1 %5, label %6, label %17
6: ; preds = %0, %6
%7 = phi i32 [ %13, %6 ], [ %4, %0 ]
%8 = phi i32 [ %10, %6 ], [ 0, %0 ]
%9 = phi i32 [ %11, %6 ], [ 0, %0 ]
%10 = add nsw i32 %7, %8
%11 = add nuw nsw i32 %9, 1
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%13 = load i32, i32* %1
%14 = icmp ult i32 %13, 101
br i1 %14, label %6, label %15
15: ; preds = %6
%16 = sitofp i32 %11 to double
br label %17
17: ; preds = %15, %0
%18 = phi double [ 0.000000e+00, %0 ], [ %16, %15 ]
%19 = phi i32 [ 0, %0 ], [ %10, %15 ]
%20 = sitofp i32 %19 to double
%21 = fdiv double %20, %18
%22 = fptosi double %21 to i32
%23 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %19, i32 %22)
ret i32 0
}