#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 *, void *);
int main(int argc, char *argv[]) {
  char charvar = '\0';
  printf("address of charvar = %p\n", (void *)(&charvar));
  printf("address of charvar - 1 = %p\n", (void *)(&charvar - 1));
  printf("address of charvar + 1 = %p\n", (void *)(&charvar + 1));
  int intvar = 1;
  printf("address of intvar = %p\n", (void *)(&intvar));
  printf("address of intvar - 1 = %p\n", (void *)(&intvar - 1));
  printf("address of intvar + 1 = %p\n", (void *)(&intvar + 1));
  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)
movb   $0x0,-0x11(%rbp)
lea    0xecf(%rip),%rdi
lea    -0x11(%rbp),%rsi
call   1030 <printf@plt>
lea    -0x11(%rbp),%rsi
add    $0xffffffffffffffff,%rsi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
lea    -0x11(%rbp),%rsi
add    $0x1,%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x18(%rbp)
lea    -0x18(%rbp),%rsi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
lea    -0x18(%rbp),%rsi
add    $0xfffffffffffffffc,%rsi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
lea    -0x18(%rbp),%rsi
add    $0x4,%rsi
lea    0xeeb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x0,0x3(%rsp)
lea    0xee3(%rip),%rdi
lea    0x3(%rsp),%rsi
call   1030 <printf@plt>
lea    0x2(%rsp),%rsi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
lea    0xef2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,0x4(%rsp)
lea    0xefb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <printf@plt>
lea    (%rsp),%rsi
lea    0xefe(%rip),%rdi
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
lea    0xf09(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [25 x i8] c"address of charvar = %p\0A\00"
@.str.1 = [29 x i8] c"address of charvar - 1 = %p\0A\00"
@.str.2 = [29 x i8] c"address of charvar + 1 = %p\0A\00"
@.str.3 = [24 x i8] c"address of intvar = %p\0A\00"
@.str.4 = [28 x i8] c"address of intvar - 1 = %p\0A\00"
@.str.5 = [28 x i8] c"address of intvar + 1 = %p\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = alloca i32
store i8 0, i8* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = getelementptr inbounds i8, i8* %3, i64 -1
%7 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds i8, i8* %3, i64 1
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = bitcast i32* %4 to i8*
store i32 1, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds i32, i32* %4, i64 -1
%13 = bitcast i32* %12 to i8*
%14 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds i32, i32* %4, i64 1
%16 = bitcast i32* %15 to i8*
%17 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), i8* %16)
ret i32 0
}