#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*/ showmatch(char *, char *);
int main() {
  showmatch("*cat", "cat");
  showmatch("*cat*", "cat");
  showmatch("cat*", "cat");
  showmatch("*cat", "this cat");
  showmatch("*cat", "this catscat");
  showmatch("*cat", "this cacatscat");
  showmatch("this*cat", "this cacatscat");
  showmatch("this*cat*", "this cacatscat");
  showmatch("th*ca*cat", "this cacatscat");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf17(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1030 <showmatch@plt>
lea    0xef9(%rip),%rdi
lea    0xec5(%rip),%rsi
call   1030 <showmatch@plt>
lea    0xee7(%rip),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <showmatch@plt>
lea    0xede(%rip),%rdi
lea    0xe9a(%rip),%rsi
call   1030 <showmatch@plt>
lea    0xecb(%rip),%rdi
lea    0xe90(%rip),%rsi
call   1030 <showmatch@plt>
lea    0xeb8(%rip),%rdi
lea    0xe8a(%rip),%rsi
call   1030 <showmatch@plt>
lea    0xe8d(%rip),%rdi
lea    0xe77(%rip),%rsi
call   1030 <showmatch@plt>
lea    0xe83(%rip),%rdi
lea    0xe64(%rip),%rsi
call   1030 <showmatch@plt>
lea    0xe7a(%rip),%rdi
lea    0xe51(%rip),%rsi
call   1030 <showmatch@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xf22(%rip),%r14
lea    0xee3(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <showmatch@plt>
lea    0xefe(%rip),%rdi
mov    %rbx,%rsi
call   1030 <showmatch@plt>
lea    0xef0(%rip),%rdi
mov    %rbx,%rsi
call   1030 <showmatch@plt>
lea    0xeae(%rip),%rsi
mov    %r14,%rdi
call   1030 <showmatch@plt>
lea    0xea8(%rip),%rsi
mov    %r14,%rdi
call   1030 <showmatch@plt>
lea    0xea6(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <showmatch@plt>
lea    0xea3(%rip),%rdi
mov    %rbx,%rsi
call   1030 <showmatch@plt>
lea    0xe9d(%rip),%rdi
mov    %rbx,%rsi
call   1030 <showmatch@plt>
lea    0xe98(%rip),%rdi
mov    %rbx,%rsi
call   1030 <showmatch@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"*cat\00"
@.str.1 = [4 x i8] c"cat\00"
@.str.2 = [6 x i8] c"*cat*\00"
@.str.3 = [5 x i8] c"cat*\00"
@.str.4 = [9 x i8] c"this cat\00"
@.str.5 = [13 x i8] c"this catscat\00"
@.str.6 = [15 x i8] c"this cacatscat\00"
@.str.7 = [9 x i8] c"this*cat\00"
@.str.8 = [10 x i8] c"this*cat*\00"
@.str.9 = [10 x i8] c"th*ca*cat\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @showmatch(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @showmatch(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @showmatch(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @showmatch(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @showmatch(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 @showmatch(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%8 = call i32 @showmatch(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%9 = call i32 @showmatch(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%10 = call i32 @showmatch(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"*cat\00"
@.str.1 = [4 x i8] c"cat\00"
@.str.2 = [6 x i8] c"*cat*\00"
@.str.3 = [5 x i8] c"cat*\00"
@.str.4 = [9 x i8] c"this cat\00"
@.str.5 = [13 x i8] c"this catscat\00"
@.str.6 = [15 x i8] c"this cacatscat\00"
@.str.7 = [9 x i8] c"this*cat\00"
@.str.8 = [10 x i8] c"this*cat*\00"
@.str.9 = [10 x i8] c"th*ca*cat\00"
define i32 @main() {
%1 = tail call i32 @showmatch(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @showmatch(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @showmatch(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @showmatch(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%5 = tail call i32 @showmatch(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%6 = tail call i32 @showmatch(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%7 = tail call i32 @showmatch(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%8 = tail call i32 @showmatch(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%9 = tail call i32 @showmatch(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}