#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*/ is_alpha(int const);
int /*<<< orphan*/ is_digit(int const);
bool is_uri_scheme_char(const int c) {
  switch (c) {
  case ':':
  case '+':
  case '-':
  case '.':
    return true;
  default:
    return is_alpha(c) || is_digit(c);
  }
}


x86 assembly (clang, -O0):
<is_uri_scheme_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2b,%eax
je     1164 <is_uri_scheme_char+0x44>
jmp    113f <is_uri_scheme_char+0x1f>
mov    -0xc(%rbp),%eax
add    $0xffffffd3,%eax
sub    $0x2,%eax
jb     1164 <is_uri_scheme_char+0x44>
jmp    1153 <is_uri_scheme_char+0x33>
mov    -0xc(%rbp),%eax
sub    $0x3a,%eax
jne    1170 <is_uri_scheme_char+0x50>
jmp    1164 <is_uri_scheme_char+0x44>
movl   $0x1,-0x4(%rbp)
jmp    11a4 <is_uri_scheme_char+0x84>
mov    -0x8(%rbp),%edi
call   1040 <is_alpha@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
jne    1199 <is_uri_scheme_char+0x79>
mov    -0x8(%rbp),%edi
call   1030 <is_digit@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_uri_scheme_char>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x1,%ebx
cmp    $0x3a,%edi
ja     114a <is_uri_scheme_char+0x2a>
mov    %ebp,%eax
movabs $0x400680000000000,%rcx
bt     %rax,%rcx
jae    114a <is_uri_scheme_char+0x2a>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %ebp,%edi
call   1040 <is_alpha@plt>
test   %eax,%eax
jne    1141 <is_uri_scheme_char+0x21>
mov    %ebp,%edi
call   1030 <is_digit@plt>
xor    %ebx,%ebx
test   %eax,%eax
setne  %bl
jmp    1141 <is_uri_scheme_char+0x21>

LLVM IR (-O0):
define i32 @is_uri_scheme_char(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 58, label %5
i32 43, label %5
i32 45, label %5
i32 46, label %5
]
5: ; preds = %1, %1, %1, %1
store i32 1, i32* %2
br label %17
6: ; preds = %1
%7 = load i32, i32* %3
%8 = call i32 @is_alpha(i32 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %3
%12 = call i32 @is_digit(i32 %11)
%13 = icmp ne i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
store i32 %16, i32* %2
br label %17
17: ; preds = %14, %5
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_uri_scheme_char(i32 %0) {
switch i32 %0, label %2 [
i32 58, label %9
i32 43, label %9
i32 45, label %9
i32 46, label %9
]
2: ; preds = %1
%3 = tail call i32 @is_alpha(i32 %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @is_digit(i32 %0)
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %2, %5, %1, %1, %1, %1
%10 = phi i32 [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}