#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 INT_MIN;
int /*<<< orphan*/ printf(char *, int);
int random();
int main() {
  int x = random();
  int y = random();
  unsigned ux = (unsigned)x;
  unsigned uy = (unsigned)y;
  printf("(x > INT_MIN) == (-x < -INT_MIN): %d\n",
         (x > INT_MIN) == (-x < -INT_MIN));
  printf("((x + y) << 5) + x - y == 31 * y + 33 * x: %d\n",
         ((x + y) << 5) + x - y == (x << 5) + x + (y << 5) - y);
  printf("((x + y) << 5) + x - y == 31 * y + 33 * x: %d\n",
         ((x + y) << 5) + x - y == 31 * y + 33 * x);
  printf("~x + ~y == ~(x + y): %d\n", ~x + ~(-1) == ~(x + (-1)));
  printf("(int) (ux - uy) == -(y - x): %d\n", (int)(ux - uy) == -(y - x));
  printf("((x >> 1) << 1) <= x: %d\n", ((x >> 1) << 1) <= x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <random@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <random@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2e8f(%rip),%rcx
cmp    (%rcx),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
xor    %edx,%edx
mov    0x2e77(%rip),%rsi
sub    (%rsi),%edx
cmp    %edx,%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x5,%ecx
add    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%edx
shl    $0x5,%edx
add    %edx,%ecx
sub    -0xc(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
imul   $0x1f,-0xc(%rbp),%ecx
imul   $0x21,-0x8(%rbp),%edx
add    %edx,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe2f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
add    $0x0,%eax
mov    -0x8(%rbp),%ecx
add    $0xffffffff,%ecx
xor    $0xffffffff,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe36(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    -0xc(%rbp),%edx
sub    -0x8(%rbp),%edx
xor    %ecx,%ecx
sub    %edx,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe29(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
shl    $0x1,%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe2a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <random@plt>
mov    %eax,%r13d
xor    %eax,%eax
call   1040 <random@plt>
mov    %eax,%r14d
lea    0xeba(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    (%r14,%r13,1),%eax
shl    $0x5,%eax
add    %r13d,%eax
mov    %eax,%r12d
sub    %r14d,%r12d
mov    %r13d,%ebx
shl    $0x5,%ebx
add    %r13d,%ebx
mov    %r14d,%ebp
shl    $0x5,%ebp
lea    (%rbx,%rbp,1),%ecx
xor    %esi,%esi
cmp    %ecx,%eax
sete   %sil
lea    0xea5(%rip),%r15
mov    %r15,%rdi
call   1030 <printf@plt>
sub    %r14d,%ebp
add    %ebx,%ebp
xor    %esi,%esi
cmp    %ebp,%r12d
sete   %sil
mov    %r15,%rdi
call   1030 <printf@plt>
mov    %r13d,%eax
not    %eax
xor    %esi,%esi
add    %r13d,%eax
sete   %sil
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeae(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %r13d,%eax
and    $0xfffffffe,%eax
xor    %esi,%esi
cmp    %r13d,%eax
setle  %sil
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [38 x i8] c"(x > INT_MIN) == (-x < -INT_MIN): %d\0A\00"
@INT_MIN = global i32 0
@.str.1 = [47 x i8] c"((x + y) << 5) + x - y == 31 * y + 33 * x: %d\0A\00"
@.str.2 = [25 x i8] c"~x + ~y == ~(x + y): %d\0A\00"
@.str.3 = [33 x i8] c"(int) (ux - uy) == -(y - x): %d\0A\00"
@.str.4 = [26 x i8] c"((x >> 1) << 1) <= x: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (...) @random()
store i32 %6, i32* %2
%7 = call i32 (...) @random()
store i32 %7, i32* %3
%8 = load i32, i32* %2
store i32 %8, i32* %4
%9 = load i32, i32* %3
store i32 %9, i32* %5
%10 = load i32, i32* %2
%11 = load i32, i32* @INT_MIN
%12 = icmp sgt i32 %10, %11
%13 = zext i1 %12 to i32
%14 = load i32, i32* %2
%15 = sub nsw i32 0, %14
%16 = load i32, i32* @INT_MIN
%17 = sub nsw i32 0, %16
%18 = icmp slt i32 %15, %17
%19 = zext i1 %18 to i32
%20 = icmp eq i32 %13, %19
%21 = zext i1 %20 to i32
%22 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = load i32, i32* %2
%24 = load i32, i32* %3
%25 = add nsw i32 %23, %24
%26 = shl i32 %25, 5
%27 = load i32, i32* %2
%28 = add nsw i32 %26, %27
%29 = load i32, i32* %3
%30 = sub nsw i32 %28, %29
%31 = load i32, i32* %2
%32 = shl i32 %31, 5
%33 = load i32, i32* %2
%34 = add nsw i32 %32, %33
%35 = load i32, i32* %3
%36 = shl i32 %35, 5
%37 = add nsw i32 %34, %36
%38 = load i32, i32* %3
%39 = sub nsw i32 %37, %38
%40 = icmp eq i32 %30, %39
%41 = zext i1 %40 to i32
%42 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 %41)
%43 = load i32, i32* %2
%44 = load i32, i32* %3
%45 = add nsw i32 %43, %44
%46 = shl i32 %45, 5
%47 = load i32, i32* %2
%48 = add nsw i32 %46, %47
%49 = load i32, i32* %3
%50 = sub nsw i32 %48, %49
%51 = load i32, i32* %3
%52 = mul nsw i32 31, %51
%53 = load i32, i32* %2
%54 = mul nsw i32 33, %53
%55 = add nsw i32 %52, %54
%56 = icmp eq i32 %50, %55
%57 = zext i1 %56 to i32
%58 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 %57)
%59 = load i32, i32* %2
%60 = xor i32 %59, -1
%61 = add nsw i32 %60, 0
%62 = load i32, i32* %2
%63 = add nsw i32 %62, -1
%64 = xor i32 %63, -1
%65 = icmp eq i32 %61, %64
%66 = zext i1 %65 to i32
%67 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %66)
%68 = load i32, i32* %4
%69 = load i32, i32* %5
%70 = sub i32 %68, %69
%71 = load i32, i32* %3
%72 = load i32, i32* %2
%73 = sub nsw i32 %71, %72
%74 = sub nsw i32 0, %73
%75 = icmp eq i32 %70, %74
%76 = zext i1 %75 to i32
%77 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %76)
%78 = load i32, i32* %2
%79 = ashr i32 %78, 1
%80 = shl i32 %79, 1
%81 = load i32, i32* %2
%82 = icmp sle i32 %80, %81
%83 = zext i1 %82 to i32
%84 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %83)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"(x > INT_MIN) == (-x < -INT_MIN): %d\0A\00"
@INT_MIN = global i32 0
@.str.1 = [47 x i8] c"((x + y) << 5) + x - y == 31 * y + 33 * x: %d\0A\00"
@.str.2 = [25 x i8] c"~x + ~y == ~(x + y): %d\0A\00"
@.str.3 = [33 x i8] c"(int) (ux - uy) == -(y - x): %d\0A\00"
@.str.4 = [26 x i8] c"((x >> 1) << 1) <= x: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @random()
%2 = tail call i32 (...) @random()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = add nsw i32 %2, %1
%5 = shl i32 %4, 5
%6 = add nsw i32 %5, %1
%7 = sub nsw i32 %6, %2
%8 = mul i32 %1, 33
%9 = shl i32 %2, 5
%10 = add nsw i32 %9, %8
%11 = icmp eq i32 %6, %10
%12 = zext i1 %11 to i32
%13 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = mul nsw i32 %2, 31
%15 = add nsw i32 %14, %8
%16 = icmp eq i32 %7, %15
%17 = zext i1 %16 to i32
%18 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = xor i32 %1, -1
%20 = sub i32 0, %1
%21 = icmp eq i32 %19, %20
%22 = zext i1 %21 to i32
%23 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %22)
%24 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 1)
%25 = and i32 %1, -2
%26 = icmp sle i32 %25, %1
%27 = zext i1 %26 to i32
%28 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %27)
ret i32 0
}