#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 */
scalar_t__ strchr(char *, int);
int is_printable(unsigned long value) {
  int ch;
  if (value > 0x7f)
    return 0;
  ch = (int)value;
  if ((ch >= 'a') && (ch <= 'z'))
    return 1;
  if ((ch >= 'A') && (ch <= 'Z'))
    return 1;
  if ((ch >= '0') && (ch <= '9'))
    return 1;
  if ((ch == ' ') || strchr("'()+,-./:=?", ch))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_printable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x7f,-0x10(%rbp)
jbe    1133 <is_printable+0x23>
movl   $0x0,-0x4(%rbp)
jmp    11d0 <is_printable+0xc0>
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
cmpl   $0x61,-0x14(%rbp)
jl     115a <is_printable+0x4a>
cmpl   $0x7a,-0x14(%rbp)
jg     115a <is_printable+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    11d0 <is_printable+0xc0>
cmpl   $0x41,-0x14(%rbp)
jl     117a <is_printable+0x6a>
cmpl   $0x5a,-0x14(%rbp)
jg     117a <is_printable+0x6a>
movl   $0x1,-0x4(%rbp)
jmp    11d0 <is_printable+0xc0>
cmpl   $0x30,-0x14(%rbp)
jl     119a <is_printable+0x8a>
cmpl   $0x39,-0x14(%rbp)
jg     119a <is_printable+0x8a>
movl   $0x1,-0x4(%rbp)
jmp    11d0 <is_printable+0xc0>
cmpl   $0x20,-0x14(%rbp)
je     11bd <is_printable+0xad>
mov    -0x14(%rbp),%esi
lea    0xe52(%rip),%rdi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     11c9 <is_printable+0xb9>
movl   $0x1,-0x4(%rbp)
jmp    11d0 <is_printable+0xc0>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_printable>:
xor    %eax,%eax
cmp    $0x7f,%rdi
ja     1156 <is_printable+0x46>
mov    %rdi,%rsi
mov    $0x1,%eax
cmp    $0x20,%esi
je     1156 <is_printable+0x46>
lea    -0x30(%rsi),%ecx
cmp    $0xa,%ecx
jb     1156 <is_printable+0x46>
mov    %esi,%ecx
and    $0xffffffdf,%ecx
add    $0xffffffbf,%ecx
cmp    $0x1a,%ecx
jb     1156 <is_printable+0x46>
push   %rax
lea    0xebe(%rip),%rdi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"'()+,-./:=?\00"
define i32 @is_printable(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp ugt i64 %5, 127
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %40
8: ; preds = %1
%9 = load i64, i64* %3
%10 = trunc i64 %9 to i32
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = icmp sge i32 %11, 97
br i1 %12, label %13, label %17
13: ; preds = %8
%14 = load i32, i32* %4
%15 = icmp sle i32 %14, 122
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 1, i32* %2
br label %40
17: ; preds = %13, %8
%18 = load i32, i32* %4
%19 = icmp sge i32 %18, 65
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = load i32, i32* %4
%22 = icmp sle i32 %21, 90
br i1 %22, label %23, label %24
23: ; preds = %20
store i32 1, i32* %2
br label %40
24: ; preds = %20, %17
%25 = load i32, i32* %4
%26 = icmp sge i32 %25, 48
br i1 %26, label %27, label %31
27: ; preds = %24
%28 = load i32, i32* %4
%29 = icmp sle i32 %28, 57
br i1 %29, label %30, label %31
30: ; preds = %27
store i32 1, i32* %2
br label %40
31: ; preds = %27, %24
%32 = load i32, i32* %4
%33 = icmp eq i32 %32, 32
br i1 %33, label %38, label %34
34: ; preds = %31
%35 = load i32, i32* %4
%36 = call i64 @strchr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %35)
%37 = icmp ne i64 %36, 0
br i1 %37, label %38, label %39
38: ; preds = %34, %31
store i32 1, i32* %2
br label %40
39: ; preds = %34
store i32 0, i32* %2
br label %40
40: ; preds = %39, %38, %30, %23, %16, %7
%41 = load i32, i32* %2
ret i32 %41
}

LLVM IR (-O2):
@.str = [12 x i8] c"'()+,-./:=?\00"
define i32 @is_printable(i64 %0) {
%2 = icmp ugt i64 %0, 127
br i1 %2, label %17, label %3
3: ; preds = %1
%4 = trunc i64 %0 to i32
%5 = and i32 %4, -33
%6 = add nsw i32 %5, -65
%7 = icmp ult i32 %6, 26
%8 = add nsw i32 %4, -48
%9 = icmp ult i32 %8, 10
%10 = or i1 %9, %7
%11 = icmp eq i32 %4, 32
%12 = or i1 %11, %10
br i1 %12, label %17, label %13
13: ; preds = %3
%14 = tail call i64 @strchr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
%15 = icmp ne i64 %14, 0
%16 = zext i1 %15 to i32
br label %17
17: ; preds = %13, %3, %1
%18 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %16, %13 ]
ret i32 %18
}