#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 */
typedef int /*<<< orphan*/ *wctype_t;

/* Variables and functions */
int /*<<< orphan*/ *iswalnum;
int /*<<< orphan*/ *iswalpha;
int /*<<< orphan*/ *iswblank;
int /*<<< orphan*/ *iswcntrl;
int /*<<< orphan*/ *iswdigit;
int /*<<< orphan*/ *iswgraph;
int /*<<< orphan*/ *iswlower;
int /*<<< orphan*/ *iswprint;
int /*<<< orphan*/ *iswpunct;
int /*<<< orphan*/ *iswspace;
int /*<<< orphan*/ *iswupper;
int /*<<< orphan*/ *iswxdigit;
scalar_t__ strcmp(char const *, char *);
wctype_t wctype(const char *charclass) {
  if (strcmp(charclass, "alnum") == 0)
    return iswalnum;
  if (strcmp(charclass, "alpha") == 0)
    return iswalpha;
  if (strcmp(charclass, "blank") == 0)
    return iswblank;
  if (strcmp(charclass, "cntrl") == 0)
    return iswcntrl;
  if (strcmp(charclass, "digit") == 0)
    return iswdigit;
  if (strcmp(charclass, "graph") == 0)
    return iswgraph;
  if (strcmp(charclass, "lower") == 0)
    return iswlower;
  if (strcmp(charclass, "print") == 0)
    return iswprint;
  if (strcmp(charclass, "punct") == 0)
    return iswpunct;
  if (strcmp(charclass, "space") == 0)
    return iswspace;
  if (strcmp(charclass, "upper") == 0)
    return iswupper;
  if (strcmp(charclass, "xdigit") == 0)
    return iswxdigit;
  return NULL;
}


