#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_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int *realloc(int *, int);
scalar_t__ scanf(char *, int *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv, char **envp) {
  int n, new_alloc, tmp = 0;
  int c;
  int *vettore;
  printf("Entry vector of integer's size [1-9]: ");
  if (scanf("%1d", &n) != 0) {
    vettore = malloc(n * sizeof(int));
  } else {
    fprintf(stderr, "Err. please entry an integer\n");
    exit(EXIT_FAILURE);
  }
  for (c = 0; c < n; c++) {
    printf("Entry '%d' element value: ", c + 1);
    scanf("%d", &vettore[c]);
  }
  for (c = n - 1; c >= 0; c--) {
    printf("vector[%d] = %d\n", c + 1, vettore[c]);
  }
  printf("\nRealloc\n"
         " -> Entry new size: ");
  if (scanf("%1d", &new_alloc) != 0) {
    if (new_alloc > 0) {
      tmp = n;
      n += new_alloc;
      vettore = realloc(vettore, (n * sizeof(int)));
    }
  } else {
    fprintf(stderr, "Err. please entry an integer\n");
    exit(EXIT_FAILURE);
  }
  printf("\n  Originary vector: \"%2d\" elements\n", n);
  printf("Reallocated vector: \"%2d\" elements\n", n + new_alloc);
  printf("\nInit new vector elements\n");
  for (c = tmp; c < n; c++) {
    printf("Entry '%d elemen value: ", (tmp++) + 1);
    scanf("%d", &vettore[c]);
  }
  printf("\n");
  for (c = n - 1; c >= 0; --c) {
    printf("vector[%d] = %d\n", c + 1, vettore[c]);
  }
  free(vettore);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe81(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1080 <scanf@plt>
cmp    $0x0,%rax
je     11d1 <main+0x61>
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x30(%rbp)
jmp    11f4 <main+0x84>
mov    0x2e08(%rip),%rax
mov    (%rax),%edi
lea    0xe4a(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2deb(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1244 <main+0xd4>
mov    -0x28(%rbp),%esi
add    $0x1,%esi
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rsi
movslq -0x28(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe33(%rip),%rdi
call   1080 <scanf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11fb <main+0x8b>
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jl     1284 <main+0x114>
mov    -0x28(%rbp),%esi
add    $0x1,%esi
mov    -0x30(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x28(%rbp)
jmp    124d <main+0xdd>
lea    0xded(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd8e(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1080 <scanf@plt>
cmp    $0x0,%rax
je     12e1 <main+0x171>
cmpl   $0x0,-0x20(%rbp)
jle    12dc <main+0x16c>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x30(%rbp),%rdi
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%esi
call   1070 <realloc@plt>
mov    %rax,-0x30(%rbp)
jmp    1304 <main+0x194>
mov    0x2cf8(%rip),%rax
mov    (%rax),%edi
lea    0xd3a(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2cdb(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
mov    -0x1c(%rbp),%esi
lea    0xd88(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%esi
add    -0x20(%rbp),%esi
lea    0xd99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdaf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    138e <main+0x21e>
mov    -0x24(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
add    $0x1,%esi
lea    0xd9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rsi
movslq -0x28(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xce9(%rip),%rdi
call   1080 <scanf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    133d <main+0x1cd>
lea    0xce1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jl     13dc <main+0x26c>
mov    -0x28(%rbp),%esi
add    $0x1,%esi
mov    -0x30(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xca0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x28(%rbp)
jmp    13a5 <main+0x235>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    0x2be4(%rip),%rax
mov    (%rax),%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    0xe5e(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe77(%rip),%rdi
mov    %rsp,%rsi
call   10a0 <scanf@plt>
test   %rax,%rax
je     137f <main+0x1ef>
mov    (%rsp),%ebx
lea    0x0(,%rbx,4),%edi
call   1080 <malloc@plt>
mov    %rax,%r14
test   %ebx,%ebx
jle    124f <main+0xbf>
lea    0xe6b(%rip),%r15
lea    0xe7f(%rip),%r12
mov    %r14,%rbx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbp
mov    %r15,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   10a0 <scanf@plt>
movslq (%rsp),%rax
add    $0x4,%rbx
cmp    %rax,%rbp
jl     11f0 <main+0x60>
mov    %eax,%ebx
test   %ebx,%ebx
jle    124f <main+0xbf>
lea    0xe42(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0x1(%rbx),%rbp
mov    %ebp,%eax
mov    (%r14,%rax,4),%edx
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0x1,%rbx
mov    %rbp,%rbx
ja     1230 <main+0xa0>
lea    0xe22(%rip),%rdi
xor    %r13d,%r13d
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xdc0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   10a0 <scanf@plt>
test   %rax,%rax
je     137f <main+0x1ef>
mov    0x4(%rsp),%esi
test   %esi,%esi
jle    129a <main+0x10a>
mov    (%rsp),%r13d
add    %r13d,%esi
mov    %esi,(%rsp)
shl    $0x2,%esi
mov    %r14,%rdi
call   1090 <realloc@plt>
mov    %rax,%r14
mov    (%rsp),%esi
lea    0xdf2(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x4(%rsp),%esi
add    (%rsp),%esi
lea    0xe02(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe31(%rip),%rdi
call   1050 <puts@plt>
cmp    (%rsp),%r13d
jge    131d <main+0x18d>
movslq %r13d,%rbp
lea    (%r14,%rbp,4),%rbx
add    $0x1,%r13d
lea    0xdfb(%rip),%r15
lea    0xd79(%rip),%r12
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbp
mov    %r15,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   10a0 <scanf@plt>
movslq (%rsp),%rax
add    $0x4,%rbx
add    $0x1,%r13d
cmp    %rax,%rbp
jl     12f0 <main+0x160>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    (%rsp),%ebx
test   %ebx,%ebx
jle    135f <main+0x1cf>
lea    0xd32(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0x1(%rbx),%rbp
mov    %ebp,%eax
mov    (%r14,%rax,4),%edx
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0x1,%rbx
mov    %rbp,%rbx
ja     1340 <main+0x1b0>
mov    %r14,%rdi
call   1030 <free@plt>
mov    0x2c62(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c5a(%rip),%rax
mov    (%rax),%edi
lea    0xc9c(%rip),%rsi
call   1070 <fprintf@plt>
mov    0x2c3d(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Entry vector of integer's size [1-9]: \00"
@.str.1 = [4 x i8] c"%1d\00"
@stderr = global i32 0
@.str.2 = [30 x i8] c"Err. please entry an integer\0A\00"
@EXIT_FAILURE = global i32 0
@.str.3 = [27 x i8] c"Entry '%d' element value: \00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [17 x i8] c"vector[%d] = %d\0A\00"
@.str.6 = [30 x i8] c"\0ARealloc\0A -> Entry new size: \00"
@.str.7 = [37 x i8] c"\0A Originary vector: \22%2d\22 elements\0A\00"
@.str.8 = [36 x i8] c"Reallocated vector: \22%2d\22 elements\0A\00"
@.str.9 = [27 x i8] c"\0AInit new vector elements\0A\00"
@.str.10 = [25 x i8] c"Entry '%d elemen value: \00"
@.str.11 = [2 x i8] c"\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store i32 0, i32* %10
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%14 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %3
%17 = load i32, i32* %8
%18 = sext i32 %17 to i64
%19 = mul i64 %18, 4
%20 = trunc i64 %19 to i32
%21 = call i32* @malloc(i32 %20)
store i32* %21, i32** %12
br label %27
22: ; preds = %3
%23 = load i32, i32* @stderr
%24 = call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%25 = load i32, i32* @EXIT_FAILURE
%26 = call i32 @exit(i32 %25)
unreachable
27: ; preds = %16
store i32 0, i32* %11
br label %28
28: ; preds = %41, %27
%29 = load i32, i32* %11
%30 = load i32, i32* %8
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %44
32: ; preds = %28
%33 = load i32, i32* %11
%34 = add nsw i32 %33, 1
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %34)
%36 = load i32*, i32** %12
%37 = load i32, i32* %11
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i32, i32* %36, i64 %38
%40 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %39)
br label %41
41: ; preds = %32
%42 = load i32, i32* %11
%43 = add nsw i32 %42, 1
store i32 %43, i32* %11
br label %28
44: ; preds = %28
%45 = load i32, i32* %8
%46 = sub nsw i32 %45, 1
store i32 %46, i32* %11
br label %47
47: ; preds = %59, %44
%48 = load i32, i32* %11
%49 = icmp sge i32 %48, 0
br i1 %49, label %50, label %62
50: ; preds = %47
%51 = load i32, i32* %11
%52 = add nsw i32 %51, 1
%53 = load i32*, i32** %12
%54 = load i32, i32* %11
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i32, i32* %53, i64 %55
%57 = load i32, i32* %56
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 %52, i32 %57)
br label %59
59: ; preds = %50
%60 = load i32, i32* %11
%61 = add nsw i32 %60, -1
store i32 %61, i32* %11
br label %47
62: ; preds = %47
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
%64 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%65 = icmp ne i64 %64, 0
br i1 %65, label %66, label %81
66: ; preds = %62
%67 = load i32, i32* %9
%68 = icmp sgt i32 %67, 0
br i1 %68, label %69, label %80
69: ; preds = %66
%70 = load i32, i32* %8
store i32 %70, i32* %10
%71 = load i32, i32* %9
%72 = load i32, i32* %8
%73 = add nsw i32 %72, %71
store i32 %73, i32* %8
%74 = load i32*, i32** %12
%75 = load i32, i32* %8
%76 = sext i32 %75 to i64
%77 = mul i64 %76, 4
%78 = trunc i64 %77 to i32
%79 = call i32* @realloc(i32* %74, i32 %78)
store i32* %79, i32** %12
br label %80
80: ; preds = %69, %66
br label %86
81: ; preds = %62
%82 = load i32, i32* @stderr
%83 = call i32 @fprintf(i32 %82, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%84 = load i32, i32* @EXIT_FAILURE
%85 = call i32 @exit(i32 %84)
unreachable
86: ; preds = %80
%87 = load i32, i32* %8
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i32 %87)
%89 = load i32, i32* %8
%90 = load i32, i32* %9
%91 = add nsw i32 %89, %90
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0), i32 %91)
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
%94 = load i32, i32* %10
store i32 %94, i32* %11
br label %95
95: ; preds = %109, %86
%96 = load i32, i32* %11
%97 = load i32, i32* %8
%98 = icmp slt i32 %96, %97
br i1 %98, label %99, label %112
99: ; preds = %95
%100 = load i32, i32* %10
%101 = add nsw i32 %100, 1
store i32 %101, i32* %10
%102 = add nsw i32 %100, 1
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i32 %102)
%104 = load i32*, i32** %12
%105 = load i32, i32* %11
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds i32, i32* %104, i64 %106
%108 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %107)
br label %109
109: ; preds = %99
%110 = load i32, i32* %11
%111 = add nsw i32 %110, 1
store i32 %111, i32* %11
br label %95
112: ; preds = %95
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%114 = load i32, i32* %8
%115 = sub nsw i32 %114, 1
store i32 %115, i32* %11
br label %116
116: ; preds = %128, %112
%117 = load i32, i32* %11
%118 = icmp sge i32 %117, 0
br i1 %118, label %119, label %131
119: ; preds = %116
%120 = load i32, i32* %11
%121 = add nsw i32 %120, 1
%122 = load i32*, i32** %12
%123 = load i32, i32* %11
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds i32, i32* %122, i64 %124
%126 = load i32, i32* %125
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 %121, i32 %126)
br label %128
128: ; preds = %119
%129 = load i32, i32* %11
%130 = add nsw i32 %129, -1
store i32 %130, i32* %11
br label %116
131: ; preds = %116
%132 = load i32*, i32** %12
%133 = call i32 @free(i32* %132)
%134 = load i32, i32* @EXIT_SUCCESS
ret i32 %134
}

LLVM IR (-O2):
@.str = [39 x i8] c"Entry vector of integer's size [1-9]: \00"
@.str.1 = [4 x i8] c"%1d\00"
@stderr = global i32 0
@.str.2 = [30 x i8] c"Err. please entry an integer\0A\00"
@EXIT_FAILURE = global i32 0
@.str.3 = [27 x i8] c"Entry '%d' element value: \00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [17 x i8] c"vector[%d] = %d\0A\00"
@.str.6 = [30 x i8] c"\0ARealloc\0A -> Entry new size: \00"
@.str.7 = [37 x i8] c"\0A Originary vector: \22%2d\22 elements\0A\00"
@.str.8 = [36 x i8] c"Reallocated vector: \22%2d\22 elements\0A\00"
@.str.10 = [25 x i8] c"Entry '%d elemen value: \00"
@EXIT_SUCCESS = global i32 0
@str = [26 x i8] c"\0AInit new vector elements\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %4 to i8*
%7 = bitcast i32* %5 to i8*
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%9 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%10 = icmp eq i64 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %3
%12 = load i32, i32* %4
%13 = shl i32 %12, 2
%14 = call i32* @malloc(i32 %13)
%15 = icmp sgt i32 %12, 0
br i1 %15, label %25, label %44
16: ; preds = %3
%17 = load i32, i32* @stderr
%18 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%19 = load i32, i32* @EXIT_FAILURE
%20 = call i32 @exit(i32 %19)
unreachable
21: ; preds = %25
%22 = icmp sgt i32 %32, 0
br i1 %22, label %23, label %44
23: ; preds = %21
%24 = zext i32 %32 to i64
br label %35
25: ; preds = %11, %25
%26 = phi i64 [ %27, %25 ], [ 0, %11 ]
%27 = add nuw nsw i64 %26, 1
%28 = trunc i64 %27 to i32
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %28)
%30 = getelementptr inbounds i32, i32* %14, i64 %26
%31 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %30)
%32 = load i32, i32* %4
%33 = sext i32 %32 to i64
%34 = icmp slt i64 %27, %33
br i1 %34, label %25, label %21
35: ; preds = %23, %35
%36 = phi i64 [ %24, %23 ], [ %37, %35 ]
%37 = add nsw i64 %36, -1
%38 = and i64 %37, 4294967295
%39 = getelementptr inbounds i32, i32* %14, i64 %38
%40 = load i32, i32* %39
%41 = trunc i64 %36 to i32
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 %41, i32 %40)
%43 = icmp ugt i64 %36, 1
br i1 %43, label %35, label %44
44: ; preds = %35, %11, %21
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
%46 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%47 = icmp eq i64 %46, 0
br i1 %47, label %56, label %48
48: ; preds = %44
%49 = load i32, i32* %5
%50 = icmp sgt i32 %49, 0
br i1 %50, label %51, label %61
51: ; preds = %48
%52 = load i32, i32* %4
%53 = add nsw i32 %52, %49
store i32 %53, i32* %4
%54 = shl i32 %53, 2
%55 = call i32* @realloc(i32* %14, i32 %54)
br label %61
56: ; preds = %44
%57 = load i32, i32* @stderr
%58 = call i32 @fprintf(i32 %57, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%59 = load i32, i32* @EXIT_FAILURE
%60 = call i32 @exit(i32 %59)
unreachable
61: ; preds = %48, %51
%62 = phi i32 [ %52, %51 ], [ 0, %48 ]
%63 = phi i32* [ %55, %51 ], [ %14, %48 ]
%64 = load i32, i32* %4
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0), i32 %64)
%66 = load i32, i32* %4
%67 = load i32, i32* %5
%68 = add nsw i32 %67, %66
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0), i32 %68)
%70 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%71 = load i32, i32* %4
%72 = icmp slt i32 %62, %71
br i1 %72, label %73, label %85
73: ; preds = %61
%74 = sext i32 %62 to i64
br label %75
75: ; preds = %73, %75
%76 = phi i64 [ %74, %73 ], [ %77, %75 ]
%77 = add nsw i64 %76, 1
%78 = trunc i64 %77 to i32
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0), i32 %78)
%80 = getelementptr inbounds i32, i32* %63, i64 %76
%81 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %80)
%82 = load i32, i32* %4
%83 = sext i32 %82 to i64
%84 = icmp slt i64 %77, %83
br i1 %84, label %75, label %85
85: ; preds = %75, %61
%86 = call i32 @putchar(i32 10)
%87 = load i32, i32* %4
%88 = icmp sgt i32 %87, 0
br i1 %88, label %89, label %100
89: ; preds = %85
%90 = zext i32 %87 to i64
br label %91
91: ; preds = %89, %91
%92 = phi i64 [ %90, %89 ], [ %93, %91 ]
%93 = add nsw i64 %92, -1
%94 = and i64 %93, 4294967295
%95 = getelementptr inbounds i32, i32* %63, i64 %94
%96 = load i32, i32* %95
%97 = trunc i64 %92 to i32
%98 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 %97, i32 %96)
%99 = icmp ugt i64 %92, 1
br i1 %99, label %91, label %100
100: ; preds = %91, %85
%101 = call i32 @free(i32* %63)
%102 = load i32, i32* @EXIT_SUCCESS
ret i32 %102
}