int main() {
  int arr[2];
  int *p;
  arr[0] = 2;
  arr[1] = 3;
  p = &arr[0];
  if (*(p++) != 2)
    return 1;
  if (*(p++) != 3)
    return 2;
  p = &arr[1];
  if (*(p--) != 3)
    return 1;
  if (*(p--) != 2)
    return 2;
  p = &arr[0];
  if (*(++p) != 3)
    return 1;
  p = &arr[1];
  if (*(--p) != 2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x3,-0x8(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
cmpl   $0x2,(%rax)
je     1145 <main+0x45>
movl   $0x1,-0x4(%rbp)
jmp    1222 <main+0x122>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
cmpl   $0x3,(%rax)
je     1169 <main+0x69>
movl   $0x2,-0x4(%rbp)
jmp    1222 <main+0x122>
lea    -0xc(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x18(%rbp)
cmpl   $0x3,(%rax)
je     1199 <main+0x99>
movl   $0x1,-0x4(%rbp)
jmp    1222 <main+0x122>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x18(%rbp)
cmpl   $0x2,(%rax)
je     11bd <main+0xbd>
movl   $0x2,-0x4(%rbp)
jmp    1222 <main+0x122>
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
cmpl   $0x3,0x4(%rax)
je     11ea <main+0xea>
movl   $0x1,-0x4(%rbp)
jmp    1222 <main+0x122>
lea    -0xc(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x18(%rbp)
cmpl   $0x2,-0x4(%rax)
je     121b <main+0x11b>
movl   $0x1,-0x4(%rbp)
jmp    1222 <main+0x122>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = alloca i32*
store i32 0, i32* %1
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
store i32 2, i32* %4
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
store i32 3, i32* %5
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i32 1
store i32* %8, i32** %3
%9 = load i32, i32* %7
%10 = icmp ne i32 %9, 2
br i1 %10, label %11, label %12
11: ; preds = %0
store i32 1, i32* %1
br label %46
12: ; preds = %0
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i32 1
store i32* %14, i32** %3
%15 = load i32, i32* %13
%16 = icmp ne i32 %15, 3
br i1 %16, label %17, label %18
17: ; preds = %12
store i32 2, i32* %1
br label %46
18: ; preds = %12
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
store i32* %19, i32** %3
%20 = load i32*, i32** %3
%21 = getelementptr inbounds i32, i32* %20, i32 -1
store i32* %21, i32** %3
%22 = load i32, i32* %20
%23 = icmp ne i32 %22, 3
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 1, i32* %1
br label %46
25: ; preds = %18
%26 = load i32*, i32** %3
%27 = getelementptr inbounds i32, i32* %26, i32 -1
store i32* %27, i32** %3
%28 = load i32, i32* %26
%29 = icmp ne i32 %28, 2
br i1 %29, label %30, label %31
30: ; preds = %25
store i32 2, i32* %1
br label %46
31: ; preds = %25
%32 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
store i32* %32, i32** %3
%33 = load i32*, i32** %3
%34 = getelementptr inbounds i32, i32* %33, i32 1
store i32* %34, i32** %3
%35 = load i32, i32* %34
%36 = icmp ne i32 %35, 3
br i1 %36, label %37, label %38
37: ; preds = %31
store i32 1, i32* %1
br label %46
38: ; preds = %31
%39 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
store i32* %39, i32** %3
%40 = load i32*, i32** %3
%41 = getelementptr inbounds i32, i32* %40, i32 -1
store i32* %41, i32** %3
%42 = load i32, i32* %41
%43 = icmp ne i32 %42, 2
br i1 %43, label %44, label %45
44: ; preds = %38
store i32 1, i32* %1
br label %46
45: ; preds = %38
store i32 0, i32* %1
br label %46
46: ; preds = %45, %44, %37, %30, %24, %17, %11
%47 = load i32, i32* %1
ret i32 %47
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}