#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 */
typedef int int32_t;

/* Variables and functions */
int32_t is_file_name_valid(const char *name) {
  while (*name) {
    switch (*name) {
    case '\\':
      return 0;
      break;
    case '/':
      return 0;
      break;
    case ':':
      return 0;
      break;
    case '*':
      return 0;
      break;
    case '?':
      return 0;
      break;
    case '"':
      return 0;
      break;
    case '<':
      return 0;
      break;
    case '>':
      return 0;
      break;
    case '|':
      return 0;
      break;
    default:
      break;
    }
    ++name;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_file_name_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1237 <is_file_name_valid+0x137>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0x22,%eax
je     11f1 <is_file_name_valid+0xf1>
jmp    112d <is_file_name_valid+0x2d>
mov    -0x14(%rbp),%eax
sub    $0x2a,%eax
je     11d9 <is_file_name_valid+0xd9>
jmp    113e <is_file_name_valid+0x3e>
mov    -0x14(%rbp),%eax
sub    $0x2f,%eax
je     11c1 <is_file_name_valid+0xc1>
jmp    114f <is_file_name_valid+0x4f>
mov    -0x14(%rbp),%eax
sub    $0x3a,%eax
je     11cd <is_file_name_valid+0xcd>
jmp    1160 <is_file_name_valid+0x60>
mov    -0x14(%rbp),%eax
sub    $0x3c,%eax
je     11fd <is_file_name_valid+0xfd>
jmp    1171 <is_file_name_valid+0x71>
mov    -0x14(%rbp),%eax
sub    $0x3e,%eax
je     1209 <is_file_name_valid+0x109>
jmp    1182 <is_file_name_valid+0x82>
mov    -0x14(%rbp),%eax
sub    $0x3f,%eax
je     11e5 <is_file_name_valid+0xe5>
jmp    1193 <is_file_name_valid+0x93>
mov    -0x14(%rbp),%eax
sub    $0x5c,%eax
je     11b5 <is_file_name_valid+0xb5>
jmp    11a4 <is_file_name_valid+0xa4>
mov    -0x14(%rbp),%eax
sub    $0x7c,%eax
je     1215 <is_file_name_valid+0x115>
jmp    1221 <is_file_name_valid+0x121>
movl   $0x0,-0x4(%rbp)
jmp    123e <is_file_name_valid+0x13e>
movl   $0x0,-0x4(%rbp)
jmp    123e <is_file_name_valid+0x13e>
movl   $0x0,-0x4(%rbp)
jmp    123e <is_file_name_valid+0x13e>
movl   $0x0,-0x4(%rbp)
jmp    123e <is_file_name_valid+0x13e>
movl   $0x0,-0x4(%rbp)
jmp    123e <is_file_name_valid+0x13e>
movl   $0x0,-0x4(%rbp)
jmp    123e <is_file_name_valid+0x13e>
movl   $0x0,-0x4(%rbp)
jmp    123e <is_file_name_valid+0x13e>
movl   $0x0,-0x4(%rbp)
jmp    123e <is_file_name_valid+0x13e>
movl   $0x0,-0x4(%rbp)
jmp    123e <is_file_name_valid+0x13e>
jmp    1226 <is_file_name_valid+0x126>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <is_file_name_valid+0x8>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_file_name_valid>:
mov    (%rdi),%al
test   %al,%al
je     1137 <is_file_name_valid+0x37>
add    $0x1,%rdi
movabs $0x400000035002101,%rcx
movsbl %al,%edx
xor    %eax,%eax
lea    -0x22(%rdx),%esi
cmp    $0x3a,%esi
ja     1127 <is_file_name_valid+0x27>
bt     %rsi,%rcx
jb     113c <is_file_name_valid+0x3c>
cmp    $0x7c,%edx
je     113c <is_file_name_valid+0x3c>
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1114 <is_file_name_valid+0x14>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_file_name_valid(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %22, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %25
8: ; preds = %4
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
switch i32 %11, label %21 [
i32 92, label %12
i32 47, label %13
i32 58, label %14
i32 42, label %15
i32 63, label %16
i32 34, label %17
i32 60, label %18
i32 62, label %19
i32 124, label %20
]
12: ; preds = %8
store i32 0, i32* %2
br label %26
13: ; preds = %8
store i32 0, i32* %2
br label %26
14: ; preds = %8
store i32 0, i32* %2
br label %26
15: ; preds = %8
store i32 0, i32* %2
br label %26
16: ; preds = %8
store i32 0, i32* %2
br label %26
17: ; preds = %8
store i32 0, i32* %2
br label %26
18: ; preds = %8
store i32 0, i32* %2
br label %26
19: ; preds = %8
store i32 0, i32* %2
br label %26
20: ; preds = %8
store i32 0, i32* %2
br label %26
21: ; preds = %8
br label %22
22: ; preds = %21
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %3
br label %4
25: ; preds = %4
store i32 1, i32* %2
br label %26
26: ; preds = %25, %20, %19, %18, %17, %16, %15, %14, %13, %12
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @is_file_name_valid(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %8
%5 = phi i8 [ %10, %8 ], [ %2, %1 ]
%6 = phi i8* [ %9, %8 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
switch i32 %7, label %8 [
i32 92, label %12
i32 47, label %12
i32 58, label %12
i32 42, label %12
i32 63, label %12
i32 34, label %12
i32 60, label %12
i32 62, label %12
i32 124, label %12
]
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %4, %4, %4, %4, %4, %4, %4, %4, %8, %1
%13 = phi i32 [ 1, %1 ], [ 1, %8 ], [ 0, %4 ], [ 0, %4 ], [ 0, %4 ], [ 0, %4 ], [ 0, %4 ], [ 0, %4 ], [ 0, %4 ], [ 0, %4 ], [ 0, %4 ]
ret i32 %13
}