#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*/ array_sum(int *, int *, int *, int const);
int /*<<< orphan*/ delete_realloc(int *, int, int const);
int /*<<< orphan*/ delete_shift(int *, int, int const);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ inverse(int *, int const);
scalar_t__ malloc(int);
int /*<<< orphan*/ print_array(int *, int const);
int /*<<< orphan*/ reset_array(int *, int const);
int /*<<< orphan*/ square(int *, int const);
int main(void) {
  const int size = 5;
  int fst_arr[] = {1, 2, 3, 4, 5};
  int snd_arr[] = {5, 4, 3, 2, 1};
  int res[size];
  array_sum(fst_arr, snd_arr, res, size);
  print_array(fst_arr, size);
  print_array(snd_arr, size);
  print_array(res, size);
  int *dynamic = (int *)malloc(sizeof(int) * size);
  int i;
  for (i = 0; i < size; ++i)
    dynamic[i] = i;
  print_array(dynamic, size);
  delete_shift(fst_arr, 2, size);
  print_array(fst_arr, size - 1);
  delete_realloc(dynamic, 1, size);
  print_array(dynamic, size - 1);
  free(dynamic);
  reset_array(fst_arr, size);
  print_array(fst_arr, size);
  inverse(snd_arr, size);
  print_array(snd_arr, size);
  square(res, size);
  print_array(res, size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    0xe53(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe50(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe4e(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xe54(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe51(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe4f(%rip),%eax
mov    %eax,-0x30(%rbp)
mov    %rsp,%rax
mov    %rax,-0x48(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
lea    -0x70(%rbp),%rdx
mov    $0x5,%ecx
call   1090 <array_sum@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1050 <print_array@plt>
lea    -0x40(%rbp),%rdi
mov    $0x5,%esi
call   1050 <print_array@plt>
lea    -0x70(%rbp),%rdi
mov    $0x5,%esi
call   1050 <print_array@plt>
mov    $0x14,%edi
call   1070 <malloc@plt>
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x54(%rbp)
cmpl   $0x5,-0x54(%rbp)
jge    1266 <main+0xd6>
mov    -0x54(%rbp),%edx
mov    -0x50(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1240 <main+0xb0>
mov    -0x50(%rbp),%rdi
mov    $0x5,%esi
call   1050 <print_array@plt>
lea    -0x20(%rbp),%rdi
mov    $0x2,%esi
mov    $0x5,%edx
call   10b0 <delete_shift@plt>
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1050 <print_array@plt>
mov    -0x50(%rbp),%rdi
mov    $0x1,%esi
mov    $0x5,%edx
call   10a0 <delete_realloc@plt>
mov    -0x50(%rbp),%rdi
mov    $0x4,%esi
call   1050 <print_array@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1040 <reset_array@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1050 <print_array@plt>
lea    -0x40(%rbp),%rdi
mov    $0x5,%esi
call   1080 <inverse@plt>
lea    -0x40(%rbp),%rdi
mov    $0x5,%esi
call   1050 <print_array@plt>
lea    -0x70(%rbp),%rdi
mov    $0x5,%esi
call   1060 <square@plt>
lea    -0x70(%rbp),%rdi
mov    $0x5,%esi
call   1050 <print_array@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x60,%rsp
mov    %rsp,%r13
mov    0xe7a(%rip),%eax
mov    %eax,0x30(%rsp)
mov    0xe90(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xe55(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe69(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%r12
mov    %rsp,%r15
lea    0x40(%rsp),%r14
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    $0x5,%ecx
call   1090 <array_sum@plt>
mov    %r12,%rdi
mov    $0x5,%esi
call   1050 <print_array@plt>
mov    %r15,%rdi
mov    $0x5,%esi
call   1050 <print_array@plt>
mov    %r14,%rdi
mov    $0x5,%esi
call   1050 <print_array@plt>
mov    $0x14,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
movaps 0xdda(%rip),%xmm0
movups %xmm0,(%rax)
movl   $0x4,0x10(%rax)
mov    %rax,%rdi
mov    $0x5,%esi
call   1050 <print_array@plt>
mov    %r12,%rdi
mov    $0x2,%esi
mov    $0x5,%edx
call   10b0 <delete_shift@plt>
mov    %r12,%rdi
mov    $0x4,%esi
call   1050 <print_array@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x5,%edx
call   10a0 <delete_realloc@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1050 <print_array@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
mov    $0x5,%esi
call   1040 <reset_array@plt>
mov    %r12,%rdi
mov    $0x5,%esi
call   1050 <print_array@plt>
mov    %r15,%rdi
mov    $0x5,%esi
call   1080 <inverse@plt>
mov    %r15,%rdi
mov    $0x5,%esi
call   1050 <print_array@plt>
mov    %r14,%rdi
mov    $0x5,%esi
call   1060 <square@plt>
mov    %r14,%rdi
mov    $0x5,%esi
call   1050 <print_array@plt>
mov    %r13,%rsp
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.fst_arr = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@__const.main.snd_arr = [5 x i32] [i32 5, i32 4, i32 3, i32 2, i32 1]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [5 x i32]
%4 = alloca [5 x i32]
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%8 = bitcast [5 x i32]* %3 to i8*
%9 = bitcast [5 x i32]* %4 to i8*
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %5
%11 = alloca i32, i64 5
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%13 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%14 = call i32 @array_sum(i32* %12, i32* %13, i32* %11, i32 5)
%15 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%16 = call i32 @print_array(i32* %15, i32 5)
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%18 = call i32 @print_array(i32* %17, i32 5)
%19 = call i32 @print_array(i32* %11, i32 5)
%20 = call i64 @malloc(i32 20)
%21 = inttoptr i64 %20 to i32*
store i32* %21, i32** %6
store i32 0, i32* %7
br label %22
22: ; preds = %31, %0
%23 = load i32, i32* %7
%24 = icmp slt i32 %23, 5
br i1 %24, label %25, label %34
25: ; preds = %22
%26 = load i32, i32* %7
%27 = load i32*, i32** %6
%28 = load i32, i32* %7
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %27, i64 %29
store i32 %26, i32* %30
br label %31
31: ; preds = %25
%32 = load i32, i32* %7
%33 = add nsw i32 %32, 1
store i32 %33, i32* %7
br label %22
34: ; preds = %22
%35 = load i32*, i32** %6
%36 = call i32 @print_array(i32* %35, i32 5)
%37 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%38 = call i32 @delete_shift(i32* %37, i32 2, i32 5)
%39 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%40 = call i32 @print_array(i32* %39, i32 4)
%41 = load i32*, i32** %6
%42 = call i32 @delete_realloc(i32* %41, i32 1, i32 5)
%43 = load i32*, i32** %6
%44 = call i32 @print_array(i32* %43, i32 4)
%45 = load i32*, i32** %6
%46 = call i32 @free(i32* %45)
%47 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%48 = call i32 @reset_array(i32* %47, i32 5)
%49 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%50 = call i32 @print_array(i32* %49, i32 5)
%51 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%52 = call i32 @inverse(i32* %51, i32 5)
%53 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%54 = call i32 @print_array(i32* %53, i32 5)
%55 = call i32 @square(i32* %11, i32 5)
%56 = call i32 @print_array(i32* %11, i32 5)
store i32 0, i32* %1
%57 = load i8*, i8** %5
%58 = load i32, i32* %1
ret i32 %58
}

LLVM IR (-O2):
@__const.main.fst_arr = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@__const.main.snd_arr = [5 x i32] [i32 5, i32 4, i32 3, i32 2, i32 1]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast [5 x i32]* %2 to i8*
%5 = tail call i8* @llvm.stacksave()
%6 = alloca [5 x i32]
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 0
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%10 = call i32 @array_sum(i32* %8, i32* %9, i32* %7, i32 5)
%11 = call i32 @print_array(i32* %8, i32 5)
%12 = call i32 @print_array(i32* %9, i32 5)
%13 = call i32 @print_array(i32* %7, i32 5)
%14 = call i64 @malloc(i32 20)
%15 = inttoptr i64 %14 to i32*
%16 = inttoptr i64 %14 to <4 x i32>*
store <4 x i32> <i32 0, i32 1, i32 2, i32 3>, <4 x i32>* %16
%17 = getelementptr inbounds i32, i32* %15, i64 4
store i32 4, i32* %17
%18 = call i32 @print_array(i32* %15, i32 5)
%19 = call i32 @delete_shift(i32* %8, i32 2, i32 5)
%20 = call i32 @print_array(i32* %8, i32 4)
%21 = call i32 @delete_realloc(i32* %15, i32 1, i32 5)
%22 = call i32 @print_array(i32* %15, i32 4)
%23 = call i32 @free(i32* %15)
%24 = call i32 @reset_array(i32* %8, i32 5)
%25 = call i32 @print_array(i32* %8, i32 5)
%26 = call i32 @inverse(i32* %9, i32 5)
%27 = call i32 @print_array(i32* %9, i32 5)
%28 = call i32 @square(i32* %7, i32 5)
%29 = call i32 @print_array(i32* %7, i32 5)
ret i32 0
}