int main() {
  int x;
  x = 0;
  if (x++)
    return 1;
  if (x != 1)
    return 2;
  if (++x != 2)
    return 3;
  if (x != 2)
    return 4;
  if (--x != 1)
    return 5;
  if (x != 1)
    return 6;
  if (x-- != 1)
    return 7;
  if (x != 0)
    return 8;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1132 <main+0x32>
movl   $0x1,-0x4(%rbp)
jmp    11ed <main+0xed>
cmpl   $0x1,-0x8(%rbp)
je     1148 <main+0x48>
movl   $0x2,-0x4(%rbp)
jmp    11ed <main+0xed>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x2,%eax
je     1166 <main+0x66>
movl   $0x3,-0x4(%rbp)
jmp    11ed <main+0xed>
cmpl   $0x2,-0x8(%rbp)
je     117c <main+0x7c>
movl   $0x4,-0x4(%rbp)
jmp    11ed <main+0xed>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x1,%eax
je     119a <main+0x9a>
movl   $0x5,-0x4(%rbp)
jmp    11ed <main+0xed>
cmpl   $0x1,-0x8(%rbp)
je     11b0 <main+0xb0>
movl   $0x6,-0x4(%rbp)
jmp    11ed <main+0xed>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x1,%eax
je     11d0 <main+0xd0>
movl   $0x7,-0x4(%rbp)
jmp    11ed <main+0xed>
cmpl   $0x0,-0x8(%rbp)
je     11e6 <main+0xe6>
movl   $0x8,-0x4(%rbp)
jmp    11ed <main+0xed>
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 i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = icmp ne i32 %3, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* %1
br label %39
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 2, i32* %1
br label %39
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
%14 = icmp ne i32 %13, 2
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 3, i32* %1
br label %39
16: ; preds = %11
%17 = load i32, i32* %2
%18 = icmp ne i32 %17, 2
br i1 %18, label %19, label %20
19: ; preds = %16
store i32 4, i32* %1
br label %39
20: ; preds = %16
%21 = load i32, i32* %2
%22 = add nsw i32 %21, -1
store i32 %22, i32* %2
%23 = icmp ne i32 %22, 1
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 5, i32* %1
br label %39
25: ; preds = %20
%26 = load i32, i32* %2
%27 = icmp ne i32 %26, 1
br i1 %27, label %28, label %29
28: ; preds = %25
store i32 6, i32* %1
br label %39
29: ; preds = %25
%30 = load i32, i32* %2
%31 = add nsw i32 %30, -1
store i32 %31, i32* %2
%32 = icmp ne i32 %30, 1
br i1 %32, label %33, label %34
33: ; preds = %29
store i32 7, i32* %1
br label %39
34: ; preds = %29
%35 = load i32, i32* %2
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %38
37: ; preds = %34
store i32 8, i32* %1
br label %39
38: ; preds = %34
store i32 0, i32* %1
br label %39
39: ; preds = %38, %37, %33, %28, %24, %19, %15, %10, %6
%40 = load i32, i32* %1
ret i32 %40
}

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