#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int val = 100;
  int *ptr = &val;
  int **pptr = &ptr;
  printf("              Address of val: %p <-\n", (void *)&val);
  printf("              Address of ptr: %p <--\n", (void *)&ptr);
  printf("             Address of pptr: %p\n", (void *)&pptr);
  printf(" The address stored into ptr: %p <-\n", (void *)ptr);
  printf("The address stored into pptr: %p <--\n", (void *)pptr);
  printf("            The value of val: %d\n", val);
  printf("    The value pointed by ptr: %d\n", *ptr);
  printf("   The value pointed by pptr: %d\n", **pptr);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
lea    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
lea    -0x18(%rbp),%rax
mov    %eax,%esi
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xef4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %eax,%esi
lea    0xf07(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xf1e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xf2e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
lea    0xf3b(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e13(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movl   $0x64,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rsi,0x18(%rsp)
lea    0x18(%rsp),%rbx
mov    %rbx,0x10(%rsp)
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0x10(%rsp),%rsi
lea    0xef4(%rip),%rdi
call   1030 <printf@plt>
mov    0x18(%rsp),%esi
lea    0xf06(%rip),%rdi
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
lea    0xf1b(%rip),%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xf31(%rip),%rdi
call   1030 <printf@plt>
mov    0x18(%rsp),%rax
mov    (%rax),%esi
lea    0xf40(%rip),%rdi
call   1030 <printf@plt>
mov    0x10(%rsp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
lea    0xf4c(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e24(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c" Address of val: %p <-\0A\00"
@.str.1 = [38 x i8] c" Address of ptr: %p <--\0A\00"
@.str.2 = [34 x i8] c" Address of pptr: %p\0A\00"
@.str.3 = [37 x i8] c" The address stored into ptr: %p <-\0A\00"
@.str.4 = [38 x i8] c"The address stored into pptr: %p <--\0A\00"
@.str.5 = [34 x i8] c" The value of val: %d\0A\00"
@.str.6 = [34 x i8] c" The value pointed by ptr: %d\0A\00"
@.str.7 = [34 x i8] c" The value pointed by pptr: %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32**
store i32 0, i32* %1
store i32 100, i32* %2
store i32* %2, i32** %3
store i32** %3, i32*** %4
%5 = bitcast i32* %2 to i8*
%6 = ptrtoint i8* %5 to i32
%7 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = bitcast i32** %3 to i8*
%9 = ptrtoint i8* %8 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = bitcast i32*** %4 to i8*
%12 = ptrtoint i8* %11 to i32
%13 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = load i32*, i32** %3
%15 = bitcast i32* %14 to i8*
%16 = ptrtoint i8* %15 to i32
%17 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i32 %16)
%18 = load i32**, i32*** %4
%19 = bitcast i32** %18 to i8*
%20 = ptrtoint i8* %19 to i32
%21 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %2
%23 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i32 %22)
%24 = load i32*, i32** %3
%25 = load i32, i32* %24
%26 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i32 %25)
%27 = load i32**, i32*** %4
%28 = load i32*, i32** %27
%29 = load i32, i32* %28
%30 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i32 %29)
%31 = load i32, i32* @EXIT_SUCCESS
ret i32 %31
}

LLVM IR (-O2):
@.str = [37 x i8] c" Address of val: %p <-\0A\00"
@.str.1 = [38 x i8] c" Address of ptr: %p <--\0A\00"
@.str.2 = [34 x i8] c" Address of pptr: %p\0A\00"
@.str.3 = [37 x i8] c" The address stored into ptr: %p <-\0A\00"
@.str.4 = [38 x i8] c"The address stored into pptr: %p <--\0A\00"
@.str.5 = [34 x i8] c" The value of val: %d\0A\00"
@.str.6 = [34 x i8] c" The value pointed by ptr: %d\0A\00"
@.str.7 = [34 x i8] c" The value pointed by pptr: %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32**
%4 = bitcast i32* %1 to i8*
store i32 100, i32* %1
%5 = bitcast i32** %2 to i8*
store i32* %1, i32** %2
%6 = bitcast i32*** %3 to i8*
store i32** %2, i32*** %3
%7 = ptrtoint i32* %1 to i64
%8 = trunc i64 %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = ptrtoint i32** %2 to i64
%11 = trunc i64 %10 to i32
%12 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = ptrtoint i32*** %3 to i64
%14 = trunc i64 %13 to i32
%15 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = bitcast i32** %2 to i8**
%17 = load i8*, i8** %16
%18 = ptrtoint i8* %17 to i64
%19 = trunc i64 %18 to i32
%20 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i32 %19)
%21 = bitcast i32*** %3 to i8**
%22 = load i8*, i8** %21
%23 = ptrtoint i8* %22 to i64
%24 = trunc i64 %23 to i32
%25 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i32 %24)
%26 = load i32, i32* %1
%27 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i32 %26)
%28 = load i32*, i32** %2
%29 = load i32, i32* %28
%30 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i32 %29)
%31 = load i32**, i32*** %3
%32 = load i32*, i32** %31
%33 = load i32, i32* %32
%34 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0), i32 %33)
%35 = load i32, i32* @EXIT_SUCCESS
ret i32 %35
}