#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*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int arr[2][3];
  int i, j, small, big, total, aver;
  for (i = 0; i < 2; i++) {
    printf("\nRow %d:\n", (i + 1));
    for (j = 0; j < 3; j++) {
      printf("Element %d:", (j + 1));
      scanf("%d", &arr[i][j]);
      getchar();
    }
  }
  printf("\n[Press Enter]");
  getchar();
  for (i = 0; i < 2; i++) {
    printf("\nRow %d:\n", (i + 1));
    for (j = 0; j < 3; j++) {
      printf("Element %d: %d\n", (j + 1), arr[i][j]);
    }
  }
  printf("\n[Press Enter]");
  getchar();
  small = arr[0][0];
  for (i = 0; i < 2; i++) {
    for (j = 0; j < 3; j++) {
      if (arr[i][j] < small) {
        small = arr[i][j];
      }
    }
  }
  printf("\nSmallest element is: %d\n", small);
  printf("\n[Press Enter]");
  getchar();
  big = arr[0][0];
  for (i = 0; i < 2; i++) {
    for (j = 0; j < 3; j++) {
      if (arr[i][j] > small) {
        big = arr[i][j];
      }
    }
  }
  printf("\nBiggest element is: %d\n", big);
  printf("\n[Press Enter]");
  getchar();
  total = 0;
  for (i = 0; i < 2; i++) {
    for (j = 0; j < 3; j++) {
      total += arr[i][j];
    }
  }
  aver = total / (2 * 3);
  printf("\nAverage is: %d\n", aver);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x2,-0x24(%rbp)
