#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 *, ...);
void main() {
  int i = 10;
  int *p = (int *)0x22cc88;
  printf("&i = %p\n", &i);
  printf("p = %p,*p = %d\n", p, *p);
  *p = 0x100;
  printf("*p = %d\n", *p);
  *(int *)0x22cc88 = 0x100;
  printf("Address = %d\n", *(int *)0x22cc88);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
mov    $0x22cc88,%eax
mov    %rax,-0x10(%rbp)
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movl   $0x100,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x22cc88,%eax
movl   $0x100,(%rax)
mov    $0x22cc88,%eax
mov    (%rax),%esi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xa,0x4(%rsp)
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x22cc88,%edx
lea    0xecf(%rip),%rdi
mov    $0x22cc88,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x100,0x22cc88
lea    0xeb8(%rip),%rdi
mov    $0x100,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x100,0x22cc88
lea    0xea3(%rip),%rdi
mov    $0x100,%esi
xor    %eax,%eax
call   1030 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"&i = %p\0A\00"
@.str.1 = [16 x i8] c"p = %p,*p = %d\0A\00"
@.str.2 = [9 x i8] c"*p = %d\0A\00"
@.str.3 = [14 x i8] c"Address = %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* inttoptr (i64 2280584 to i32*)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32* inttoptr (i64 2280584 to i32*), i32 %4)
store i32 256, i32* inttoptr (i64 2280584 to i32*)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 256)
store i32 256, i32* inttoptr (i64 2280584 to i32*)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 256)
ret void
}