#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 x[11] = {10, 20, 30, 40, 50, 60, 70, 80, 90, 1000, 2000}, *p, a = 0;
  p = x;
  printf("&p = %p\n", &p);
  printf("p = %p\n", p);
  printf("p + 10 = %p\n", p + 10);
  printf("*(p + 10) = %d\n", *(p + 10));
  printf("x = %p\n", x);
  printf("&x[10] = %p\n", &x[10]);
  printf("x[10] = %d\n", x[10]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x2c,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x3c(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    0xed9(%rip),%rdi
lea    -0x38(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rsi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rsi
add    $0x28,%rsi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
mov    0x28(%rax),%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
add    $0x28,%rsi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
movups 0xf00(%rip),%xmm0
movups %xmm0,0x2c(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,0x8(%rsp)
lea    0xee2(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%rsi
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%rsi
add    $0x28,%rsi
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%rax
mov    0x28(%rax),%esi
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x38(%rsp),%rsi
lea    0xea7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x38(%rsp),%esi
lea    0xea2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.x = [11 x i32] [i32 10, i32 20, i32 30, i32 40, i32 50, i32 60, i32 70, i32 80, i32 90, i32 1000, i32 2000]
@.str = [9 x i8] c"&p = %p\0A\00"
@.str.1 = [8 x i8] c"p = %p\0A\00"
@.str.2 = [13 x i8] c"p + 10 = %p\0A\00"
@.str.3 = [16 x i8] c"*(p + 10) = %d\0A\00"
@.str.4 = [8 x i8] c"x = %p\0A\00"
@.str.5 = [13 x i8] c"&x[10] = %p\0A\00"
@.str.6 = [12 x i8] c"x[10] = %d\0A\00"
define i32 @main() {
%1 = alloca [11 x i32]
%2 = alloca i32*
%3 = alloca i32
%4 = bitcast [11 x i32]* %1 to i8*
store i32 0, i32* %3
%5 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
store i32* %5, i32** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32** %2)
%7 = load i32*, i32** %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 10
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32* %10)
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 10
%14 = load i32, i32* %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %14)
%16 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32* %16)
%18 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 10
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32* %18)
%20 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 10
%21 = load i32, i32* %20
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 %21)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [11 x i32] [i32 10, i32 20, i32 30, i32 40, i32 50, i32 60, i32 70, i32 80, i32 90, i32 1000, i32 2000]
@.str = [9 x i8] c"&p = %p\0A\00"
@.str.1 = [8 x i8] c"p = %p\0A\00"
@.str.2 = [13 x i8] c"p + 10 = %p\0A\00"
@.str.3 = [16 x i8] c"*(p + 10) = %d\0A\00"
@.str.4 = [8 x i8] c"x = %p\0A\00"
@.str.5 = [13 x i8] c"&x[10] = %p\0A\00"
@.str.6 = [12 x i8] c"x[10] = %d\0A\00"
define i32 @main() {
%1 = alloca [11 x i32]
%2 = alloca i32*
%3 = bitcast [11 x i32]* %1 to i8*
%4 = bitcast i32** %2 to i8*
%5 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
store i32* %5, i32** %2
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32** %2)
%7 = load i32*, i32** %2
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 10
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32* %10)
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 10
%14 = load i32, i32* %13
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %14)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32* %5)
%17 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 10
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32* %17)
%19 = load i32, i32* %17
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 %19)
ret i32 0
}