#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", "t1");
    exit(-1);
  };
  if (!(isMatch("aa", "aa") == 1)) {
    printf("assert fail: %s\n", "t1");
    exit(-1);
  };
  if (!(isMatch("aaa", "aa") == 0)) {
    printf("assert fail: %s\n", "t1");
    exit(-1);
  };
  if (!(isMatch("aa", "a*") == 1)) {
    printf("assert fail: %s\n", "t1");
    exit(-1);
  };
  if (!(isMatch("aa", ".*") == 1)) {
    printf("assert fail: %s\n", "t1");
    exit(-1);
  };
  if (!(isMatch("ab", ".*") == 1)) {
    printf("assert fail: %s\n", "t1");
    exit(-1);
  };
  if (!(isMatch("aab", "c*a*b") == 1)) {
    printf("assert fail: %s\n", "t2");
    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    0xec8(%rip),%rdi
lea    0xec2(%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    0xe8d(%rip),%rsi
mov    %rsi,%rdi
call   1030 <isMatch@plt>
cmp    $0x1,%eax
je     11b8 <main+0x88>
lea    0xe60(%rip),%rdi
lea    0xe6a(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
lea    0xe55(%rip),%rdi
lea    0xe4f(%rip),%rsi
call   1030 <isMatch@plt>
cmp    $0x0,%eax
je     11f3 <main+0xc3>
lea    0xe25(%rip),%rdi
lea    0xe2f(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
lea    0xe1b(%rip),%rdi
lea    0xe17(%rip),%rsi
call   1030 <isMatch@plt>
cmp    $0x1,%eax
je     122e <main+0xfe>
lea    0xdea(%rip),%rdi
lea    0xdf4(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
lea    0xde0(%rip),%rdi
lea    0xddf(%rip),%rsi
call   1030 <isMatch@plt>
cmp    $0x1,%eax
je     1269 <main+0x139>
lea    0xdaf(%rip),%rdi
lea    0xdb9(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
lea    0xdaf(%rip),%rdi
lea    0xda4(%rip),%rsi
call   1030 <isMatch@plt>
cmp    $0x1,%eax
je     12a4 <main+0x174>
lea    0xd74(%rip),%rdi
lea    0xd7e(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
lea    0xd73(%rip),%rdi
lea    0xd70(%rip),%rsi
call   1030 <isMatch@plt>
cmp    $0x1,%eax
je     12df <main+0x1af>
lea    0xd39(%rip),%rdi
lea    0xd5a(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
lea    0xd45(%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    0xecd(%rip),%rdi
lea    0xec7(%rip),%rsi
call   1040 <isMatch@plt>
test   %eax,%eax
jne    11fb <main+0xbb>
lea    0xeb2(%rip),%rdi
mov    %rdi,%rsi
call   1040 <isMatch@plt>
cmp    $0x1,%eax
jne    11fb <main+0xbb>
lea    0xe99(%rip),%rdi
lea    0xe93(%rip),%rsi
call   1040 <isMatch@plt>
test   %eax,%eax
jne    11fb <main+0xbb>
lea    0xe83(%rip),%rdi
lea    0xe7f(%rip),%rsi
call   1040 <isMatch@plt>
cmp    $0x1,%eax
jne    11fb <main+0xbb>
lea    0xe6b(%rip),%rdi
lea    0xe6a(%rip),%rsi
call   1040 <isMatch@plt>
cmp    $0x1,%eax
jne    11fb <main+0xbb>
lea    0xe5d(%rip),%rdi
lea    0xe52(%rip),%rsi
call   1040 <isMatch@plt>
cmp    $0x1,%eax
jne    11fb <main+0xbb>
lea    0xe44(%rip),%rdi
lea    0xe41(%rip),%rsi
call   1040 <isMatch@plt>
cmp    $0x1,%eax
jne    121a <main+0xda>
lea    0xe39(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xdfe(%rip),%rdi
lea    0xe08(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
lea    0xddf(%rip),%rdi
lea    0xe00(%rip),%rsi
jmp    1209 <main+0xc9>

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 = [3 x i8] c"t1\00"
@.str.4 = [4 x i8] c"aaa\00"
@.str.5 = [3 x i8] c"a*\00"
@.str.6 = [3 x i8] c".*\00"
@.str.7 = [3 x i8] c"ab\00"
@.str.8 = [4 x i8] c"aab\00"
@.str.9 = [6 x i8] c"c*a*b\00"
@.str.10 = [3 x i8] c"t2\00"
@.str.11 = [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 ([3 x i8], [3 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 ([3 x i8], [3 x i8]* @.str.3, 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.4, 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 ([3 x i8], [3 x i8]* @.str.3, 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 ([3 x i8], [3 x i8]* @.str.5, 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 ([3 x i8], [3 x i8]* @.str.3, 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.6, 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 ([3 x i8], [3 x i8]* @.str.3, 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.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, 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 ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%40 = call i32 @exit(i32 -1)
unreachable
41: ; preds = %35
%42 = call i32 @isMatch(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%43 = icmp eq i32 %42, 1
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.10, i64 0, i64 0))
%46 = call i32 @exit(i32 -1)
unreachable
47: ; preds = %41
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, 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 = [3 x i8] c"t1\00"
@.str.4 = [4 x i8] c"aaa\00"
@.str.5 = [3 x i8] c"a*\00"
@.str.6 = [3 x i8] c".*\00"
@.str.7 = [3 x i8] c"ab\00"
@.str.8 = [4 x i8] c"aab\00"
@.str.9 = [6 x i8] c"c*a*b\00"
@.str.10 = [3 x i8] c"t2\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 ([3 x i8], [3 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 ([3 x i8], [3 x i8]* @.str.3, 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.4, 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 ([3 x i8], [3 x i8]* @.str.3, 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 ([3 x i8], [3 x i8]* @.str.5, 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 ([3 x i8], [3 x i8]* @.str.3, 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.6, 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 ([3 x i8], [3 x i8]* @.str.3, 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.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, 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 ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%37 = tail call i32 @exit(i32 -1)
unreachable
38: ; preds = %32
%39 = tail call i32 @isMatch(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%40 = icmp eq i32 %39, 1
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.10, i64 0, i64 0))
%43 = tail call i32 @exit(i32 -1)
unreachable
44: ; preds = %38
%45 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}