#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 *, ...);
void point() {
  int zahl = 7;
  int *zeiger = &zahl;
  printf("Adresse zahl: %p\n", &zahl);
  printf("Wert zahl: %d\n\n", zahl);
  printf("Adresse zeiger: %p\n", &zeiger);
  printf("Wert zeiger: %p\n", zeiger);
  printf("Wert von Adresse %p: %d\n\n", zeiger, *zeiger);
  int **zeigerAufZeiger = &zeiger;
  printf("Adresse von zeigerAufZeiger: %p\n", &zeigerAufZeiger);
  printf("Wert von zeigerAufZeiger: %d\n", **zeigerAufZeiger);
  printf("Adresse von zeiger: %p\n", &zeiger);
}


x86 assembly (clang, -O0):
<point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x7,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    0xecc(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<point>:
push   %rbx
sub    $0x20,%rsp
movl   $0x7,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rsi,0x10(%rsp)
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%rsi
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%rsi
mov    (%rsi),%edx
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,0x18(%rsp)
lea    0xed0(%rip),%rdi
lea    0x18(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x18(%rsp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Adresse zahl: %p\0A\00"
@.str.1 = [16 x i8] c"Wert zahl: %d\0A\0A\00"
@.str.2 = [20 x i8] c"Adresse zeiger: %p\0A\00"
@.str.3 = [17 x i8] c"Wert zeiger: %p\0A\00"
@.str.4 = [26 x i8] c"Wert von Adresse %p: %d\0A\0A\00"
@.str.5 = [33 x i8] c"Adresse von zeigerAufZeiger: %p\0A\00"
@.str.6 = [30 x i8] c"Wert von zeigerAufZeiger: %d\0A\00"
@.str.7 = [24 x i8] c"Adresse von zeiger: %p\0A\00"
define void @point() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32**
store i32 7, i32* %1
store i32* %1, i32** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32** %2)
%8 = load i32*, i32** %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32* %8)
%10 = load i32*, i32** %2
%11 = load i32*, i32** %2
%12 = load i32, i32* %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32* %10, i32 %12)
store i32** %2, i32*** %3
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i32*** %3)
%15 = load i32**, i32*** %3
%16 = load i32*, i32** %15
%17 = load i32, i32* %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i32** %2)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Adresse zahl: %p\0A\00"
@.str.1 = [16 x i8] c"Wert zahl: %d\0A\0A\00"
@.str.2 = [20 x i8] c"Adresse zeiger: %p\0A\00"
@.str.3 = [17 x i8] c"Wert zeiger: %p\0A\00"
@.str.4 = [26 x i8] c"Wert von Adresse %p: %d\0A\0A\00"
@.str.5 = [33 x i8] c"Adresse von zeigerAufZeiger: %p\0A\00"
@.str.6 = [30 x i8] c"Wert von zeigerAufZeiger: %d\0A\00"
@.str.7 = [24 x i8] c"Adresse von zeiger: %p\0A\00"
define void @point() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32**
%4 = bitcast i32* %1 to i8*
store i32 7, i32* %1
%5 = bitcast i32** %2 to i8*
store i32* %1, i32** %2
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32** %2)
%10 = load i32*, i32** %2
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32* %10)
%12 = load i32*, i32** %2
%13 = load i32, i32* %12
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32* %12, i32 %13)
%15 = bitcast i32*** %3 to i8*
store i32** %2, i32*** %3
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i32*** %3)
%17 = load i32**, i32*** %3
%18 = load i32*, i32** %17
%19 = load i32, i32* %18
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 %19)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i32** %2)
ret void
}