int main() {
  int x;
  x = 0;
  x = x + 2;
  x = x - 1;
  x = x * 6;
  x = x / 2;
  x = x % 2;
  x = x << 2;
  x = x >> 1;
  x = x | 255;
  x = x & 3;
  x = x ^ 1;
  x = x + (x > 1);
  x = x + (x < 3);
  x = x + (x > 1);
  x = x + (x < 4);
  if (x != 4)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
imul   $0x6,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmpl   $0x1,-0x8(%rbp)
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmpl   $0x3,-0x8(%rbp)
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmpl   $0x1,-0x8(%rbp)
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmpl   $0x4,-0x8(%rbp)
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     11e0 <main+0xe0>
movl   $0x1,-0x4(%rbp)
jmp    11e7 <main+0xe7>
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, 2
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = sub nsw i32 %5, 1
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = mul nsw i32 %7, 6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = sdiv i32 %9, 2
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = srem i32 %11, 2
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = shl i32 %13, 2
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 1
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = or i32 %17, 255
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = and i32 %19, 3
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = xor i32 %21, 1
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = load i32, i32* %2
%25 = icmp sgt i32 %24, 1
%26 = zext i1 %25 to i32
%27 = add nsw i32 %23, %26
store i32 %27, i32* %2
%28 = load i32, i32* %2
%29 = load i32, i32* %2
%30 = icmp slt i32 %29, 3
%31 = zext i1 %30 to i32
%32 = add nsw i32 %28, %31
store i32 %32, i32* %2
%33 = load i32, i32* %2
%34 = load i32, i32* %2
%35 = icmp sgt i32 %34, 1
%36 = zext i1 %35 to i32
%37 = add nsw i32 %33, %36
store i32 %37, i32* %2
%38 = load i32, i32* %2
%39 = load i32, i32* %2
%40 = icmp slt i32 %39, 4
%41 = zext i1 %40 to i32
%42 = add nsw i32 %38, %41
store i32 %42, i32* %2
%43 = load i32, i32* %2
%44 = icmp ne i32 %43, 4
br i1 %44, label %45, label %46
45: ; preds = %0
store i32 1, i32* %1
br label %47
46: ; preds = %0
store i32 0, i32* %1
br label %47
47: ; preds = %46, %45
%48 = load i32, i32* %1
ret i32 %48
}

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