#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('_');
  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    $0x0,%al
call   1030 <dump@plt>
mov    $0x0,%al
call   1050 <clear@plt>
movl   $0x20,-0x8(%rbp)
cmpl   $0x7e,-0x8(%rbp)
jg     11dd <main+0xad>
mov    -0x8(%rbp),%edi
call   1040 <legal@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11bd <main+0x8d>
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>
xor    %eax,%eax
call   1030 <dump@plt>
xor    %eax,%eax
call   1050 <clear@plt>
mov    $0x20,%ebx
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1040 <legal@plt>
add    $0x1,%ebx
cmp    $0x7f,%ebx
jne    12d0 <main+0x1a0>
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 (...) @dump()
%27 = call i32 (...) @clear()
store i32 32, i32* %2
br label %28
28: ; preds = %34, %23
%29 = load i32, i32* %2
%30 = icmp sle i32 %29, 126
br i1 %30, label %31, label %37
31: ; preds = %28
%32 = load i32, i32* %2
%33 = call i32 @legal(i32 %32)
br label %34
34: ; preds = %31
%35 = load i32, i32* %2
%36 = add nsw i32 %35, 1
store i32 %36, i32* %2
br label %28
37: ; preds = %28
%38 = 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 (...) @dump()
%41 = tail call i32 (...) @clear()
br label %42
42: ; preds = %0, %42
%43 = phi i32 [ 32, %0 ], [ %45, %42 ]
%44 = tail call i32 @legal(i32 %43)
%45 = add nuw nsw i32 %43, 1
%46 = icmp eq i32 %45, 127
br i1 %46, label %47, label %42
47: ; preds = %42
%48 = tail call i32 (...) @dump()
ret i32 0
}