x86 assembly (clang, -O0):
<wctype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1149 <wctype+0x39>
mov    0x2e4b(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1340 <wctype+0x230>
mov    -0x10(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1176 <wctype+0x66>
mov    0x2e56(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1340 <wctype+0x230>
mov    -0x10(%rbp),%rdi
lea    0xe8b(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11a3 <wctype+0x93>
mov    0x2e41(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1340 <wctype+0x230>
mov    -0x10(%rbp),%rdi
lea    0xe64(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11d0 <wctype+0xc0>
mov    0x2dbc(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1340 <wctype+0x230>
mov    -0x10(%rbp),%rdi
lea    0xe62(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11fd <wctype+0xed>
mov    0x2daf(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1340 <wctype+0x230>
mov    -0x10(%rbp),%rdi
lea    0xe10(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    122a <wctype+0x11a>
mov    0x2dca(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1340 <wctype+0x230>
mov    -0x10(%rbp),%rdi
lea    0xde9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1257 <wctype+0x147>
mov    0x2d5d(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1340 <wctype+0x230>
mov    -0x10(%rbp),%rdi
lea    0xdc2(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1284 <wctype+0x174>
mov    0x2d50(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1340 <wctype+0x230>
mov    -0x10(%rbp),%rdi
lea    0xd9b(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    12b1 <wctype+0x1a1>
mov    0x2d53(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1340 <wctype+0x230>
mov    -0x10(%rbp),%rdi
lea    0xd74(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    12de <wctype+0x1ce>
mov    0x2cfe(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1340 <wctype+0x230>
mov    -0x10(%rbp),%rdi
lea    0xd4d(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    130b <wctype+0x1fb>
mov    0x2cb9(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1340 <wctype+0x230>
mov    -0x10(%rbp),%rdi
lea    0xd26(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1338 <wctype+0x228>
mov    0x2c6c(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1340 <wctype+0x230>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wctype>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1232 <wctype+0x122>
lea    0xed6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     123b <wctype+0x12b>
lea    0xec4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1244 <wctype+0x134>
lea    0xeb2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     124d <wctype+0x13d>
lea    0xec5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1256 <wctype+0x146>
lea    0xe88(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     125f <wctype+0x14f>
lea    0xe76(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1268 <wctype+0x158>
lea    0xe64(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1271 <wctype+0x161>
lea    0xe52(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     127a <wctype+0x16a>
lea    0xe40(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1283 <wctype+0x173>
lea    0xe2e(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     128c <wctype+0x17c>
lea    0xe20(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    1298 <wctype+0x188>
mov    0x2d68(%rip),%rax
jmp    1293 <wctype+0x183>
mov    0x2d4f(%rip),%rax
jmp    1293 <wctype+0x183>
mov    0x2d7e(%rip),%rax
jmp    1293 <wctype+0x183>
mov    0x2d8d(%rip),%rax
jmp    1293 <wctype+0x183>
mov    0x2d2c(%rip),%rax
jmp    1293 <wctype+0x183>
mov    0x2d43(%rip),%rax
jmp    1293 <wctype+0x183>
mov    0x2d82(%rip),%rax
jmp    1293 <wctype+0x183>
mov    0x2d39(%rip),%rax
jmp    1293 <wctype+0x183>
mov    0x2d50(%rip),%rax
jmp    1293 <wctype+0x183>
mov    0x2d77(%rip),%rax
jmp    1293 <wctype+0x183>
mov    0x2d46(%rip),%rax
jmp    1293 <wctype+0x183>
mov    0x2d25(%rip),%rax
mov    (%rax),%rax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"alnum\00"
@iswalnum = global i32* null
@.str.1 = [6 x i8] c"alpha\00"
@iswalpha = global i32* null
@.str.2 = [6 x i8] c"blank\00"
@iswblank = global i32* null
@.str.3 = [6 x i8] c"cntrl\00"
@iswcntrl = global i32* null
@.str.4 = [6 x i8] c"digit\00"
@iswdigit = global i32* null
@.str.5 = [6 x i8] c"graph\00"
@iswgraph = global i32* null
@.str.6 = [6 x i8] c"lower\00"
@iswlower = global i32* null
@.str.7 = [6 x i8] c"print\00"
@iswprint = global i32* null
@.str.8 = [6 x i8] c"punct\00"
@iswpunct = global i32* null
@.str.9 = [6 x i8] c"space\00"
@iswspace = global i32* null
@.str.10 = [6 x i8] c"upper\00"
@iswupper = global i32* null
@.str.11 = [7 x i8] c"xdigit\00"
@iswxdigit = global i32* null
define i32* @wctype(i8* %0) {
%2 = alloca i32*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32*, i32** @iswalnum
store i32* %8, i32** %2
br label %76
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = load i32*, i32** @iswalpha
store i32* %14, i32** %2
br label %76
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = load i32*, i32** @iswblank
store i32* %20, i32** %2
br label %76
21: ; preds = %15
%22 = load i8*, i8** %3
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = load i32*, i32** @iswcntrl
store i32* %26, i32** %2
br label %76
27: ; preds = %21
%28 = load i8*, i8** %3
%29 = call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = load i32*, i32** @iswdigit
store i32* %32, i32** %2
br label %76
33: ; preds = %27
%34 = load i8*, i8** %3
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = load i32*, i32** @iswgraph
store i32* %38, i32** %2
br label %76
39: ; preds = %33
%40 = load i8*, i8** %3
%41 = call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = load i32*, i32** @iswlower
store i32* %44, i32** %2
br label %76
45: ; preds = %39
%46 = load i8*, i8** %3
%47 = call i64 @strcmp(i8* %46, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %45
%50 = load i32*, i32** @iswprint
store i32* %50, i32** %2
br label %76
51: ; preds = %45
%52 = load i8*, i8** %3
%53 = call i64 @strcmp(i8* %52, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %51
%56 = load i32*, i32** @iswpunct
store i32* %56, i32** %2
br label %76
57: ; preds = %51
%58 = load i8*, i8** %3
%59 = call i64 @strcmp(i8* %58, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %63
61: ; preds = %57
%62 = load i32*, i32** @iswspace
store i32* %62, i32** %2
br label %76
63: ; preds = %57
%64 = load i8*, i8** %3
%65 = call i64 @strcmp(i8* %64, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %69
67: ; preds = %63
%68 = load i32*, i32** @iswupper
store i32* %68, i32** %2
br label %76
69: ; preds = %63
%70 = load i8*, i8** %3
%71 = call i64 @strcmp(i8* %70, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
%72 = icmp eq i64 %71, 0
br i1 %72, label %73, label %75
73: ; preds = %69
%74 = load i32*, i32** @iswxdigit
store i32* %74, i32** %2
br label %76
75: ; preds = %69
store i32* null, i32** %2
br label %76
76: ; preds = %75, %73, %67, %61, %55, %49, %43, %37, %31, %25, %19, %13, %7
%77 = load i32*, i32** %2
ret i32* %77
}

LLVM IR (-O2):
@.str = [6 x i8] c"alnum\00"
@iswalnum = global i32* null
@.str.1 = [6 x i8] c"alpha\00"
@iswalpha = global i32* null
@.str.2 = [6 x i8] c"blank\00"
@iswblank = global i32* null
@.str.3 = [6 x i8] c"cntrl\00"
@iswcntrl = global i32* null
@.str.4 = [6 x i8] c"digit\00"
@iswdigit = global i32* null
@.str.5 = [6 x i8] c"graph\00"
@iswgraph = global i32* null
@.str.6 = [6 x i8] c"lower\00"
@iswlower = global i32* null
@.str.7 = [6 x i8] c"print\00"
@iswprint = global i32* null
@.str.8 = [6 x i8] c"punct\00"
@iswpunct = global i32* null
@.str.9 = [6 x i8] c"space\00"
@iswspace = global i32* null
@.str.10 = [6 x i8] c"upper\00"
@iswupper = global i32* null
@.str.11 = [7 x i8] c"xdigit\00"
@iswxdigit = global i32* null
define i32* @wctype(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = load i32*, i32** @iswalnum
br label %61
6: ; preds = %1
%7 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = load i32*, i32** @iswalpha
br label %61
11: ; preds = %6
%12 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = load i32*, i32** @iswblank
br label %61
16: ; preds = %11
%17 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = load i32*, i32** @iswcntrl
br label %61
21: ; preds = %16
%22 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = load i32*, i32** @iswdigit
br label %61
26: ; preds = %21
%27 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = load i32*, i32** @iswgraph
br label %61
31: ; preds = %26
%32 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = load i32*, i32** @iswlower
br label %61
36: ; preds = %31
%37 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = load i32*, i32** @iswprint
br label %61
41: ; preds = %36
%42 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = load i32*, i32** @iswpunct
br label %61
46: ; preds = %41
%47 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %46
%50 = load i32*, i32** @iswspace
br label %61
51: ; preds = %46
%52 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %51
%55 = load i32*, i32** @iswupper
br label %61
56: ; preds = %51
%57 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
%58 = icmp eq i64 %57, 0
%59 = load i32*, i32** @iswxdigit
%60 = select i1 %58, i32* %59, i32* null
br label %61
61: ; preds = %56, %54, %49, %44, %39, %34, %29, %24, %19, %14, %9, %4
%62 = phi i32* [ %5, %4 ], [ %10, %9 ], [ %15, %14 ], [ %20, %19 ], [ %25, %24 ], [ %30, %29 ], [ %35, %34 ], [ %40, %39 ], [ %45, %44 ], [ %50, %49 ], [ %55, %54 ], [ %60, %56 ]
ret i32* %62
}