#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();
int /*<<< orphan*/ legal(int);
int main(void) {
  int i;
  clear();
  for (i = 'a'; i <= 'z'; i++)
    legal(i);
  for (i = '0'; i <= '9'; i++)
    legal(i);
  legal('-');
  legal('_');
  legal('.');
  dump();
  clear();
  for (i = 32; i <= 126; i++) {
    legal(i);
  }
  dump();
  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   $0x30,-0x8(%rbp)
cmpl   $0x39,-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>
mov    $0x2d,%edi
call   1040 <legal@plt>
mov    $0x5f,%edi
call   1040 <legal@plt>
mov    $0x2e,%edi
call   1040 <legal@plt>
mov    $0x0,%al
call   1030 <dump@plt>
mov    $0x0,%al
call   1050 <clear@plt>
movl   $0x20,-0x8(%rbp)
cmpl   $0x7e,-0x8(%rbp)
jg     11e7 <main+0xb7>
mov    -0x8(%rbp),%edi
call   1040 <legal@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11c7 <main+0x97>
mov    $0x0,%al
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    $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>
xor    %eax,%eax
call   1030 <dump@plt>
xor    %eax,%eax
call   1050 <clear@plt>
mov    $0x20,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1040 <legal@plt>
add    $0x1,%ebx
cmp    $0x7f,%ebx
jne    12e0 <main+0x1b0>
xor    %eax,%eax
call   1030 <dump@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
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 48, i32* %2
br label %14
14: ; preds = %20, %13
%15 = load i32, i32* %2
%16 = icmp sle i32 %15, 57
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
%24 = call i32 @legal(i32 45)
%25 = call i32 @legal(i32 95)
%26 = call i32 @legal(i32 46)
%27 = call i32 (...) @dump()
%28 = call i32 (...) @clear()
store i32 32, i32* %2
br label %29
29: ; preds = %35, %23
%30 = load i32, i32* %2
%31 = icmp sle i32 %30, 126
br i1 %31, label %32, label %38
32: ; preds = %29
%33 = load i32, i32* %2
%34 = call i32 @legal(i32 %33)
br label %35
35: ; preds = %32
%36 = load i32, i32* %2
%37 = add nsw i32 %36, 1
store i32 %37, i32* %2
br label %29
38: ; preds = %29
%39 = call i32 (...) @dump()
ret i32 0
}

LLVM IR (-O2):
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 48)
%29 = tail call i32 @legal(i32 49)
%30 = tail call i32 @legal(i32 50)
%31 = tail call i32 @legal(i32 51)
%32 = tail call i32 @legal(i32 52)
%33 = tail call i32 @legal(i32 53)
%34 = tail call i32 @legal(i32 54)
%35 = tail call i32 @legal(i32 55)
%36 = tail call i32 @legal(i32 56)
%37 = tail call i32 @legal(i32 57)
%38 = tail call i32 @legal(i32 45)
%39 = tail call i32 @legal(i32 95)
%40 = tail call i32 @legal(i32 46)
%41 = tail call i32 (...) @dump()
%42 = tail call i32 (...) @clear()
br label %43
43: ; preds = %0, %43
%44 = phi i32 [ 32, %0 ], [ %46, %43 ]
%45 = tail call i32 @legal(i32 %44)
%46 = add nuw nsw i32 %44, 1
%47 = icmp eq i32 %46, 127
br i1 %47, label %48, label %43
48: ; preds = %43
%49 = tail call i32 (...) @dump()
ret i32 0
}