#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, int);
int main() {
  int tab[512], licznik, liczba = 128, index = 0;
  int *wskaznik = &liczba;
  for (licznik = 0; licznik <= 512; licznik++, index++) {
    tab[licznik] = *wskaznik;
    printf("%d ---> %d\n", index, tab[licznik]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x830,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x80,-0x818(%rbp)
movl   $0x0,-0x81c(%rbp)
lea    -0x818(%rbp),%rax
mov    %rax,-0x828(%rbp)
movl   $0x0,-0x814(%rbp)
cmpl   $0x200,-0x814(%rbp)
jg     11b8 <main+0xa8>
mov    -0x828(%rbp),%rax
mov    (%rax),%ecx
movslq -0x814(%rbp),%rax
mov    %ecx,-0x810(%rbp,%rax,4)
mov    -0x81c(%rbp),%esi
movslq -0x814(%rbp),%rax
mov    -0x810(%rbp,%rax,4),%edx
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
mov    -0x814(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x814(%rbp)
mov    -0x81c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x81c(%rbp)
jmp    114e <main+0x3e>
xor    %eax,%eax
add    $0x830,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x80,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x201,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%d ---> %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [512 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 0, i32* %1
store i32 128, i32* %4
store i32 0, i32* %5
store i32* %4, i32** %6
store i32 0, i32* %3
br label %7
7: ; preds = %22, %0
%8 = load i32, i32* %3
%9 = icmp sle i32 %8, 512
br i1 %9, label %10, label %27
10: ; preds = %7
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [512 x i32], [512 x i32]* %2, i64 0, i64 %14
store i32 %12, i32* %15
%16 = load i32, i32* %5
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [512 x i32], [512 x i32]* %2, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %20)
br label %22
22: ; preds = %10
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %7
27: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%d ---> %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2, i32 128)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 513
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}