int main() {
  int a[10], i, s;
  for (s = i = 0; i < 10; i++)
    scanf("%d", a + i), s += a[i];
  return 0 * printf("합계: %d\n평균: %.2lf\n", s, s / 10.0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    1180 <main+0x60>
lea    -0x30(%rbp),%rsi
movslq -0x34(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
add    -0x38(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    113d <main+0x1d>
mov    -0x38(%rbp),%esi
cvtsi2sdl -0x38(%rbp),%xmm0
movsd  0xe70(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe70(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
imul   $0x0,%eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x60,%rsp
lea    0xed9(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    (%rsp),%r14d
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebp
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xc(%rsp),%rsi
movss  0x8(%rsp),%xmm0
movaps %xmm0,0x40(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x10(%rsp),%rsi
movss  0xc(%rsp),%xmm0
unpcklps 0x40(%rsp),%xmm0
movaps %xmm0,0x40(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x14(%rsp),%rsi
movss  0x10(%rsp),%xmm0
movaps %xmm0,0x30(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x18(%rsp),%rsi
movss  0x14(%rsp),%xmm0
unpcklps 0x30(%rsp),%xmm0
unpcklpd 0x40(%rsp),%xmm0
movaps %xmm0,0x40(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x1c(%rsp),%rsi
movss  0x18(%rsp),%xmm0
movaps %xmm0,0x30(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x20(%rsp),%rsi
movss  0x1c(%rsp),%xmm0
unpcklps 0x30(%rsp),%xmm0
movaps %xmm0,0x30(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x24(%rsp),%rsi
movss  0x20(%rsp),%xmm0
movaps %xmm0,0x50(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
movd   0x24(%rsp),%xmm0
punpckldq 0x50(%rsp),%xmm0
punpcklqdq 0x30(%rsp),%xmm0
paddd  0x40(%rsp),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%esi
add    %ebp,%esi
add    %r14d,%esi
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
divsd  0xd91(%rip),%xmm0
lea    0xd95(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [26 x i8] c"\ED\95\A9\EA\B3\84: %d\0A\ED\8F\89\EA\B7\A0: %.2lf\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = load i32, i32* %3
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%8 = load i32, i32* %6
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = load i32, i32* %9
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %12)
%14 = load i32, i32* %12
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %15)
%17 = load i32, i32* %15
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %18)
%20 = load i32, i32* %18
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %21)
%23 = load i32, i32* %21
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%25 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %24)
%26 = load i32, i32* %24
%27 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%28 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %27)
%29 = load i32, i32* %27
%30 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%31 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %30)
%32 = load i32, i32* %30
%33 = insertelement <8 x i32> poison, i32 %32, i64 0
%34 = insertelement <8 x i32> %33, i32 %29, i64 1
%35 = insertelement <8 x i32> %34, i32 %26, i64 2
%36 = insertelement <8 x i32> %35, i32 %23, i64 3
%37 = insertelement <8 x i32> %36, i32 %20, i64 4
%38 = insertelement <8 x i32> %37, i32 %17, i64 5
%39 = insertelement <8 x i32> %38, i32 %14, i64 6
%40 = insertelement <8 x i32> %39, i32 %11, i64 7
%41 = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %40)
%42 = add nsw i32 %41, %8
%43 = add nsw i32 %42, %5
%44 = sitofp i32 %43 to double
%45 = fdiv double %44, 1.000000e+01
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %43, double %45)
ret i32 0
}