#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 main(void) {
  int numbers[5] = {5, 9, 12, 51, 30};
  int maxnum, i;
  for (i = 0; i < 5; i++) {
    if (i == 0) {
      maxnum = numbers[i];
    } else {
      if (numbers[i] > maxnum) {
        maxnum = numbers[i];
      }
    }
  }
  printf("%d", maxnum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x5,-0x28(%rbp)
jge    119d <main+0x8d>
cmpl   $0x0,-0x28(%rbp)
jne    1169 <main+0x59>
movslq -0x28(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
mov    %eax,-0x24(%rbp)
jmp    118a <main+0x7a>
movslq -0x28(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
cmp    -0x24(%rbp),%eax
jle    1185 <main+0x75>
movslq -0x28(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
mov    %eax,-0x24(%rbp)
jmp    118a <main+0x7a>
jmp    118f <main+0x7f>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1145 <main+0x35>
mov    -0x24(%rbp),%esi
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x33,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 51)
ret i32 0
}