#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(void) {
  int A[] = {12, 23, 34, 45, 56, 67, 78, 89, 90};
  int *P;
  P = A;
  printf("P  = %p\n", P);
  printf("A  = %p\n", A);
  printf("&A  = %p\n", &A);
  printf("&P  = %p\n", &P);
  printf("*P+2  = %p\n", *P + 2);
  printf("*(P+2)  = %p\n", *(P + 2));
  printf("&P+1  = %p\n", &P + 1);
  printf("&A[4]-3  = %p\n", &A[4] - 3);
  printf("A+3  = %p\n", A + 3);
  printf("P + (*P-10)  = %p\n", P + (*P - 10));
  printf("*(P+*(P+8)-A[7])  = %p\n", *(P + *(P + 8) - A[7]));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rsi
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
lea    -0x38(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
mov    (%rax),%esi
add    $0x2,%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%esi
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x38(%rbp),%rsi
add    $0x8,%rsi
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
add    $0x10,%rsi
add    $0xfffffffffffffff4,%rsi
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
add    $0xc,%rsi
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rsi
mov    -0x38(%rbp),%rax
mov    (%rax),%eax
sub    $0xa,%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
mov    -0x38(%rbp),%rcx
movslq 0x20(%rcx),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe42(%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
mov    0xf05(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xeea(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xece(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,0x8(%rsp)
lea    0xee7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%rax
mov    (%rax),%esi
add    $0x2,%esi
lea    0xea0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%rax
mov    0x8(%rax),%esi
lea    0xe96(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%rsi
lea    0xe91(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x14(%rsp),%rsi
lea    0xe8a(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x1c(%rsp),%rsi
lea    0xe86(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%rax
movslq (%rax),%rcx
lea    (%rax,%rcx,4),%rsi
add    $0xffffffffffffffd8,%rsi
lea    0xe73(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%rax
movslq 0x20(%rax),%rcx
lea    (%rax,%rcx,4),%rax
movslq 0x2c(%rsp),%rcx
shl    $0x2,%rcx
sub    %rcx,%rax
mov    (%rax),%esi
lea    0xe5d(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.A = [9 x i32] [i32 12, i32 23, i32 34, i32 45, i32 56, i32 67, i32 78, i32 89, i32 90]
@.str = [9 x i8] c"P = %p\0A\00"
@.str.1 = [9 x i8] c"A = %p\0A\00"
@.str.2 = [10 x i8] c"&A = %p\0A\00"
@.str.3 = [10 x i8] c"&P = %p\0A\00"
@.str.4 = [12 x i8] c"*P+2 = %p\0A\00"
@.str.5 = [14 x i8] c"*(P+2) = %p\0A\00"
@.str.6 = [12 x i8] c"&P+1 = %p\0A\00"
@.str.7 = [15 x i8] c"&A[4]-3 = %p\0A\00"
@.str.8 = [11 x i8] c"A+3 = %p\0A\00"
@.str.9 = [19 x i8] c"P + (*P-10) = %p\0A\00"
@.str.10 = [24 x i8] c"*(P+*(P+8)-A[7]) = %p\0A\00"
define i32 @main() {
%1 = alloca [9 x i32]
%2 = alloca i32*
%3 = bitcast [9 x i32]* %1 to i8*
%4 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %5)
%7 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), [9 x i32]* %1)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32** %2)
%11 = load i32*, i32** %2
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %13)
%15 = load i32*, i32** %2
%16 = getelementptr inbounds i32, i32* %15, i64 2
%17 = load i32, i32* %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %17)
%19 = getelementptr inbounds i32*, i32** %2, i64 1
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32** %19)
%21 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 4
%22 = getelementptr inbounds i32, i32* %21, i64 -3
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i32* %22)
%24 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%25 = getelementptr inbounds i32, i32* %24, i64 3
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32* %25)
%27 = load i32*, i32** %2
%28 = load i32*, i32** %2
%29 = load i32, i32* %28
%30 = sub nsw i32 %29, 10
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i32, i32* %27, i64 %31
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32* %32)
%34 = load i32*, i32** %2
%35 = load i32*, i32** %2
%36 = getelementptr inbounds i32, i32* %35, i64 8
%37 = load i32, i32* %36
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i32, i32* %34, i64 %38
%40 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 7
%41 = load i32, i32* %40
%42 = sext i32 %41 to i64
%43 = sub i64 0, %42
%44 = getelementptr inbounds i32, i32* %39, i64 %43
%45 = load i32, i32* %44
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0), i32 %45)
ret i32 0
}

LLVM IR (-O2):
@__const.main.A = [9 x i32] [i32 12, i32 23, i32 34, i32 45, i32 56, i32 67, i32 78, i32 89, i32 90]
@.str = [9 x i8] c"P = %p\0A\00"
@.str.1 = [9 x i8] c"A = %p\0A\00"
@.str.2 = [10 x i8] c"&A = %p\0A\00"
@.str.3 = [10 x i8] c"&P = %p\0A\00"
@.str.4 = [12 x i8] c"*P+2 = %p\0A\00"
@.str.5 = [14 x i8] c"*(P+2) = %p\0A\00"
@.str.6 = [12 x i8] c"&P+1 = %p\0A\00"
@.str.7 = [15 x i8] c"&A[4]-3 = %p\0A\00"
@.str.8 = [11 x i8] c"A+3 = %p\0A\00"
@.str.9 = [19 x i8] c"P + (*P-10) = %p\0A\00"
@.str.10 = [24 x i8] c"*(P+*(P+8)-A[7]) = %p\0A\00"
define i32 @main() {
%1 = alloca [9 x i32]
%2 = alloca i32*
%3 = bitcast [9 x i32]* %1 to i8*
%4 = bitcast i32** %2 to i8*
%5 = getelementptr inbounds [9 x i32], [9 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* %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), [9 x i32]* %1)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32** %2)
%10 = load i32*, i32** %2
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 2
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %12)
%14 = load i32*, i32** %2
%15 = getelementptr inbounds i32, i32* %14, i64 2
%16 = load i32, i32* %15
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %16)
%18 = getelementptr inbounds i32*, i32** %2, i64 1
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32** %18)
%20 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 1
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i32* %20)
%22 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 3
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32* %22)
%24 = load i32*, i32** %2
%25 = load i32, i32* %24
%26 = add nsw i32 %25, -10
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %24, i64 %27
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i32* %28)
%30 = load i32*, i32** %2
%31 = getelementptr inbounds i32, i32* %30, i64 8
%32 = load i32, i32* %31
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i32, i32* %30, i64 %33
%35 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 7
%36 = load i32, i32* %35
%37 = sext i32 %36 to i64
%38 = sub nsw i64 0, %37
%39 = getelementptr inbounds i32, i32* %34, i64 %38
%40 = load i32, i32* %39
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0), i32 %40)
ret i32 0
}