jge    11d7 <main+0xa7>
mov    -0x24(%rbp),%esi
add    $0x1,%esi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x28(%rbp)
cmpl   $0x3,-0x28(%rbp)
jge    11c4 <main+0x94>
mov    -0x28(%rbp),%esi
add    $0x1,%esi
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x24(%rbp),%rax
lea    -0x20(%rbp),%rsi
imul   $0xc,%rax,%rax
add    %rax,%rsi
movslq -0x28(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe6c(%rip),%rdi
call   1050 <scanf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    116b <main+0x3b>
jmp    11c9 <main+0x99>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1146 <main+0x16>
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x2,-0x24(%rbp)
jge    126d <main+0x13d>
mov    -0x24(%rbp),%esi
add    $0x1,%esi
lea    0xdf6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x28(%rbp)
cmpl   $0x3,-0x28(%rbp)
jge    125a <main+0x12a>
mov    -0x28(%rbp),%esi
add    $0x1,%esi
movslq -0x24(%rbp),%rcx
lea    -0x20(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xde3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1218 <main+0xe8>
jmp    125f <main+0x12f>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11f3 <main+0xc3>
lea    0xda5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x2,-0x24(%rbp)
jge    1308 <main+0x1d8>
movl   $0x0,-0x28(%rbp)
cmpl   $0x3,-0x28(%rbp)
jge    12f5 <main+0x1c5>
movslq -0x24(%rbp),%rcx
lea    -0x20(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x2c(%rbp),%eax
jge    12e2 <main+0x1b2>
movslq -0x24(%rbp),%rcx
lea    -0x20(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x2c(%rbp)
jmp    12e7 <main+0x1b7>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    12a0 <main+0x170>
jmp    12fa <main+0x1ca>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    128f <main+0x15f>
mov    -0x2c(%rbp),%esi
lea    0xd26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xcf9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x30(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x2,-0x24(%rbp)
jge    13b4 <main+0x284>
movl   $0x0,-0x28(%rbp)
cmpl   $0x3,-0x28(%rbp)
jge    13a1 <main+0x271>
movslq -0x24(%rbp),%rcx
lea    -0x20(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x2c(%rbp),%eax
jle    138e <main+0x25e>
movslq -0x24(%rbp),%rcx
lea    -0x20(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x30(%rbp)
jmp    1393 <main+0x263>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    134c <main+0x21c>
jmp    13a6 <main+0x276>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    133b <main+0x20b>
mov    -0x30(%rbp),%esi
lea    0xc94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xc4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x2,-0x24(%rbp)
jge    1440 <main+0x310>
movl   $0x0,-0x28(%rbp)
cmpl   $0x3,-0x28(%rbp)
jge    142d <main+0x2fd>
movslq -0x24(%rbp),%rcx
lea    -0x20(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    13f9 <main+0x2c9>
jmp    1432 <main+0x302>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    13e8 <main+0x2b8>
mov    -0x34(%rbp),%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%esi
lea    0xc13(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xebf(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb3(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea9(%rip),%r15
mov    %rsp,%rsi
mov    %r15,%rdi
call   1050 <scanf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %r15,%rdi
call   1050 <scanf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %r15,%rdi
call   1050 <scanf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %r15,%rdi
call   1050 <scanf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %r15,%rdi
call   1050 <scanf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x14(%rsp),%rsi
mov    %r15,%rdi
call   1050 <scanf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
lea    0xdd5(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%edx
lea    0xdba(%rip),%rbp
mov    %rbp,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%edx
mov    %rbp,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%edx
mov    %rbp,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%edx
mov    %rbp,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%edx
mov    %rbp,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x14(%rsp),%edx
mov    %rbp,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    (%rsp),%ebp
mov    0x4(%rsp),%eax
cmp    %ebp,%eax
cmovl  %eax,%ebp
mov    0x8(%rsp),%eax
cmp    %ebp,%eax
cmovl  %eax,%ebp
mov    0xc(%rsp),%eax
cmp    %ebp,%eax
cmovl  %eax,%ebp
mov    0x10(%rsp),%eax
cmp    %ebp,%eax
cmovl  %eax,%ebp
mov    0x14(%rsp),%eax
cmp    %ebp,%eax
cmovl  %eax,%ebp
lea    0xd05(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x4(%rsp),%esi
mov    0x8(%rsp),%eax
cmp    %ebp,%esi
jg     135c <main+0x22c>
mov    (%rsp),%esi
cmp    %ebp,%eax
cmovg  %eax,%esi
mov    0xc(%rsp),%eax
cmp    %ebp,%eax
cmovg  %eax,%esi
mov    0x10(%rsp),%eax
cmp    %ebp,%eax
cmovg  %eax,%esi
mov    0x14(%rsp),%eax
cmp    %ebp,%eax
cmovg  %eax,%esi
lea    0xccf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
movdqu 0x8(%rsp),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%eax
add    0x4(%rsp),%eax
add    (%rsp),%eax
cltq
imul   $0x2aaaaaab,%rax,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
shr    $0x20,%rsi
add    %eax,%esi
lea    0xc90(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"\0ARow %d:\0A\00"
@.str.1 = [12 x i8] c"Element %d:\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [15 x i8] c"\0A[Press Enter]\00"
@.str.4 = [16 x i8] c"Element %d: %d\0A\00"
@.str.5 = [26 x i8] c"\0ASmallest element is: %d\0A\00"
@.str.6 = [25 x i8] c"\0ABiggest element is: %d\0A\00"
@.str.7 = [17 x i8] c"\0AAverage is: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x [3 x i32]]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %9
9: ; preds = %35, %0
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 2
br i1 %11, label %12, label %38
12: ; preds = %9
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %14)
store i32 0, i32* %4
br label %16
16: ; preds = %31, %12
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, 3
br i1 %18, label %19, label %34
19: ; preds = %16
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %2, i64 0, i64 %24
%26 = load i32, i32* %4
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [3 x i32], [3 x i32]* %25, i64 0, i64 %27
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %28)
%30 = call i32 (...) @getchar()
br label %31
31: ; preds = %19
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
store i32 %33, i32* %4
br label %16
34: ; preds = %16
br label %35
35: ; preds = %34
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 1
store i32 %37, i32* %3
br label %9
38: ; preds = %9
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%40 = call i32 (...) @getchar()
store i32 0, i32* %3
br label %41
41: ; preds = %66, %38
%42 = load i32, i32* %3
%43 = icmp slt i32 %42, 2
br i1 %43, label %44, label %69
44: ; preds = %41
%45 = load i32, i32* %3
%46 = add nsw i32 %45, 1
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %46)
store i32 0, i32* %4
br label %48
48: ; preds = %62, %44
%49 = load i32, i32* %4
%50 = icmp slt i32 %49, 3
br i1 %50, label %51, label %65
51: ; preds = %48
%52 = load i32, i32* %4
%53 = add nsw i32 %52, 1
%54 = load i32, i32* %3
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %2, i64 0, i64 %55
%57 = load i32, i32* %4
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [3 x i32], [3 x i32]* %56, i64 0, i64 %58
%60 = load i32, i32* %59
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %53, i32 %60)
br label %62
62: ; preds = %51
%63 = load i32, i32* %4
%64 = add nsw i32 %63, 1
store i32 %64, i32* %4
br label %48
65: ; preds = %48
br label %66
66: ; preds = %65
%67 = load i32, i32* %3
%68 = add nsw i32 %67, 1
store i32 %68, i32* %3
br label %41
69: ; preds = %41
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%71 = call i32 (...) @getchar()
%72 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %2, i64 0, i64 0
%73 = getelementptr inbounds [3 x i32], [3 x i32]* %72, i64 0, i64 0
%74 = load i32, i32* %73
store i32 %74, i32* %5
store i32 0, i32* %3
br label %75
75: ; preds = %105, %69
%76 = load i32, i32* %3
%77 = icmp slt i32 %76, 2
br i1 %77, label %78, label %108
78: ; preds = %75
store i32 0, i32* %4
br label %79
79: ; preds = %101, %78
%80 = load i32, i32* %4
%81 = icmp slt i32 %80, 3
br i1 %81, label %82, label %104
82: ; preds = %79
%83 = load i32, i32* %3
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %2, i64 0, i64 %84
%86 = load i32, i32* %4
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [3 x i32], [3 x i32]* %85, i64 0, i64 %87
%89 = load i32, i32* %88
%90 = load i32, i32* %5
%91 = icmp slt i32 %89, %90
br i1 %91, label %92, label %100
92: ; preds = %82
%93 = load i32, i32* %3
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %2, i64 0, i64 %94
%96 = load i32, i32* %4
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [3 x i32], [3 x i32]* %95, i64 0, i64 %97
%99 = load i32, i32* %98
store i32 %99, i32* %5
br label %100
100: ; preds = %92, %82
br label %101
101: ; preds = %100
%102 = load i32, i32* %4
%103 = add nsw i32 %102, 1
store i32 %103, i32* %4
br label %79
104: ; preds = %79
br label %105
105: ; preds = %104
%106 = load i32, i32* %3
%107 = add nsw i32 %106, 1
store i32 %107, i32* %3
br label %75
108: ; preds = %75
%109 = load i32, i32* %5
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %109)
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%112 = call i32 (...) @getchar()
%113 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %2, i64 0, i64 0
%114 = getelementptr inbounds [3 x i32], [3 x i32]* %113, i64 0, i64 0
%115 = load i32, i32* %114
store i32 %115, i32* %6
store i32 0, i32* %3
br label %116
116: ; preds = %146, %108
%117 = load i32, i32* %3
%118 = icmp slt i32 %117, 2
br i1 %118, label %119, label %149
119: ; preds = %116
store i32 0, i32* %4
br label %120
120: ; preds = %142, %119
%121 = load i32, i32* %4
%122 = icmp slt i32 %121, 3
br i1 %122, label %123, label %145
123: ; preds = %120
%124 = load i32, i32* %3
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %2, i64 0, i64 %125
%127 = load i32, i32* %4
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds [3 x i32], [3 x i32]* %126, i64 0, i64 %128
%130 = load i32, i32* %129
%131 = load i32, i32* %5
%132 = icmp sgt i32 %130, %131
br i1 %132, label %133, label %141
133: ; preds = %123
%134 = load i32, i32* %3
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %2, i64 0, i64 %135
%137 = load i32, i32* %4
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds [3 x i32], [3 x i32]* %136, i64 0, i64 %138
%140 = load i32, i32* %139
store i32 %140, i32* %6
br label %141
141: ; preds = %133, %123
br label %142
142: ; preds = %141
%143 = load i32, i32* %4
%144 = add nsw i32 %143, 1
store i32 %144, i32* %4
br label %120
145: ; preds = %120
br label %146
146: ; preds = %145
%147 = load i32, i32* %3
%148 = add nsw i32 %147, 1
store i32 %148, i32* %3
br label %116
149: ; preds = %116
%150 = load i32, i32* %6
%151 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i32 %150)
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%153 = call i32 (...) @getchar()
store i32 0, i32* %7
store i32 0, i32* %3
br label %154
154: ; preds = %175, %149
%155 = load i32, i32* %3
%156 = icmp slt i32 %155, 2
br i1 %156, label %157, label %178
157: ; preds = %154
store i32 0, i32* %4
br label %158
158: ; preds = %171, %157
%159 = load i32, i32* %4
%160 = icmp slt i32 %159, 3
br i1 %160, label %161, label %174
161: ; preds = %158
%162 = load i32, i32* %3
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %2, i64 0, i64 %163
%165 = load i32, i32* %4
%166 = sext i32 %165 to i64
%167 = getelementptr inbounds [3 x i32], [3 x i32]* %164, i64 0, i64 %166
%168 = load i32, i32* %167
%169 = load i32, i32* %7
%170 = add nsw i32 %169, %168
store i32 %170, i32* %7
br label %171
171: ; preds = %161
%172 = load i32, i32* %4
%173 = add nsw i32 %172, 1
store i32 %173, i32* %4
br label %158
174: ; preds = %158
br label %175
175: ; preds = %174
%176 = load i32, i32* %3
%177 = add nsw i32 %176, 1
store i32 %177, i32* %3
br label %154
178: ; preds = %154
%179 = load i32, i32* %7
%180 = sdiv i32 %179, 6
store i32 %180, i32* %8
%181 = load i32, i32* %8
%182 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i32 %181)
%183 = load i32, i32* %1
ret i32 %183
}

LLVM IR (-O2):
@.str = [10 x i8] c"\0ARow %d:\0A\00"
@.str.1 = [12 x i8] c"Element %d:\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [15 x i8] c"\0A[Press Enter]\00"
@.str.4 = [16 x i8] c"Element %d: %d\0A\00"
@.str.5 = [26 x i8] c"\0ASmallest element is: %d\0A\00"
@.str.6 = [25 x i8] c"\0ABiggest element is: %d\0A\00"
@.str.7 = [17 x i8] c"\0AAverage is: %d\0A\00"
define i32 @main() {
%1 = alloca [2 x [3 x i32]]
%2 = bitcast [2 x [3 x i32]]* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 1)
%5 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %1, i64 0, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%7 = call i32 (...) @getchar()
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 2)
%9 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %1, i64 0, i64 0, i64 1
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %9)
%11 = call i32 (...) @getchar()
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 3)
%13 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %1, i64 0, i64 0, i64 2
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %13)
%15 = call i32 (...) @getchar()
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 1)
%18 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %1, i64 0, i64 1, i64 0
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %18)
%20 = call i32 (...) @getchar()
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 2)
%22 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %1, i64 0, i64 1, i64 1
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %22)
%24 = call i32 (...) @getchar()
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 3)
%26 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %1, i64 0, i64 1, i64 2
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %26)
%28 = call i32 (...) @getchar()
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%30 = call i32 (...) @getchar()
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%32 = load i32, i32* %5
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 1, i32 %32)
%34 = load i32, i32* %9
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 2, i32 %34)
%36 = load i32, i32* %13
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 3, i32 %36)
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2)
%39 = load i32, i32* %18
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 1, i32 %39)
%41 = load i32, i32* %22
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 2, i32 %41)
%43 = load i32, i32* %26
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 3, i32 %43)
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%46 = call i32 (...) @getchar()
%47 = load i32, i32* %5
%48 = load i32, i32* %9
%49 = icmp slt i32 %48, %47
%50 = select i1 %49, i32 %48, i32 %47
%51 = load i32, i32* %13
%52 = icmp slt i32 %51, %50
%53 = select i1 %52, i32 %51, i32 %50
%54 = load i32, i32* %18
%55 = icmp slt i32 %54, %53
%56 = select i1 %55, i32 %54, i32 %53
%57 = load i32, i32* %22
%58 = icmp slt i32 %57, %56
%59 = select i1 %58, i32 %57, i32 %56
%60 = load i32, i32* %26
%61 = icmp slt i32 %60, %59
%62 = select i1 %61, i32 %60, i32 %59
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %62)
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%65 = call i32 (...) @getchar()
%66 = load i32, i32* %5
%67 = load i32, i32* %9
%68 = icmp sgt i32 %67, %62
%69 = select i1 %68, i32 %67, i32 %66
%70 = load i32, i32* %13
%71 = icmp sgt i32 %70, %62
%72 = select i1 %71, i32 %70, i32 %69
%73 = load i32, i32* %18
%74 = icmp sgt i32 %73, %62
%75 = select i1 %74, i32 %73, i32 %72
%76 = load i32, i32* %22
%77 = icmp sgt i32 %76, %62
%78 = select i1 %77, i32 %76, i32 %75
%79 = load i32, i32* %26
%80 = icmp sgt i32 %79, %62
%81 = select i1 %80, i32 %79, i32 %78
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i32 %81)
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%84 = call i32 (...) @getchar()
%85 = load i32, i32* %5
%86 = load i32, i32* %9
%87 = bitcast i32* %13 to <4 x i32>*
%88 = load <4 x i32>, <4 x i32>* %87
%89 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %88)
%90 = add nsw i32 %89, %86
%91 = add nsw i32 %90, %85
%92 = sdiv i32 %91, 6
%93 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i32 %92)
ret i32 0
}