#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*/ exit(int);
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int *realloc(int *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int i;
  printf("\nDigite a quantidade de numeros que serao digitados: ");
  scanf("%d", &i);
  int *p = malloc(i * sizeof(int));
  if (p == NULL) {
    printf("\nERRO.MEMORIA INSUFICIENTE");
    exit(1);
  }
  for (int k = 0; k < i; k++) {
    printf("\nDigite o % do valor do vetor: ", k + 1);
    scanf("%d", &p[k]);
  }
  printf("\n\n========== VETOR PREENCHIDO ==========\n");
  for (int k = 0; k < i; k++)
    printf("%d\t", p[k]);
  printf("\n\nSeu vetor possui %d elementos.", i);
  printf("\nDigite um valor positivo para aumentar ao vetor.");
  printf("\nDigite um valor negativo para diminuir do vetor.\n\n");
  int n;
  scanf("%d", &n);
  if (!(i + n)) {
    printf("\nSeu vetor possui 0 elementos.\n\n");
    exit(1);
  } else if ((i + n) < 0) {
    printf("\nSeu vetor possui quantidade negativa de elemento.\n\nIMPOSSIVEL "
           "ALOCAR MEMORIA.\n\n");
    exit(1);
  }
  p = realloc(p, (i + n) * sizeof(int));
  if (p == NULL) {
    printf("\nERRO DE RE-ALOCACAO.MEMORIA INSUFICIENTE");
    exit(1);
  }
  for (int k = i; k < (n + i); k++) {
    printf("\nDigite o % do valor do vetor: ", k + 1);
    scanf("%d", &p[k]);
  }
  printf("\n\n========== VETOR PREENCHIDO REALOCADO ==========\n");
  for (int k = 0; k < (n + i); k++) {
    printf("%d\t", p[k]);
  }
  free(p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11c3 <main+0x63>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1213 <main+0xb3>
mov    -0x14(%rbp),%esi
add    $0x1,%esi
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe36(%rip),%rdi
call   1070 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ca <main+0x6a>
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    125b <main+0xfb>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1228 <main+0xc8>
mov    -0x8(%rbp),%esi
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xda7(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0x1c(%rbp),%eax
cmp    $0x0,%eax
jne    12bf <main+0x15f>
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x8(%rbp),%eax
add    -0x1c(%rbp),%eax
cmp    $0x0,%eax
jge    12e6 <main+0x186>
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
jmp    12eb <main+0x18b>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%eax
add    -0x1c(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%esi
call   1060 <realloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1329 <main+0x1c9>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x1c(%rbp),%ecx
add    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    137d <main+0x21d>
mov    -0x20(%rbp),%esi
add    $0x1,%esi
lea    0xd07(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rsi
movslq -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xccc(%rip),%rdi
call   1070 <scanf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    132f <main+0x1cf>
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x1c(%rbp),%ecx
add    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jge    13ca <main+0x26a>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xce9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1392 <main+0x232>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xe7e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xea6(%rip),%rdi
mov    %rsp,%rsi
call   1080 <scanf@plt>
mov    (%rsp),%ebx
lea    0x0(,%rbx,4),%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     135c <main+0x1ec>
mov    %rax,%r14
test   %ebx,%ebx
jle    11f8 <main+0x88>
lea    0xe96(%rip),%r15
lea    0xe71(%rip),%r12
mov    %r14,%rbp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %rbp,%rsi
call   1080 <scanf@plt>
movslq (%rsp),%rax
add    $0x4,%rbp
cmp    %rax,%rbx
jl     11d0 <main+0x60>
lea    0xef6(%rip),%rdi
call   1040 <puts@plt>
mov    (%rsp),%esi
test   %esi,%esi
jle    123b <main+0xcb>
lea    0xe62(%rip),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r14,%rbp,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
movslq (%rsp),%rsi
cmp    %rsi,%rbp
jl     1220 <main+0xb0>
lea    0xe36(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe49(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec0(%rip),%rdi
call   1040 <puts@plt>
lea    0xdcc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1080 <scanf@plt>
mov    0x4(%rsp),%esi
add    (%rsp),%esi
je     1365 <main+0x1f5>
js     136e <main+0x1fe>
shl    $0x2,%esi
mov    %r14,%rdi
call   1070 <realloc@plt>
test   %rax,%rax
je     1384 <main+0x214>
mov    %rax,%r14
cmpl   $0x0,0x4(%rsp)
jle    12f3 <main+0x183>
movslq (%rsp),%r13
lea    (%r14,%r13,4),%rbx
lea    0x1(%r13),%ebp
lea    0xd9c(%rip),%r15
lea    0xd77(%rip),%r12
nop
add    $0x1,%r13
mov    %r15,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1080 <scanf@plt>
movslq 0x4(%rsp),%rax
movslq (%rsp),%rcx
add    %rax,%rcx
add    $0x4,%rbx
add    $0x1,%ebp
cmp    %rcx,%r13
jl     12c0 <main+0x150>
lea    0xe77(%rip),%rdi
call   1040 <puts@plt>
mov    (%rsp),%eax
add    0x4(%rsp),%eax
jle    1343 <main+0x1d3>
lea    0xd65(%rip),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbp,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
movslq 0x4(%rsp),%rax
movslq (%rsp),%rcx
add    %rax,%rcx
cmp    %rcx,%rbp
jl     1320 <main+0x1b0>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcd6(%rip),%rdi
jmp    138b <main+0x21b>
lea    0xde5(%rip),%rdi
jmp    1375 <main+0x205>
lea    0xe2f(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
lea    0xd40(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"\0ADigite a quantidade de numeros que serao digitados: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"\0AERRO.MEMORIA INSUFICIENTE\00"
@.str.3 = [32 x i8] c"\0ADigite o % do valor do vetor: \00"
@.str.4 = [42 x i8] c"\0A\0A========== VETOR PREENCHIDO ==========\0A\00"
@.str.5 = [4 x i8] c"%d\09\00"
@.str.6 = [33 x i8] c"\0A\0ASeu vetor possui %d elementos.\00"
@.str.7 = [50 x i8] c"\0ADigite um valor positivo para aumentar ao vetor.\00"
@.str.8 = [52 x i8] c"\0ADigite um valor negativo para diminuir do vetor.\0A\0A\00"
@.str.9 = [33 x i8] c"\0ASeu vetor possui 0 elementos.\0A\0A\00"
@.str.10 = [81 x i8] c"\0ASeu vetor possui quantidade negativa de elemento.\0A\0AIMPOSSIVEL ALOCAR MEMORIA.\0A\0A\00"
@.str.11 = [42 x i8] c"\0AERRO DE RE-ALOCACAO.MEMORIA INSUFICIENTE\00"
@.str.12 = [52 x i8] c"\0A\0A========== VETOR PREENCHIDO REALOCADO ==========\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 4
%14 = trunc i64 %13 to i32
%15 = call i32* @malloc(i32 %14)
store i32* %15, i32** %3
%16 = load i32*, i32** %3
%17 = icmp eq i32* %16, null
br i1 %17, label %18, label %21
18: ; preds = %0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %0
store i32 0, i32* %4
br label %22
22: ; preds = %35, %21
%23 = load i32, i32* %4
%24 = load i32, i32* %2
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %38
26: ; preds = %22
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %28)
%30 = load i32*, i32** %3
%31 = load i32, i32* %4
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %30, i64 %32
%34 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %33)
br label %35
35: ; preds = %26
%36 = load i32, i32* %4
%37 = add nsw i32 %36, 1
store i32 %37, i32* %4
br label %22
38: ; preds = %22
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %5
br label %40
40: ; preds = %51, %38
%41 = load i32, i32* %5
%42 = load i32, i32* %2
%43 = icmp slt i32 %41, %42
br i1 %43, label %44, label %54
44: ; preds = %40
%45 = load i32*, i32** %3
%46 = load i32, i32* %5
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i32, i32* %45, i64 %47
%49 = load i32, i32* %48
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %49)
br label %51
51: ; preds = %44
%52 = load i32, i32* %5
%53 = add nsw i32 %52, 1
store i32 %53, i32* %5
br label %40
54: ; preds = %40
%55 = load i32, i32* %2
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i32 %55)
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0))
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.8, i64 0, i64 0))
%59 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%60 = load i32, i32* %2
%61 = load i32, i32* %6
%62 = add nsw i32 %60, %61
%63 = icmp ne i32 %62, 0
br i1 %63, label %67, label %64
64: ; preds = %54
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0))
%66 = call i32 @exit(i32 1)
unreachable
67: ; preds = %54
%68 = load i32, i32* %2
%69 = load i32, i32* %6
%70 = add nsw i32 %68, %69
%71 = icmp slt i32 %70, 0
br i1 %71, label %72, label %75
72: ; preds = %67
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.10, i64 0, i64 0))
%74 = call i32 @exit(i32 1)
unreachable
75: ; preds = %67
br label %76
76: ; preds = %75
%77 = load i32*, i32** %3
%78 = load i32, i32* %2
%79 = load i32, i32* %6
%80 = add nsw i32 %78, %79
%81 = sext i32 %80 to i64
%82 = mul i64 %81, 4
%83 = trunc i64 %82 to i32
%84 = call i32* @realloc(i32* %77, i32 %83)
store i32* %84, i32** %3
%85 = load i32*, i32** %3
%86 = icmp eq i32* %85, null
br i1 %86, label %87, label %90
87: ; preds = %76
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.11, i64 0, i64 0))
%89 = call i32 @exit(i32 1)
unreachable
90: ; preds = %76
%91 = load i32, i32* %2
store i32 %91, i32* %7
br label %92
92: ; preds = %107, %90
%93 = load i32, i32* %7
%94 = load i32, i32* %6
%95 = load i32, i32* %2
%96 = add nsw i32 %94, %95
%97 = icmp slt i32 %93, %96
br i1 %97, label %98, label %110
98: ; preds = %92
%99 = load i32, i32* %7
%100 = add nsw i32 %99, 1
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %100)
%102 = load i32*, i32** %3
%103 = load i32, i32* %7
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds i32, i32* %102, i64 %104
%106 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %105)
br label %107
107: ; preds = %98
%108 = load i32, i32* %7
%109 = add nsw i32 %108, 1
store i32 %109, i32* %7
br label %92
110: ; preds = %92
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.12, i64 0, i64 0))
store i32 0, i32* %8
br label %112
112: ; preds = %125, %110
%113 = load i32, i32* %8
%114 = load i32, i32* %6
%115 = load i32, i32* %2
%116 = add nsw i32 %114, %115
%117 = icmp slt i32 %113, %116
br i1 %117, label %118, label %128
118: ; preds = %112
%119 = load i32*, i32** %3
%120 = load i32, i32* %8
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds i32, i32* %119, i64 %121
%123 = load i32, i32* %122
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %123)
br label %125
125: ; preds = %118
%126 = load i32, i32* %8
%127 = add nsw i32 %126, 1
store i32 %127, i32* %8
br label %112
128: ; preds = %112
%129 = load i32*, i32** %3
%130 = call i32 @free(i32* %129)
%131 = load i32, i32* %1
ret i32 %131
}

