#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ insertelement(int *, int *, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ system(char *);
int main() {
  int a[10] = {0}, n = 0, i;
  char ch = 'n';
  system("cls");
  printf("\nEnter the number of elemenets: ");
  scanf("%d", &n);
  printf("\nEnter the array:\n");
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  printf("\nEntered array is: \n");
  for (i = 0; i < n; i++) {
    printf(" %d", a[i]);
  }
  do {
    int data = 0, pos = -1;
    if (n == 10) {
      printf("\nNo More Space Left to Insert element.");
      break;
    }
    printf("\n\nEnter an element to insert: ");
    scanf("%d", &data);
    printf("\nEnter a position: ");
    scanf("%d", &pos);
    if (pos < 1) {
      printf("\nPosition is invalid!\nInserting at beginning.\n");
      pos = 1;
    } else if (pos >= n) {
      printf("\nPosition is invalid!\nInserting at end.\n");
      pos = n;
    }
    insertelement(a, &n, data, pos);
    printf("\nChanged array is: \n");
    for (i = 0; i < n; i++) {
      printf(" %d", a[i]);
    }
    fflush(stdin);
    printf("\n\nWant to Insert more? (Y/N): ");
    scanf("%c", &ch);
  } while (ch == 'y' || ch == 'Y');
  printf("\n");
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1050 <memset@plt>
movl   $0x0,-0x34(%rbp)
movb   $0x6e,-0x39(%rbp)
lea    0xe6f(%rip),%rdi
call   1030 <system@plt>
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea3(%rip),%rdi
lea    -0x34(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    1202 <main+0xa2>
movslq -0x38(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11cb <main+0x6b>
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    1247 <main+0xe7>
movslq -0x38(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe1b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1217 <main+0xb7>
jmp    124c <main+0xec>
movl   $0x0,-0x40(%rbp)
movl   $0xffffffff,-0x44(%rbp)
cmpl   $0xa,-0x34(%rbp)
jne    1277 <main+0x117>
lea    0xde6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13b0 <main+0x250>
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdc2(%rip),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xda2(%rip),%rdi
lea    -0x44(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
cmpl   $0x1,-0x44(%rbp)
jge    12db <main+0x17b>
lea    0xde3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x44(%rbp)
jmp    1300 <main+0x1a0>
mov    -0x44(%rbp),%eax
cmp    -0x34(%rbp),%eax
jl     12fb <main+0x19b>
lea    0xdec(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x34(%rbp),%eax
mov    %eax,-0x44(%rbp)
jmp    1300 <main+0x1a0>
lea    -0x30(%rbp),%rdi
mov    -0x40(%rbp),%edx
mov    -0x44(%rbp),%ecx
lea    -0x34(%rbp),%rsi
call   1080 <insertelement@plt>
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    1358 <main+0x1f8>
movslq -0x38(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xd0a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1328 <main+0x1c8>
mov    0x2c89(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
lea    0xdab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdbc(%rip),%rdi
lea    -0x39(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
movsbl -0x39(%rbp),%ecx
mov    $0x1,%al
cmp    $0x79,%ecx
mov    %al,-0x45(%rbp)
je     13a5 <main+0x245>
movsbl -0x39(%rbp),%eax
cmp    $0x59,%eax
sete   %al
mov    %al,-0x45(%rbp)
mov    -0x45(%rbp),%al
test   $0x1,%al
jne    124c <main+0xec>
lea    0xd5f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd75(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x30(%rsp)
movl   $0x0,(%rsp)
movb   $0x6e,0x7(%rsp)
lea    0xe5e(%rip),%rdi
call   1050 <system@plt>
lea    0xe56(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe6a(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
lea    0xede(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x0,(%rsp)
jle    120e <main+0x9e>
lea    0x10(%rsp),%r15
lea    0xe42(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
add    $0x1,%rbx
movslq (%rsp),%rax
add    $0x4,%r15
cmp    %rax,%rbx
jl     11f0 <main+0x80>
lea    0xea8(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x0,(%rsp)
jle    1265 <main+0xf5>
lea    0xdfe(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    0x10(%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%rbx
movslq (%rsp),%rax
cmp    %rax,%rbx
jl     1230 <main+0xc0>
movl   $0x0,0xc(%rsp)
movl   $0xffffffff,0x8(%rsp)
ff
cmp    $0xa,%eax
jne    1280 <main+0x110>
jmp    13b0 <main+0x240>
movl   $0x0,0xc(%rsp)
movl   $0xffffffff,0x8(%rsp)
ff
cs nopw 0x0(%rax,%rax,1)
nop
lea    0xdc9(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd91(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <scanf@plt>
lea    0xdc4(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    0x8(%rsp),%ecx
test   %ecx,%ecx
jle    12f0 <main+0x180>
cmp    (%rsp),%ecx
jl     1309 <main+0x199>
lea    0xe10(%rip),%rdi
call   1040 <puts@plt>
mov    (%rsp),%ecx
mov    %ecx,0x8(%rsp)
jmp    1309 <main+0x199>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0xe16(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,0x8(%rsp)
mov    $0x1,%ecx
mov    0xc(%rsp),%edx
lea    0x10(%rsp),%rdi
mov    %rsp,%rsi
call   1090 <insertelement@plt>
lea    0xdb0(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x0,(%rsp)
jle    135b <main+0x1eb>
lea    0xcf2(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x10(%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%rbx
movslq (%rsp),%rax
cmp    %rax,%rbx
jl     1340 <main+0x1d0>
mov    0x2c86(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
lea    0xd13(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd24(%rip),%rdi
lea    0x7(%rsp),%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    0x7(%rsp),%al
and    $0xdf,%al
cmp    $0x59,%al
jne    13be <main+0x24e>
mov    (%rsp),%eax
movl   $0x0,0xc(%rsp)
movl   $0xffffffff,0x8(%rsp)
ff
cmp    $0xa,%eax
jne    1280 <main+0x110>
lea    0xc72(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xcd6(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
@.str.1 = [33 x i8] c"\0AEnter the number of elemenets: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [19 x i8] c"\0AEnter the array:\0A\00"
@.str.4 = [21 x i8] c"\0AEntered array is: \0A\00"
@.str.5 = [4 x i8] c" %d\00"
@.str.6 = [39 x i8] c"\0ANo More Space Left to Insert element.\00"
@.str.7 = [31 x i8] c"\0A\0AEnter an element to insert: \00"
@.str.8 = [20 x i8] c"\0AEnter a position: \00"
@.str.9 = [47 x i8] c"\0APosition is invalid!\0AInserting at beginning.\0A\00"
@.str.10 = [41 x i8] c"\0APosition is invalid!\0AInserting at end.\0A\00"
@.str.11 = [21 x i8] c"\0AChanged array is: \0A\00"
@stdin = global i32 0
@.str.12 = [31 x i8] c"\0A\0AWant to Insert more? (Y/N): \00"
@.str.13 = [3 x i8] c"%c\00"
@.str.14 = [2 x i8] c"\0A\00"
@.str.15 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = bitcast [10 x i32]* %2 to i8*
store i32 0, i32* %3
store i8 110, i8* %5
%9 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %4
br label %13
13: ; preds = %22, %0
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %25
17: ; preds = %13
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %19
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %20)
br label %22
22: ; preds = %17
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %13
25: ; preds = %13
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %4
br label %27
27: ; preds = %37, %25
%28 = load i32, i32* %4
%29 = load i32, i32* %3
%30 = icmp slt i32 %28, %29
br i1 %30, label %31, label %40
31: ; preds = %27
%32 = load i32, i32* %4
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %35)
br label %37
37: ; preds = %31
%38 = load i32, i32* %4
%39 = add nsw i32 %38, 1
store i32 %39, i32* %4
br label %27
40: ; preds = %27
br label %41
41: ; preds = %95, %40
store i32 0, i32* %6
store i32 -1, i32* %7
%42 = load i32, i32* %3
%43 = icmp eq i32 %42, 10
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0))
br label %97
46: ; preds = %41
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0))
%48 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %6)
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0))
%50 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %7)
%51 = load i32, i32* %7
%52 = icmp slt i32 %51, 1
br i1 %52, label %53, label %55
53: ; preds = %46
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.9, i64 0, i64 0))
store i32 1, i32* %7
br label %63
55: ; preds = %46
%56 = load i32, i32* %7
%57 = load i32, i32* %3
%58 = icmp sge i32 %56, %57
br i1 %58, label %59, label %62
59: ; preds = %55
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.10, i64 0, i64 0))
%61 = load i32, i32* %3
store i32 %61, i32* %7
br label %62
62: ; preds = %59, %55
br label %63
63: ; preds = %62, %53
%64 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%65 = load i32, i32* %6
%66 = load i32, i32* %7
%67 = call i32 @insertelement(i32* %64, i32* %3, i32 %65, i32 %66)
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0))
store i32 0, i32* %4
br label %69
69: ; preds = %79, %63
%70 = load i32, i32* %4
%71 = load i32, i32* %3
%72 = icmp slt i32 %70, %71
br i1 %72, label %73, label %82
73: ; preds = %69
%74 = load i32, i32* %4
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %75
%77 = load i32, i32* %76
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %77)
br label %79
79: ; preds = %73
%80 = load i32, i32* %4
%81 = add nsw i32 %80, 1
store i32 %81, i32* %4
br label %69
82: ; preds = %69
%83 = load i32, i32* @stdin
%84 = call i32 @fflush(i32 %83)
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.12, i64 0, i64 0))
%86 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* %5)
br label %87
87: ; preds = %82
%88 = load i8, i8* %5
%89 = sext i8 %88 to i32
%90 = icmp eq i32 %89, 121
br i1 %90, label %95, label %91
91: ; preds = %87
%92 = load i8, i8* %5
%93 = sext i8 %92 to i32
%94 = icmp eq i32 %93, 89
br label %95
95: ; preds = %91, %87
%96 = phi i1 [ true, %87 ], [ %94, %91 ]
br i1 %96, label %41, label %97
97: ; preds = %95, %44
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%99 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@.str.1 = [33 x i8] c"\0AEnter the number of elemenets: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.5 = [4 x i8] c" %d\00"
@.str.6 = [39 x i8] c"\0ANo More Space Left to Insert element.\00"
@.str.7 = [31 x i8] c"\0A\0AEnter an element to insert: \00"
@.str.8 = [20 x i8] c"\0AEnter a position: \00"
@stdin = global i32 0
@.str.12 = [31 x i8] c"\0A\0AWant to Insert more? (Y/N): \00"
@.str.13 = [3 x i8] c"%c\00"
@.str.15 = [6 x i8] c"pause\00"
@str = [18 x i8] c"\0AEnter the array:\00"
@str.16 = [20 x i8] c"\0AEntered array is: \00"
@str.17 = [20 x i8] c"\0AChanged array is: \00"
@str.18 = [40 x i8] c"\0APosition is invalid!\0AInserting at end.\00"
@str.19 = [46 x i8] c"\0APosition is invalid!\0AInserting at beginning.\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
%6 = bitcast [10 x i32]* %1 to i8*
%7 = bitcast i32* %2 to i8*
store i32 0, i32* %2
store i8 110, i8* %3
%8 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %22
14: ; preds = %0, %14
%15 = phi i64 [ %18, %14 ], [ 0, %0 ]
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %15
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %16)
%18 = add nuw nsw i64 %15, 1
%19 = load i32, i32* %2
%20 = sext i32 %19 to i64
%21 = icmp slt i64 %18, %20
br i1 %21, label %14, label %22
22: ; preds = %14, %0
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.16, i64 0, i64 0))
%24 = load i32, i32* %2
%25 = icmp sgt i32 %24, 0
br i1 %25, label %37, label %26
26: ; preds = %22
%27 = bitcast i32* %4 to i8*
%28 = bitcast i32* %5 to i8*
store i32 0, i32* %4
store i32 -1, i32* %5
br label %33
29: ; preds = %37
%30 = bitcast i32* %4 to i8*
%31 = bitcast i32* %5 to i8*
store i32 0, i32* %4
store i32 -1, i32* %5
%32 = icmp eq i32 %43, 10
br i1 %32, label %80, label %33
33: ; preds = %26, %29
%34 = bitcast i32* %4 to i8*
%35 = bitcast i32* %5 to i8*
%36 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
br label %49
37: ; preds = %22, %37
%38 = phi i64 [ %42, %37 ], [ 0, %22 ]
%39 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %38
%40 = load i32, i32* %39
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %40)
%42 = add nuw nsw i64 %38, 1
%43 = load i32, i32* %2
%44 = sext i32 %43 to i64
%45 = icmp slt i64 %42, %44
br i1 %45, label %37, label %29
46: ; preds = %84
%47 = load i32, i32* %2
store i32 0, i32* %4
store i32 -1, i32* %5
%48 = icmp eq i32 %47, 10
br i1 %48, label %80, label %49
49: ; preds = %33, %46
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0))
%51 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0))
%53 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%54 = load i32, i32* %5
%55 = icmp slt i32 %54, 1
br i1 %55, label %56, label %58
56: ; preds = %49
%57 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.19, i64 0, i64 0))
store i32 1, i32* %5
br label %64
58: ; preds = %49
%59 = load i32, i32* %2
%60 = icmp slt i32 %54, %59
br i1 %60, label %64, label %61
61: ; preds = %58
%62 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.18, i64 0, i64 0))
%63 = load i32, i32* %2
store i32 %63, i32* %5
br label %64
64: ; preds = %58, %61, %56
%65 = phi i32 [ %54, %58 ], [ %63, %61 ], [ 1, %56 ]
%66 = load i32, i32* %4
%67 = call i32 @insertelement(i32* %36, i32* %2, i32 %66, i32 %65)
%68 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.17, i64 0, i64 0))
%69 = load i32, i32* %2
%70 = icmp sgt i32 %69, 0
br i1 %70, label %71, label %84
71: ; preds = %64, %71
%72 = phi i64 [ %76, %71 ], [ 0, %64 ]
%73 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %72
%74 = load i32, i32* %73
%75 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %74)
%76 = add nuw nsw i64 %72, 1
%77 = load i32, i32* %2
%78 = sext i32 %77 to i64
%79 = icmp slt i64 %76, %78
br i1 %79, label %71, label %84
80: ; preds = %46, %29
%81 = bitcast i32* %4 to i8*
%82 = bitcast i32* %5 to i8*
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0))
br label %92
84: ; preds = %71, %64
%85 = load i32, i32* @stdin
%86 = call i32 @fflush(i32 %85)
%87 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.12, i64 0, i64 0))
%88 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* %3)
%89 = load i8, i8* %3
%90 = and i8 %89, -33
%91 = icmp eq i8 %90, 89
br i1 %91, label %46, label %92
92: ; preds = %84, %80
%93 = call i32 @putchar(i32 10)
%94 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
ret i32 0
}