int main(int argc, char *argv[]) {
  int x = 2;
  int y = 3;
  int *xp;
  printf("x=%d\n", x);
  xp = &x;
  *xp = 10;
  printf("x=%d\n", x);
  y = *xp;
  printf("y=%d\n", y);
  char *t = "aabcd";
  printf("&t = %d\n", &t);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x3,-0x18(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0xa,(%rax)
mov    -0x14(%rbp),%esi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8a(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe85(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xee4(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb8(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xeb2(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"x=%d\0A\00"
@.str.1 = [6 x i8] c"y=%d\0A\00"
@.str.2 = [6 x i8] c"aabcd\00"
@.str.3 = [9 x i8] c"&t = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8*
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 2)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 10)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 10)
%7 = bitcast i8** %3 to i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %3
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8** %3)
ret i32 0
}