#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*/ delete (int *, int);
int /*<<< orphan*/ display(int *);
int /*<<< orphan*/ insert(int *, int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ reverse(int *);
int /*<<< orphan*/ search(int *, int);
int main(void) {
  int array[5];
  insert(array, 1, 11);
  insert(array, 2, 12);
  insert(array, 3, 13);
  insert(array, 4, 14);
  insert(array, 5, 15);
  printf("Array Contents: \n");
  display(array);
  delete (array, 5);
  delete (array, 2);
  printf("After Deletion: \n");
  display(array);
  insert(array, 2, 222);
  insert(array, 5, 555);
  printf("Array Insertion: \n");
  display(array);
  reverse(array);
  printf("After Reversal: \n");
  display(array);
  search(array, 222);
  search(array, 666);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x1,%esi
mov    $0xb,%edx
call   1070 <insert@plt>
lea    -0x20(%rbp),%rdi
mov    $0x2,%esi
mov    $0xc,%edx
call   1070 <insert@plt>
lea    -0x20(%rbp),%rdi
mov    $0x3,%esi
mov    $0xd,%edx
call   1070 <insert@plt>
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
mov    $0xe,%edx
call   1070 <insert@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
mov    $0xf,%edx
call   1070 <insert@plt>
lea    0xe2b(%rip),%rdi
call   1050 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <display@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1080 <delete@plt>
lea    -0x20(%rbp),%rdi
mov    $0x2,%esi
call   1080 <delete@plt>
lea    0xe0c(%rip),%rdi
call   1050 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <display@plt>
lea    -0x20(%rbp),%rdi
mov    $0x2,%esi
mov    $0xde,%edx
call   1070 <insert@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
mov    $0x22b,%edx
call   1070 <insert@plt>
lea    0xde3(%rip),%rdi
call   1050 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <display@plt>
lea    -0x20(%rbp),%rdi
call   1030 <reverse@plt>
lea    0xdd8(%rip),%rdi
call   1050 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <display@plt>
lea    -0x20(%rbp),%rdi
mov    $0xde,%esi
call   1060 <search@plt>
lea    -0x20(%rbp),%rdi
mov    $0x29a,%esi
call   1060 <search@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0xb,%edx
call   1070 <insert@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0xc,%edx
call   1070 <insert@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0xd,%edx
call   1070 <insert@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0xe,%edx
call   1070 <insert@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0xf,%edx
call   1070 <insert@plt>
lea    0xe37(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <display@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1080 <delete@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1080 <delete@plt>
lea    0xe1a(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <display@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0xde,%edx
call   1070 <insert@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x22b,%edx
call   1070 <insert@plt>
lea    0xdf3(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <display@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
lea    0xde9(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <display@plt>
mov    %rbx,%rdi
mov    $0xde,%esi
call   1060 <search@plt>
mov    %rbx,%rdi
mov    $0x29a,%esi
call   1060 <search@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Array Contents: \0A\00"
@.str.1 = [18 x i8] c"After Deletion: \0A\00"
@.str.2 = [19 x i8] c"Array Insertion: \0A\00"
@.str.3 = [18 x i8] c"After Reversal: \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%4 = call i32 @insert(i32* %3, i32 1, i32 11)
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%6 = call i32 @insert(i32* %5, i32 2, i32 12)
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%8 = call i32 @insert(i32* %7, i32 3, i32 13)
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%10 = call i32 @insert(i32* %9, i32 4, i32 14)
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%12 = call i32 @insert(i32* %11, i32 5, i32 15)
%13 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%14 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%15 = call i32 @display(i32* %14)
%16 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%17 = call i32 @delete(i32* %16, i32 5)
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%19 = call i32 @delete(i32* %18, i32 2)
%20 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%21 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%22 = call i32 @display(i32* %21)
%23 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%24 = call i32 @insert(i32* %23, i32 2, i32 222)
%25 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%26 = call i32 @insert(i32* %25, i32 5, i32 555)
%27 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%28 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%29 = call i32 @display(i32* %28)
%30 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%31 = call i32 @reverse(i32* %30)
%32 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%33 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%34 = call i32 @display(i32* %33)
%35 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%36 = call i32 @search(i32* %35, i32 222)
%37 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%38 = call i32 @search(i32* %37, i32 666)
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"Array Contents: \00"
@str.4 = [17 x i8] c"After Deletion: \00"
@str.5 = [18 x i8] c"Array Insertion: \00"
@str.6 = [17 x i8] c"After Reversal: \00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @insert(i32* %3, i32 1, i32 11)
%5 = call i32 @insert(i32* %3, i32 2, i32 12)
%6 = call i32 @insert(i32* %3, i32 3, i32 13)
%7 = call i32 @insert(i32* %3, i32 4, i32 14)
%8 = call i32 @insert(i32* %3, i32 5, i32 15)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%10 = call i32 @display(i32* %3)
%11 = call i32 @delete(i32* %3, i32 5)
%12 = call i32 @delete(i32* %3, i32 2)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.4, i64 0, i64 0))
%14 = call i32 @display(i32* %3)
%15 = call i32 @insert(i32* %3, i32 2, i32 222)
%16 = call i32 @insert(i32* %3, i32 5, i32 555)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.5, i64 0, i64 0))
%18 = call i32 @display(i32* %3)
%19 = call i32 @reverse(i32* %3)
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.6, i64 0, i64 0))
%21 = call i32 @display(i32* %3)
%22 = call i32 @search(i32* %3, i32 222)
%23 = call i32 @search(i32* %3, i32 666)
ret i32 0
}