#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*/ *strchr(char *, char const);
int xdict_match_simple(const char *w, const char *p) {
  int i;
  for (i = 0; p[i]; ++i) {
    if (w[i] == '\0')
      return 0;
    else if (p[i] == '1') {
      if (!(strchr("bcdfghjklmnpqrstvwxyz", w[i]) != NULL))
        return 0;
    } else if (p[i] == '0') {
      if (!(strchr("aeiouy", w[i]) != NULL))
        return 0;
    } else if (p[i] != '?') {
      if (p[i] != w[i])
        return 0;
    }
  }
  return (w[i] == '\0');
}


x86 assembly (clang, -O0):
<xdict_match_simple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1252 <xdict_match_simple+0x142>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    115a <xdict_match_simple+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    126c <xdict_match_simple+0x15c>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x31,%eax
jne    11a2 <xdict_match_simple+0x92>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
lea    0xe82(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
jne    119d <xdict_match_simple+0x8d>
movl   $0x0,-0x4(%rbp)
jmp    126c <xdict_match_simple+0x15c>
jmp    123a <xdict_match_simple+0x12a>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jne    11ea <xdict_match_simple+0xda>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
lea    0xe50(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
jne    11e5 <xdict_match_simple+0xd5>
movl   $0x0,-0x4(%rbp)
jmp    126c <xdict_match_simple+0x15c>
jmp    1235 <xdict_match_simple+0x125>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3f,%eax
je     1230 <xdict_match_simple+0x120>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     122b <xdict_match_simple+0x11b>
movl   $0x0,-0x4(%rbp)
jmp    126c <xdict_match_simple+0x15c>
jmp    1230 <xdict_match_simple+0x120>
jmp    1235 <xdict_match_simple+0x125>
jmp    123a <xdict_match_simple+0x12a>
jmp    123f <xdict_match_simple+0x12f>
jmp    1244 <xdict_match_simple+0x134>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1127 <xdict_match_simple+0x17>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdict_match_simple>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r15
mov    (%rsi),%al
test   %al,%al
je     1182 <xdict_match_simple+0x72>
mov    %rsi,%rbx
xor    %r14d,%r14d
lea    0xee5(%rip),%r12
lea    0xec8(%rip),%r13
xor    %ebp,%ebp
jmp    1151 <xdict_match_simple+0x41>
nopl   0x0(%rax)
cmp    %cl,%al
jne    1194 <xdict_match_simple+0x84>
movzbl 0x1(%rbx,%rbp,1),%eax
add    $0x1,%rbp
test   %al,%al
je     1186 <xdict_match_simple+0x76>
movzbl (%r15,%rbp,1),%ecx
test   %cl,%cl
je     1194 <xdict_match_simple+0x84>
cmp    $0x30,%al
je     1170 <xdict_match_simple+0x60>
cmp    $0x3f,%al
je     1144 <xdict_match_simple+0x34>
cmp    $0x31,%al
jne    1140 <xdict_match_simple+0x30>
movsbl %cl,%esi
mov    %r13,%rdi
jmp    1176 <xdict_match_simple+0x66>
xchg   %ax,%ax
movsbl %cl,%esi
mov    %r12,%rdi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1144 <xdict_match_simple+0x34>
jmp    1194 <xdict_match_simple+0x84>
xor    %eax,%eax
jmp    1188 <xdict_match_simple+0x78>
mov    %ebp,%eax
xor    %r14d,%r14d
cmpb   $0x0,(%r15,%rax,1)
sete   %r14b
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"bcdfghjklmnpqrstvwxyz\00"
@.str.1 = [7 x i8] c"aeiouy\00"
define i32 @xdict_match_simple(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 0, i32* %6
br label %7
7: ; preds = %87, %2
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %90
14: ; preds = %7
%15 = load i8*, i8** %4
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 0, i32* %3
br label %99
23: ; preds = %14
%24 = load i8*, i8** %5
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %24, i64 %26
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 49
br i1 %30, label %31, label %41
31: ; preds = %23
%32 = load i8*, i8** %4
%33 = load i32, i32* %6
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8, i8* %32, i64 %34
%36 = load i8, i8* %35
%37 = call i32* @strchr(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8 signext %36)
%38 = icmp ne i32* %37, null
br i1 %38, label %40, label %39
39: ; preds = %31
store i32 0, i32* %3
br label %99
40: ; preds = %31
br label %85
41: ; preds = %23
%42 = load i8*, i8** %5
%43 = load i32, i32* %6
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8, i8* %42, i64 %44
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 48
br i1 %48, label %49, label %59
49: ; preds = %41
%50 = load i8*, i8** %4
%51 = load i32, i32* %6
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8, i8* %50, i64 %52
%54 = load i8, i8* %53
%55 = call i32* @strchr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8 signext %54)
%56 = icmp ne i32* %55, null
br i1 %56, label %58, label %57
57: ; preds = %49
store i32 0, i32* %3
br label %99
58: ; preds = %49
br label %84
59: ; preds = %41
%60 = load i8*, i8** %5
%61 = load i32, i32* %6
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i8, i8* %60, i64 %62
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp ne i32 %65, 63
br i1 %66, label %67, label %83
67: ; preds = %59
%68 = load i8*, i8** %5
%69 = load i32, i32* %6
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8, i8* %68, i64 %70
%72 = load i8, i8* %71
%73 = sext i8 %72 to i32
%74 = load i8*, i8** %4
%75 = load i32, i32* %6
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i8, i8* %74, i64 %76
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = icmp ne i32 %73, %79
br i1 %80, label %81, label %82
81: ; preds = %67
store i32 0, i32* %3
br label %99
82: ; preds = %67
br label %83
83: ; preds = %82, %59
br label %84
84: ; preds = %83, %58
br label %85
85: ; preds = %84, %40
br label %86
86: ; preds = %85
br label %87
87: ; preds = %86
%88 = load i32, i32* %6
%89 = add nsw i32 %88, 1
store i32 %89, i32* %6
br label %7
90: ; preds = %7
%91 = load i8*, i8** %4
%92 = load i32, i32* %6
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i8, i8* %91, i64 %93
%95 = load i8, i8* %94
%96 = sext i8 %95 to i32
%97 = icmp eq i32 %96, 0
%98 = zext i1 %97 to i32
store i32 %98, i32* %3
br label %99
99: ; preds = %90, %81, %57, %39, %22
%100 = load i32, i32* %3
ret i32 %100
}

LLVM IR (-O2):
@.str = [22 x i8] c"bcdfghjklmnpqrstvwxyz\00"
@.str.1 = [7 x i8] c"aeiouy\00"
define i32 @xdict_match_simple(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %27, label %5
5: ; preds = %2, %20
%6 = phi i64 [ %21, %20 ], [ 0, %2 ]
%7 = phi i8 [ %23, %20 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %33, label %11
11: ; preds = %5
switch i8 %7, label %18 [
i8 49, label %12
i8 48, label %15
i8 63, label %20
]
12: ; preds = %11
%13 = tail call i32* @strchr(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8 signext %9)
%14 = icmp eq i32* %13, null
br i1 %14, label %33, label %20
15: ; preds = %11
%16 = tail call i32* @strchr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8 signext %9)
%17 = icmp eq i32* %16, null
br i1 %17, label %33, label %20
18: ; preds = %11
%19 = icmp eq i8 %7, %9
br i1 %19, label %20, label %33
20: ; preds = %11, %15, %18, %12
%21 = add nuw i64 %6, 1
%22 = getelementptr inbounds i8, i8* %1, i64 %21
%23 = load i8, i8* %22
%24 = icmp eq i8 %23, 0
br i1 %24, label %25, label %5
25: ; preds = %20
%26 = and i64 %21, 4294967295
br label %27
27: ; preds = %25, %2
%28 = phi i64 [ 0, %2 ], [ %26, %25 ]
%29 = getelementptr inbounds i8, i8* %0, i64 %28
%30 = load i8, i8* %29
%31 = icmp eq i8 %30, 0
%32 = zext i1 %31 to i32
br label %33
33: ; preds = %18, %15, %12, %5, %27
%34 = phi i32 [ %32, %27 ], [ 0, %5 ], [ 0, %12 ], [ 0, %15 ], [ 0, %18 ]
ret i32 %34
}