int main() {
  int x, a[7] = {0};
  while (scanf("%d", &x), x)
    a[x /= 10, x >= 6 ? 6 : x]++;
  for (x = 1; x <= 6; x++)
    printf(x >= 6 ? "어르신" : "%d0대", x), printf(" : %d명\n", a[x]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x1c,%edx
call   1040 <memset@plt>
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     11ab <main+0x7b>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jl     1190 <main+0x60>
mov    $0x6,%eax
mov    %eax,-0x34(%rbp)
jmp    1196 <main+0x66>
mov    -0x8(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cltq
mov    -0x30(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x30(%rbp,%rax,4)
jmp    114f <main+0x1f>
movl   $0x1,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jg     1202 <main+0xd2>
mov    -0x8(%rbp),%ecx
lea    0xe47(%rip),%rdi
lea    0xe36(%rip),%rax
cmp    $0x6,%ecx
cmovge %rax,%rdi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x8(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11b2 <main+0x82>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0x1c(%rsp)
movaps %xmm0,0x10(%rsp)
lea    0xec4(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
je     11ad <main+0x8d>
mov    $0x6,%ebp
lea    0xea4(%rip),%r14
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
mov    %ecx,0xc(%rsp)
cmp    $0x3c,%eax
cmovge %ebp,%ecx
movslq %ecx,%rax
addl   $0x1,0x10(%rsp,%rax,4)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jne    1170 <main+0x50>
movl   $0x1,0xc(%rsp)
mov    $0x1,%esi
lea    0xe42(%rip),%r14
lea    0xe45(%rip),%rbp
lea    0xe45(%rip),%rbx
nop
cmp    $0x6,%esi
mov    %rbp,%rdi
cmove  %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movslq 0xc(%rsp),%rax
mov    0x10(%rsp,%rax,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
lea    0x1(%rax),%esi
mov    %esi,0xc(%rsp)
cmp    $0x6,%eax
jl     11d0 <main+0xb0>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"\EC\96\B4\EB\A5\B4\EC\8B\A0\00"
@.str.2 = [7 x i8] c"%d0\EB\8C\80\00"
@.str.3 = [10 x i8] c" : %d\EB\AA\85\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [7 x i32]
store i32 0, i32* %1
%4 = bitcast [7 x i32]* %3 to i8*
br label %5
5: ; preds = %17, %0
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %23
9: ; preds = %5
%10 = load i32, i32* %2
%11 = sdiv i32 %10, 10
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = icmp sge i32 %12, 6
br i1 %13, label %14, label %15
14: ; preds = %9
br label %17
15: ; preds = %9
%16 = load i32, i32* %2
br label %17
17: ; preds = %15, %14
%18 = phi i32 [ 6, %14 ], [ %16, %15 ]
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = add nsw i32 %21, 1
store i32 %22, i32* %20
br label %5
23: ; preds = %5
store i32 1, i32* %2
br label %24
24: ; preds = %39, %23
%25 = load i32, i32* %2
%26 = icmp sle i32 %25, 6
br i1 %26, label %27, label %42
27: ; preds = %24
%28 = load i32, i32* %2
%29 = icmp sge i32 %28, 6
%30 = zext i1 %29 to i64
%31 = select i1 %29, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%32 = load i32, i32* %2
%33 = call i32 (i8*, ...) @printf(i8* %31, i32 %32)
%34 = load i32, i32* %2
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %37)
br label %39
39: ; preds = %27
%40 = load i32, i32* %2
%41 = add nsw i32 %40, 1
store i32 %41, i32* %2
br label %24
42: ; preds = %24
%43 = load i32, i32* %1
ret i32 %43
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"\EC\96\B4\EB\A5\B4\EC\8B\A0\00"
@.str.2 = [7 x i8] c"%d0\EB\8C\80\00"
@.str.3 = [10 x i8] c" : %d\EB\AA\85\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [7 x i32]* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %9, %0
store i32 1, i32* %1
br label %21
9: ; preds = %0, %9
%10 = phi i32 [ %19, %9 ], [ %6, %0 ]
%11 = sdiv i32 %10, 10
store i32 %11, i32* %1
%12 = icmp sgt i32 %10, 59
%13 = select i1 %12, i32 6, i32 %11
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 %14
%16 = load i32, i32* %15
%17 = add nsw i32 %16, 1
store i32 %17, i32* %15
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%19 = load i32, i32* %1
%20 = icmp eq i32 %19, 0
br i1 %20, label %8, label %9
21: ; preds = %8, %21
%22 = phi i32 [ 1, %8 ], [ %32, %21 ]
%23 = icmp eq i32 %22, 6
%24 = select i1 %23, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %24, i32 %22)
%26 = load i32, i32* %1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 %27
%29 = load i32, i32* %28
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %1
%32 = add nsw i32 %31, 1
store i32 %32, i32* %1
%33 = icmp slt i32 %31, 6
br i1 %33, label %21, label %34
34: ; preds = %21
ret i32 0
}