#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__ isalnum(char);
int is_legal_dos_char(char c) {
  return isalnum(c) || (c >= '!' && c <= ')') || (c == '-') || (c == '@') ||
         (c >= '^' && c <= '`') || (c == '{' || c == '}' || c == '~');
}


x86 assembly (clang, -O0):
<is_legal_dos_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    11d2 <is_legal_dos_char+0xc2>
movsbl -0x1(%rbp),%eax
cmp    $0x21,%eax
jl     1158 <is_legal_dos_char+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x29,%ecx
mov    %al,-0x2(%rbp)
jle    11d2 <is_legal_dos_char+0xc2>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2d,%ecx
mov    %al,-0x2(%rbp)
je     11d2 <is_legal_dos_char+0xc2>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x40,%ecx
mov    %al,-0x2(%rbp)
je     11d2 <is_legal_dos_char+0xc2>
movsbl -0x1(%rbp),%eax
cmp    $0x5e,%eax
jl     119b <is_legal_dos_char+0x8b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x60,%ecx
mov    %al,-0x2(%rbp)
jle    11d2 <is_legal_dos_char+0xc2>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7b,%ecx
mov    %al,-0x3(%rbp)
je     11cc <is_legal_dos_char+0xbc>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7d,%ecx
mov    %al,-0x3(%rbp)
je     11cc <is_legal_dos_char+0xbc>
movsbl -0x1(%rbp),%eax
cmp    $0x7e,%eax
sete   %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_legal_dos_char>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
mov    %rax,%rcx
lea    -0x21(%rbx),%edx
mov    $0x1,%eax
cmp    $0x9,%dl
jb     1151 <is_legal_dos_char+0x41>
test   %rcx,%rcx
jne    1151 <is_legal_dos_char+0x41>
cmp    $0x2d,%bl
je     1151 <is_legal_dos_char+0x41>
cmp    $0x40,%bl
je     1151 <is_legal_dos_char+0x41>
lea    -0x5e(%rbx),%ecx
cmp    $0x3,%cl
jb     1151 <is_legal_dos_char+0x41>
cmp    $0x7b,%bl
je     1151 <is_legal_dos_char+0x41>
cmp    $0x7d,%bl
je     1151 <is_legal_dos_char+0x41>
xor    %eax,%eax
cmp    $0x7e,%bl
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_legal_dos_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalnum(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %44, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 33
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 41
br i1 %13, label %44, label %14
14: ; preds = %10, %6
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 45
br i1 %17, label %44, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 64
br i1 %21, label %44, label %22
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sge i32 %24, 94
br i1 %25, label %26, label %30
26: ; preds = %22
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = icmp sle i32 %28, 96
br i1 %29, label %44, label %30
30: ; preds = %26, %22
%31 = load i8, i8* %2
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 123
br i1 %33, label %42, label %34
34: ; preds = %30
%35 = load i8, i8* %2
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 125
br i1 %37, label %42, label %38
38: ; preds = %34
%39 = load i8, i8* %2
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 126
br label %42
42: ; preds = %38, %34, %30
%43 = phi i1 [ true, %34 ], [ true, %30 ], [ %41, %38 ]
br label %44
44: ; preds = %42, %26, %18, %14, %10, %1
%45 = phi i1 [ true, %26 ], [ true, %18 ], [ true, %14 ], [ true, %10 ], [ true, %1 ], [ %43, %42 ]
%46 = zext i1 %45 to i32
ret i32 %46
}

LLVM IR (-O2):
define i32 @is_legal_dos_char(i8 signext %0) {
%2 = tail call i64 @isalnum(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = add i8 %0, -33
%5 = icmp ult i8 %4, 9
%6 = or i1 %5, %3
br i1 %6, label %15, label %7
7: ; preds = %1
switch i8 %0, label %8 [
i8 64, label %15
i8 45, label %15
]
8: ; preds = %7
%9 = add i8 %0, -94
%10 = icmp ult i8 %9, 3
br i1 %10, label %15, label %11
11: ; preds = %8
switch i8 %0, label %12 [
i8 125, label %15
i8 123, label %15
]
12: ; preds = %11
%13 = icmp eq i8 %0, 126
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %11, %11, %7, %7, %12, %8, %1
%16 = phi i32 [ 1, %1 ], [ 1, %7 ], [ 1, %8 ], [ 1, %11 ], [ %14, %12 ], [ 1, %7 ], [ 1, %11 ]
ret i32 %16
}