#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 main() {
  int i, j = 0;
  int novo = 5;
  int lista[10] = {2, 4, 6, 8, 10};
  int posicao_ultimo_item = 10;
  for (i = 0; i <= posicao_ultimo_item && lista[i] < novo; i++) {
    for (j = posicao_ultimo_item + 1; j > i; j--) {
      lista[j] = lista[j - 1];
    }
  }
  printf("Agora vamos imprimir o vetor: \n");
  for (i = 0; i <= 10; i++) {
    printf("%d\n", lista[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movl   $0x2,-0x40(%rbp)
movl   $0x4,-0x3c(%rbp)
movl   $0x6,-0x38(%rbp)
movl   $0x8,-0x34(%rbp)
movl   $0xa,-0x30(%rbp)
movl   $0xa,-0x44(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0x44(%rbp),%ecx
mov    %al,-0x45(%rbp)
jg     11a0 <main+0x80>
movslq -0x8(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
cmp    -0x10(%rbp),%eax
setl   %al
mov    %al,-0x45(%rbp)
mov    -0x45(%rbp),%al
test   $0x1,%al
jne    11b0 <main+0x90>
jmp    11fa <main+0xda>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    11e7 <main+0xc7>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x40(%rbp,%rax,4),%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    11b9 <main+0x99>
jmp    11ec <main+0xcc>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117e <main+0x5e>
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     123d <main+0x11d>
movslq -0x8(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%esi
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    120f <main+0xef>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x20(%rsp)
movaps 0xec0(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0xa,0x10(%rsp)
movaps 0x10(%rsp),%xmm0
movaps (%rsp),%xmm1
movups %xmm1,0x4(%rsp)
mov    0x28(%rsp),%eax
mov    %eax,0x2c(%rsp)
movups %xmm0,0x14(%rsp)
movq   $0x0,0x24(%rsp)
mov    0x4(%rsp),%ebx
cmp    $0x5,%ebx
jge    127b <main+0x15b>
lea    0x4(%rsp),%rax
movups (%rax),%xmm0
movups 0x10(%rax),%xmm1
mov    0x20(%rax),%rcx
mov    %rcx,0x24(%rax)
movups %xmm1,0x14(%rax)
movups %xmm0,0x4(%rax)
mov    0x8(%rsp),%r14d
cmp    $0x4,%r14d
jg     1280 <main+0x160>
lea    0xc(%rsp),%rcx
movups 0x4(%rax),%xmm0
movups 0x14(%rax),%xmm1
mov    0x24(%rax),%eax
mov    %eax,0x20(%rcx)
movups %xmm1,0x10(%rcx)
movups %xmm0,(%rcx)
cmpl   $0x4,0xc(%rsp)
jg     1280 <main+0x160>
lea    0x10(%rsp),%rax
movups (%rcx),%xmm0
movups 0x10(%rcx),%xmm1
movups %xmm1,0x10(%rax)
movups %xmm0,(%rax)
cmpl   $0x4,0x10(%rsp)
jg     1280 <main+0x160>
mov    0x10(%rax),%rcx
mov    0x18(%rax),%edx
movups (%rax),%xmm0
movups %xmm0,0x14(%rsp)
mov    %edx,0x2c(%rsp)
mov    %rcx,0x24(%rsp)
cmpl   $0x4,0x14(%rsp)
jg     1280 <main+0x160>
lea    0x14(%rsp),%rax
mov    0x10(%rax),%rcx
movups (%rax),%xmm0
movups %xmm0,0x18(%rsp)
mov    %rcx,0x28(%rsp)
cmpl   $0x4,0x18(%rsp)
jg     1280 <main+0x160>
lea    0x18(%rsp),%rax
mov    0x10(%rax),%ecx
movups (%rax),%xmm0
movups %xmm0,0x1c(%rsp)
mov    %ecx,0x2c(%rsp)
cmpl   $0x4,0x1c(%rsp)
jg     1280 <main+0x160>
lea    0x1c(%rsp),%rax
movups (%rax),%xmm0
movaps %xmm0,0x20(%rsp)
cmpl   $0x4,0x20(%rsp)
jg     1280 <main+0x160>
lea    0x20(%rsp),%rax
mov    (%rax),%rcx
mov    0x8(%rax),%eax
mov    %eax,0x2c(%rsp)
mov    %rcx,0x24(%rsp)
cmp    $0x4,%ecx
jg     1280 <main+0x160>
mov    0x24(%rsp),%rax
mov    %rax,0x28(%rsp)
jmp    1280 <main+0x160>
mov    0x8(%rsp),%r14d
lea    0xd8d(%rip),%rdi
call   1030 <puts@plt>
lea    0xd7d(%rip),%rbp
mov    %rbp,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rsp),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rsp),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x28(%rsp),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Agora vamos imprimir o vetor: \0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [10 x i32]
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 5, i32* %4
%7 = bitcast [10 x i32]* %5 to i8*
%8 = bitcast i8* %7 to [10 x i32]*
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %8, i32 0, i32 0
store i32 2, i32* %9
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %8, i32 0, i32 1
store i32 4, i32* %10
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %8, i32 0, i32 2
store i32 6, i32* %11
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %8, i32 0, i32 3
store i32 8, i32* %12
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %8, i32 0, i32 4
store i32 10, i32* %13
store i32 10, i32* %6
store i32 0, i32* %2
br label %14
14: ; preds = %47, %0
%15 = load i32, i32* %2
%16 = load i32, i32* %6
%17 = icmp sle i32 %15, %16
br i1 %17, label %18, label %25
18: ; preds = %14
%19 = load i32, i32* %2
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 %20
%22 = load i32, i32* %21
%23 = load i32, i32* %4
%24 = icmp slt i32 %22, %23
br label %25
25: ; preds = %18, %14
%26 = phi i1 [ false, %14 ], [ %24, %18 ]
br i1 %26, label %27, label %50
27: ; preds = %25
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %30
30: ; preds = %43, %27
%31 = load i32, i32* %3
%32 = load i32, i32* %2
%33 = icmp sgt i32 %31, %32
br i1 %33, label %34, label %46
34: ; preds = %30
%35 = load i32, i32* %3
%36 = sub nsw i32 %35, 1
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = load i32, i32* %3
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 %41
store i32 %39, i32* %42
br label %43
43: ; preds = %34
%44 = load i32, i32* %3
%45 = add nsw i32 %44, -1
store i32 %45, i32* %3
br label %30
46: ; preds = %30
br label %47
47: ; preds = %46
%48 = load i32, i32* %2
%49 = add nsw i32 %48, 1
store i32 %49, i32* %2
br label %14
50: ; preds = %25
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %52
52: ; preds = %61, %50
%53 = load i32, i32* %2
%54 = icmp sle i32 %53, 10
br i1 %54, label %55, label %64
55: ; preds = %52
%56 = load i32, i32* %2
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 %57
%59 = load i32, i32* %58
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %59)
br label %61
61: ; preds = %55
%62 = load i32, i32* %2
%63 = add nsw i32 %62, 1
store i32 %63, i32* %2
br label %52
64: ; preds = %52
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
@str = [31 x i8] c"Agora vamos imprimir o vetor: \00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%4 = bitcast i32* %3 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%8 = bitcast [10 x i32]* %1 to <4 x i32>*
store <4 x i32> <i32 2, i32 4, i32 6, i32 8>, <4 x i32>* %8
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
store i32 10, i32* %9
%10 = bitcast i32* %5 to i8*
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 5
br i1 %12, label %15, label %13
13: ; preds = %0
%14 = load i32, i32* %6
br label %70
15: ; preds = %0
%16 = bitcast i32* %6 to i8*
%17 = bitcast i32* %5 to i8*
%18 = load i32, i32* %6
%19 = icmp slt i32 %18, 5
br i1 %19, label %20, label %70
20: ; preds = %15
%21 = bitcast i32* %7 to i8*
%22 = bitcast i32* %6 to i8*
%23 = load i32, i32* %7
%24 = icmp slt i32 %23, 5
br i1 %24, label %25, label %70
25: ; preds = %20
%26 = bitcast i32* %9 to i8*
%27 = bitcast i32* %7 to i8*
%28 = load i32, i32* %9
%29 = icmp slt i32 %28, 5
br i1 %29, label %30, label %70
30: ; preds = %25
%31 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%32 = bitcast i32* %31 to i8*
%33 = bitcast i32* %9 to i8*
%34 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%35 = load i32, i32* %34
%36 = icmp slt i32 %35, 5
br i1 %36, label %37, label %70
37: ; preds = %30
%38 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%39 = bitcast i32* %38 to i8*
%40 = bitcast i32* %34 to i8*
%41 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%42 = load i32, i32* %41
%43 = icmp slt i32 %42, 5
br i1 %43, label %44, label %70
44: ; preds = %37
%45 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%46 = bitcast i32* %45 to i8*
%47 = bitcast i32* %41 to i8*
%48 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%49 = load i32, i32* %48
%50 = icmp slt i32 %49, 5
br i1 %50, label %51, label %70
51: ; preds = %44
%52 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%53 = bitcast i32* %52 to i8*
%54 = bitcast i32* %48 to i8*
%55 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%56 = load i32, i32* %55
%57 = icmp slt i32 %56, 5
br i1 %57, label %58, label %70
58: ; preds = %51
%59 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%60 = bitcast i32* %59 to i8*
%61 = bitcast i32* %55 to i8*
%62 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%63 = load i32, i32* %62
%64 = icmp slt i32 %63, 5
br i1 %64, label %65, label %70
65: ; preds = %58
%66 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 1, i64 0
%67 = bitcast i32* %62 to i64*
%68 = bitcast i32* %66 to i64*
%69 = load i64, i64* %67
store i64 %69, i64* %68
br label %70
70: ; preds = %65, %13, %58, %51, %44, %37, %30, %25, %20, %15
%71 = phi i32 [ %18, %58 ], [ %18, %51 ], [ %18, %44 ], [ %18, %37 ], [ %18, %30 ], [ %18, %25 ], [ %18, %20 ], [ %18, %15 ], [ %14, %13 ], [ %18, %65 ]
%72 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%73 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 2)
%74 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%75 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %71)
%76 = load i32, i32* %7
%77 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %76)
%78 = load i32, i32* %9
%79 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %78)
%80 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%81 = load i32, i32* %80
%82 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %81)
%83 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%84 = load i32, i32* %83
%85 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %84)
%86 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%87 = load i32, i32* %86
%88 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %87)
%89 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%90 = load i32, i32* %89
%91 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %90)
%92 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%93 = load i32, i32* %92
%94 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %93)
%95 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 10
%96 = load i32, i32* %95
%97 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %96)
ret i32 0
}