#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*/ populate_a_array_with_user_input(int *);
int /*<<< orphan*/ reverse_a_array(int *, int *);
int /*<<< orphan*/ show_elements_from_array(int *, char *);
int main() {
  int array[10] = {0};
  int reversed_array[10] = {0};
  populate_a_array_with_user_input(array);
  show_elements_from_array(array, "First");
  reverse_a_array(array, reversed_array);
  show_elements_from_array(reversed_array, "Reversed");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rdi
call   1050 <populate_a_array_with_user_input@plt>
lea    -0x30(%rbp),%rdi
lea    0xe7d(%rip),%rsi
call   1030 <show_elements_from_array@plt>
lea    -0x30(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1060 <reverse_a_array@plt>
lea    -0x60(%rbp),%rdi
lea    0xe66(%rip),%rsi
call   1030 <show_elements_from_array@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x58,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movq   $0x0,0x50(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x20(%rsp)
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <populate_a_array_with_user_input@plt>
lea    0xe8d(%rip),%rsi
mov    %rbx,%rdi
call   1030 <show_elements_from_array@plt>
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <reverse_a_array@plt>
lea    0xe76(%rip),%rsi
mov    %r14,%rdi
call   1030 <show_elements_from_array@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"First\00"
@.str.1 = [9 x i8] c"Reversed\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca [10 x i32]
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
%5 = bitcast [10 x i32]* %3 to i8*
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%7 = call i32 @populate_a_array_with_user_input(i32* %6)
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%9 = call i32 @show_elements_from_array(i32* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%12 = call i32 @reverse_a_array(i32* %10, i32* %11)
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%14 = call i32 @show_elements_from_array(i32* %13, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"First\00"
@.str.1 = [9 x i8] c"Reversed\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @populate_a_array_with_user_input(i32* %5)
%7 = call i32 @show_elements_from_array(i32* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%9 = call i32 @reverse_a_array(i32* %5, i32* %8)
%10 = call i32 @show_elements_from_array(i32* %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}