#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 match(char *, char *);
int /*<<< orphan*/ printf(char *, char *, char *);
int main() {
  if (match("foobar", "*oba*") != 1) {
    printf("matching \"%s\" against \"%s\" failed!\n", "foobar", "*oba*");
  };
  if (match("foobar", "*ba*") != 1) {
    printf("matching \"%s\" against \"%s\" failed!\n", "foobar", "*ba*");
  };
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1040 <match@plt>
cmp    $0x1,%eax
je     1165 <main+0x45>
lea    0xebb(%rip),%rdi
lea    0xea7(%rip),%rsi
lea    0xea7(%rip),%rdx
call   1030 <printf@plt>
lea    0xe94(%rip),%rdi
lea    0xebe(%rip),%rsi
call   1040 <match@plt>
cmp    $0x1,%eax
je     119b <main+0x7b>
lea    0xe85(%rip),%rdi
lea    0xe71(%rip),%rsi
lea    0xe9b(%rip),%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1040 <match@plt>
cmp    $0x1,%eax
je     1153 <main+0x33>
lea    0xecd(%rip),%rdi
lea    0xeb9(%rip),%rsi
lea    0xeb9(%rip),%rdx
call   1030 <printf@plt>
lea    0xea6(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1040 <match@plt>
cmp    $0x1,%eax
je     1185 <main+0x65>
lea    0xe9b(%rip),%rdi
lea    0xe87(%rip),%rsi
lea    0xeb1(%rip),%rdx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"foobar\00"
@.str.1 = [6 x i8] c"*oba*\00"
@.str.2 = [36 x i8] c"matching \22%s\22 against \22%s\22 failed!\0A\00"
@.str.3 = [5 x i8] c"*ba*\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @match(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp ne i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = call i32 @match(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"foobar\00"
@.str.1 = [6 x i8] c"*oba*\00"
@.str.2 = [36 x i8] c"matching \22%s\22 against \22%s\22 failed!\0A\00"
@.str.3 = [5 x i8] c"*ba*\00"
define i32 @main() {
%1 = tail call i32 @match(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32 %1, 1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = tail call i32 @match(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%7 = icmp eq i32 %6, 1
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret i32 0
}