#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*/ addValue(int *, int);
int /*<<< orphan*/ disp(int *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int arr[10 + 1] = {1, 2, 3, 5, 6, 8, 10, 28, 45, 100};
  int num;
  printf("Before Insertion \n");
  disp(arr, 10);
  printf("Enter A Value To Insert: ");
  scanf("%d", &num);
  printf("After Insertion \n");
  addValue(arr, num);
  disp(arr, 10 + 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe96(%rip),%rsi
mov    $0x2c,%edx
call   1050 <memcpy@plt>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1060 <disp@plt>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    -0x34(%rbp),%rsi
call   1070 <scanf@plt>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1040 <addValue@plt>
lea    -0x30(%rbp),%rdi
mov    $0xb,%esi
call   1060 <disp@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
movups 0xec0(%rip),%xmm0
movups %xmm0,0x2c(%rsp)
movaps 0xea8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe8c(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1060 <disp@plt>
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9c(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
lea    0xea0(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1050 <addValue@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1060 <disp@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [11 x i32] [i32 1, i32 2, i32 3, i32 5, i32 6, i32 8, i32 10, i32 28, i32 45, i32 100, i32 0]
@.str = [19 x i8] c"Before Insertion \0A\00"
@.str.1 = [26 x i8] c"Enter A Value To Insert: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [18 x i8] c"After Insertion \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [11 x i32]* %2 to i8*
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 0
%7 = call i32 @disp(i32* %6, i32 10)
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%11 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 0
%12 = load i32, i32* %3
%13 = call i32 @addValue(i32* %11, i32 %12)
%14 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 0
%15 = call i32 @disp(i32* %14, i32 11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [11 x i32] [i32 1, i32 2, i32 3, i32 5, i32 6, i32 8, i32 10, i32 28, i32 45, i32 100, i32 0]
@.str.1 = [26 x i8] c"Enter A Value To Insert: \00"
@.str.2 = [3 x i8] c"%d\00"
@str = [18 x i8] c"Before Insertion \00"
@str.4 = [17 x i8] c"After Insertion \00"
define i32 @main() {
%1 = alloca [11 x i32]
%2 = alloca i32
%3 = bitcast [11 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%6 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%7 = call i32 @disp(i32* %6, i32 10)
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.4, i64 0, i64 0))
%11 = load i32, i32* %2
%12 = call i32 @addValue(i32* %6, i32 %11)
%13 = call i32 @disp(i32* %6, i32 11)
ret i32 0
}