int main() {
  int *pc;
  int c;
  c = 5;
  printf("Address of c: %d\n", &c);
  printf("Value of c: %d\n", c);
  pc = &c;
  printf("Address of pc: %d\n", &pc);
  printf("Content of pc: %d\n", *pc);
  c = 11;
  printf("Address of pointer pc: %d\n", &pc);
  printf("Content of pointer pc: %d\n", *pc);
  *pc = 2;
  printf("Address of c: %u\n", &c);
  printf("Value of c: %d\n", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0xc(%rbp)
lea    0xeda(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xc(%rbp),%rax
mov    %rax,-0x8(%rbp)
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xb,-0xc(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
lea    0xed0(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x5,0x4(%rsp)
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%r15
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xed0(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,0x8(%rsp)
lea    0xeca(%rip),%rdi
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%rax
mov    (%rax),%esi
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0xb,0x4(%rsp)
lea    0xebd(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%rax
mov    (%rax),%esi
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%rax
movl   $0x2,(%rax)
lea    0xec2(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Address of c: %d\0A\00"
@.str.1 = [16 x i8] c"Value of c: %d\0A\00"
@.str.2 = [19 x i8] c"Address of pc: %d\0A\00"
@.str.3 = [19 x i8] c"Content of pc: %d\0A\00"
@.str.4 = [27 x i8] c"Address of pointer pc: %d\0A\00"
@.str.5 = [27 x i8] c"Content of pointer pc: %d\0A\00"
@.str.6 = [18 x i8] c"Address of c: %u\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32
store i32 5, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %4)
store i32* %2, i32** %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32** %1)
%7 = load i32*, i32** %1
%8 = load i32, i32* %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %8)
store i32 11, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32** %1)
%11 = load i32*, i32** %1
%12 = load i32, i32* %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 %12)
%14 = load i32*, i32** %1
store i32 2, i32* %14
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32* %2)
%16 = load i32, i32* %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Address of c: %d\0A\00"
@.str.1 = [16 x i8] c"Value of c: %d\0A\00"
@.str.2 = [19 x i8] c"Address of pc: %d\0A\00"
@.str.3 = [19 x i8] c"Content of pc: %d\0A\00"
@.str.4 = [27 x i8] c"Address of pointer pc: %d\0A\00"
@.str.5 = [27 x i8] c"Content of pointer pc: %d\0A\00"
@.str.6 = [18 x i8] c"Address of c: %u\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32
%3 = bitcast i32** %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 5, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %6)
store i32* %2, i32** %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32** %1)
%9 = load i32*, i32** %1
%10 = load i32, i32* %9
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %10)
store i32 11, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32** %1)
%13 = load i32*, i32** %1
%14 = load i32, i32* %13
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 %14)
%16 = load i32*, i32** %1
store i32 2, i32* %16
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32* %2)
%18 = load i32, i32* %2
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %18)
ret i32 0
}