#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 main() {
  int a = 23;
  int *p = &a;
  int **pp = &p;
  printf("a: %d\n", a);
  printf("p: %p, *p: %d\n", p, *p);
  printf("pp: %p, *pp: %p, **pp: %d\n", pp, *pp, **pp);
  pp -= 1000;
  printf("pp: %p, *pp: %p, **pp: %d\n", pp, *pp, **pp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x17,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%ecx
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffe0c0,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%ecx
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movl   $0x17,0xc(%rsp)
lea    0xc(%rsp),%r14
mov    %r14,0x10(%rsp)
lea    0xed0(%rip),%rdi
mov    $0x17,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%edx
lea    0xec0(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%ecx
lea    0xeba(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    -0x1f30(%rsp),%rsi
ff
mov    -0x1f30(%rsp),%rdx
ff
mov    (%rdx),%ecx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"a: %d\0A\00"
@.str.1 = [15 x i8] c"p: %p, *p: %d\0A\00"
@.str.2 = [27 x i8] c"pp: %p, *pp: %p, **pp: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32**
store i32 23, i32* %1
store i32* %1, i32** %2
store i32** %2, i32*** %3
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32*, i32** %2
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32 %8)
%10 = load i32**, i32*** %3
%11 = load i32**, i32*** %3
%12 = load i32*, i32** %11
%13 = load i32**, i32*** %3
%14 = load i32*, i32** %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32** %10, i32* %12, i32 %15)
%17 = load i32**, i32*** %3
%18 = getelementptr inbounds i32*, i32** %17, i64 -1000
store i32** %18, i32*** %3
%19 = load i32**, i32*** %3
%20 = load i32**, i32*** %3
%21 = load i32*, i32** %20
%22 = load i32**, i32*** %3
%23 = load i32*, i32** %22
%24 = load i32, i32* %23
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32** %19, i32* %21, i32 %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"a: %d\0A\00"
@.str.1 = [15 x i8] c"p: %p, *p: %d\0A\00"
@.str.2 = [27 x i8] c"pp: %p, *pp: %p, **pp: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = bitcast i32* %1 to i8*
store i32 23, i32* %1
%4 = bitcast i32** %2 to i8*
store i32* %1, i32** %2
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 23)
%6 = load i32, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32 %6)
%8 = load i32, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32** %2, i32* %1, i32 %8)
%10 = getelementptr inbounds i32*, i32** %2, i64 -1000
%11 = load i32*, i32** %10
%12 = load i32, i32* %11
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32** %10, i32* %11, i32 %12)
ret i32 0
}