LLVM IR (-O2):
@.str = [54 x i8] c"\0ADigite a quantidade de numeros que serao digitados: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"\0AERRO.MEMORIA INSUFICIENTE\00"
@.str.3 = [32 x i8] c"\0ADigite o % do valor do vetor: \00"
@.str.5 = [4 x i8] c"%d\09\00"
@.str.6 = [33 x i8] c"\0A\0ASeu vetor possui %d elementos.\00"
@.str.7 = [50 x i8] c"\0ADigite um valor positivo para aumentar ao vetor.\00"
@.str.11 = [42 x i8] c"\0AERRO DE RE-ALOCACAO.MEMORIA INSUFICIENTE\00"
@str = [41 x i8] c"\0A\0A========== VETOR PREENCHIDO ==========\00"
@str.13 = [51 x i8] c"\0ADigite um valor negativo para diminuir do vetor.\0A\00"
@str.14 = [32 x i8] c"\0ASeu vetor possui 0 elementos.\0A\00"
@str.15 = [51 x i8] c"\0A\0A========== VETOR PREENCHIDO REALOCADO ==========\00"
@str.16 = [80 x i8] c"\0ASeu vetor possui quantidade negativa de elemento.\0A\0AIMPOSSIVEL ALOCAR MEMORIA.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = shl i32 %6, 2
%8 = call i32* @malloc(i32 %7)
%9 = icmp eq i32* %8, null
br i1 %9, label %12, label %10
10: ; preds = %0
%11 = icmp sgt i32 %6, 0
br i1 %11, label %19, label %15
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %19, %10
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%17 = load i32, i32* %1
%18 = icmp sgt i32 %17, 0
br i1 %18, label %40, label %29
19: ; preds = %10, %19
%20 = phi i64 [ %21, %19 ], [ 0, %10 ]
%21 = add nuw nsw i64 %20, 1
%22 = trunc i64 %21 to i32
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %22)
%24 = getelementptr inbounds i32, i32* %8, i64 %20
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %24)
%26 = load i32, i32* %1
%27 = sext i32 %26 to i64
%28 = icmp slt i64 %21, %27
br i1 %28, label %19, label %15
29: ; preds = %40, %15
%30 = phi i32 [ %17, %15 ], [ %46, %40 ]
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0), i32 %30)
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0))
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.13, i64 0, i64 0))
%34 = bitcast i32* %2 to i8*
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%36 = load i32, i32* %1
%37 = load i32, i32* %2
%38 = add nsw i32 %37, %36
%39 = icmp eq i32 %38, 0
br i1 %39, label %49, label %52
40: ; preds = %15, %40
%41 = phi i64 [ %45, %40 ], [ 0, %15 ]
%42 = getelementptr inbounds i32, i32* %8, i64 %41
%43 = load i32, i32* %42
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %43)
%45 = add nuw nsw i64 %41, 1
%46 = load i32, i32* %1
%47 = sext i32 %46 to i64
%48 = icmp slt i64 %45, %47
br i1 %48, label %40, label %29
49: ; preds = %29
%50 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.14, i64 0, i64 0))
%51 = call i32 @exit(i32 1)
unreachable
52: ; preds = %29
%53 = icmp slt i32 %38, 0
br i1 %53, label %54, label %57
54: ; preds = %52
%55 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str.16, i64 0, i64 0))
%56 = call i32 @exit(i32 1)
unreachable
57: ; preds = %52
%58 = shl i32 %38, 2
%59 = call i32* @realloc(i32* %8, i32 %58)
%60 = icmp eq i32* %59, null
br i1 %60, label %61, label %64
61: ; preds = %57
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.11, i64 0, i64 0))
%63 = call i32 @exit(i32 1)
unreachable
64: ; preds = %57
%65 = load i32, i32* %2
%66 = icmp sgt i32 %65, 0
br i1 %66, label %67, label %70
67: ; preds = %64
%68 = load i32, i32* %1
%69 = sext i32 %68 to i64
br label %76
70: ; preds = %76, %64
%71 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.15, i64 0, i64 0))
%72 = load i32, i32* %2
%73 = load i32, i32* %1
%74 = add nsw i32 %73, %72
%75 = icmp sgt i32 %74, 0
br i1 %75, label %90, label %88
76: ; preds = %67, %76
%77 = phi i64 [ %69, %67 ], [ %78, %76 ]
%78 = add nsw i64 %77, 1
%79 = trunc i64 %78 to i32
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %79)
%81 = getelementptr inbounds i32, i32* %59, i64 %77
%82 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %81)
%83 = load i32, i32* %2
%84 = load i32, i32* %1
%85 = add nsw i32 %84, %83
%86 = sext i32 %85 to i64
%87 = icmp slt i64 %78, %86
br i1 %87, label %76, label %70
88: ; preds = %90, %70
%89 = call i32 @free(i32* %59)
ret i32 0
90: ; preds = %70, %90
%91 = phi i64 [ %95, %90 ], [ 0, %70 ]
%92 = getelementptr inbounds i32, i32* %59, i64 %91
%93 = load i32, i32* %92
%94 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %93)
%95 = add nuw nsw i64 %91, 1
%96 = load i32, i32* %2
%97 = load i32, i32* %1
%98 = add nsw i32 %97, %96
%99 = sext i32 %98 to i64
%100 = icmp slt i64 %95, %99
br i1 %100, label %90, label %88
}