#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);
int isMatch(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  if (!(isMatch("aa", "a") == 0)) {
    printf("assert fail: %s\n", "aa a");
    exit(-1);
  };
  if (!(isMatch("aa", "aa") == 1)) {
    printf("assert fail: %s\n", "aa aa");
    exit(-1);
  };
  if (!(isMatch("aaa", "aa") == 0)) {
    printf("assert fail: %s\n", "aaa aa");
    exit(-1);
  };
  if (!(isMatch("aa", "*") == 1)) {
    printf("assert fail: %s\n", "aa *");
    exit(-1);
  };
  if (!(isMatch("aa", "a*") == 1)) {
    printf("assert fail: %s\n", "aa a*");
    exit(-1);
  };
  if (!(isMatch("ab", "?*") == 1)) {
    printf("assert fail: %s\n", "ab ?*");
    exit(-1);
  };
  if (!(isMatch("", "?") == 0)) {
    printf("assert fail: %s\n", " ?");
    exit(-1);
  };
  if (!(isMatch("aab", "c*a*b") == 0)) {
    printf("assert fail: %s\n", "aab c*a*b");
    exit(-1);
  };
  printf("everything is fine!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed1(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1030 <isMatch@plt>
cmp    $0x0,%eax
je     1181 <main+0x51>
lea    0xe97(%rip),%rdi
lea    0xea1(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
lea    0xe96(%rip),%rsi
mov    %rsi,%rdi
call   1030 <isMatch@plt>
cmp    $0x1,%eax
je     11b8 <main+0x88>
lea    0xe60(%rip),%rdi
lea    0xe74(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
lea    0xe57(%rip),%rdi
lea    0xe58(%rip),%rsi
call   1030 <isMatch@plt>
cmp    $0x0,%eax
je     11f3 <main+0xc3>
lea    0xe25(%rip),%rdi
lea    0xe38(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
lea    0xe24(%rip),%rdi
lea    0xe23(%rip),%rsi
call   1030 <isMatch@plt>
cmp    $0x1,%eax
je     122e <main+0xfe>
lea    0xdea(%rip),%rdi
lea    0xe04(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
lea    0xde9(%rip),%rdi
lea    0xded(%rip),%rsi
call   1030 <isMatch@plt>
cmp    $0x1,%eax
je     1269 <main+0x139>
lea    0xdaf(%rip),%rdi
lea    0xdce(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
lea    0xdc6(%rip),%rdi
lea    0xdb8(%rip),%rsi
call   1030 <isMatch@plt>
cmp    $0x1,%eax
je     12a4 <main+0x174>
lea    0xd74(%rip),%rdi
lea    0xd99(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
lea    0xdac(%rip),%rdi
lea    0xd81(%rip),%rsi
call   1030 <isMatch@plt>
cmp    $0x0,%eax
je     12df <main+0x1af>
lea    0xd39(%rip),%rdi
lea    0xd64(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
lea    0xd4f(%rip),%rdi
lea    0xd50(%rip),%rsi
call   1030 <isMatch@plt>
cmp    $0x0,%eax
je     131a <main+0x1ea>
lea    0xcfe(%rip),%rdi
lea    0xd30(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
lea    0xd22(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed6(%rip),%rdi
lea    0xec5(%rip),%rsi
call   1040 <isMatch@plt>
test   %eax,%eax
jne    1229 <main+0xe9>
lea    0xebb(%rip),%rdi
mov    %rdi,%rsi
call   1040 <isMatch@plt>
cmp    $0x1,%eax
jne    1239 <main+0xf9>
lea    0xe9b(%rip),%rdi
lea    0xe9c(%rip),%rsi
call   1040 <isMatch@plt>
test   %eax,%eax
jne    1249 <main+0x109>
lea    0xe88(%rip),%rdi
lea    0xe87(%rip),%rsi
call   1040 <isMatch@plt>
cmp    $0x1,%eax
jne    1259 <main+0x119>
lea    0xe6c(%rip),%rdi
lea    0xe70(%rip),%rsi
call   1040 <isMatch@plt>
cmp    $0x1,%eax
jne    1269 <main+0x129>
lea    0xe68(%rip),%rdi
lea    0xe5a(%rip),%rsi
call   1040 <isMatch@plt>
cmp    $0x1,%eax
jne    1279 <main+0x139>
lea    0xe26(%rip),%rdi
lea    0xe42(%rip),%rsi
call   1040 <isMatch@plt>
test   %eax,%eax
jne    1289 <main+0x149>
lea    0xe30(%rip),%rdi
lea    0xe31(%rip),%rsi
call   1040 <isMatch@plt>
test   %eax,%eax
jne    1299 <main+0x159>
lea    0xe23(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xdd0(%rip),%rdi
lea    0xdda(%rip),%rsi
jmp    12a7 <main+0x167>
lea    0xdc0(%rip),%rdi
lea    0xdd4(%rip),%rsi
jmp    12a7 <main+0x167>
lea    0xdb0(%rip),%rdi
lea    0xdc3(%rip),%rsi
jmp    12a7 <main+0x167>
lea    0xda0(%rip),%rdi
lea    0xdba(%rip),%rsi
jmp    12a7 <main+0x167>
lea    0xd90(%rip),%rdi
lea    0xdaf(%rip),%rsi
jmp    12a7 <main+0x167>
lea    0xd80(%rip),%rdi
lea    0xda5(%rip),%rsi
jmp    12a7 <main+0x167>
lea    0xd70(%rip),%rdi
lea    0xd9b(%rip),%rsi
jmp    12a7 <main+0x167>
lea    0xd60(%rip),%rdi
lea    0xd92(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"aa\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [17 x i8] c"assert fail: %s\0A\00"
@.str.3 = [5 x i8] c"aa a\00"
@.str.4 = [6 x i8] c"aa aa\00"
@.str.5 = [4 x i8] c"aaa\00"
@.str.6 = [7 x i8] c"aaa aa\00"
@.str.7 = [2 x i8] c"*\00"
@.str.8 = [5 x i8] c"aa *\00"
@.str.9 = [3 x i8] c"a*\00"
@.str.10 = [6 x i8] c"aa a*\00"
@.str.11 = [3 x i8] c"ab\00"
@.str.12 = [3 x i8] c"?*\00"
@.str.13 = [6 x i8] c"ab ?*\00"
@.str.14 = [1 x i8] zeroinitializer
@.str.15 = [2 x i8] c"?\00"
@.str.16 = [3 x i8] c" ?\00"
@.str.17 = [4 x i8] c"aab\00"
@.str.18 = [6 x i8] c"c*a*b\00"
@.str.19 = [10 x i8] c"aab c*a*b\00"
@.str.20 = [21 x i8] c"everything is fine!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @isMatch(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %2
%12 = call i32 @isMatch(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i32 %12, 1
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 @exit(i32 -1)
unreachable
17: ; preds = %11
%18 = call i32 @isMatch(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%19 = icmp eq i32 %18, 0
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%22 = call i32 @exit(i32 -1)
unreachable
23: ; preds = %17
%24 = call i32 @isMatch(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%25 = icmp eq i32 %24, 1
br i1 %25, label %29, label %26
26: ; preds = %23
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%28 = call i32 @exit(i32 -1)
unreachable
29: ; preds = %23
%30 = call i32 @isMatch(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%31 = icmp eq i32 %30, 1
br i1 %31, label %35, label %32
32: ; preds = %29
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%34 = call i32 @exit(i32 -1)
unreachable
35: ; preds = %29
%36 = call i32 @isMatch(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%37 = icmp eq i32 %36, 1
br i1 %37, label %41, label %38
38: ; preds = %35
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
%40 = call i32 @exit(i32 -1)
unreachable
41: ; preds = %35
%42 = call i32 @isMatch(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
%43 = icmp eq i32 %42, 0
br i1 %43, label %47, label %44
44: ; preds = %41
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0))
%46 = call i32 @exit(i32 -1)
unreachable
47: ; preds = %41
%48 = call i32 @isMatch(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%49 = icmp eq i32 %48, 0
br i1 %49, label %53, label %50
50: ; preds = %47
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.19, i64 0, i64 0))
%52 = call i32 @exit(i32 -1)
unreachable
53: ; preds = %47
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.20, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"aa\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [17 x i8] c"assert fail: %s\0A\00"
@.str.3 = [5 x i8] c"aa a\00"
@.str.4 = [6 x i8] c"aa aa\00"
@.str.5 = [4 x i8] c"aaa\00"
@.str.6 = [7 x i8] c"aaa aa\00"
@.str.7 = [2 x i8] c"*\00"
@.str.8 = [5 x i8] c"aa *\00"
@.str.9 = [3 x i8] c"a*\00"
@.str.10 = [6 x i8] c"aa a*\00"
@.str.11 = [3 x i8] c"ab\00"
@.str.12 = [3 x i8] c"?*\00"
@.str.13 = [6 x i8] c"ab ?*\00"
@.str.14 = [1 x i8] zeroinitializer
@.str.15 = [2 x i8] c"?\00"
@.str.16 = [3 x i8] c" ?\00"
@.str.17 = [4 x i8] c"aab\00"
@.str.18 = [6 x i8] c"c*a*b\00"
@.str.19 = [10 x i8] c"aab c*a*b\00"
@str = [20 x i8] c"everything is fine!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @isMatch(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
%9 = tail call i32 @isMatch(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i32 %9, 1
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%13 = tail call i32 @exit(i32 -1)
unreachable
14: ; preds = %8
%15 = tail call i32 @isMatch(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%16 = icmp eq i32 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%19 = tail call i32 @exit(i32 -1)
unreachable
20: ; preds = %14
%21 = tail call i32 @isMatch(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%22 = icmp eq i32 %21, 1
br i1 %22, label %26, label %23
23: ; preds = %20
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%25 = tail call i32 @exit(i32 -1)
unreachable
26: ; preds = %20
%27 = tail call i32 @isMatch(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%28 = icmp eq i32 %27, 1
br i1 %28, label %32, label %29
29: ; preds = %26
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%31 = tail call i32 @exit(i32 -1)
unreachable
32: ; preds = %26
%33 = tail call i32 @isMatch(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%34 = icmp eq i32 %33, 1
br i1 %34, label %38, label %35
35: ; preds = %32
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
%37 = tail call i32 @exit(i32 -1)
unreachable
38: ; preds = %32
%39 = tail call i32 @isMatch(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0))
%40 = icmp eq i32 %39, 0
br i1 %40, label %44, label %41
41: ; preds = %38
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0))
%43 = tail call i32 @exit(i32 -1)
unreachable
44: ; preds = %38
%45 = tail call i32 @isMatch(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%46 = icmp eq i32 %45, 0
br i1 %46, label %50, label %47
47: ; preds = %44
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.19, i64 0, i64 0))
%49 = tail call i32 @exit(i32 -1)
unreachable
50: ; preds = %44
%51 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}