#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 /*<<< orphan*/ printf(char *, int, int, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int v[3], aver, l;
  int a[5][3], i, j;
  aver = 0;
  for (i = 0; i < 5; i++)
    for (j = 0; j < 3; j++)
      scanf("%d", &a[i][j]);
  for (j = 0; j < 3; j++) {
    for (i = 0; i < 5; i++)
      aver = aver + a[i][j];
    v[j] = aver / 5;
    aver = 0;
  }
  l = (v[0] + v[1] + v[2]) / 3;
  printf("k1:%d\nk2:%d\nk3:%d\nl:%d\n", v[0], v[1], v[2], l);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x64(%rbp)
cmpl   $0x5,-0x64(%rbp)
jge    119f <main+0x7f>
movl   $0x0,-0x68(%rbp)
cmpl   $0x3,-0x68(%rbp)
jge    118c <main+0x6c>
movslq -0x64(%rbp),%rax
lea    -0x60(%rbp),%rsi
imul   $0xc,%rax,%rax
add    %rax,%rsi
movslq -0x68(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe87(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    114e <main+0x2e>
jmp    1191 <main+0x71>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    113d <main+0x1d>
movl   $0x0,-0x68(%rbp)
cmpl   $0x3,-0x68(%rbp)
jge    1215 <main+0xf5>
movl   $0x0,-0x64(%rbp)
cmpl   $0x5,-0x64(%rbp)
jge    11eb <main+0xcb>
mov    -0x14(%rbp),%eax
movslq -0x64(%rbp),%rdx
lea    -0x60(%rbp),%rcx
imul   $0xc,%rdx,%rdx
add    %rdx,%rcx
movslq -0x68(%rbp),%rdx
add    (%rcx,%rdx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    11b7 <main+0x97>
mov    -0x14(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
movslq -0x68(%rbp),%rax
mov    %ecx,-0x10(%rbp,%rax,4)
movl   $0x0,-0x14(%rbp)
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    11a6 <main+0x86>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xdc6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xee4(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x2c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x30(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x34(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x38(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
add    (%rsp),%eax
add    0x18(%rsp),%eax
add    0x24(%rsp),%eax
add    0x30(%rsp),%eax
cltq
imul   $0x66666667,%rax,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
shr    $0x20,%rsi
sar    %esi
add    %eax,%esi
movq   0x4(%rsp),%xmm0
movq   0x10(%rsp),%xmm1
paddd  %xmm0,%xmm1
movq   0x1c(%rsp),%xmm0
movq   0x28(%rsp),%xmm2
paddd  %xmm0,%xmm2
paddd  %xmm1,%xmm2
movq   0x34(%rsp),%xmm0
paddd  %xmm2,%xmm0
movdqa 0xdb2(%rip),%xmm1
pshufd $0xf5,%xmm0,%xmm2
pxor   %xmm3,%xmm3
pcmpgtd %xmm0,%xmm3
pmuludq %xmm1,%xmm0
pshufd $0xed,%xmm0,%xmm0
pmuludq %xmm1,%xmm2
pshufd $0xed,%xmm2,%xmm2
punpckldq %xmm2,%xmm0
pand   %xmm1,%xmm3
psubd  %xmm3,%xmm0
movdqa %xmm0,%xmm1
psrld  $0x1f,%xmm1
psrad  $0x1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%edx
lea    (%rdx,%rsi,1),%eax
pshufd $0x55,%xmm0,%xmm0
movd   %xmm0,%ecx
add    %ecx,%eax
cltq
imul   $0x55555556,%rax,%r8
mov    %r8,%rax
shr    $0x3f,%rax
shr    $0x20,%r8
add    %eax,%r8d
lea    0xd58(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [24 x i8] c"k1:%d\0Ak2:%d\0Ak3:%d\0Al:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca [5 x [3 x i32]]
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %6
br label %8
8: ; preds = %27, %0
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 5
br i1 %10, label %11, label %30
11: ; preds = %8
store i32 0, i32* %7
br label %12
12: ; preds = %23, %11
%13 = load i32, i32* %7
%14 = icmp slt i32 %13, 3
br i1 %14, label %15, label %26
15: ; preds = %12
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [5 x [3 x i32]], [5 x [3 x i32]]* %5, i64 0, i64 %17
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [3 x i32], [3 x i32]* %18, i64 0, i64 %20
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %21)
br label %23
23: ; preds = %15
%24 = load i32, i32* %7
%25 = add nsw i32 %24, 1
store i32 %25, i32* %7
br label %12
26: ; preds = %12
br label %27
27: ; preds = %26
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %8
30: ; preds = %8
store i32 0, i32* %7
br label %31
31: ; preds = %57, %30
%32 = load i32, i32* %7
%33 = icmp slt i32 %32, 3
br i1 %33, label %34, label %60
34: ; preds = %31
store i32 0, i32* %6
br label %35
35: ; preds = %48, %34
%36 = load i32, i32* %6
%37 = icmp slt i32 %36, 5
br i1 %37, label %38, label %51
38: ; preds = %35
%39 = load i32, i32* %3
%40 = load i32, i32* %6
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [5 x [3 x i32]], [5 x [3 x i32]]* %5, i64 0, i64 %41
%43 = load i32, i32* %7
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [3 x i32], [3 x i32]* %42, i64 0, i64 %44
%46 = load i32, i32* %45
%47 = add nsw i32 %39, %46
store i32 %47, i32* %3
br label %48
48: ; preds = %38
%49 = load i32, i32* %6
%50 = add nsw i32 %49, 1
store i32 %50, i32* %6
br label %35
51: ; preds = %35
%52 = load i32, i32* %3
%53 = sdiv i32 %52, 5
%54 = load i32, i32* %7
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 %55
store i32 %53, i32* %56
store i32 0, i32* %3
br label %57
57: ; preds = %51
%58 = load i32, i32* %7
%59 = add nsw i32 %58, 1
store i32 %59, i32* %7
br label %31
60: ; preds = %31
%61 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%62 = load i32, i32* %61
%63 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%64 = load i32, i32* %63
%65 = add nsw i32 %62, %64
%66 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%67 = load i32, i32* %66
%68 = add nsw i32 %65, %67
%69 = sdiv i32 %68, 3
store i32 %69, i32* %4
%70 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%71 = load i32, i32* %70
%72 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%73 = load i32, i32* %72
%74 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%75 = load i32, i32* %74
%76 = load i32, i32* %4
%77 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %71, i32 %73, i32 %75, i32 %76)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [24 x i8] c"k1:%d\0Ak2:%d\0Ak3:%d\0Al:%d\0A\00"
define i32 @main() {
%1 = alloca [5 x [3 x i32]]
%2 = bitcast [5 x [3 x i32]]* %1 to i8*
%3 = getelementptr inbounds [5 x [3 x i32]], [5 x [3 x i32]]* %1, i64 0, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = getelementptr inbounds [5 x [3 x i32]], [5 x [3 x i32]]* %1, i64 0, i64 0, i64 1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%7 = getelementptr inbounds [5 x [3 x i32]], [5 x [3 x i32]]* %1, i64 0, i64 0, i64 2
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%9 = getelementptr inbounds [5 x [3 x i32]], [5 x [3 x i32]]* %1, i64 0, i64 1, i64 0
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = getelementptr inbounds [5 x [3 x i32]], [5 x [3 x i32]]* %1, i64 0, i64 1, i64 1
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %11)
%13 = getelementptr inbounds [5 x [3 x i32]], [5 x [3 x i32]]* %1, i64 0, i64 1, i64 2
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %13)
%15 = getelementptr inbounds [5 x [3 x i32]], [5 x [3 x i32]]* %1, i64 0, i64 2, i64 0
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %15)
%17 = getelementptr inbounds [5 x [3 x i32]], [5 x [3 x i32]]* %1, i64 0, i64 2, i64 1
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %17)
%19 = getelementptr inbounds [5 x [3 x i32]], [5 x [3 x i32]]* %1, i64 0, i64 2, i64 2
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %19)
%21 = getelementptr inbounds [5 x [3 x i32]], [5 x [3 x i32]]* %1, i64 0, i64 3, i64 0
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %21)
%23 = getelementptr inbounds [5 x [3 x i32]], [5 x [3 x i32]]* %1, i64 0, i64 3, i64 1
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %23)
%25 = getelementptr inbounds [5 x [3 x i32]], [5 x [3 x i32]]* %1, i64 0, i64 3, i64 2
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %25)
%27 = getelementptr inbounds [5 x [3 x i32]], [5 x [3 x i32]]* %1, i64 0, i64 4, i64 0
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %27)
%29 = getelementptr inbounds [5 x [3 x i32]], [5 x [3 x i32]]* %1, i64 0, i64 4, i64 1
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %29)
%31 = getelementptr inbounds [5 x [3 x i32]], [5 x [3 x i32]]* %1, i64 0, i64 4, i64 2
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %31)
%33 = load i32, i32* %3
%34 = load i32, i32* %9
%35 = add nsw i32 %34, %33
%36 = load i32, i32* %15
%37 = add nsw i32 %36, %35
%38 = load i32, i32* %21
%39 = add nsw i32 %38, %37
%40 = load i32, i32* %27
%41 = add nsw i32 %40, %39
%42 = sdiv i32 %41, 5
%43 = bitcast i32* %5 to <2 x i32>*
%44 = load <2 x i32>, <2 x i32>* %43
%45 = bitcast i32* %11 to <2 x i32>*
%46 = load <2 x i32>, <2 x i32>* %45
%47 = add nsw <2 x i32> %46, %44
%48 = bitcast i32* %17 to <2 x i32>*
%49 = load <2 x i32>, <2 x i32>* %48
%50 = add nsw <2 x i32> %49, %47
%51 = bitcast i32* %23 to <2 x i32>*
%52 = load <2 x i32>, <2 x i32>* %51
%53 = add nsw <2 x i32> %52, %50
%54 = bitcast i32* %29 to <2 x i32>*
%55 = load <2 x i32>, <2 x i32>* %54
%56 = add nsw <2 x i32> %55, %53
%57 = sdiv <2 x i32> %56, <i32 5, i32 5>
%58 = extractelement <2 x i32> %57, i64 0
%59 = add nsw i32 %58, %42
%60 = extractelement <2 x i32> %57, i64 1
%61 = add nsw i32 %59, %60
%62 = sdiv i32 %61, 3
%63 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %42, i32 %58, i32 %60, i32 %62)
ret i32 0
}