#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*/ print(int *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ turnArrayAround(int *);
int main() {
  int A[] = {45, 1, 2,  3,  4, 5, 6,  7,  8, 9, 10, 11, 1, 2,  3,
             4,  5, 6,  7,  8, 9, 10, 11, 1, 2, 3,  4,  5, 6,  7,
             8,  9, 10, 11, 1, 2, 3,  4,  5, 6, 7,  8,  9, 10, 11};
  printf("Before turnArrayAround:\n");
  print(A);
  turnArrayAround(A);
  printf("After turnArrayAround:\n");
  print(A);
  int B[] = {11, 0, 6, 2, 7, 5, 3, 5, 2, 8, 1};
  printf("Before turnArrayAround:\n");
  print(B);
  turnArrayAround(B);
  printf("After turnArrayAround:\n");
  print(B);
  int C[] = {5, 1, 3, 3, 7};
  printf("Before turnArrayAround:\n");
  print(C);
  turnArrayAround(C);
  printf("After turnArrayAround:\n");
  print(C);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xc0(%rbp),%rdi
lea    0xea0(%rip),%rsi
mov    $0xb4,%edx
call   1060 <memcpy@plt>
lea    0xf93(%rip),%rdi
call   1030 <printf@plt>
lea    -0xc0(%rbp),%rdi
call   1050 <print@plt>
lea    -0xc0(%rbp),%rdi
call   1040 <turnArrayAround@plt>
lea    0xf88(%rip),%rdi
call   1030 <printf@plt>
lea    -0xc0(%rbp),%rdi
call   1050 <print@plt>
lea    -0xf0(%rbp),%rdi
lea    0xf0c(%rip),%rsi
mov    $0x2c,%edx
call   1060 <memcpy@plt>
lea    0xf3f(%rip),%rdi
call   1030 <printf@plt>
lea    -0xf0(%rbp),%rdi
call   1050 <print@plt>
lea    -0xf0(%rbp),%rdi
call   1040 <turnArrayAround@plt>
lea    0xf34(%rip),%rdi
call   1030 <printf@plt>
lea    -0xf0(%rbp),%rdi
call   1050 <print@plt>
mov    0xeef(%rip),%rax
mov    %rax,-0x110(%rbp)
mov    0xee9(%rip),%rax
mov    %rax,-0x108(%rbp)
mov    0xee4(%rip),%eax
mov    %eax,-0x100(%rbp)
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
lea    -0x110(%rbp),%rdi
call   1050 <print@plt>
lea    -0x110(%rbp),%rdi
call   1040 <turnArrayAround@plt>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
lea    -0x110(%rbp),%rdi
call   1050 <print@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x110,%rsp
lea    0xead(%rip),%rsi
lea    0x50(%rsp),%rbx
mov    $0xb4,%edx
mov    %rbx,%rdi
call   1060 <memcpy@plt>
lea    0xf98(%rip),%r15
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1050 <print@plt>
mov    %rbx,%rdi
call   1040 <turnArrayAround@plt>
lea    0xf91(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1050 <print@plt>
movups 0xf3a(%rip),%xmm0
movups %xmm0,0x3c(%rsp)
movaps 0xf22(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xf06(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    %r15,%rdi
call   1030 <puts@plt>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <print@plt>
mov    %rbx,%rdi
call   1040 <turnArrayAround@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1050 <print@plt>
mov    0xf0e(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xef3(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <print@plt>
mov    %rbx,%rdi
call   1040 <turnArrayAround@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1050 <print@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.A = [45 x i32] [i32 45, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11]
@.str = [25 x i8] c"Before turnArrayAround:\0A\00"
@.str.1 = [24 x i8] c"After turnArrayAround:\0A\00"
@__const.main.B = [11 x i32] [i32 11, i32 0, i32 6, i32 2, i32 7, i32 5, i32 3, i32 5, i32 2, i32 8, i32 1]
@__const.main.C = [5 x i32] [i32 5, i32 1, i32 3, i32 3, i32 7]
define i32 @main() {
%1 = alloca i32
%2 = alloca [45 x i32]
%3 = alloca [11 x i32]
%4 = alloca [5 x i32]
store i32 0, i32* %1
%5 = bitcast [45 x i32]* %2 to i8*
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [45 x i32], [45 x i32]* %2, i64 0, i64 0
%8 = call i32 @print(i32* %7)
%9 = getelementptr inbounds [45 x i32], [45 x i32]* %2, i64 0, i64 0
%10 = call i32 @turnArrayAround(i32* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%12 = getelementptr inbounds [45 x i32], [45 x i32]* %2, i64 0, i64 0
%13 = call i32 @print(i32* %12)
%14 = bitcast [11 x i32]* %3 to i8*
%15 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%16 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 0
%17 = call i32 @print(i32* %16)
%18 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 0
%19 = call i32 @turnArrayAround(i32* %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%21 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 0
%22 = call i32 @print(i32* %21)
%23 = bitcast [5 x i32]* %4 to i8*
%24 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%25 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%26 = call i32 @print(i32* %25)
%27 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%28 = call i32 @turnArrayAround(i32* %27)
%29 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%30 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%31 = call i32 @print(i32* %30)
ret i32 0
}

LLVM IR (-O2):
@__const.main.A = [45 x i32] [i32 45, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11]
@__const.main.B = [11 x i32] [i32 11, i32 0, i32 6, i32 2, i32 7, i32 5, i32 3, i32 5, i32 2, i32 8, i32 1]
@__const.main.C = [5 x i32] [i32 5, i32 1, i32 3, i32 3, i32 7]
@str.5 = [24 x i8] c"Before turnArrayAround:\00"
@str.6 = [23 x i8] c"After turnArrayAround:\00"
define i32 @main() {
%1 = alloca [45 x i32]
%2 = alloca [11 x i32]
%3 = alloca [5 x i32]
%4 = bitcast [45 x i32]* %1 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.5, i64 0, i64 0))
%6 = getelementptr inbounds [45 x i32], [45 x i32]* %1, i64 0, i64 0
%7 = call i32 @print(i32* %6)
%8 = call i32 @turnArrayAround(i32* %6)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.6, i64 0, i64 0))
%10 = call i32 @print(i32* %6)
%11 = bitcast [11 x i32]* %2 to i8*
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.5, i64 0, i64 0))
%13 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 0
%14 = call i32 @print(i32* %13)
%15 = call i32 @turnArrayAround(i32* %13)
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.6, i64 0, i64 0))
%17 = call i32 @print(i32* %13)
%18 = bitcast [5 x i32]* %3 to i8*
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.5, i64 0, i64 0))
%20 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%21 = call i32 @print(i32* %20)
%22 = call i32 @turnArrayAround(i32* %20)
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.6, i64 0, i64 0))
%24 = call i32 @print(i32* %20)
ret i32 0
}