int GetPossibleCharacterSet(unsigned char C) {
  if (C <= '\x19')
    return 1;
  if (C >= '0' && C <= '9')
    return (1 + 2 + 4);
  if (C == (unsigned char)(128))
    return (1 + 2 + 4 + 64);
  if (C >= '\x60' && C <= '\x7f')
    return 2;
  return 1 + 2;
}


x86 assembly (clang, -O0):
<GetPossibleCharacterSet>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x19,%eax
jg     1123 <GetPossibleCharacterSet+0x23>
movl   $0x1,-0x4(%rbp)
jmp    1191 <GetPossibleCharacterSet+0x91>
movzbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1149 <GetPossibleCharacterSet+0x49>
movzbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1149 <GetPossibleCharacterSet+0x49>
movl   $0x7,-0x4(%rbp)
jmp    1191 <GetPossibleCharacterSet+0x91>
movzbl -0x5(%rbp),%eax
cmp    $0x80,%eax
jne    1164 <GetPossibleCharacterSet+0x64>
movl   $0x47,-0x4(%rbp)
jmp    1191 <GetPossibleCharacterSet+0x91>
movzbl -0x5(%rbp),%eax
cmp    $0x60,%eax
jl     118a <GetPossibleCharacterSet+0x8a>
movzbl -0x5(%rbp),%eax
cmp    $0x7f,%eax
jg     118a <GetPossibleCharacterSet+0x8a>
movl   $0x2,-0x4(%rbp)
jmp    1191 <GetPossibleCharacterSet+0x91>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetPossibleCharacterSet>:
mov    $0x1,%eax
cmp    $0x1a,%dil
jb     112f <GetPossibleCharacterSet+0x2f>
lea    -0x30(%rdi),%ecx
mov    $0x7,%eax
cmp    $0xa,%cl
jb     112f <GetPossibleCharacterSet+0x2f>
mov    $0x47,%eax
cmp    $0x80,%dil
je     112f <GetPossibleCharacterSet+0x2f>
xor    %eax,%eax
cmp    $0x60,%dil
setge  %al
xor    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @GetPossibleCharacterSet(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sle i32 %5, 25
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %32
8: ; preds = %1
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = icmp sge i32 %10, 48
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = icmp sle i32 %14, 57
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 7, i32* %2
br label %32
17: ; preds = %12, %8
%18 = load i8, i8* %3
%19 = zext i8 %18 to i32
%20 = icmp eq i32 %19, 128
br i1 %20, label %21, label %22
21: ; preds = %17
store i32 71, i32* %2
br label %32
22: ; preds = %17
%23 = load i8, i8* %3
%24 = zext i8 %23 to i32
%25 = icmp sge i32 %24, 96
br i1 %25, label %26, label %31
26: ; preds = %22
%27 = load i8, i8* %3
%28 = zext i8 %27 to i32
%29 = icmp sle i32 %28, 127
br i1 %29, label %30, label %31
30: ; preds = %26
store i32 2, i32* %2
br label %32
31: ; preds = %26, %22
store i32 3, i32* %2
br label %32
32: ; preds = %31, %30, %21, %16, %7
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @GetPossibleCharacterSet(i8 zeroext %0) {
%2 = icmp ult i8 %0, 26
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = add i8 %0, -48
%5 = icmp ult i8 %4, 10
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = icmp eq i8 %0, -128
br i1 %7, label %11, label %8
8: ; preds = %6
%9 = icmp sgt i8 %0, 95
%10 = select i1 %9, i32 2, i32 3
br label %11
11: ; preds = %8, %6, %3, %1
%12 = phi i32 [ 1, %1 ], [ 7, %3 ], [ 71, %6 ], [ %10, %8 ]
ret i32 %12
}