#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 argc, char *argv[]) {
  int a, *p;
  p = &a;
  printf("a is %d,adress is %p\np is %p,*p is %d\n", a, &a, p, *p);
  p = p + 0x21;
  printf("p is %p,*p is %d\n", p, *p);
  *p = 20000220;
  printf("*p is %d\n", *p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    (%rax),%r8d
lea    0xebd(%rip),%rdi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x84,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
movl   $0x1312ddc,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rcx
mov    %rcx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x88(%rsp),%rsi
mov    0x88(%rsp),%edx
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x1312ddc,0x88(%rsp)
dc 2d 31 01
lea    0xec7(%rip),%rdi
mov    $0x1312ddc,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [39 x i8] c"a is %d,adress is %p\0Ap is %p,*p is %d\0A\00"
@.str.1 = [18 x i8] c"p is %p,*p is %d\0A\00"
@.str.2 = [10 x i8] c"*p is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 undef, i32* %3, i32* %3, i32 undef)
%6 = getelementptr inbounds i32, i32* %3, i64 33
%7 = load i32, i32* %6
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32 %7)
store i32 20000220, i32* %6
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 20000220)
ret i32 0
}