#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ gen(char *, int /*<<< orphan*/, char *, char *, char);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ usage(char *);
int main(int argc, char **argv) {
  char *charset = 0;
  char *charset_num = "0123456789";
  char *charset_char = "abcdefghijklmnopqrstuvwxyz";
  char *charset_upperchar = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  char *charset_hexa = "0123456789abcdef";
  char *charset_alfanum = "0123456789abcdefghijklmnopqrstuvwxyz";
  char *charset_sensitivealfanum =
      "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  char wildcard = 'X';
  if (argc != 3) {
    usage(argv[0]);
  }
  if (strcmp(argv[1], "-n") == 0) {
    charset = charset_num;
  } else if (strcmp(argv[1], "-c") == 0) {
    charset = charset_char;
  } else if (strcmp(argv[1], "-h") == 0) {
    charset = charset_hexa;
  } else if (strcmp(argv[1], "-a") == 0) {
    charset = charset_alfanum;
  } else if (strcmp(argv[1], "-C") == 0) {
    charset = charset_upperchar;
  } else if (strcmp(argv[1], "-s") == 0) {
    charset = charset_sensitivealfanum;
  } else {
    usage(argv[0]);
  }
  gen("", 0, argv[2], charset, wildcard);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    0xe9b(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xeb6(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xeea(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xe85(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xe8b(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xea5(%rip),%rax
mov    %rax,-0x48(%rbp)
movb   $0x58,-0x49(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11ba <main+0x7a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xeb7(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11e5 <main+0xa5>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    12e1 <main+0x1a1>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe8f(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1210 <main+0xd0>
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    12dc <main+0x19c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    123b <main+0xfb>
mov    -0x38(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    12d7 <main+0x197>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe3f(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1266 <main+0x126>
mov    -0x40(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    12d2 <main+0x192>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe17(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1291 <main+0x151>
mov    -0x30(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    12cd <main+0x18d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdef(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    12bc <main+0x17c>
mov    -0x48(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    12c8 <main+0x188>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <usage@plt>
jmp    12cd <main+0x18d>
jmp    12d2 <main+0x192>
jmp    12d7 <main+0x197>
jmp    12dc <main+0x19c>
jmp    12e1 <main+0x1a1>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
mov    -0x18(%rbp),%rcx
lea    0xd16(%rip),%rdi
xor    %esi,%esi
movsbl -0x49(%rbp),%r8d
call   1040 <gen@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x3,%edi
je     1151 <main+0x11>
mov    (%rbx),%rdi
call   1050 <usage@plt>
mov    0x8(%rbx),%rdi
lea    0xf24(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    1172 <main+0x32>
lea    0xe93(%rip),%rcx
jmp    1215 <main+0xd5>
mov    0x8(%rbx),%rdi
lea    0xf06(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    1193 <main+0x53>
lea    0xe98(%rip),%rcx
jmp    1215 <main+0xd5>
mov    0x8(%rbx),%rdi
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    11b1 <main+0x71>
lea    0xe5c(%rip),%rcx
jmp    1215 <main+0xd5>
mov    0x8(%rbx),%rdi
lea    0xecd(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    11cf <main+0x8f>
lea    0xe4f(%rip),%rcx
jmp    1215 <main+0xd5>
mov    0x8(%rbx),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    11ed <main+0xad>
lea    0xe7a(%rip),%rcx
jmp    1215 <main+0xd5>
mov    0x8(%rbx),%rdi
lea    0xe97(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    120b <main+0xcb>
lea    0xe38(%rip),%rcx
jmp    1215 <main+0xd5>
mov    (%rbx),%rdi
call   1050 <usage@plt>
xor    %ecx,%ecx
mov    0x10(%rbx),%rdx
lea    0xdea(%rip),%rdi
xor    %esi,%esi
mov    $0x58,%r8d
call   1040 <gen@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"0123456789\00"
@.str.1 = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
@.str.2 = [27 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
@.str.3 = [17 x i8] c"0123456789abcdef\00"
@.str.4 = [37 x i8] c"0123456789abcdefghijklmnopqrstuvwxyz\00"
@.str.5 = [63 x i8] c"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
@.str.6 = [3 x i8] c"-n\00"
@.str.7 = [3 x i8] c"-c\00"
@.str.8 = [3 x i8] c"-h\00"
@.str.9 = [3 x i8] c"-a\00"
@.str.10 = [3 x i8] c"-C\00"
@.str.11 = [3 x i8] c"-s\00"
@.str.12 = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %7
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8** %8
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8** %9
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8** %10
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i8** %11
store i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.5, i64 0, i64 0), i8** %12
store i8 88, i8* %13
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 3
br i1 %15, label %16, label %21
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i32 @usage(i8* %19)
br label %21
21: ; preds = %16, %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %21
%28 = load i8*, i8** %7
store i8* %28, i8** %6
br label %79
29: ; preds = %21
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i64 @strcmp(i8* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %29
%36 = load i8*, i8** %8
store i8* %36, i8** %6
br label %78
37: ; preds = %29
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 1
%40 = load i8*, i8** %39
%41 = call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %37
%44 = load i8*, i8** %10
store i8* %44, i8** %6
br label %77
45: ; preds = %37
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 1
%48 = load i8*, i8** %47
%49 = call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %45
%52 = load i8*, i8** %11
store i8* %52, i8** %6
br label %76
53: ; preds = %45
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 1
%56 = load i8*, i8** %55
%57 = call i64 @strcmp(i8* %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %53
%60 = load i8*, i8** %9
store i8* %60, i8** %6
br label %75
61: ; preds = %53
%62 = load i8**, i8*** %5
%63 = getelementptr inbounds i8*, i8** %62, i64 1
%64 = load i8*, i8** %63
%65 = call i64 @strcmp(i8* %64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %69
67: ; preds = %61
%68 = load i8*, i8** %12
store i8* %68, i8** %6
br label %74
69: ; preds = %61
%70 = load i8**, i8*** %5
%71 = getelementptr inbounds i8*, i8** %70, i64 0
%72 = load i8*, i8** %71
%73 = call i32 @usage(i8* %72)
br label %74
74: ; preds = %69, %67
br label %75
75: ; preds = %74, %59
br label %76
76: ; preds = %75, %51
br label %77
77: ; preds = %76, %43
br label %78
78: ; preds = %77, %35
br label %79
79: ; preds = %78, %27
%80 = load i8**, i8*** %5
%81 = getelementptr inbounds i8*, i8** %80, i64 2
%82 = load i8*, i8** %81
%83 = load i8*, i8** %6
%84 = load i8, i8* %13
%85 = call i32 @gen(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0), i32 0, i8* %82, i8* %83, i8 signext %84)
%86 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"0123456789\00"
@.str.1 = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
@.str.2 = [27 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
@.str.3 = [17 x i8] c"0123456789abcdef\00"
@.str.4 = [37 x i8] c"0123456789abcdefghijklmnopqrstuvwxyz\00"
@.str.5 = [63 x i8] c"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
@.str.6 = [3 x i8] c"-n\00"
@.str.7 = [3 x i8] c"-c\00"
@.str.8 = [3 x i8] c"-h\00"
@.str.9 = [3 x i8] c"-a\00"
@.str.10 = [3 x i8] c"-C\00"
@.str.11 = [3 x i8] c"-s\00"
@.str.12 = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @usage(i8* %5)
br label %7
7: ; preds = %4, %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %35, label %12
12: ; preds = %7
%13 = load i8*, i8** %8
%14 = tail call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %35, label %16
16: ; preds = %12
%17 = load i8*, i8** %8
%18 = tail call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %35, label %20
20: ; preds = %16
%21 = load i8*, i8** %8
%22 = tail call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %35, label %24
24: ; preds = %20
%25 = load i8*, i8** %8
%26 = tail call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %35, label %28
28: ; preds = %24
%29 = load i8*, i8** %8
%30 = tail call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %35, label %32
32: ; preds = %28
%33 = load i8*, i8** %1
%34 = tail call i32 @usage(i8* %33)
br label %35
35: ; preds = %28, %24, %20, %16, %12, %7, %32
%36 = phi i8* [ null, %32 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %7 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), %12 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), %16 ], [ getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), %20 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), %24 ], [ getelementptr inbounds ([63 x i8], [63 x i8]* @.str.5, i64 0, i64 0), %28 ]
%37 = getelementptr inbounds i8*, i8** %1, i64 2
%38 = load i8*, i8** %37
%39 = tail call i32 @gen(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.12, i64 0, i64 0), i32 0, i8* %38, i8* %36, i8 signext 88)
%40 = tail call i32 @exit(i32 0)
unreachable
}