#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 a, *p;
  a = 10;
  printf("a: %d\n", a);
  printf("&a: %p\n\n", &a);
  p = &a;
  printf("p: %p\n", p);
  printf("*p: %d\n", *p);
  printf("&p: %p\n\n", &p);
  a = 20;
  printf("a: %d\n", a);
  printf("&a: %p\n\n", &a);
  printf("p: %p\n", p);
  printf("*p: %d\n", *p);
  printf("&p: %p\n", &p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea1(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x14,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe66(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe48(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0xa,0xc(%rsp)
lea    0xed3(%rip),%r14
mov    %r14,%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec4(%rip),%r15
lea    0xc(%rsp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,0x10(%rsp)
lea    0xec1(%rip),%r12
mov    %r12,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xe97(%rip),%r13
mov    %r13,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe8e(%rip),%rdi
lea    0x10(%rsp),%rbp
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x14,0xc(%rsp)
mov    %r14,%rdi
mov    $0x14,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%rax
mov    (%rax),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe3d(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"a: %d\0A\00"
@.str.1 = [9 x i8] c"&a: %p\0A\0A\00"
@.str.2 = [7 x i8] c"p: %p\0A\00"
@.str.3 = [8 x i8] c"*p: %d\0A\00"
@.str.4 = [9 x i8] c"&p: %p\0A\0A\00"
@.str.5 = [8 x i8] c"&p: %p\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 10, i32* %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 10)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1)
store i32* %1, i32** %2
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32** %2)
store i32 20, i32* %1
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 20)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%13 = load i32*, i32** %2
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32* %13)
%15 = load i32*, i32** %2
%16 = load i32, i32* %15
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %16)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32** %2)
ret i32 0
}