#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(void) {
  char ch;
  int num;
  double size;
  char *p1 = &ch;
  int *p2 = &num;
  double *p3 = &size;
  printf("%p %p %p\n", p1, p1 + 1, p1 - 1);
  printf("%p %p %p\n", p2, p2 + 1, p2 - 1);
  printf("%p %p %p\n", p3, p3 + 1, p3 - 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x5(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x20(%rbp),%rdx
add    $0x1,%rdx
mov    -0x20(%rbp),%rcx
add    $0xffffffffffffffff,%rcx
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
mov    -0x28(%rbp),%rdx
add    $0x4,%rdx
mov    -0x28(%rbp),%rcx
add    $0xfffffffffffffffc,%rcx
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%rsi
mov    -0x30(%rbp),%rdx
add    $0x8,%rdx
mov    -0x30(%rbp),%rcx
add    $0xfffffffffffffff8,%rcx
lea    0xe6a(%rip),%rdi
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    0x4(%rsp),%rdx
lea    0x2(%rsp),%rcx
lea    0xeda(%rip),%rbx
lea    0x3(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rdx
lea    (%rsp),%rcx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%rdx
lea    (%rsp),%rcx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%p %p %p\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i32
%3 = alloca double
%4 = bitcast i32* %2 to i8*
%5 = bitcast double* %3 to i8*
%6 = getelementptr inbounds i8, i8* %1, i64 1
%7 = getelementptr inbounds i8, i8* %1, i64 -1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %6, i8* %7)
%9 = getelementptr inbounds i32, i32* %2, i64 1
%10 = getelementptr inbounds i32, i32* %2, i64 -1
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %9, i32* %10)
%12 = getelementptr inbounds double, double* %3, i64 1
%13 = getelementptr inbounds double, double* %3, i64 -1
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double* %3, double* %12, double* %13)
ret i32 0
}