#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 tab[5], i;
  for (i = 0; i < 5; i++) {
    printf("podaj tab[%d]", i);
    scanf("%d", &tab[i]);
  }
  for (i = 0; i < 5; i++)
    printf("tab[%d]=%d\n", i, tab[i]);
  printf("\n");
  for (tab[i] = 0; i < 5; i++) {
    if (tab[i] % 2 == 0)
      printf("liczby parzyste to: tab[%d]=%d\n", i, tab[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    117a <main+0x5a>
mov    -0x24(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x24(%rbp),%rax
lea    -0x20(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xea7(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1136 <main+0x16>
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    11b2 <main+0x92>
mov    -0x24(%rbp),%esi
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edx
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1181 <main+0x61>
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x24(%rbp),%rax
movl   $0x0,-0x20(%rbp,%rax,4)
cmpl   $0x5,-0x24(%rbp)
jge    121b <main+0xfb>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1208 <main+0xe8>
mov    -0x24(%rbp),%esi
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edx
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    120d <main+0xed>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11cc <main+0xac>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xec2(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebd(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    (%rsp),%edx
lea    0xe3b(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%edx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%edx
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"podaj tab[%d]\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [12 x i8] c"tab[%d]=%d\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 1)
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 2)
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 3)
%13 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 3
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %13)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 4)
%16 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %16)
%18 = load i32, i32* %4
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 %18)
%20 = load i32, i32* %7
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 %20)
%22 = load i32, i32* %10
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 2, i32 %22)
%24 = load i32, i32* %13
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 3, i32 %24)
%26 = load i32, i32* %16
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 4, i32 %26)
%28 = call i32 @putchar(i32 10)
ret i32 0
}