#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*/ flushall();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int i;
  int j;
  int smallest;
  int largest;
  float average;
  int total;
  int numbers[3][2];
  total = 0;
  average = 0;
  printf("\t\t\tPlease enter 6 values:\n");
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 2; j++) {
      scanf("%d", &numbers[i][j]);
      total = total + numbers[i][j];
    }
    flushall();
  }
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 2; j++) {
      if (largest < numbers[i][j]) {
        largest = numbers[i][j];
      }
    }
  }
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 2; j++) {
      if (smallest > numbers[i][j]) {
        smallest = numbers[i][j];
      }
    }
  }
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 2; j++) {
      printf("%d, ", numbers[i][j]);
    }
  }
  average = total / 6;
  printf("\nLargest number is %d\nThe smallest number is %d\n", largest,
         smallest);
  printf("The average of the numbers is %.2f\n", average);
  printf("Total = %d", total);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11f3 <main+0xb3>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    11de <main+0x9e>
movslq -0x8(%rbp),%rax
lea    -0x40(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xece(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x1c(%rbp),%eax
movslq -0x8(%rbp),%rdx
lea    -0x40(%rbp),%rcx
shl    $0x3,%rdx
add    %rdx,%rcx
movslq -0xc(%rbp),%rdx
add    (%rcx,%rdx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1184 <main+0x44>
mov    $0x0,%al
call   1040 <flushall@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1173 <main+0x33>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1273 <main+0x133>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1260 <main+0x120>
mov    -0x14(%rbp),%eax
movslq -0x8(%rbp),%rdx
lea    -0x40(%rbp),%rcx
shl    $0x3,%rdx
add    %rdx,%rcx
movslq -0xc(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    124d <main+0x10d>
movslq -0x8(%rbp),%rcx
lea    -0x40(%rbp),%rax
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
jmp    1252 <main+0x112>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    120b <main+0xcb>
jmp    1265 <main+0x125>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11fa <main+0xba>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    12f3 <main+0x1b3>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    12e0 <main+0x1a0>
mov    -0x10(%rbp),%eax
movslq -0x8(%rbp),%rdx
lea    -0x40(%rbp),%rcx
shl    $0x3,%rdx
add    %rdx,%rcx
movslq -0xc(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jle    12cd <main+0x18d>
movslq -0x8(%rbp),%rcx
lea    -0x40(%rbp),%rax
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
jmp    12d2 <main+0x192>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    128b <main+0x14b>
jmp    12e5 <main+0x1a5>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    127a <main+0x13a>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    135a <main+0x21a>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1347 <main+0x207>
movslq -0x8(%rbp),%rcx
lea    -0x40(%rbp),%rax
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xce9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    130b <main+0x1cb>
jmp    134c <main+0x20c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12fa <main+0x1ba>
mov    -0x1c(%rbp),%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xca5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xcbf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xcd2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
lea    0xef9(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
mov    (%rsp),%ebp
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
add    0x4(%rsp),%ebp
xor    %eax,%eax
call   1050 <flushall@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
add    0x8(%rsp),%ebp
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
add    0xc(%rsp),%ebp
xor    %eax,%eax
call   1050 <flushall@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0x14(%rsp),%rsi
add    0x10(%rsp),%ebp
mov    %rbx,%rdi
call   1070 <scanf@plt>
add    0x14(%rsp),%ebp
xor    %eax,%eax
call   1050 <flushall@plt>
mov    (%rsp),%esi
lea    0xe15(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movslq %ebp,%rbx
imul   $0x2aaaaaab,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x24(%rsp)
lea    0xda2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movss  0x24(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdbb(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xdd1(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"\09\09\09Please enter 6 values:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"%d, \00"
@.str.3 = [49 x i8] c"\0ALargest number is %d\0AThe smallest number is %d\0A\00"
@.str.4 = [36 x i8] c"The average of the numbers is %.2f\0A\00"
@.str.5 = [11 x i8] c"Total = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = alloca i32
%8 = alloca [3 x [2 x i32]]
store i32 0, i32* %1
store i32 0, i32* %7
store float 0.000000e+00, float* %6
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %10
10: ; preds = %39, %0
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 3
br i1 %12, label %13, label %42
13: ; preds = %10
store i32 0, i32* %3
br label %14
14: ; preds = %34, %13
%15 = load i32, i32* %3
%16 = icmp slt i32 %15, 2
br i1 %16, label %17, label %37
17: ; preds = %14
%18 = load i32, i32* %2
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %8, i64 0, i64 %19
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [2 x i32], [2 x i32]* %20, i64 0, i64 %22
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %23)
%25 = load i32, i32* %7
%26 = load i32, i32* %2
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %8, i64 0, i64 %27
%29 = load i32, i32* %3
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [2 x i32], [2 x i32]* %28, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = add nsw i32 %25, %32
store i32 %33, i32* %7
br label %34
34: ; preds = %17
%35 = load i32, i32* %3
%36 = add nsw i32 %35, 1
store i32 %36, i32* %3
br label %14
37: ; preds = %14
%38 = call i32 (...) @flushall()
br label %39
39: ; preds = %37
%40 = load i32, i32* %2
%41 = add nsw i32 %40, 1
store i32 %41, i32* %2
br label %10
42: ; preds = %10
store i32 0, i32* %2
br label %43
43: ; preds = %73, %42
%44 = load i32, i32* %2
%45 = icmp slt i32 %44, 3
br i1 %45, label %46, label %76
46: ; preds = %43
store i32 0, i32* %3
br label %47
47: ; preds = %69, %46
%48 = load i32, i32* %3
%49 = icmp slt i32 %48, 2
br i1 %49, label %50, label %72
50: ; preds = %47
%51 = load i32, i32* %5
%52 = load i32, i32* %2
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %8, i64 0, i64 %53
%55 = load i32, i32* %3
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [2 x i32], [2 x i32]* %54, i64 0, i64 %56
%58 = load i32, i32* %57
%59 = icmp slt i32 %51, %58
br i1 %59, label %60, label %68
60: ; preds = %50
%61 = load i32, i32* %2
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %8, i64 0, i64 %62
%64 = load i32, i32* %3
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [2 x i32], [2 x i32]* %63, i64 0, i64 %65
%67 = load i32, i32* %66
store i32 %67, i32* %5
br label %68
68: ; preds = %60, %50
br label %69
69: ; preds = %68
%70 = load i32, i32* %3
%71 = add nsw i32 %70, 1
store i32 %71, i32* %3
br label %47
72: ; preds = %47
br label %73
73: ; preds = %72
%74 = load i32, i32* %2
%75 = add nsw i32 %74, 1
store i32 %75, i32* %2
br label %43
76: ; preds = %43
store i32 0, i32* %2
br label %77
77: ; preds = %107, %76
%78 = load i32, i32* %2
%79 = icmp slt i32 %78, 3
br i1 %79, label %80, label %110
80: ; preds = %77
store i32 0, i32* %3
br label %81
81: ; preds = %103, %80
%82 = load i32, i32* %3
%83 = icmp slt i32 %82, 2
br i1 %83, label %84, label %106
84: ; preds = %81
%85 = load i32, i32* %4
%86 = load i32, i32* %2
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %8, i64 0, i64 %87
%89 = load i32, i32* %3
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [2 x i32], [2 x i32]* %88, i64 0, i64 %90
%92 = load i32, i32* %91
%93 = icmp sgt i32 %85, %92
br i1 %93, label %94, label %102
94: ; preds = %84
%95 = load i32, i32* %2
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %8, i64 0, i64 %96
%98 = load i32, i32* %3
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds [2 x i32], [2 x i32]* %97, i64 0, i64 %99
%101 = load i32, i32* %100
store i32 %101, i32* %4
br label %102
102: ; preds = %94, %84
br label %103
103: ; preds = %102
%104 = load i32, i32* %3
%105 = add nsw i32 %104, 1
store i32 %105, i32* %3
br label %81
106: ; preds = %81
br label %107
107: ; preds = %106
%108 = load i32, i32* %2
%109 = add nsw i32 %108, 1
store i32 %109, i32* %2
br label %77
110: ; preds = %77
store i32 0, i32* %2
br label %111
111: ; preds = %131, %110
%112 = load i32, i32* %2
%113 = icmp slt i32 %112, 3
br i1 %113, label %114, label %134
114: ; preds = %111
store i32 0, i32* %3
br label %115
115: ; preds = %127, %114
%116 = load i32, i32* %3
%117 = icmp slt i32 %116, 2
br i1 %117, label %118, label %130
118: ; preds = %115
%119 = load i32, i32* %2
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %8, i64 0, i64 %120
%122 = load i32, i32* %3
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds [2 x i32], [2 x i32]* %121, i64 0, i64 %123
%125 = load i32, i32* %124
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %125)
br label %127
127: ; preds = %118
%128 = load i32, i32* %3
%129 = add nsw i32 %128, 1
store i32 %129, i32* %3
br label %115
130: ; preds = %115
br label %131
131: ; preds = %130
%132 = load i32, i32* %2
%133 = add nsw i32 %132, 1
store i32 %133, i32* %2
br label %111
134: ; preds = %111
%135 = load i32, i32* %7
%136 = sdiv i32 %135, 6
%137 = sitofp i32 %136 to float
store float %137, float* %6
%138 = load i32, i32* %5
%139 = load i32, i32* %4
%140 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), i32 %138, i32 %139)
%141 = load float, float* %6
%142 = fpext float %141 to double
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), double %142)
%144 = load i32, i32* %7
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 %144)
%146 = call i32 (...) @getchar()
%147 = load i32, i32* %1
ret i32 %147
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"%d, \00"
@.str.3 = [49 x i8] c"\0ALargest number is %d\0AThe smallest number is %d\0A\00"
@.str.4 = [36 x i8] c"The average of the numbers is %.2f\0A\00"
@.str.5 = [11 x i8] c"Total = %d\00"
@str = [26 x i8] c"\09\09\09Please enter 6 values:\00"
define i32 @main() {
%1 = alloca [3 x [2 x i32]]
%2 = bitcast [3 x [2 x i32]]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %1, i64 0, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%6 = load i32, i32* %4
%7 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %1, i64 0, i64 0, i64 1
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%9 = load i32, i32* %7
%10 = add nsw i32 %9, %6
%11 = call i32 (...) @flushall()
%12 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %1, i64 0, i64 1, i64 0
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %12)
%14 = load i32, i32* %12
%15 = add nsw i32 %14, %10
%16 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %1, i64 0, i64 1, i64 1
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %16)
%18 = load i32, i32* %16
%19 = add nsw i32 %18, %15
%20 = call i32 (...) @flushall()
%21 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %1, i64 0, i64 2, i64 0
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %21)
%23 = load i32, i32* %21
%24 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %1, i64 0, i64 2, i64 1
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %24)
%26 = load i32, i32* %24
%27 = call i32 (...) @flushall()
%28 = add nsw i32 %23, %19
%29 = load i32, i32* %4
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %7
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %31)
%33 = load i32, i32* %12
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %33)
%35 = load i32, i32* %16
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %35)
%37 = load i32, i32* %21
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %37)
%39 = load i32, i32* %24
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %39)
%41 = add nsw i32 %26, %28
%42 = sdiv i32 %41, 6
%43 = sitofp i32 %42 to float
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), i32 undef, i32 undef)
%45 = fpext float %43 to double
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), double %45)
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 %41)
%48 = call i32 (...) @getchar()
ret i32 0
}