#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, ...);
int main() {
  int y = 1000, z;
  int *p = &y;
  printf("The pointer  p has the value %d and address: %p\n", *p, p);
  z = *p++ + 5;
  printf("The pointer  p has the value %d and address: %p\n", *p, p);
  printf("The variable z has the value %d\n", z);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3e8,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rdx
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%eax
add    $0x5,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rdx
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
movl   $0x3e8,0x4(%rsp)
lea    0xede(%rip),%rbx
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x3e8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rdx
mov    0x4(%rsp),%ebp
mov    0x8(%rsp),%esi
add    $0x5,%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [49 x i8] c"The pointer p has the value %d and address: %p\0A\00"
@.str.1 = [33 x i8] c"The variable z has the value %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 0, i32* %1
store i32 1000, i32* %2
store i32* %2, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = load i32*, i32** %4
%8 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %6, i32* %7)
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i32 1
store i32* %10, i32** %4
%11 = load i32, i32* %9
%12 = add nsw i32 %11, 5
store i32 %12, i32* %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32*, i32** %4
%16 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %14, i32* %15)
%17 = load i32, i32* %3
%18 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [49 x i8] c"The pointer p has the value %d and address: %p\0A\00"
@.str.1 = [33 x i8] c"The variable z has the value %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1000, i32* %1
%3 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 1000, i32* %1)
%4 = getelementptr inbounds i32, i32* %1, i64 1
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 5
%7 = load i32, i32* %4
%8 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %7, i32* %4)
%9 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}