#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() {
  char c = 'a';
  char *cp = &c;
  printf("&c=%p\n", &c);
  printf("cp=%p\n", cp);
  printf("cp+1=%p\n", cp + 1);
  printf("cp+3=%p\n", cp + 3);
  int i = 1;
  int *ip = &i;
  printf("&i=%p\n", &i);
  printf("ip=%p\n", ip);
  printf("ip+1=%p\n", ip + 1);
  printf("ip+3=%p\n", ip + 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movb   $0x61,-0x1(%rbp)
lea    -0x1(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0xed5(%rip),%rdi
lea    -0x1(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
add    $0x3,%rsi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    0xe96(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
add    $0x4,%rsi
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
add    $0xc,%rsi
lea    0xe6b(%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    $0x10,%rsp
movb   $0x61,0xb(%rsp)
lea    0xedf(%rip),%rdi
lea    0xb(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%rsi
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe(%rsp),%rsi
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x1,0xc(%rsp)
lea    0xeaa(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe9b(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%rsi
lea    0xe8c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x18(%rsp),%rsi
lea    0xe82(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

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