#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(int argc, char **argv) {
  int x;
  printf("Please enter a number between 0 and 255: ");
  scanf("%d", &x);
  if ((x<0 | x> 255) & (x != -1)) {
    printf("You entered an improper value or it was out of range...\n");
  } else if ((x >= 0) & (x <= 255)) {
    printf("%c\n", x);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x14(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0xff,-0x14(%rbp)
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
cmpl   $0xffffffff,-0x14(%rbp)
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     119d <main+0x7d>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11da <main+0xba>
cmpl   $0x0,-0x14(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0xff,-0x14(%rbp)
setle  %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     11d5 <main+0xb5>
mov    -0x14(%rbp),%esi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11da <main+0xba>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
mov    %esi,%eax
shr    $0x1f,%eax
xor    %ecx,%ecx
cmp    $0x100,%esi
setge  %cl
or     %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%esi
setne  %al
test   %eax,%ecx
je     1180 <main+0x50>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
jmp    11a4 <main+0x74>
mov    %esi,%eax
not    %eax
shr    $0x1f,%eax
xor    %ecx,%ecx
cmp    $0x100,%esi
setl   %cl
test   %ecx,%eax
je     11a4 <main+0x74>
lea    0xe90(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Please enter a number between 0 and 255: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [57 x i8] c"You entered an improper value or it was out of range...\0A\00"
@.str.3 = [4 x i8] c"%c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 0
%11 = zext i1 %10 to i32
%12 = load i32, i32* %6
%13 = icmp sgt i32 %12, 255
%14 = zext i1 %13 to i32
%15 = or i32 %11, %14
%16 = load i32, i32* %6
%17 = icmp ne i32 %16, -1
%18 = zext i1 %17 to i32
%19 = and i32 %15, %18
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %2
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0))
br label %36
23: ; preds = %2
%24 = load i32, i32* %6
%25 = icmp sge i32 %24, 0
%26 = zext i1 %25 to i32
%27 = load i32, i32* %6
%28 = icmp sle i32 %27, 255
%29 = zext i1 %28 to i32
%30 = and i32 %26, %29
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %23
%33 = load i32, i32* %6
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %33)
br label %35
35: ; preds = %32, %23
br label %36
36: ; preds = %35, %21
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
@.str = [42 x i8] c"Please enter a number between 0 and 255: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [4 x i8] c"%c\0A\00"
@str = [56 x i8] c"You entered an improper value or it was out of range...\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = lshr i32 %7, 31
%9 = icmp sgt i32 %7, 255
%10 = zext i1 %9 to i32
%11 = or i32 %8, %10
%12 = icmp ne i32 %7, -1
%13 = zext i1 %12 to i32
%14 = and i32 %11, %13
%15 = icmp eq i32 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
br label %27
18: ; preds = %2
%19 = xor i32 %7, -1
%20 = lshr i32 %19, 31
%21 = icmp slt i32 %7, 256
%22 = zext i1 %21 to i32
%23 = and i32 %20, %22
%24 = icmp eq i32 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %18
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %7)
br label %27
27: ; preds = %18, %25, %16
ret i32 0
}