#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 */
typedef int /*<<< orphan*/ integers;

/* Variables and functions */
int maximumInt_a(int *, int);
int maximumInt_p(int *, int);
int *maximum_a(int *, int);
int *maximum_p(int *, int);
int /*<<< orphan*/ printEndFormatting();
int /*<<< orphan*/ printMaxIntValue(int);
int /*<<< orphan*/ printMaxValue(int *);
int main() {
  int integers[] = {5, 2, 0, 1, 4, 4, 8, 9, 7};
  int size = sizeof(integers) / sizeof(integers[0]);
  int *maxp_a = maximum_a(integers, size);
  printMaxValue(maxp_a);
  int maxi_a = maximumInt_a(integers, size);
  printMaxIntValue(maxi_a);
  int *maxp_p = maximum_p(integers, size);
  printMaxValue(maxp_p);
  int maxi_p = maximumInt_p(integers, size);
  printMaxIntValue(maxi_p);
  printEndFormatting();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe66(%rip),%rsi
mov    $0x24,%edx
call   1050 <memcpy@plt>
movl   $0x9,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   10a0 <maximum_a@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
call   1080 <printMaxValue@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1060 <maximumInt_a@plt>
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%edi
call   1090 <printMaxIntValue@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1070 <maximum_p@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
call   1080 <printMaxValue@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <maximumInt_p@plt>
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%edi
call   1090 <printMaxIntValue@plt>
mov    $0x0,%al
call   1040 <printEndFormatting@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xea5(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xe8a(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe6e(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x9,%esi
call   1090 <maximum_a@plt>
mov    %rax,%rdi
call   1070 <printMaxValue@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1050 <maximumInt_a@plt>
mov    %eax,%edi
call   1080 <printMaxIntValue@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1060 <maximum_p@plt>
mov    %rax,%rdi
call   1070 <printMaxValue@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <maximumInt_p@plt>
mov    %eax,%edi
call   1080 <printMaxIntValue@plt>
xor    %eax,%eax
call   1040 <printEndFormatting@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.integers = [9 x i32] [i32 5, i32 2, i32 0, i32 1, i32 4, i32 4, i32 8, i32 9, i32 7]
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i32]
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32 0, i32* %1
%8 = bitcast [9 x i32]* %2 to i8*
store i32 9, i32* %3
%9 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%10 = load i32, i32* %3
%11 = call i32* @maximum_a(i32* %9, i32 %10)
store i32* %11, i32** %4
%12 = load i32*, i32** %4
%13 = call i32 @printMaxValue(i32* %12)
%14 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%15 = load i32, i32* %3
%16 = call i32 @maximumInt_a(i32* %14, i32 %15)
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = call i32 @printMaxIntValue(i32 %17)
%19 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%20 = load i32, i32* %3
%21 = call i32* @maximum_p(i32* %19, i32 %20)
store i32* %21, i32** %6
%22 = load i32*, i32** %6
%23 = call i32 @printMaxValue(i32* %22)
%24 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%25 = load i32, i32* %3
%26 = call i32 @maximumInt_p(i32* %24, i32 %25)
store i32 %26, i32* %7
%27 = load i32, i32* %7
%28 = call i32 @printMaxIntValue(i32 %27)
%29 = call i32 (...) @printEndFormatting()
ret i32 0
}

LLVM IR (-O2):
@__const.main.integers = [9 x i32] [i32 5, i32 2, i32 0, i32 1, i32 4, i32 4, i32 8, i32 9, i32 7]
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32* @maximum_a(i32* %3, i32 9)
%5 = call i32 @printMaxValue(i32* %4)
%6 = call i32 @maximumInt_a(i32* %3, i32 9)
%7 = call i32 @printMaxIntValue(i32 %6)
%8 = call i32* @maximum_p(i32* %3, i32 9)
%9 = call i32 @printMaxValue(i32* %8)
%10 = call i32 @maximumInt_p(i32* %3, i32 9)
%11 = call i32 @printMaxIntValue(i32 %10)
%12 = call i32 (...) @printEndFormatting()
ret i32 0
}