#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*/ clear();
int /*<<< orphan*/ dump(char *);
int /*<<< orphan*/ legal(int);
int main(void) {
  int i;
  clear();
  for (i = 'a'; i <= 'z'; i++)
    legal(i);
  for (i = 'A'; i <= 'Z'; i++)
    legal(i);
  for (i = '0'; i <= '9'; i++)
    legal(i);
  legal('-');
  legal('_');
  legal('.');
  legal('~');
  dump("gpr_url_percent_encoding_unreserved_bytes");
  clear();
  for (i = 32; i <= 126; i++) {
    if (i == '%')
      continue;
    legal(i);
  }
  dump("gpr_compatible_percent_encoding_unreserved_bytes");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <clear@plt>
movl   $0x61,-0x8(%rbp)
cmpl   $0x7a,-0x8(%rbp)
jg     116d <main+0x3d>
mov    -0x8(%rbp),%edi
call   1040 <legal@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114d <main+0x1d>
movl   $0x41,-0x8(%rbp)
cmpl   $0x5a,-0x8(%rbp)
jg     1194 <main+0x64>
mov    -0x8(%rbp),%edi
call   1040 <legal@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1174 <main+0x44>
movl   $0x30,-0x8(%rbp)
cmpl   $0x39,-0x8(%rbp)
jg     11bb <main+0x8b>
mov    -0x8(%rbp),%edi
call   1040 <legal@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    119b <main+0x6b>
mov    $0x2d,%edi
call   1040 <legal@plt>
mov    $0x5f,%edi
call   1040 <legal@plt>
mov    $0x2e,%edi
call   1040 <legal@plt>
mov    $0x7e,%edi
call   1040 <legal@plt>
lea    0xe16(%rip),%rdi
call   1030 <dump@plt>
mov    $0x0,%al
call   1050 <clear@plt>
movl   $0x20,-0x8(%rbp)
cmpl   $0x7e,-0x8(%rbp)
jg     122c <main+0xfc>
cmpl   $0x25,-0x8(%rbp)
jne    1216 <main+0xe6>
jmp    121e <main+0xee>
mov    -0x8(%rbp),%edi
call   1040 <legal@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11fd <main+0xcd>
lea    0xdf7(%rip),%rdi
call   1030 <dump@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <clear@plt>
mov    $0x61,%edi
call   1040 <legal@plt>
mov    $0x62,%edi
call   1040 <legal@plt>
mov    $0x63,%edi
call   1040 <legal@plt>
mov    $0x64,%edi
call   1040 <legal@plt>
mov    $0x65,%edi
call   1040 <legal@plt>
mov    $0x66,%edi
call   1040 <legal@plt>
mov    $0x67,%edi
call   1040 <legal@plt>
mov    $0x68,%edi
call   1040 <legal@plt>
mov    $0x69,%edi
call   1040 <legal@plt>
mov    $0x6a,%edi
call   1040 <legal@plt>
mov    $0x6b,%edi
call   1040 <legal@plt>
mov    $0x6c,%edi
call   1040 <legal@plt>
mov    $0x6d,%edi
call   1040 <legal@plt>
mov    $0x6e,%edi
call   1040 <legal@plt>
mov    $0x6f,%edi
call   1040 <legal@plt>
mov    $0x70,%edi
call   1040 <legal@plt>
mov    $0x71,%edi
call   1040 <legal@plt>
mov    $0x72,%edi
call   1040 <legal@plt>
mov    $0x73,%edi
call   1040 <legal@plt>
mov    $0x74,%edi
call   1040 <legal@plt>
mov    $0x75,%edi
call   1040 <legal@plt>
mov    $0x76,%edi
call   1040 <legal@plt>
mov    $0x77,%edi
call   1040 <legal@plt>
mov    $0x78,%edi
call   1040 <legal@plt>
mov    $0x79,%edi
call   1040 <legal@plt>
mov    $0x7a,%edi
call   1040 <legal@plt>
mov    $0x41,%edi
call   1040 <legal@plt>
mov    $0x42,%edi
call   1040 <legal@plt>
mov    $0x43,%edi
call   1040 <legal@plt>
mov    $0x44,%edi
call   1040 <legal@plt>
mov    $0x45,%edi
call   1040 <legal@plt>
mov    $0x46,%edi
call   1040 <legal@plt>
mov    $0x47,%edi
call   1040 <legal@plt>
mov    $0x48,%edi
call   1040 <legal@plt>
mov    $0x49,%edi
call   1040 <legal@plt>
mov    $0x4a,%edi
call   1040 <legal@plt>
mov    $0x4b,%edi
call   1040 <legal@plt>
mov    $0x4c,%edi
call   1040 <legal@plt>
mov    $0x4d,%edi
call   1040 <legal@plt>
mov    $0x4e,%edi
call   1040 <legal@plt>
mov    $0x4f,%edi
call   1040 <legal@plt>
mov    $0x50,%edi
call   1040 <legal@plt>
mov    $0x51,%edi
call   1040 <legal@plt>
mov    $0x52,%edi
call   1040 <legal@plt>
mov    $0x53,%edi
call   1040 <legal@plt>
mov    $0x54,%edi
call   1040 <legal@plt>
mov    $0x55,%edi
call   1040 <legal@plt>
mov    $0x56,%edi
call   1040 <legal@plt>
mov    $0x57,%edi
call   1040 <legal@plt>
mov    $0x58,%edi
call   1040 <legal@plt>
mov    $0x59,%edi
call   1040 <legal@plt>
mov    $0x5a,%edi
call   1040 <legal@plt>
mov    $0x30,%edi
call   1040 <legal@plt>
mov    $0x31,%edi
call   1040 <legal@plt>
mov    $0x32,%edi
call   1040 <legal@plt>
mov    $0x33,%edi
call   1040 <legal@plt>
mov    $0x34,%edi
call   1040 <legal@plt>
mov    $0x35,%edi
call   1040 <legal@plt>
mov    $0x36,%edi
call   1040 <legal@plt>
mov    $0x37,%edi
call   1040 <legal@plt>
mov    $0x38,%edi
call   1040 <legal@plt>
mov    $0x39,%edi
call   1040 <legal@plt>
mov    $0x2d,%edi
call   1040 <legal@plt>
mov    $0x5f,%edi
call   1040 <legal@plt>
mov    $0x2e,%edi
call   1040 <legal@plt>
mov    $0x7e,%edi
call   1040 <legal@plt>
lea    0xc2d(%rip),%rdi
call   1030 <dump@plt>
xor    %eax,%eax
call   1050 <clear@plt>
mov    $0x20,%edi
call   1040 <legal@plt>
mov    $0x21,%edi
call   1040 <legal@plt>
mov    $0x22,%edi
call   1040 <legal@plt>
mov    $0x23,%edi
call   1040 <legal@plt>
mov    $0x24,%edi
call   1040 <legal@plt>
mov    $0x26,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1040 <legal@plt>
add    $0x1,%ebx
cmp    $0x7f,%ebx
jne    1420 <main+0x2f0>
lea    0xbf4(%rip),%rdi
call   1030 <dump@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"gpr_url_percent_encoding_unreserved_bytes\00"
@.str.1 = [49 x i8] c"gpr_compatible_percent_encoding_unreserved_bytes\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @clear()
store i32 97, i32* %2
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 122
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i32 @legal(i32 %8)
br label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %4
13: ; preds = %4
store i32 65, i32* %2
br label %14
14: ; preds = %20, %13
%15 = load i32, i32* %2
%16 = icmp sle i32 %15, 90
br i1 %16, label %17, label %23
17: ; preds = %14
%18 = load i32, i32* %2
%19 = call i32 @legal(i32 %18)
br label %20
20: ; preds = %17
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %14
23: ; preds = %14
store i32 48, i32* %2
br label %24
24: ; preds = %30, %23
%25 = load i32, i32* %2
%26 = icmp sle i32 %25, 57
br i1 %26, label %27, label %33
27: ; preds = %24
%28 = load i32, i32* %2
%29 = call i32 @legal(i32 %28)
br label %30
30: ; preds = %27
%31 = load i32, i32* %2
%32 = add nsw i32 %31, 1
store i32 %32, i32* %2
br label %24
33: ; preds = %24
%34 = call i32 @legal(i32 45)
%35 = call i32 @legal(i32 95)
%36 = call i32 @legal(i32 46)
%37 = call i32 @legal(i32 126)
%38 = call i32 @dump(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%39 = call i32 (...) @clear()
store i32 32, i32* %2
br label %40
40: ; preds = %50, %33
%41 = load i32, i32* %2
%42 = icmp sle i32 %41, 126
br i1 %42, label %43, label %53
43: ; preds = %40
%44 = load i32, i32* %2
%45 = icmp eq i32 %44, 37
br i1 %45, label %46, label %47
46: ; preds = %43
br label %50
47: ; preds = %43
%48 = load i32, i32* %2
%49 = call i32 @legal(i32 %48)
br label %50
50: ; preds = %47, %46
%51 = load i32, i32* %2
%52 = add nsw i32 %51, 1
store i32 %52, i32* %2
br label %40
53: ; preds = %40
%54 = call i32 @dump(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [42 x i8] c"gpr_url_percent_encoding_unreserved_bytes\00"
@.str.1 = [49 x i8] c"gpr_compatible_percent_encoding_unreserved_bytes\00"
define i32 @main() {
%1 = tail call i32 (...) @clear()
%2 = tail call i32 @legal(i32 97)
%3 = tail call i32 @legal(i32 98)
%4 = tail call i32 @legal(i32 99)
%5 = tail call i32 @legal(i32 100)
%6 = tail call i32 @legal(i32 101)
%7 = tail call i32 @legal(i32 102)
%8 = tail call i32 @legal(i32 103)
%9 = tail call i32 @legal(i32 104)
%10 = tail call i32 @legal(i32 105)
%11 = tail call i32 @legal(i32 106)
%12 = tail call i32 @legal(i32 107)
%13 = tail call i32 @legal(i32 108)
%14 = tail call i32 @legal(i32 109)
%15 = tail call i32 @legal(i32 110)
%16 = tail call i32 @legal(i32 111)
%17 = tail call i32 @legal(i32 112)
%18 = tail call i32 @legal(i32 113)
%19 = tail call i32 @legal(i32 114)
%20 = tail call i32 @legal(i32 115)
%21 = tail call i32 @legal(i32 116)
%22 = tail call i32 @legal(i32 117)
%23 = tail call i32 @legal(i32 118)
%24 = tail call i32 @legal(i32 119)
%25 = tail call i32 @legal(i32 120)
%26 = tail call i32 @legal(i32 121)
%27 = tail call i32 @legal(i32 122)
%28 = tail call i32 @legal(i32 65)
%29 = tail call i32 @legal(i32 66)
%30 = tail call i32 @legal(i32 67)
%31 = tail call i32 @legal(i32 68)
%32 = tail call i32 @legal(i32 69)
%33 = tail call i32 @legal(i32 70)
%34 = tail call i32 @legal(i32 71)
%35 = tail call i32 @legal(i32 72)
%36 = tail call i32 @legal(i32 73)
%37 = tail call i32 @legal(i32 74)
%38 = tail call i32 @legal(i32 75)
%39 = tail call i32 @legal(i32 76)
%40 = tail call i32 @legal(i32 77)
%41 = tail call i32 @legal(i32 78)
%42 = tail call i32 @legal(i32 79)
%43 = tail call i32 @legal(i32 80)
%44 = tail call i32 @legal(i32 81)
%45 = tail call i32 @legal(i32 82)
%46 = tail call i32 @legal(i32 83)
%47 = tail call i32 @legal(i32 84)
%48 = tail call i32 @legal(i32 85)
%49 = tail call i32 @legal(i32 86)
%50 = tail call i32 @legal(i32 87)
%51 = tail call i32 @legal(i32 88)
%52 = tail call i32 @legal(i32 89)
%53 = tail call i32 @legal(i32 90)
%54 = tail call i32 @legal(i32 48)
%55 = tail call i32 @legal(i32 49)
%56 = tail call i32 @legal(i32 50)
%57 = tail call i32 @legal(i32 51)
%58 = tail call i32 @legal(i32 52)
%59 = tail call i32 @legal(i32 53)
%60 = tail call i32 @legal(i32 54)
%61 = tail call i32 @legal(i32 55)
%62 = tail call i32 @legal(i32 56)
%63 = tail call i32 @legal(i32 57)
%64 = tail call i32 @legal(i32 45)
%65 = tail call i32 @legal(i32 95)
%66 = tail call i32 @legal(i32 46)
%67 = tail call i32 @legal(i32 126)
%68 = tail call i32 @dump(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%69 = tail call i32 (...) @clear()
%70 = tail call i32 @legal(i32 32)
%71 = tail call i32 @legal(i32 33)
%72 = tail call i32 @legal(i32 34)
%73 = tail call i32 @legal(i32 35)
%74 = tail call i32 @legal(i32 36)
br label %75
75: ; preds = %0, %75
%76 = phi i32 [ 38, %0 ], [ %78, %75 ]
%77 = tail call i32 @legal(i32 %76)
%78 = add nuw nsw i32 %76, 1
%79 = icmp eq i32 %78, 127
br i1 %79, label %80, label %75
80: ; preds = %75
%81 = tail call i32 @dump(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}