#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[3] = {6, 4, 10};
  int i;
  int maxnum;
  for (i = 0; i < 3; i++) {
    if (i == 0) {
      maxnum = numbers[i];
    } else {
      if (numbers[i] > maxnum) {
        maxnum = numbers[i];
      }
    }
  }
  printf("Maximum number is %d", maxnum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    1192 <main+0x82>
cmpl   $0x0,-0x14(%rbp)
jne    115e <main+0x4e>
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp,%rax,4),%eax
mov    %eax,-0x18(%rbp)
jmp    117f <main+0x6f>
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp,%rax,4),%eax
cmp    -0x18(%rbp),%eax
jle    117a <main+0x6a>
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp,%rax,4),%eax
mov    %eax,-0x18(%rbp)
jmp    117f <main+0x6f>
jmp    1184 <main+0x74>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113a <main+0x2a>
mov    -0x18(%rbp),%esi
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

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