#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 /*<<< orphan*/ getchar();
scalar_t__ printf(char *);
scalar_t__ test_option_a(int);
scalar_t__ test_option_b(int);
scalar_t__ test_option_c(int);
scalar_t__ test_option_d(int);
int main(void) {
  int w = sizeof(int) << 3;
  int any_bit_eql_1 = ~0;
  int any_bit_eql_0 = 0;
  int any_bit_in_lsb_eql_1 = 0xFF;
  int any_bit_in_msb_eql_0 = 0xFF << (w - 8);
  (test_option_a(any_bit_eql_1)) && (printf("Option A pass\n"));
  (test_option_b(any_bit_eql_0)) && (printf("Option B pass\12"));
  (test_option_c(any_bit_in_lsb_eql_1)) && (printf("Option C pass\n"));
  (test_option_d(any_bit_in_msb_eql_0)) && (printf("Option D Pass\n"));
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0xff,-0x14(%rbp)
mov    -0x8(%rbp),%ecx
sub    $0x8,%ecx
mov    $0xff,%eax
shl    %cl,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <test_option_a@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     11cb <main+0x6b>
lea    0xe44(%rip),%rdi
call   1030 <printf@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
mov    -0x10(%rbp),%edi
call   1070 <test_option_b@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1a(%rbp)
je     11fe <main+0x9e>
lea    0xe20(%rip),%rdi
call   1030 <printf@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1a(%rbp)
mov    -0x1a(%rbp),%al
mov    -0x14(%rbp),%edi
call   1050 <test_option_c@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1b(%rbp)
je     1231 <main+0xd1>
lea    0xdfc(%rip),%rdi
call   1030 <printf@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1b(%rbp)
mov    -0x1b(%rbp),%al
mov    -0x18(%rbp),%edi
call   1080 <test_option_d@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1c(%rbp)
je     1264 <main+0x104>
lea    0xdd8(%rip),%rdi
call   1030 <printf@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1c(%rbp)
mov    -0x1c(%rbp),%al
mov    $0x0,%al
call   1060 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffffff,%edi
call   1040 <test_option_a@plt>
test   %rax,%rax
je     117c <main+0x1c>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1070 <test_option_b@plt>
test   %rax,%rax
je     1194 <main+0x34>
lea    0xe8d(%rip),%rdi
call   1030 <puts@plt>
mov    $0xff,%edi
call   1050 <test_option_c@plt>
test   %rax,%rax
je     11af <main+0x4f>
lea    0xe64(%rip),%rdi
call   1030 <puts@plt>
mov    $0xff000000,%edi
call   1080 <test_option_d@plt>
test   %rax,%rax
je     11ca <main+0x6a>
lea    0xe3b(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Option A pass\0A\00"
@.str.1 = [15 x i8] c"Option B pass\0A\00"
@.str.2 = [15 x i8] c"Option C pass\0A\00"
@.str.3 = [15 x i8] c"Option D Pass\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 32, i32* %2
store i32 -1, i32* %3
store i32 0, i32* %4
store i32 255, i32* %5
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 8
%9 = shl i32 255, %8
store i32 %9, i32* %6
%10 = load i32, i32* %3
%11 = call i64 @test_option_a(i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %0
%14 = call i64 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%15 = icmp ne i64 %14, 0
br label %16
16: ; preds = %13, %0
%17 = phi i1 [ false, %0 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
%19 = load i32, i32* %4
%20 = call i64 @test_option_b(i32 %19)
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %16
%23 = call i64 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp ne i64 %23, 0
br label %25
25: ; preds = %22, %16
%26 = phi i1 [ false, %16 ], [ %24, %22 ]
%27 = zext i1 %26 to i32
%28 = load i32, i32* %5
%29 = call i64 @test_option_c(i32 %28)
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %25
%32 = call i64 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%33 = icmp ne i64 %32, 0
br label %34
34: ; preds = %31, %25
%35 = phi i1 [ false, %25 ], [ %33, %31 ]
%36 = zext i1 %35 to i32
%37 = load i32, i32* %6
%38 = call i64 @test_option_d(i32 %37)
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %43
40: ; preds = %34
%41 = call i64 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%42 = icmp ne i64 %41, 0
br label %43
43: ; preds = %40, %34
%44 = phi i1 [ false, %34 ], [ %42, %40 ]
%45 = zext i1 %44 to i32
%46 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Option D Pass\00"
@str.4 = [14 x i8] c"Option C pass\00"
@str.5 = [14 x i8] c"Option B pass\00"
@str.6 = [14 x i8] c"Option A pass\00"
define i32 @main() {
%1 = tail call i64 @test_option_a(i32 -1)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.6, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = tail call i64 @test_option_b(i32 0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.5, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
%11 = tail call i64 @test_option_c(i32 255)
%12 = icmp eq i64 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.4, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
%16 = tail call i64 @test_option_d(i32 -16777216)
%17 = icmp eq i64 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %15
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %20
20: ; preds = %18, %15
%21 = tail call i32 (...) @getchar()
ret i32 0
}