int unsafe_character(char c) {
  int ret = 0;
  switch (c) {
  case '/':
    ret = 1;
    break;
  case '<':
    ret = 1;
    break;
  case '>':
    ret = 1;
    break;
  case ':':
    ret = 1;
    break;
  case '|':
    ret = 1;
    break;
  case '?':
    ret = 1;
    break;
  case '*':
    ret = 1;
    break;
  case '\"':
    ret = 1;
    break;
  case '\\':
    ret = 1;
    break;
  case '\0':
    ret = 1;
    break;
  default:
    break;
  }
  return ret;
}


x86 assembly (clang, -O0):
<unsafe_character>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     122a <unsafe_character+0x12a>
jmp    1125 <unsafe_character+0x25>
mov    -0xc(%rbp),%eax
sub    $0x22,%eax
je     1212 <unsafe_character+0x112>
jmp    1136 <unsafe_character+0x36>
mov    -0xc(%rbp),%eax
sub    $0x2a,%eax
je     1206 <unsafe_character+0x106>
jmp    1147 <unsafe_character+0x47>
mov    -0xc(%rbp),%eax
sub    $0x2f,%eax
je     11be <unsafe_character+0xbe>
jmp    1158 <unsafe_character+0x58>
mov    -0xc(%rbp),%eax
sub    $0x3a,%eax
je     11e2 <unsafe_character+0xe2>
jmp    1169 <unsafe_character+0x69>
mov    -0xc(%rbp),%eax
sub    $0x3c,%eax
je     11ca <unsafe_character+0xca>
jmp    117a <unsafe_character+0x7a>
mov    -0xc(%rbp),%eax
sub    $0x3e,%eax
je     11d6 <unsafe_character+0xd6>
jmp    118b <unsafe_character+0x8b>
mov    -0xc(%rbp),%eax
sub    $0x3f,%eax
je     11fa <unsafe_character+0xfa>
jmp    119c <unsafe_character+0x9c>
mov    -0xc(%rbp),%eax
sub    $0x5c,%eax
je     121e <unsafe_character+0x11e>
jmp    11ad <unsafe_character+0xad>
mov    -0xc(%rbp),%eax
sub    $0x7c,%eax
je     11ee <unsafe_character+0xee>
jmp    1236 <unsafe_character+0x136>
movl   $0x1,-0x8(%rbp)
jmp    123b <unsafe_character+0x13b>
movl   $0x1,-0x8(%rbp)
jmp    123b <unsafe_character+0x13b>
movl   $0x1,-0x8(%rbp)
jmp    123b <unsafe_character+0x13b>
movl   $0x1,-0x8(%rbp)
jmp    123b <unsafe_character+0x13b>
movl   $0x1,-0x8(%rbp)
jmp    123b <unsafe_character+0x13b>
movl   $0x1,-0x8(%rbp)
jmp    123b <unsafe_character+0x13b>
movl   $0x1,-0x8(%rbp)
jmp    123b <unsafe_character+0x13b>
movl   $0x1,-0x8(%rbp)
jmp    123b <unsafe_character+0x13b>
movl   $0x1,-0x8(%rbp)
jmp    123b <unsafe_character+0x13b>
movl   $0x1,-0x8(%rbp)
jmp    123b <unsafe_character+0x13b>
jmp    123b <unsafe_character+0x13b>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsafe_character>:
xor    %eax,%eax
lea    -0x22(%rdi),%ecx
cmp    $0x3a,%ecx
ja     1120 <unsafe_character+0x20>
lea    0xeef(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x1,%eax
ret
test   %edi,%edi
je     111a <unsafe_character+0x1a>
cmp    $0x7c,%edi
je     111a <unsafe_character+0x1a>
jmp    111f <unsafe_character+0x1f>

LLVM IR (-O0):
define i32 @unsafe_character(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %16 [
i32 47, label %6
i32 60, label %7
i32 62, label %8
i32 58, label %9
i32 124, label %10
i32 63, label %11
i32 42, label %12
i32 34, label %13
i32 92, label %14
i32 0, label %15
]
6: ; preds = %1
store i32 1, i32* %3
br label %17
7: ; preds = %1
store i32 1, i32* %3
br label %17
8: ; preds = %1
store i32 1, i32* %3
br label %17
9: ; preds = %1
store i32 1, i32* %3
br label %17
10: ; preds = %1
store i32 1, i32* %3
br label %17
11: ; preds = %1
store i32 1, i32* %3
br label %17
12: ; preds = %1
store i32 1, i32* %3
br label %17
13: ; preds = %1
store i32 1, i32* %3
br label %17
14: ; preds = %1
store i32 1, i32* %3
br label %17
15: ; preds = %1
store i32 1, i32* %3
br label %17
16: ; preds = %1
br label %17
17: ; preds = %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @unsafe_character(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %13 [
i32 47, label %3
i32 60, label %4
i32 62, label %5
i32 58, label %6
i32 124, label %7
i32 63, label %8
i32 42, label %9
i32 34, label %10
i32 92, label %11
i32 0, label %12
]
3: ; preds = %1
br label %13
4: ; preds = %1
br label %13
5: ; preds = %1
br label %13
6: ; preds = %1
br label %13
7: ; preds = %1
br label %13
8: ; preds = %1
br label %13
9: ; preds = %1
br label %13
10: ; preds = %1
br label %13
11: ; preds = %1
br label %13
12: ; preds = %1
br label %13
13: ; preds = %1, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3
%14 = phi i32 [ 0, %1 ], [ 1, %12 ], [ 1, %11 ], [ 1, %10 ], [ 1, %9 ], [ 1, %8 ], [ 1, %7 ], [ 1, %6 ], [ 1, %5 ], [ 1, %4 ], [ 1, %3 ]
ret i32 %14
}