#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(void) {
  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 == 31 * y + 33 * x);
  printf("~x + ~y == ~(x + y): %d\n", ~x + ~y == ~(x + y));
  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
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    0xe68(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe6a(%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    0xe5d(%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    0xe5d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <random@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1040 <random@plt>
mov    %eax,%ebx
lea    0xec2(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    (%rbx,%r14,1),%ebp
mov    %ebp,%eax
shl    $0x5,%eax
mov    %r14d,%ecx
sub    %ebx,%ecx
add    %eax,%ecx
mov    %ebx,%eax
shl    $0x5,%eax
sub    %ebx,%eax
mov    %r14d,%edx
shl    $0x5,%edx
add    %r14d,%edx
add    %eax,%edx
xor    %esi,%esi
cmp    %edx,%ecx
sete   %sil
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    %r14d,%eax
not    %eax
not    %ebx
add    %eax,%ebx
not    %ebp
xor    %esi,%esi
cmp    %ebp,%ebx
sete   %sil
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %r14d,%eax
and    $0xfffffffe,%eax
xor    %esi,%esi
cmp    %r14d,%eax
setle  %sil
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
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 = [32 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* %3
%32 = mul nsw i32 31, %31
%33 = load i32, i32* %2
%34 = mul nsw i32 33, %33
%35 = add nsw i32 %32, %34
%36 = icmp eq i32 %30, %35
%37 = zext i1 %36 to i32
%38 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 %37)
%39 = load i32, i32* %2
%40 = xor i32 %39, -1
%41 = load i32, i32* %3
%42 = xor i32 %41, -1
%43 = add nsw i32 %40, %42
%44 = load i32, i32* %2
%45 = load i32, i32* %3
%46 = add nsw i32 %44, %45
%47 = xor i32 %46, -1
%48 = icmp eq i32 %43, %47
%49 = zext i1 %48 to i32
%50 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %49)
%51 = load i32, i32* %4
%52 = load i32, i32* %5
%53 = sub i32 %51, %52
%54 = load i32, i32* %3
%55 = load i32, i32* %2
%56 = sub nsw i32 %54, %55
%57 = sub nsw i32 0, %56
%58 = icmp eq i32 %53, %57
%59 = zext i1 %58 to i32
%60 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %59)
%61 = load i32, i32* %2
%62 = ashr i32 %61, 1
%63 = shl i32 %62, 1
%64 = load i32, i32* %2
%65 = icmp sle i32 %63, %64
%66 = zext i1 %65 to i32
%67 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %66)
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 = [32 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 = sub i32 %1, %2
%7 = add i32 %6, %5
%8 = mul nsw i32 %2, 31
%9 = mul nsw i32 %1, 33
%10 = add nsw i32 %8, %9
%11 = icmp eq i32 %7, %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 = xor i32 %1, -1
%15 = xor i32 %2, -1
%16 = add nsw i32 %15, %14
%17 = xor i32 %4, -1
%18 = icmp eq i32 %16, %17
%19 = zext i1 %18 to i32
%20 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %19)
%21 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 1)
%22 = and i32 %1, -2
%23 = icmp sle i32 %22, %1
%24 = zext i1 %23 to i32
%25 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %24)
ret i32 0
}