#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(void) {
  int i, *p, a[512];
  i = 0;
  p = &a[0];
  for (i = 0; i < 512; i++) {
    *(p + i) = 128;
  }
  printf("Dla %d ostatnia wartosc to %d\n", *p, *(p + (512 - 1)));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x810(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x200,-0x8(%rbp)
jge    1165 <main+0x55>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movl   $0x80,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113b <main+0x2b>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x7fc(%rax),%edx
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x808,%rsp
xor    %eax,%eax
movaps 0xee0(%rip),%xmm0
movaps %xmm0,(%rsp,%rax,4)
movaps %xmm0,0x10(%rsp,%rax,4)
movaps %xmm0,0x20(%rsp,%rax,4)
movaps %xmm0,0x30(%rsp,%rax,4)
movaps %xmm0,0x40(%rsp,%rax,4)
movaps %xmm0,0x50(%rsp,%rax,4)
movaps %xmm0,0x60(%rsp,%rax,4)
movaps %xmm0,0x70(%rsp,%rax,4)
movaps %xmm0,0x80(%rsp,%rax,4)
movaps %xmm0,0x90(%rsp,%rax,4)
movaps %xmm0,0xa0(%rsp,%rax,4)
movaps %xmm0,0xb0(%rsp,%rax,4)
movaps %xmm0,0xc0(%rsp,%rax,4)
movaps %xmm0,0xd0(%rsp,%rax,4)
movaps %xmm0,0xe0(%rsp,%rax,4)
movaps %xmm0,0xf0(%rsp,%rax,4)
add    $0x40,%rax
cmp    $0x200,%rax
jne    1120 <main+0x10>
mov    (%rsp),%esi
mov    0x7fc(%rsp),%edx
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x808,%rsp
ret

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

LLVM IR (-O2):
@.str = [31 x i8] c"Dla %d ostatnia wartosc to %d\0A\00"
define i32 @main() {
%1 = alloca [512 x i32]
%2 = bitcast [512 x i32]* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = phi i64 [ 0, %0 ], [ %44, %3 ]
%5 = getelementptr inbounds [512 x i32], [512 x i32]* %1, i64 0, i64 %4
%6 = bitcast i32* %5 to <4 x i32>*
store <4 x i32> <i32 128, i32 128, i32 128, i32 128>, <4 x i32>* %6
%7 = getelementptr inbounds i32, i32* %5, i64 4
%8 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> <i32 128, i32 128, i32 128, i32 128>, <4 x i32>* %8
%9 = or i64 %4, 8
%10 = getelementptr inbounds [512 x i32], [512 x i32]* %1, i64 0, i64 %9
%11 = bitcast i32* %10 to <4 x i32>*
store <4 x i32> <i32 128, i32 128, i32 128, i32 128>, <4 x i32>* %11
%12 = getelementptr inbounds i32, i32* %10, i64 4
%13 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> <i32 128, i32 128, i32 128, i32 128>, <4 x i32>* %13
%14 = or i64 %4, 16
%15 = getelementptr inbounds [512 x i32], [512 x i32]* %1, i64 0, i64 %14
%16 = bitcast i32* %15 to <4 x i32>*
store <4 x i32> <i32 128, i32 128, i32 128, i32 128>, <4 x i32>* %16
%17 = getelementptr inbounds i32, i32* %15, i64 4
%18 = bitcast i32* %17 to <4 x i32>*
store <4 x i32> <i32 128, i32 128, i32 128, i32 128>, <4 x i32>* %18
%19 = or i64 %4, 24
%20 = getelementptr inbounds [512 x i32], [512 x i32]* %1, i64 0, i64 %19
%21 = bitcast i32* %20 to <4 x i32>*
store <4 x i32> <i32 128, i32 128, i32 128, i32 128>, <4 x i32>* %21
%22 = getelementptr inbounds i32, i32* %20, i64 4
%23 = bitcast i32* %22 to <4 x i32>*
store <4 x i32> <i32 128, i32 128, i32 128, i32 128>, <4 x i32>* %23
%24 = or i64 %4, 32
%25 = getelementptr inbounds [512 x i32], [512 x i32]* %1, i64 0, i64 %24
%26 = bitcast i32* %25 to <4 x i32>*
store <4 x i32> <i32 128, i32 128, i32 128, i32 128>, <4 x i32>* %26
%27 = getelementptr inbounds i32, i32* %25, i64 4
%28 = bitcast i32* %27 to <4 x i32>*
store <4 x i32> <i32 128, i32 128, i32 128, i32 128>, <4 x i32>* %28
%29 = or i64 %4, 40
%30 = getelementptr inbounds [512 x i32], [512 x i32]* %1, i64 0, i64 %29
%31 = bitcast i32* %30 to <4 x i32>*
store <4 x i32> <i32 128, i32 128, i32 128, i32 128>, <4 x i32>* %31
%32 = getelementptr inbounds i32, i32* %30, i64 4
%33 = bitcast i32* %32 to <4 x i32>*
store <4 x i32> <i32 128, i32 128, i32 128, i32 128>, <4 x i32>* %33
%34 = or i64 %4, 48
%35 = getelementptr inbounds [512 x i32], [512 x i32]* %1, i64 0, i64 %34
%36 = bitcast i32* %35 to <4 x i32>*
store <4 x i32> <i32 128, i32 128, i32 128, i32 128>, <4 x i32>* %36
%37 = getelementptr inbounds i32, i32* %35, i64 4
%38 = bitcast i32* %37 to <4 x i32>*
store <4 x i32> <i32 128, i32 128, i32 128, i32 128>, <4 x i32>* %38
%39 = or i64 %4, 56
%40 = getelementptr inbounds [512 x i32], [512 x i32]* %1, i64 0, i64 %39
%41 = bitcast i32* %40 to <4 x i32>*
store <4 x i32> <i32 128, i32 128, i32 128, i32 128>, <4 x i32>* %41
%42 = getelementptr inbounds i32, i32* %40, i64 4
%43 = bitcast i32* %42 to <4 x i32>*
store <4 x i32> <i32 128, i32 128, i32 128, i32 128>, <4 x i32>* %43
%44 = add nuw nsw i64 %4, 64
%45 = icmp eq i64 %44, 512
br i1 %45, label %46, label %3
46: ; preds = %3
%47 = getelementptr inbounds [512 x i32], [512 x i32]* %1, i64 0, i64 0
%48 = load i32, i32* %47
%49 = getelementptr inbounds [512 x i32], [512 x i32]* %1, i64 0, i64 511
%50 = load i32, i32* %49
%51 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %48, i32 %50)
ret i32 0
}