#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);
void pointArray() {
  int punkte[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  int *pos;
  pos = punkte;
  printf("(punkte[0]) Wert pos: %d\n", *pos);
  pos++;
  printf("(punkte[1]) Wert pos: %d\n", *pos);
  pos = punkte + 4;
  printf("(punkte[4]) Wert pos: %d\n", *pos);
  pos--;
  printf("(punkte[3]) Wert pos: %d\n", *pos);
  pos = punkte + 11;
  printf("Aus Array herausgesprungen %d\n", *pos);
}


x86 assembly (clang, -O0):
<pointArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%esi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rax
add    $0x2c,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pointArray>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xf0c(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@__const.pointArray.punkte = [10 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str = [26 x i8] c"(punkte[0]) Wert pos: %d\0A\00"
@.str.1 = [26 x i8] c"(punkte[1]) Wert pos: %d\0A\00"
@.str.2 = [26 x i8] c"(punkte[4]) Wert pos: %d\0A\00"
@.str.3 = [26 x i8] c"(punkte[3]) Wert pos: %d\0A\00"
@.str.4 = [31 x i8] c"Aus Array herausgesprungen %d\0A\00"
define void @pointArray() {
%1 = alloca [10 x i32]
%2 = alloca i32*
%3 = bitcast [10 x i32]* %1 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i32 1
store i32* %9, i32** %2
%10 = load i32*, i32** %2
%11 = load i32, i32* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%14 = getelementptr inbounds i32, i32* %13, i64 4
store i32* %14, i32** %2
%15 = load i32*, i32** %2
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %16)
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i32 -1
store i32* %19, i32** %2
%20 = load i32*, i32** %2
%21 = load i32, i32* %20
%22 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%24 = getelementptr inbounds i32, i32* %23, i64 11
store i32* %24, i32** %2
%25 = load i32*, i32** %2
%26 = load i32, i32* %25
%27 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i32 %26)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"(punkte[0]) Wert pos: %d\0A\00"
@.str.1 = [26 x i8] c"(punkte[1]) Wert pos: %d\0A\00"
@.str.2 = [26 x i8] c"(punkte[4]) Wert pos: %d\0A\00"
@.str.3 = [26 x i8] c"(punkte[3]) Wert pos: %d\0A\00"
@.str.4 = [31 x i8] c"Aus Array herausgesprungen %d\0A\00"
define void @pointArray() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i32 4)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i32 poison)
ret void
}