#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 hoge = 5;
  int piyo = 10;
  int *hoge_p;
  printf("&hoge.. %p\n", &hoge);
  printf("&piyo.. %p\n", &piyo);
  printf("&hoge_p.. %p\n", &hoge_p);
  hoge_p = &hoge;
  printf("hoge_p.. %p\n", hoge_p);
  printf("*hoge_p.. %d\n", *hoge_p);
  *hoge_p = 10;
  printf("hoge.. %d\n", hoge);
  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)
movl   $0x5,-0x14(%rbp)
movl   $0xa,-0x18(%rbp)
lea    0xec5(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
movl   $0xa,(%rax)
mov    -0x14(%rbp),%esi
lea    0xe88(%rip),%rdi
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   $0x5,0xc(%rsp)
movl   $0xa,0x1c(%rsp)
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
lea    0x1c(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,0x10(%rsp)
lea    0xeac(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%rax
mov    (%rax),%esi
lea    0xea1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%rax
movl   $0xa,(%rax)
mov    0xc(%rsp),%esi
lea    0xe92(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

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