char *uri_ok() {
  static char ok[128];
  int done = (0);
  const char *s;
  if (!done) {
    int i;
    for (i = 'a'; i <= 'z'; i++)
      ok[i] = (1);
    for (i = 'A'; i <= 'Z'; i++)
      ok[i] = (1);
    for (i = '0'; i <= '9'; i++)
      ok[i] = (1);
    for (s = "-_.!~*'()"; *s; s++)
      ok[(int)*s] = (1);
    for (s = ";/&?:@=#"; *s; s++)
      ok[(int)*s] = (1);
    done = (1);
  }
  return ok;
}


x86 assembly (clang, -O0):
<uri_ok>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1222 <uri_ok+0x122>
movl   $0x61,-0x14(%rbp)
cmpl   $0x7a,-0x14(%rbp)
jg     1143 <uri_ok+0x43>
movslq -0x14(%rbp),%rcx
lea    0x2eff(%rip),%rax
movb   $0x1,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111c <uri_ok+0x1c>
movl   $0x41,-0x14(%rbp)
cmpl   $0x5a,-0x14(%rbp)
jg     1171 <uri_ok+0x71>
movslq -0x14(%rbp),%rcx
lea    0x2ed1(%rip),%rax
movb   $0x1,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114a <uri_ok+0x4a>
movl   $0x30,-0x14(%rbp)
cmpl   $0x39,-0x14(%rbp)
jg     119f <uri_ok+0x9f>
movslq -0x14(%rbp),%rcx
lea    0x2ea3(%rip),%rax
movb   $0x1,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1178 <uri_ok+0x78>
lea    0xe5a(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     11dd <uri_ok+0xdd>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movslq %eax,%rcx
lea    0x2e68(%rip),%rax
movb   $0x1,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    11aa <uri_ok+0xaa>
lea    0xe26(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     121b <uri_ok+0x11b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movslq %eax,%rcx
lea    0x2e2a(%rip),%rax
movb   $0x1,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    11e8 <uri_ok+0xe8>
movl   $0x1,-0x4(%rbp)
lea    0x2e07(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uri_ok>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,0x2f8d(%rip)
movups %xmm0,0x2f7c(%rip)
lea    0x2f14(%rip),%rax
movb   $0x1,0x2f6c(%rip)
movb   $0x1,0x2f27(%rip)
movb   $0x1,0x2f7d(%rip)
movb   $0x1,0x2f35(%rip)
movb   $0x1,0x2f14(%rip)
movl   $0x1010101,0x2f0d(%rip)
01 01 01
movb   $0x1,0x2f0a(%rip)
movabs $0x101010101010101,%rcx
01 01 01
mov    %rcx,0x2efc(%rip)
mov    %rcx,0x2efc(%rip)
movups %xmm0,0x2f00(%rip)
movups %xmm0,0x2f05(%rip)
ret

LLVM IR (-O0):
@uri_ok.ok = internal global [128 x i8] zeroinitializer
@.str = [10 x i8] c"-_.!~*'()\00"
@.str.1 = [9 x i8] c";/&?:@=#\00"
define i8* @uri_ok() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 0
br i1 %5, label %68, label %6
6: ; preds = %0
store i32 97, i32* %3
br label %7
7: ; preds = %14, %6
%8 = load i32, i32* %3
%9 = icmp sle i32 %8, 122
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [128 x i8], [128 x i8]* @uri_ok.ok, i64 0, i64 %12
store i8 1, i8* %13
br label %14
14: ; preds = %10
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %7
17: ; preds = %7
store i32 65, i32* %3
br label %18
18: ; preds = %25, %17
%19 = load i32, i32* %3
%20 = icmp sle i32 %19, 90
br i1 %20, label %21, label %28
21: ; preds = %18
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [128 x i8], [128 x i8]* @uri_ok.ok, i64 0, i64 %23
store i8 1, i8* %24
br label %25
25: ; preds = %21
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %18
28: ; preds = %18
store i32 48, i32* %3
br label %29
29: ; preds = %36, %28
%30 = load i32, i32* %3
%31 = icmp sle i32 %30, 57
br i1 %31, label %32, label %39
32: ; preds = %29
%33 = load i32, i32* %3
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [128 x i8], [128 x i8]* @uri_ok.ok, i64 0, i64 %34
store i8 1, i8* %35
br label %36
36: ; preds = %32
%37 = load i32, i32* %3
%38 = add nsw i32 %37, 1
store i32 %38, i32* %3
br label %29
39: ; preds = %29
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %2
br label %40
40: ; preds = %50, %39
%41 = load i8*, i8** %2
%42 = load i8, i8* %41
%43 = icmp ne i8 %42, 0
br i1 %43, label %44, label %53
44: ; preds = %40
%45 = load i8*, i8** %2
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [128 x i8], [128 x i8]* @uri_ok.ok, i64 0, i64 %48
store i8 1, i8* %49
br label %50
50: ; preds = %44
%51 = load i8*, i8** %2
%52 = getelementptr inbounds i8, i8* %51, i32 1
store i8* %52, i8** %2
br label %40
53: ; preds = %40
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %54
54: ; preds = %64, %53
%55 = load i8*, i8** %2
%56 = load i8, i8* %55
%57 = icmp ne i8 %56, 0
br i1 %57, label %58, label %67
58: ; preds = %54
%59 = load i8*, i8** %2
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [128 x i8], [128 x i8]* @uri_ok.ok, i64 0, i64 %62
store i8 1, i8* %63
br label %64
64: ; preds = %58
%65 = load i8*, i8** %2
%66 = getelementptr inbounds i8, i8* %65, i32 1
store i8* %66, i8** %2
br label %54
67: ; preds = %54
store i32 1, i32* %1
br label %68
68: ; preds = %67, %0
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @uri_ok.ok, i64 0, i64 0)
}

LLVM IR (-O2):
@uri_ok.ok = internal global [128 x i8] zeroinitializer
define i8* @uri_ok() {
store i8 1, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @uri_ok.ok, i64 0, i64 95)
store i8 1, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @uri_ok.ok, i64 0, i64 33)
store i8 1, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @uri_ok.ok, i64 0, i64 126)
store i8 1, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @uri_ok.ok, i64 0, i64 61)
store i8 1, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @uri_ok.ok, i64 0, i64 35)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @uri_ok.ok, i64 0, i64 0)
}