#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 matrix[3][2];
  int i, j;
  int largest;
  printf("\t\tPlease enter 6 numbers and this program \n\t\twill tell you the "
         "biggest of these numbers:\n");
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 2; j++) {
      scanf("%d", &matrix[i][j]);
      flushall();
    }
  }
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 2; j++) {
      if (largest < matrix[i][j]) {
        largest = matrix[i][j];
      }
    }
  }
  printf("The largest number in the array is %d", largest);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x24(%rbp)
jge    11cd <main+0x8d>
movl   $0x0,-0x28(%rbp)
cmpl   $0x2,-0x28(%rbp)
jge    11ba <main+0x7a>
movslq -0x24(%rbp),%rax
lea    -0x20(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
movslq -0x28(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xedd(%rip),%rdi
call   1060 <scanf@plt>
mov    $0x0,%al
call   1040 <flushall@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1175 <main+0x35>
jmp    11bf <main+0x7f>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1164 <main+0x24>
movl   $0x0,-0x24(%rbp)
cmpl   $0x3,-0x24(%rbp)
jge    124d <main+0x10d>
movl   $0x0,-0x28(%rbp)
cmpl   $0x2,-0x28(%rbp)
jge    123a <main+0xfa>
mov    -0x2c(%rbp),%eax
movslq -0x24(%rbp),%rdx
lea    -0x20(%rbp),%rcx
shl    $0x3,%rdx
add    %rdx,%rcx
movslq -0x28(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    1227 <main+0xe7>
movslq -0x24(%rbp),%rcx
lea    -0x20(%rbp),%rax
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x2c(%rbp)
jmp    122c <main+0xec>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11e5 <main+0xa5>
jmp    123f <main+0xff>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11d4 <main+0x94>
mov    -0x2c(%rbp),%esi
lea    0xe03(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
lea    0xebb(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1050 <flushall@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1050 <flushall@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1050 <flushall@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1050 <flushall@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1050 <flushall@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1050 <flushall@plt>
lea    0xe1b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [90 x i8] c"\09\09Please enter 6 numbers and this program \0A\09\09will tell you the biggest of these numbers:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [38 x i8] c"The largest number in the array is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x [2 x i32]]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %7
7: ; preds = %27, %0
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 3
br i1 %9, label %10, label %30
10: ; preds = %7
store i32 0, i32* %4
br label %11
11: ; preds = %23, %10
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 2
br i1 %13, label %14, label %26
14: ; preds = %11
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %2, i64 0, i64 %16
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %17, i64 0, i64 %19
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %20)
%22 = call i32 (...) @flushall()
br label %23
23: ; preds = %14
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %11
26: ; preds = %11
br label %27
27: ; preds = %26
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %7
30: ; preds = %7
store i32 0, i32* %3
br label %31
31: ; preds = %61, %30
%32 = load i32, i32* %3
%33 = icmp slt i32 %32, 3
br i1 %33, label %34, label %64
34: ; preds = %31
store i32 0, i32* %4
br label %35
35: ; preds = %57, %34
%36 = load i32, i32* %4
%37 = icmp slt i32 %36, 2
br i1 %37, label %38, label %60
38: ; preds = %35
%39 = load i32, i32* %5
%40 = load i32, i32* %3
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %2, i64 0, i64 %41
%43 = load i32, i32* %4
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [2 x i32], [2 x i32]* %42, i64 0, i64 %44
%46 = load i32, i32* %45
%47 = icmp slt i32 %39, %46
br i1 %47, label %48, label %56
48: ; preds = %38
%49 = load i32, i32* %3
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %2, i64 0, i64 %50
%52 = load i32, i32* %4
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [2 x i32], [2 x i32]* %51, i64 0, i64 %53
%55 = load i32, i32* %54
store i32 %55, i32* %5
br label %56
56: ; preds = %48, %38
br label %57
57: ; preds = %56
%58 = load i32, i32* %4
%59 = add nsw i32 %58, 1
store i32 %59, i32* %4
br label %35
60: ; preds = %35
br label %61
61: ; preds = %60
%62 = load i32, i32* %3
%63 = add nsw i32 %62, 1
store i32 %63, i32* %3
br label %31
64: ; preds = %31
%65 = load i32, i32* %5
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %65)
%67 = call i32 (...) @getchar()
%68 = load i32, i32* %1
ret i32 %68
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [38 x i8] c"The largest number in the array is %d\00"
@str = [89 x i8] c"\09\09Please enter 6 numbers and this program \0A\09\09will tell you the biggest of these numbers:\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 ([89 x i8], [89 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 = call i32 (...) @flushall()
%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 = call i32 (...) @flushall()
%10 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %1, i64 0, i64 1, i64 0
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%12 = call i32 (...) @flushall()
%13 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %1, i64 0, i64 1, i64 1
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %13)
%15 = call i32 (...) @flushall()
%16 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %1, i64 0, i64 2, i64 0
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %16)
%18 = call i32 (...) @flushall()
%19 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %1, i64 0, i64 2, i64 1
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %19)
%21 = call i32 (...) @flushall()
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 undef)
%23 = call i32 (...) @getchar()
ret i32 0
}