#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int a, b, n;
  n = 1;
  scanf("%d", &a);
  printf("%s\n", ((-100 <= a && a <= 100) ? "true" : "false"));
  printf("Input a number > 100 in hex:\n");
  scanf("%x", &b);
  while (n < (9 + 1)) {
    b = b << 1;
    if (n == 9) {
      printf("%s\n", (b & 1) ? ("bit = 1") : ("bit = 0"));
    }
    ++n;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
mov    $0xffffff9c,%ecx
cmp    -0x8(%rbp),%ecx
mov    %al,-0x11(%rbp)
jg     1163 <main+0x43>
cmpl   $0x64,-0x8(%rbp)
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%cl
lea    0xe9f(%rip),%rsi
lea    0xe93(%rip),%rax
test   $0x1,%cl
cmovne %rax,%rsi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe92(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xa,-0x10(%rbp)
jge    11fb <main+0xdb>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x9,-0x10(%rbp)
jne    11ed <main+0xcd>
mov    -0xc(%rbp),%ecx
and    $0x1,%ecx
lea    0xe6a(%rip),%rsi
lea    0xe5b(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11a7 <main+0x87>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0x64,%eax
cmp    $0xc9,%eax
lea    0xebe(%rip),%rax
lea    0xebc(%rip),%rdi
cmovb  %rax,%rdi
call   1030 <puts@plt>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
lea    0xea6(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
shll   $0x9,(%rsp)
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [5 x i8] c"true\00"
@.str.3 = [6 x i8] c"false\00"
@.str.4 = [30 x i8] c"Input a number > 100 in hex:\0A\00"
@.str.5 = [3 x i8] c"%x\00"
@.str.6 = [8 x i8] c"bit = 1\00"
@.str.7 = [8 x i8] c"bit = 0\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %4
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = icmp sle i32 -100, %6
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i32, i32* %2
%10 = icmp sle i32 %9, 100
br label %11
11: ; preds = %8, %0
%12 = phi i1 [ false, %0 ], [ %10, %8 ]
%13 = zext i1 %12 to i64
%14 = select i1 %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %3)
br label %18
18: ; preds = %33, %11
%19 = load i32, i32* %4
%20 = icmp slt i32 %19, 10
br i1 %20, label %21, label %36
21: ; preds = %18
%22 = load i32, i32* %3
%23 = shl i32 %22, 1
store i32 %23, i32* %3
%24 = load i32, i32* %4
%25 = icmp eq i32 %24, 9
br i1 %25, label %26, label %33
26: ; preds = %21
%27 = load i32, i32* %3
%28 = and i32 %27, 1
%29 = icmp ne i32 %28, 0
%30 = zext i1 %29 to i64
%31 = select i1 %29, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0)
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %31)
br label %33
33: ; preds = %26, %21
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
br label %18
36: ; preds = %18
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"true\00"
@.str.3 = [6 x i8] c"false\00"
@.str.5 = [3 x i8] c"%x\00"
@.str.7 = [8 x i8] c"bit = 0\00"
@str = [29 x i8] c"Input a number > 100 in hex:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = add i32 %6, 100
%8 = icmp ult i32 %7, 201
%9 = select i1 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0)
%10 = call i32 @puts(i8* dereferenceable(1) %9)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %2)
%13 = load i32, i32* %2
%14 = shl i32 %13, 9
store i32 %14, i32* %2
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}