#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 argc, const char *argv[]) {
  int i, tablica[50], num;
  printf("\nEnter numbers of elements in array :");
  scanf("%d", &num);
  printf("\nEnter the values :");
  for (i = 0; i < num; i++) {
    scanf("%d", &tablica[i]);
  }
  for (i = 0; i < num; i++) {
    printf("\n [%d] = %d \n", i, tablica[i]);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0xe4(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xe4(%rbp),%eax
jge    11aa <main+0x8a>
movslq -0x14(%rbp),%rax
lea    -0xe0(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe8f(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116f <main+0x4f>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xe4(%rbp),%eax
jge    11ea <main+0xca>
mov    -0x14(%rbp),%esi
movslq -0x14(%rbp),%rax
mov    -0xe0(%rbp,%rax,4),%edx
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11b1 <main+0x91>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0xe0,%rsp
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xed7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11be <main+0x9e>
lea    0x10(%rsp),%r15
xor    %ebx,%ebx
lea    0xeb8(%rip),%r14
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
add    $0x4,%r15
cmp    %rax,%rbx
jl     1170 <main+0x50>
test   %eax,%eax
jle    11be <main+0x9e>
lea    0xea5(%rip),%r14
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    0x10(%rsp,%rbx,4),%edx
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
cmp    %rax,%rbx
jl     11a0 <main+0x80>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [38 x i8] c"\0AEnter numbers of elements in array :\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"\0AEnter the values :\00"
@.str.3 = [14 x i8] c"\0A [%d] = %d \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [50 x i32]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 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* %8)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %6
br label %12
12: ; preds = %21, %2
%13 = load i32, i32* %6
%14 = load i32, i32* %8
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %24
16: ; preds = %12
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [50 x i32], [50 x i32]* %7, i64 0, i64 %18
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %19)
br label %21
21: ; preds = %16
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
br label %12
24: ; preds = %12
store i32 0, i32* %6
br label %25
25: ; preds = %36, %24
%26 = load i32, i32* %6
%27 = load i32, i32* %8
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %39
29: ; preds = %25
%30 = load i32, i32* %6
%31 = load i32, i32* %6
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [50 x i32], [50 x i32]* %7, i64 0, i64 %32
%34 = load i32, i32* %33
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %30, i32 %34)
br label %36
36: ; preds = %29
%37 = load i32, i32* %6
%38 = add nsw i32 %37, 1
store i32 %38, i32* %6
br label %25
39: ; preds = %25
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"\0AEnter numbers of elements in array :\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"\0AEnter the values :\00"
@.str.3 = [14 x i8] c"\0A [%d] = %d \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [50 x i32]
%4 = alloca i32
%5 = bitcast [50 x i32]* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 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* %4)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 0
br i1 %11, label %14, label %32
12: ; preds = %14
%13 = icmp sgt i32 %19, 0
br i1 %13, label %22, label %32
14: ; preds = %2, %14
%15 = phi i64 [ %18, %14 ], [ 0, %2 ]
%16 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 %15
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %16)
%18 = add nuw nsw i64 %15, 1
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = icmp slt i64 %18, %20
br i1 %21, label %14, label %12
22: ; preds = %12, %22
%23 = phi i64 [ %28, %22 ], [ 0, %12 ]
%24 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 %23
%25 = load i32, i32* %24
%26 = trunc i64 %23 to i32
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %26, i32 %25)
%28 = add nuw nsw i64 %23, 1
%29 = load i32, i32* %4
%30 = sext i32 %29 to i64
%31 = icmp slt i64 %28, %30
br i1 %31, label %22, label %32
32: ; preds = %22, %2, %12
ret i32 0
}