main() {
  static int a[] = {0, 1, 2, 3, 4};
  static int *p[] = {a, a + 1, a + 2, a + 3, a + 4};
  int **ptr = p;
  printf("\n %u %u", a, *a);
  printf("\n %u %u %u", p, *p, **p);
  printf("\n %u %u %u", ptr, *ptr, **ptr);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0x2f31(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2f07(%rip),%edx
lea    0xed0(%rip),%rdi
lea    0x2ef9(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2f0b(%rip),%rdx
mov    0x2f04(%rip),%rax
mov    (%rax),%ecx
lea    0xeb3(%rip),%rdi
lea    0x2ef4(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%ecx
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2f16(%rip),%edx
lea    0x2f0f(%rip),%rsi
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x2f1a(%rip),%r14
mov    0x2f13(%rip),%rdx
mov    (%rdx),%ecx
lea    0xec2(%rip),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2ef6(%rip),%rdx
mov    (%rdx),%ecx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@main.a = internal global [5 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4]
@main.p = internal global [5 x i32*] [i32* getelementptr inbounds ([5 x i32], [5 x i32]* @main.a, i32 0, i32 0), i32* bitcast (i8* getelementptr (i8, i8* bitcast ([5 x i32]* @main.a to i8*), i64 4) to i32*), i32* bitcast (i8* getelementptr (i8, i8* bitcast ([5 x i32]* @main.a to i8*), i64 8) to i32*), i32* bitcast (i8* getelementptr (i8, i8* bitcast ([5 x i32]* @main.a to i8*), i64 12) to i32*), i32* bitcast (i8* getelementptr (i8, i8* bitcast ([5 x i32]* @main.a to i8*), i64 16) to i32*)]
@.str = [8 x i8] c"\0A %u %u\00"
@.str.1 = [11 x i8] c"\0A %u %u %u\00"
define i32 @main() {
%1 = alloca i32**
store i32** getelementptr inbounds ([5 x i32*], [5 x i32*]* @main.p, i64 0, i64 0), i32*** %1
%2 = load i32, i32* getelementptr inbounds ([5 x i32], [5 x i32]* @main.a, i64 0, i64 0)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* getelementptr inbounds ([5 x i32], [5 x i32]* @main.a, i64 0, i64 0), i32 %2)
%4 = load i32*, i32** getelementptr inbounds ([5 x i32*], [5 x i32*]* @main.p, i64 0, i64 0)
%5 = load i32*, i32** getelementptr inbounds ([5 x i32*], [5 x i32*]* @main.p, i64 0, i64 0)
%6 = load i32, i32* %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32** getelementptr inbounds ([5 x i32*], [5 x i32*]* @main.p, i64 0, i64 0), i32* %4, i32 %6)
%8 = load i32**, i32*** %1
%9 = load i32**, i32*** %1
%10 = load i32*, i32** %9
%11 = load i32**, i32*** %1
%12 = load i32*, i32** %11
%13 = load i32, i32* %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32** %8, i32* %10, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@main.a = internal global [5 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4]
@main.p = internal global [5 x i32*] [i32* getelementptr inbounds ([5 x i32], [5 x i32]* @main.a, i32 0, i32 0), i32* bitcast (i8* getelementptr (i8, i8* bitcast ([5 x i32]* @main.a to i8*), i64 4) to i32*), i32* bitcast (i8* getelementptr (i8, i8* bitcast ([5 x i32]* @main.a to i8*), i64 8) to i32*), i32* bitcast (i8* getelementptr (i8, i8* bitcast ([5 x i32]* @main.a to i8*), i64 12) to i32*), i32* bitcast (i8* getelementptr (i8, i8* bitcast ([5 x i32]* @main.a to i8*), i64 16) to i32*)]
@.str = [8 x i8] c"\0A %u %u\00"
@.str.1 = [11 x i8] c"\0A %u %u %u\00"
define i32 @main() {
%1 = load i32, i32* getelementptr inbounds ([5 x i32], [5 x i32]* @main.a, i64 0, i64 0)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* getelementptr inbounds ([5 x i32], [5 x i32]* @main.a, i64 0, i64 0), i32 %1)
%3 = load i32*, i32** getelementptr inbounds ([5 x i32*], [5 x i32*]* @main.p, i64 0, i64 0)
%4 = load i32, i32* %3
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32** getelementptr inbounds ([5 x i32*], [5 x i32*]* @main.p, i64 0, i64 0), i32* %3, i32 %4)
%6 = load i32*, i32** getelementptr inbounds ([5 x i32*], [5 x i32*]* @main.p, i64 0, i64 0)
%7 = load i32, i32* %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32** getelementptr inbounds ([5 x i32*], [5 x i32*]* @main.p, i64 0, i64 0), i32* %6, i32 %7)
ret i32 0
}