#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*/ printf(char *, int);
void deleteElement(int a[], int *size, int pos) {
  int i, item = 0;
  item = a[pos - 1];
  for (i = pos - 1; i < (*size) - 1; i++) {
    a[i] = a[i + 1];
  }
  (*size) -= 1;
  printf("\nElement %d was deleted Successfully.\n", item);
}


x86 assembly (clang, -O0):
<deleteElement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1183 <deleteElement+0x73>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1146 <deleteElement+0x36>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%esi
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteElement>:
mov    %rsi,%r8
movslq %edx,%rdx
mov    -0x4(%rdi,%rdx,4),%esi
mov    (%r8),%ecx
cmp    %edx,%ecx
jle    114c <deleteElement+0x3c>
add    $0xffffffffffffffff,%rdx
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x4(%rdi,%rdx,4),%ecx
mov    %ecx,(%rdi,%rdx,4)
lea    0x1(%rdx),%rax
movslq (%r8),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rax,%rdx
cmp    %rcx,%rax
jl     1130 <deleteElement+0x20>
jmp    114f <deleteElement+0x3f>
add    $0xffffffff,%ecx
mov    %ecx,(%r8)
lea    0xea7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"\0AElement %d was deleted Successfully.\0A\00"
define void @deleteElement(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
store i32 0, i32* %8
%9 = load i32*, i32** %4
%10 = load i32, i32* %6
%11 = sub nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %9, i64 %12
%14 = load i32, i32* %13
store i32 %14, i32* %8
%15 = load i32, i32* %6
%16 = sub nsw i32 %15, 1
store i32 %16, i32* %7
br label %17
17: ; preds = %34, %3
%18 = load i32, i32* %7
%19 = load i32*, i32** %5
%20 = load i32, i32* %19
%21 = sub nsw i32 %20, 1
%22 = icmp slt i32 %18, %21
br i1 %22, label %23, label %37
23: ; preds = %17
%24 = load i32*, i32** %4
%25 = load i32, i32* %7
%26 = add nsw i32 %25, 1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %24, i64 %27
%29 = load i32, i32* %28
%30 = load i32*, i32** %4
%31 = load i32, i32* %7
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %30, i64 %32
store i32 %29, i32* %33
br label %34
34: ; preds = %23
%35 = load i32, i32* %7
%36 = add nsw i32 %35, 1
store i32 %36, i32* %7
br label %17
37: ; preds = %17
%38 = load i32*, i32** %5
%39 = load i32, i32* %38
%40 = sub nsw i32 %39, 1
store i32 %40, i32* %38
%41 = load i32, i32* %8
%42 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %41)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"\0AElement %d was deleted Successfully.\0A\00"
define void @deleteElement(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = load i32, i32* %1
%9 = add nsw i32 %8, -1
%10 = icmp sgt i32 %8, %2
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = sext i32 %2 to i64
%13 = add nsw i64 %12, -1
br label %14
14: ; preds = %11, %14
%15 = phi i64 [ %13, %11 ], [ %16, %14 ]
%16 = add nsw i64 %15, 1
%17 = getelementptr inbounds i32, i32* %0, i64 %16
%18 = load i32, i32* %17
%19 = getelementptr inbounds i32, i32* %0, i64 %15
store i32 %18, i32* %19
%20 = load i32, i32* %1
%21 = add nsw i32 %20, -1
%22 = sext i32 %21 to i64
%23 = icmp slt i64 %16, %22
br i1 %23, label %14, label %24
24: ; preds = %14, %3
%25 = phi i32 [ %9, %3 ], [ %21, %14 ]
store i32 %25, i32* %1
%26 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}