#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i;
  int pos;
  int v[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  int tot;
  tot = 10;
  printf("Inserire la posizione  ");
  scanf("%d", &pos);
  for (i = pos; i < (tot - 1); i++) {
    v[i] = v[i] + 1;
  }
  tot--;
  for (i = 0; i < tot; i++) {
    printf("%d", v[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movl   $0xa,-0x44(%rbp)
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11b1 <main+0x81>
movslq -0x8(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%ecx
add    $0x1,%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117f <main+0x4f>
mov    -0x44(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x44(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    11f1 <main+0xc1>
movslq -0x8(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%esi
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11c1 <main+0x91>
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    0xedb(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movdqa 0xea2(%rip),%xmm0
movdqa %xmm0,0x10(%rsp)
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
movslq 0xc(%rsp),%rax
cmp    $0x8,%rax
jg     12a2 <main+0x172>
mov    $0x8,%ecx
sub    %eax,%ecx
cmp    $0x7,%ecx
jb     1260 <main+0x130>
add    $0x1,%rcx
mov    %rcx,%rdx
and    $0xfffffffffffffff8,%rdx
lea    -0x8(%rdx),%rsi
mov    %rsi,%rbp
shr    $0x3,%rbp
add    $0x1,%rbp
test   %rsi,%rsi
je     136e <main+0x23e>
mov    %rbp,%rdi
and    $0xfffffffffffffffe,%rdi
lea    (%rsp,%rax,4),%rbx
add    $0x40,%rbx
xor    %esi,%esi
pcmpeqd %xmm0,%xmm0
nopw   0x0(%rax,%rax,1)
movdqu -0x30(%rbx,%rsi,4),%xmm1
movdqu -0x20(%rbx,%rsi,4),%xmm2
movdqu -0x10(%rbx,%rsi,4),%xmm3
movdqu (%rbx,%rsi,4),%xmm4
psubd  %xmm0,%xmm1
psubd  %xmm0,%xmm2
movdqu %xmm1,-0x30(%rbx,%rsi,4)
movdqu %xmm2,-0x20(%rbx,%rsi,4)
psubd  %xmm0,%xmm3
psubd  %xmm0,%xmm4
movdqu %xmm3,-0x10(%rbx,%rsi,4)
movdqu %xmm4,(%rbx,%rsi,4)
add    $0x10,%rsi
add    $0xfffffffffffffffe,%rdi
jne    11e0 <main+0xb0>
test   $0x1,%bpl
je     1255 <main+0x125>
add    %rax,%rsi
movdqu 0x10(%rsp,%rsi,4),%xmm0
movdqu 0x20(%rsp,%rsi,4),%xmm1
pcmpeqd %xmm2,%xmm2
psubd  %xmm2,%xmm0
psubd  %xmm2,%xmm1
movdqu %xmm0,0x10(%rsp,%rsi,4)
movdqu %xmm1,0x20(%rsp,%rsi,4)
cmp    %rdx,%rcx
je     126e <main+0x13e>
add    %rdx,%rax
nopl   (%rax)
addl   $0x1,0x10(%rsp,%rax,4)
add    $0x1,%rax
cmp    $0x9,%eax
jne    1260 <main+0x130>
mov    0x10(%rsp),%esi
mov    0x14(%rsp),%r15d
mov    0x18(%rsp),%r14d
mov    0x1c(%rsp),%ebp
mov    0x20(%rsp),%ebx
mov    0x24(%rsp),%r13d
mov    0x28(%rsp),%eax
mov    %eax,(%rsp)
mov    0x2c(%rsp),%eax
mov    %eax,0x4(%rsp)
mov    0x30(%rsp),%eax
mov    %eax,0x8(%rsp)
jmp    12da <main+0x1aa>
mov    $0x1,%esi
mov    $0x2,%r15d
mov    $0x3,%r14d
mov    $0x4,%ebp
mov    $0x5,%ebx
mov    $0x6,%r13d
movl   $0x7,(%rsp)
movl   $0x8,0x4(%rsp)
movl   $0x9,0x8(%rsp)
lea    0xd5f(%rip),%r12
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    (%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    0x4(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    0x8(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %esi,%esi
test   $0x1,%bpl
jne    122e <main+0xfe>
jmp    1255 <main+0x125>

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

LLVM IR (-O2):
@__const.main.v = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str = [24 x i8] c"Inserire la posizione \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 9
br i1 %8, label %9, label %92
9: ; preds = %0
%10 = sext i32 %7 to i64
%11 = sub i32 8, %7
%12 = zext i32 %11 to i64
%13 = add nuw nsw i64 %12, 1
%14 = icmp ult i32 %11, 7
br i1 %14, label %71, label %15
15: ; preds = %9
%16 = and i64 %13, 8589934584
%17 = add nsw i64 %16, %10
%18 = add nsw i64 %16, -8
%19 = lshr exact i64 %18, 3
%20 = add nuw nsw i64 %19, 1
%21 = and i64 %20, 1
%22 = icmp eq i64 %18, 0
br i1 %22, label %54, label %23
23: ; preds = %15
%24 = and i64 %20, 4611686018427387902
br label %25
25: ; preds = %25, %23
%26 = phi i64 [ 0, %23 ], [ %51, %25 ]
%27 = phi i64 [ 0, %23 ], [ %52, %25 ]
%28 = add i64 %26, %10
%29 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %28
%30 = bitcast i32* %29 to <4 x i32>*
%31 = load <4 x i32>, <4 x i32>* %30
%32 = getelementptr inbounds i32, i32* %29, i64 4
%33 = bitcast i32* %32 to <4 x i32>*
%34 = load <4 x i32>, <4 x i32>* %33
%35 = add nsw <4 x i32> %31, <i32 1, i32 1, i32 1, i32 1>
%36 = add nsw <4 x i32> %34, <i32 1, i32 1, i32 1, i32 1>
%37 = bitcast i32* %29 to <4 x i32>*
store <4 x i32> %35, <4 x i32>* %37
%38 = bitcast i32* %32 to <4 x i32>*
store <4 x i32> %36, <4 x i32>* %38
%39 = or i64 %26, 8
%40 = add i64 %39, %10
%41 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %40
%42 = bitcast i32* %41 to <4 x i32>*
%43 = load <4 x i32>, <4 x i32>* %42
%44 = getelementptr inbounds i32, i32* %41, i64 4
%45 = bitcast i32* %44 to <4 x i32>*
%46 = load <4 x i32>, <4 x i32>* %45
%47 = add nsw <4 x i32> %43, <i32 1, i32 1, i32 1, i32 1>
%48 = add nsw <4 x i32> %46, <i32 1, i32 1, i32 1, i32 1>
%49 = bitcast i32* %41 to <4 x i32>*
store <4 x i32> %47, <4 x i32>* %49
%50 = bitcast i32* %44 to <4 x i32>*
store <4 x i32> %48, <4 x i32>* %50
%51 = add nuw i64 %26, 16
%52 = add i64 %27, 2
%53 = icmp eq i64 %52, %24
br i1 %53, label %54, label %25
54: ; preds = %25, %15
%55 = phi i64 [ 0, %15 ], [ %51, %25 ]
%56 = icmp eq i64 %21, 0
br i1 %56, label %69, label %57
57: ; preds = %54
%58 = add i64 %55, %10
%59 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %58
%60 = bitcast i32* %59 to <4 x i32>*
%61 = load <4 x i32>, <4 x i32>* %60
%62 = getelementptr inbounds i32, i32* %59, i64 4
%63 = bitcast i32* %62 to <4 x i32>*
%64 = load <4 x i32>, <4 x i32>* %63
%65 = add nsw <4 x i32> %61, <i32 1, i32 1, i32 1, i32 1>
%66 = add nsw <4 x i32> %64, <i32 1, i32 1, i32 1, i32 1>
%67 = bitcast i32* %59 to <4 x i32>*
store <4 x i32> %65, <4 x i32>* %67
%68 = bitcast i32* %62 to <4 x i32>*
store <4 x i32> %66, <4 x i32>* %68
br label %69
69: ; preds = %54, %57
%70 = icmp eq i64 %13, %16
br i1 %70, label %73, label %71
71: ; preds = %9, %69
%72 = phi i64 [ %10, %9 ], [ %17, %69 ]
br label %112
73: ; preds = %112, %69
%74 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%75 = load i32, i32* %74
%76 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 1
%77 = load i32, i32* %76
%78 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 2
%79 = load i32, i32* %78
%80 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 3
%81 = load i32, i32* %80
%82 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 4
%83 = load i32, i32* %82
%84 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 5
%85 = load i32, i32* %84
%86 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 6
%87 = load i32, i32* %86
%88 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 7
%89 = load i32, i32* %88
%90 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 8
%91 = load i32, i32* %90
br label %92
92: ; preds = %73, %0
%93 = phi i32 [ %91, %73 ], [ 9, %0 ]
%94 = phi i32 [ %89, %73 ], [ 8, %0 ]
%95 = phi i32 [ %87, %73 ], [ 7, %0 ]
%96 = phi i32 [ %85, %73 ], [ 6, %0 ]
%97 = phi i32 [ %83, %73 ], [ 5, %0 ]
%98 = phi i32 [ %81, %73 ], [ 4, %0 ]
%99 = phi i32 [ %79, %73 ], [ 3, %0 ]
%100 = phi i32 [ %77, %73 ], [ 2, %0 ]
%101 = phi i32 [ %75, %73 ], [ 1, %0 ]
%102 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %101)
%103 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %100)
%104 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %99)
%105 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %98)
%106 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %97)
%107 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %96)
%108 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %95)
%109 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %94)
%110 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %93)
%111 = call i32 @putchar(i32 10)
ret i32 0
112: ; preds = %71, %112
%113 = phi i64 [ %117, %112 ], [ %72, %71 ]
%114 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %113
%115 = load i32, i32* %114
%116 = add nsw i32 %115, 1
store i32 %116, i32* %114
%117 = add nsw i64 %113, 1
%118 = trunc i64 %117 to i32
%119 = icmp eq i32 %118, 9
br i1 %119, label %73, label %112
}