#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 max(int *, int);
int /*<<< orphan*/ printArray(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  int a1[5] = {1, 2, 3, 4, 5};
  printArray(a1, 5);
  printf(", %i\n", max(a1, 5));
  int a2[5] = {1, 1, 1, 1, 1};
  printArray(a2, 5);
  printf(", %i\n", max(a2, 5));
  int a3[5] = {2135345544};
  printArray(a3, 5);
  printf(", %i\n", max(a3, 5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeb3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeae(%rip),%eax
mov    %eax,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x5,%esi
call   1050 <printArray@plt>
lea    -0x30(%rbp),%rdi
mov    $0x5,%esi
call   1040 <max@plt>
mov    %eax,%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    0xe8a(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe87(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe85(%rip),%eax
mov    %eax,-0x40(%rbp)
lea    -0x50(%rbp),%rdi
mov    $0x5,%esi
call   1050 <printArray@plt>
lea    -0x50(%rbp),%rdi
mov    $0x5,%esi
call   1040 <max@plt>
mov    %eax,%esi
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
mov    0xe61(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xe5e(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xe5c(%rip),%eax
mov    %eax,-0x60(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0x5,%esi
call   1050 <printArray@plt>
lea    -0x70(%rbp),%rdi
mov    $0x5,%esi
call   1040 <max@plt>
mov    %eax,%esi
lea    0xe38(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    0xed3(%rip),%eax
mov    %eax,0x50(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1050 <printArray@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <max@plt>
lea    0xee1(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0xead(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xe92(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1050 <printArray@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <max@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0xe8e(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xe73(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1050 <printArray@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <max@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.a1 = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [6 x i8] c", %i\0A\00"
@__const.main.a2 = [5 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1]
@__const.main.a3 = [5 x i32] [i32 2135345544, i32 0, i32 0, i32 0, i32 0]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x i32]
%7 = alloca [5 x i32]
%8 = alloca [5 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [5 x i32]* %6 to i8*
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 0
%11 = call i32 @printArray(i32* %10, i32 5)
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 0
%13 = call i32 @max(i32* %12, i32 5)
%14 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = bitcast [5 x i32]* %7 to i8*
%16 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 0
%17 = call i32 @printArray(i32* %16, i32 5)
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 0
%19 = call i32 @max(i32* %18, i32 5)
%20 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = bitcast [5 x i32]* %8 to i8*
%22 = getelementptr inbounds [5 x i32], [5 x i32]* %8, i64 0, i64 0
%23 = call i32 @printArray(i32* %22, i32 5)
%24 = getelementptr inbounds [5 x i32], [5 x i32]* %8, i64 0, i64 0
%25 = call i32 @max(i32* %24, i32 5)
%26 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %25)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a1 = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [6 x i8] c", %i\0A\00"
@__const.main.a2 = [5 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1]
@__const.main.a3 = [5 x i32] [i32 2135345544, i32 0, i32 0, i32 0, i32 0]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x i32]
%4 = alloca [5 x i32]
%5 = alloca [5 x i32]
%6 = bitcast [5 x i32]* %3 to i8*
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%8 = call i32 @printArray(i32* %7, i32 5)
%9 = call i32 @max(i32* %7, i32 5)
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = bitcast [5 x i32]* %4 to i8*
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%13 = call i32 @printArray(i32* %12, i32 5)
%14 = call i32 @max(i32* %12, i32 5)
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = bitcast [5 x i32]* %5 to i8*
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 0
%18 = call i32 @printArray(i32* %17, i32 5)
%19 = call i32 @max(i32* %17, i32 5)
%20 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %19)
ret i32 0
}