int main() {
  int *p;
  int *q;
  int *r;
  int x = 10;
  p = &x;
  q = &x;
  r = &x;
  printf("&p = %u\t p = %u\t *p = %d\n", &p, p, *p);
  printf("&q = %u\t q = %u\t *q = %d\n", &q, q, *q);
  printf("&r = %u\t r = %u\t *r = %d\n", &r, r, *r);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xa,-0x1c(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x8(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
lea    0xeb8(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
lea    0xeb6(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
lea    0xeb4(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movl   $0xa,0x4(%rsp)
lea    0x4(%rsp),%rbx
mov    %rbx,0x18(%rsp)
mov    %rbx,0x10(%rsp)
mov    %rbx,0x8(%rsp)
lea    0xec8(%rip),%rdi
lea    0x18(%rsp),%rsi
mov    %rbx,%rdx
mov    $0xa,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%ecx
lea    0xec3(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%ecx
lea    0xec3(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [26 x i8] c"&p = %u\09 p = %u\09 *p = %d\0A\00"
@.str.1 = [26 x i8] c"&q = %u\09 q = %u\09 *q = %d\0A\00"
@.str.2 = [26 x i8] c"&r = %u\09 r = %u\09 *r = %d\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = bitcast i32** %1 to i8*
%6 = bitcast i32** %2 to i8*
%7 = bitcast i32** %3 to i8*
%8 = bitcast i32* %4 to i8*
store i32 10, i32* %4
store i32* %4, i32** %1
store i32* %4, i32** %2
store i32* %4, i32** %3
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32** %1, i32* %4, i32 10)
%10 = load i32, i32* %4
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32** %2, i32* %4, i32 %10)
%12 = load i32, i32* %4
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32** %3, i32* %4, i32 %12)
ret i32 0
}