#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 getIntArray(int *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printIntArray(int *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ reverseIntArray(int *, int);
int main(void) {
  int x[10];
  int hmny;
  hmny = getIntArray(x, 10, 0);
  printf("The array was: \n");
  printIntArray(x, hmny);
  reverseIntArray(x, hmny);
  printf("after reverse it is:\n");
  printIntArray(x, hmny);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
xor    %edx,%edx
call   1060 <getIntArray@plt>
mov    %eax,-0x34(%rbp)
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1050 <printIntArray@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1040 <reverseIntArray@plt>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1050 <printIntArray@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
xor    %edx,%edx
call   1060 <getIntArray@plt>
mov    %eax,%ebp
lea    0xe9f(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <printIntArray@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <reverseIntArray@plt>
lea    0xe8f(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <printIntArray@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"The array was: \0A\00"
@.str.1 = [22 x i8] c"after reverse it is:\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca i32
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @getIntArray(i32* %3, i32 10, i32 0)
store i32 %4, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = load i32, i32* %2
%8 = call i32 @printIntArray(i32* %6, i32 %7)
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%10 = load i32, i32* %2
%11 = call i32 @reverseIntArray(i32* %9, i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%14 = load i32, i32* %2
%15 = call i32 @printIntArray(i32* %13, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"The array was: \00"
@str.2 = [21 x i8] c"after reverse it is:\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @getIntArray(i32* %3, i32 10, i32 0)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%6 = call i32 @printIntArray(i32* %3, i32 %4)
%7 = call i32 @reverseIntArray(i32* %3, i32 %4)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.2, i64 0, i64 0))
%9 = call i32 @printIntArray(i32* %3, i32 %4)
ret i32 0
}