#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 *, char *, ...);
main() {
  char ch0 = 'e';
  char ch1 = 'v';
  char ch2 = 'i';
  char *p = &ch1;
  printf("%p, %c, %c\n", p, *p, ch1);
  ++p;
  printf("%p, %c, %c\n", p, *p, ch1);
  p -= 2;
  printf("%p, %c, %c\n", p, *p, ch1);
  printf("%p, %p, %p\n", &ch0, &ch1, &ch2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x65,-0x1(%rbp)
movb   $0x76,-0x2(%rbp)
movb   $0x69,-0x3(%rbp)
lea    -0x2(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
movsbl -0x2(%rbp),%ecx
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
movsbl -0x2(%rbp),%ecx
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffffe,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
movsbl -0x2(%rbp),%ecx
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe6a(%rip),%rdi
lea    -0x1(%rbp),%rsi
lea    -0x2(%rbp),%rdx
lea    -0x3(%rbp),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movb   $0x65,0x7(%rsp)
movb   $0x76,0x5(%rsp)
movb   $0x69,0x6(%rsp)
lea    0xed6(%rip),%rbx
lea    0x5(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x76,%edx
mov    $0x76,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x6(%rsp),%rsi
movsbl 0x6(%rsp),%edx
movsbl 0x5(%rsp),%ecx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
movsbl 0x4(%rsp),%edx
movsbl 0x5(%rsp),%ecx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe8d(%rip),%rdi
lea    0x7(%rsp),%rsi
lea    0x6(%rsp),%rcx
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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