#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 */
size_t URL_PrintableCharSize(unsigned char charVal) {
  size_t size;
  if (((charVal == 0) || (charVal == '!') || (charVal == '(') ||
       (charVal == ')') || (charVal == '*') || (charVal == '-') ||
       (charVal == '.') || ((charVal >= '0') && (charVal <= '9')) ||
       ((charVal >= 'A') && (charVal <= 'Z')) || (charVal == '_') ||
       ((charVal >= 'a') && (charVal <= 'z')))) {
    size = 1;
  } else {
    if (charVal < 0x80) {
      size = 3;
    } else {
      size = 6;
    }
  }
  return size;
}


x86 assembly (clang, -O0):
<URL_PrintableCharSize>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x0,%eax
je     11c0 <URL_PrintableCharSize+0xc0>
movzbl -0x1(%rbp),%eax
cmp    $0x21,%eax
je     11c0 <URL_PrintableCharSize+0xc0>
movzbl -0x1(%rbp),%eax
cmp    $0x28,%eax
je     11c0 <URL_PrintableCharSize+0xc0>
movzbl -0x1(%rbp),%eax
cmp    $0x29,%eax
je     11c0 <URL_PrintableCharSize+0xc0>
movzbl -0x1(%rbp),%eax
cmp    $0x2a,%eax
je     11c0 <URL_PrintableCharSize+0xc0>
movzbl -0x1(%rbp),%eax
cmp    $0x2d,%eax
je     11c0 <URL_PrintableCharSize+0xc0>
movzbl -0x1(%rbp),%eax
cmp    $0x2e,%eax
je     11c0 <URL_PrintableCharSize+0xc0>
movzbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     117f <URL_PrintableCharSize+0x7f>
movzbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jle    11c0 <URL_PrintableCharSize+0xc0>
movzbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1199 <URL_PrintableCharSize+0x99>
movzbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jle    11c0 <URL_PrintableCharSize+0xc0>
movzbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
je     11c0 <URL_PrintableCharSize+0xc0>
movzbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     11cd <URL_PrintableCharSize+0xcd>
movzbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     11cd <URL_PrintableCharSize+0xcd>
movq   $0x1,-0x10(%rbp)
jmp    11f6 <URL_PrintableCharSize+0xf6>
movzbl -0x1(%rbp),%eax
cmp    $0x80,%eax
jge    11e9 <URL_PrintableCharSize+0xe9>
movq   $0x3,-0x10(%rbp)
jmp    11f1 <URL_PrintableCharSize+0xf1>
movq   $0x6,-0x10(%rbp)
jmp    11f6 <URL_PrintableCharSize+0xf6>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<URL_PrintableCharSize>:
mov    $0x1,%eax
cmp    $0x2e,%dil
ja     111e <URL_PrintableCharSize+0x1e>
mov    %edi,%ecx
movabs $0x670200000001,%rdx
bt     %rcx,%rdx
jae    111e <URL_PrintableCharSize+0x1e>
ret
lea    -0x30(%rdi),%ecx
cmp    $0xa,%cl
jb     111d <URL_PrintableCharSize+0x1d>
cmp    $0x5f,%dil
je     111d <URL_PrintableCharSize+0x1d>
mov    %edi,%ecx
and    $0xdf,%cl
add    $0xbf,%cl
cmp    $0x1a,%cl
jb     111d <URL_PrintableCharSize+0x1d>
shr    $0x7,%dil
movzbl %dil,%eax
lea    (%rax,%rax,2),%rax
add    $0x3,%rax
ret

LLVM IR (-O0):
define i64 @URL_PrintableCharSize(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i64
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %59, label %7
7: ; preds = %1
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = icmp eq i32 %9, 33
br i1 %10, label %59, label %11
11: ; preds = %7
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = icmp eq i32 %13, 40
br i1 %14, label %59, label %15
15: ; preds = %11
%16 = load i8, i8* %2
%17 = zext i8 %16 to i32
%18 = icmp eq i32 %17, 41
br i1 %18, label %59, label %19
19: ; preds = %15
%20 = load i8, i8* %2
%21 = zext i8 %20 to i32
%22 = icmp eq i32 %21, 42
br i1 %22, label %59, label %23
23: ; preds = %19
%24 = load i8, i8* %2
%25 = zext i8 %24 to i32
%26 = icmp eq i32 %25, 45
br i1 %26, label %59, label %27
27: ; preds = %23
%28 = load i8, i8* %2
%29 = zext i8 %28 to i32
%30 = icmp eq i32 %29, 46
br i1 %30, label %59, label %31
31: ; preds = %27
%32 = load i8, i8* %2
%33 = zext i8 %32 to i32
%34 = icmp sge i32 %33, 48
br i1 %34, label %35, label %39
35: ; preds = %31
%36 = load i8, i8* %2
%37 = zext i8 %36 to i32
%38 = icmp sle i32 %37, 57
br i1 %38, label %59, label %39
39: ; preds = %35, %31
%40 = load i8, i8* %2
%41 = zext i8 %40 to i32
%42 = icmp sge i32 %41, 65
br i1 %42, label %43, label %47
43: ; preds = %39
%44 = load i8, i8* %2
%45 = zext i8 %44 to i32
%46 = icmp sle i32 %45, 90
br i1 %46, label %59, label %47
47: ; preds = %43, %39
%48 = load i8, i8* %2
%49 = zext i8 %48 to i32
%50 = icmp eq i32 %49, 95
br i1 %50, label %59, label %51
51: ; preds = %47
%52 = load i8, i8* %2
%53 = zext i8 %52 to i32
%54 = icmp sge i32 %53, 97
br i1 %54, label %55, label %60
55: ; preds = %51
%56 = load i8, i8* %2
%57 = zext i8 %56 to i32
%58 = icmp sle i32 %57, 122
br i1 %58, label %59, label %60
59: ; preds = %55, %47, %43, %35, %27, %23, %19, %15, %11, %7, %1
store i64 1, i64* %3
br label %67
60: ; preds = %55, %51
%61 = load i8, i8* %2
%62 = zext i8 %61 to i32
%63 = icmp slt i32 %62, 128
br i1 %63, label %64, label %65
64: ; preds = %60
store i64 3, i64* %3
br label %66
65: ; preds = %60
store i64 6, i64* %3
br label %66
66: ; preds = %65, %64
br label %67
67: ; preds = %66, %59
%68 = load i64, i64* %3
ret i64 %68
}

LLVM IR (-O2):
define i64 @URL_PrintableCharSize(i8 zeroext %0) {
switch i8 %0, label %2 [
i8 46, label %14
i8 45, label %14
i8 42, label %14
i8 41, label %14
i8 40, label %14
i8 33, label %14
i8 0, label %14
]
2: ; preds = %1
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %14, label %5
5: ; preds = %2
%6 = icmp eq i8 %0, 95
%7 = and i8 %0, -33
%8 = add i8 %7, -65
%9 = icmp ult i8 %8, 26
%10 = or i1 %6, %9
br i1 %10, label %14, label %11
11: ; preds = %5
%12 = icmp sgt i8 %0, -1
%13 = select i1 %12, i64 3, i64 6
br label %14
14: ; preds = %11, %2, %5, %1, %1, %1, %1, %1, %1, %1
%15 = phi i64 [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %5 ], [ 1, %2 ], [ %13, %11 ]
ret i64 %15
}