#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*/ printInt(int);
int /*<<< orphan*/ printStr(char *);
int /*<<< orphan*/ readInt(int);
void main() {
  int i, max;
  int values[5];
  printStr("Enter 5 values: ");
  for (i = 0; i < 5; i++)
    readInt(values[i]);
  max = 0;
  for (i = 0; i < 5; i++) {
    if (values[i] > values[max])
      max = i;
  }
  printStr("Maximum = ");
  printInt(values[max]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printStr@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    1170 <main+0x40>
movslq -0x4(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edi
call   1050 <readInt@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114b <main+0x1b>
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    11b7 <main+0x87>
movslq -0x4(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
movslq -0x8(%rbp),%rcx
cmp    -0x20(%rbp,%rcx,4),%eax
jle    11a4 <main+0x74>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    11a9 <main+0x79>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    117e <main+0x4e>
lea    0xe53(%rip),%rdi
call   1040 <printStr@plt>
movslq -0x8(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edi
call   1030 <printInt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printStr@plt>
call   1050 <readInt@plt>
call   1050 <readInt@plt>
call   1050 <readInt@plt>
call   1050 <readInt@plt>
call   1050 <readInt@plt>
lea    0xeb4(%rip),%rdi
call   1040 <printStr@plt>
pop    %rax
jmp    1030 <printInt@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Enter 5 values: \00"
@.str.1 = [11 x i8] c"Maximum = \00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [5 x i32]
%4 = call i32 @printStr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %5
5: ; preds = %14, %0
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 5
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 %10
%12 = load i32, i32* %11
%13 = call i32 @readInt(i32 %12)
br label %14
14: ; preds = %8
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
br label %5
17: ; preds = %5
store i32 0, i32* %2
store i32 0, i32* %1
br label %18
18: ; preds = %34, %17
%19 = load i32, i32* %1
%20 = icmp slt i32 %19, 5
br i1 %20, label %21, label %37
21: ; preds = %18
%22 = load i32, i32* %1
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 %23
%25 = load i32, i32* %24
%26 = load i32, i32* %2
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 %27
%29 = load i32, i32* %28
%30 = icmp sgt i32 %25, %29
br i1 %30, label %31, label %33
31: ; preds = %21
%32 = load i32, i32* %1
store i32 %32, i32* %2
br label %33
33: ; preds = %31, %21
br label %34
34: ; preds = %33
%35 = load i32, i32* %1
%36 = add nsw i32 %35, 1
store i32 %36, i32* %1
br label %18
37: ; preds = %18
%38 = call i32 @printStr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%39 = load i32, i32* %2
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 %40
%42 = load i32, i32* %41
%43 = call i32 @printInt(i32 %42)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter 5 values: \00"
@.str.1 = [11 x i8] c"Maximum = \00"
define void @main() {
%1 = tail call i32 @printStr(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @readInt(i32 undef)
%3 = tail call i32 @readInt(i32 undef)
%4 = tail call i32 @readInt(i32 undef)
%5 = tail call i32 @readInt(i32 undef)
%6 = tail call i32 @readInt(i32 undef)
%7 = tail call i32 @printStr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @printInt(i32 undef)
ret void
}