#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*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int i;
  char *value;
  printf("/* this file is automatically generated by "
         "gen_uri_delims, do not edit */\n");
  printf("static const unsigned char uri_delims[256] = {");
  for (i = 0; i < 256; ++i) {
    if (i % 20 == 0)
      printf("\n    ");
    switch (i) {
    case ':':
      value = "T_COLON";
      break;
    case '/':
      value = "T_SLASH";
      break;
    case '?':
      value = "T_QUESTION";
      break;
    case '#':
      value = "T_HASH";
      break;
    case '\0':
      value = "T_NUL";
      break;
    default:
      value = "0";
      break;
    }
    printf("%s%c", value, (i < 255) ? ',' : ' ');
  }
  printf("\n};\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf10(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x100,-0x14(%rbp)
jge    1260 <main+0x150>
mov    -0x14(%rbp),%eax
mov    $0x14,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1178 <main+0x68>
lea    0xf09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
test   %eax,%eax
je     120f <main+0xff>
jmp    118b <main+0x7b>
mov    -0x24(%rbp),%eax
sub    $0x23,%eax
je     11ff <main+0xef>
jmp    119c <main+0x8c>
mov    -0x24(%rbp),%eax
sub    $0x2f,%eax
je     11df <main+0xcf>
jmp    11ad <main+0x9d>
mov    -0x24(%rbp),%eax
sub    $0x3a,%eax
je     11cf <main+0xbf>
jmp    11be <main+0xae>
mov    -0x24(%rbp),%eax
sub    $0x3f,%eax
je     11ef <main+0xdf>
jmp    121f <main+0x10f>
lea    0xeaa(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    122a <main+0x11a>
lea    0xea2(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    122a <main+0x11a>
lea    0xe9a(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    122a <main+0x11a>
lea    0xe95(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    122a <main+0x11a>
lea    0xe8c(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    122a <main+0x11a>
lea    0xe82(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%ecx
mov    $0x20,%edx
mov    $0x2c,%eax
cmp    $0xff,%ecx
cmovl  %eax,%edx
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1149 <main+0x39>
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xfa6(%rip),%rdi
call   1030 <puts@plt>
lea    0xf36(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf57(%rip),%r14
lea    0xf56(%rip),%r15
mov    $0x2c,%ebp
lea    0xf74(%rip),%rbx
lea    0xe9a(%rip),%r12
xor    %r13d,%r13d
jmp    11a6 <main+0x86>
lea    0xf5f(%rip),%rsi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    $0xff,%r13d
mov    $0x20,%edx
cmovb  %ebp,%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r13d
cmp    $0x100,%r13d
je     121d <main+0xfd>
movzbl %r13b,%eax
imul   $0xcd,%eax,%ecx
shr    $0xa,%ecx
and    $0xfffffffc,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
add    %cl,%al
jne    11c9 <main+0xa9>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    -0x23(%r13),%eax
cmp    $0x1c,%eax
ja     11f0 <main+0xd0>
movslq (%r12,%rax,4),%rax
add    %r12,%rax
mov    %r15,%rsi
jmp    *%rax
lea    0xedf(%rip),%rsi
jmp    1180 <main+0x60>
nopw   0x0(%rax,%rax,1)
test   %r13d,%r13d
jne    116b <main+0x4b>
lea    0xecb(%rip),%rsi
jmp    1180 <main+0x60>
lea    0xea5(%rip),%rsi
jmp    1180 <main+0x60>
lea    0xea1(%rip),%rsi
jmp    1180 <main+0x60>
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [75 x i8] c"/* this file is automatically generated by gen_uri_delims, do not edit */\0A\00"
@.str.1 = [47 x i8] c"static const unsigned char uri_delims[256] = {\00"
@.str.2 = [6 x i8] c"\0A \00"
@.str.3 = [8 x i8] c"T_COLON\00"
@.str.4 = [8 x i8] c"T_SLASH\00"
@.str.5 = [11 x i8] c"T_QUESTION\00"
@.str.6 = [7 x i8] c"T_HASH\00"
@.str.7 = [6 x i8] c"T_NUL\00"
@.str.8 = [2 x i8] c"0\00"
@.str.9 = [5 x i8] c"%s%c\00"
@.str.10 = [5 x i8] c"\0A};\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %6
br label %10
10: ; preds = %34, %2
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 256
br i1 %12, label %13, label %37
13: ; preds = %10
%14 = load i32, i32* %6
%15 = srem i32 %14, 20
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %19
19: ; preds = %17, %13
%20 = load i32, i32* %6
switch i32 %20, label %26 [
i32 58, label %21
i32 47, label %22
i32 63, label %23
i32 35, label %24
i32 0, label %25
]
21: ; preds = %19
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %7
br label %27
22: ; preds = %19
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8** %7
br label %27
23: ; preds = %19
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8** %7
br label %27
24: ; preds = %19
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8** %7
br label %27
25: ; preds = %19
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8** %7
br label %27
26: ; preds = %19
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8** %7
br label %27
27: ; preds = %26, %25, %24, %23, %22, %21
%28 = load i8*, i8** %7
%29 = load i32, i32* %6
%30 = icmp slt i32 %29, 255
%31 = zext i1 %30 to i64
%32 = select i1 %30, i32 44, i32 32
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i8* %28, i32 %32)
br label %34
34: ; preds = %27
%35 = load i32, i32* %6
%36 = add nsw i32 %35, 1
store i32 %36, i32* %6
br label %10
37: ; preds = %10
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [47 x i8] c"static const unsigned char uri_delims[256] = {\00"
@.str.2 = [6 x i8] c"\0A \00"
@.str.3 = [8 x i8] c"T_COLON\00"
@.str.4 = [8 x i8] c"T_SLASH\00"
@.str.5 = [11 x i8] c"T_QUESTION\00"
@.str.6 = [7 x i8] c"T_HASH\00"
@.str.7 = [6 x i8] c"T_NUL\00"
@.str.8 = [2 x i8] c"0\00"
@.str.9 = [5 x i8] c"%s%c\00"
@str = [74 x i8] c"/* this file is automatically generated by gen_uri_delims, do not edit */\00"
@str.11 = [4 x i8] c"\0A};\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %2, %18
%6 = phi i32 [ 0, %2 ], [ %23, %18 ]
%7 = trunc i32 %6 to i8
%8 = urem i8 %7, 20
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10, %5
switch i32 %6, label %17 [
i32 58, label %18
i32 47, label %13
i32 63, label %14
i32 35, label %15
i32 0, label %16
]
13: ; preds = %12
br label %18
14: ; preds = %12
br label %18
15: ; preds = %12
br label %18
16: ; preds = %12
br label %18
17: ; preds = %12
br label %18
18: ; preds = %12, %17, %16, %15, %14, %13
%19 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), %17 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), %16 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), %15 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), %14 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), %13 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %12 ]
%20 = icmp ult i32 %6, 255
%21 = select i1 %20, i32 44, i32 32
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i8* %19, i32 %21)
%23 = add nuw nsw i32 %6, 1
%24 = icmp eq i32 %23, 256
br i1 %24, label %25, label %5
25: ; preds = %18
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.11, i64 0, i64 0))
ret i32 0
}