#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 */
scalar_t__ fnmatch(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *);
int main(int argc, char **argv) {
  char szFirst[] = "rImport_ysb_20150921095504_1.txt";
  char szSecond[] = "rImport_ysb_201509110946_03_0.txt";
  char reFirst[] = "rImport_ysb_*_*.txt";
  char reSecond[] = "rImport_ysb_*_*_*.txt";
  if (fnmatch(reFirst, szFirst, 0) == 0) {
    printf("%s is match %s\n", szFirst, reFirst);
  }
  if (fnmatch(reFirst, szSecond, 0) == 0) {
    printf("%s is match %s\n", szSecond, reFirst);
  }
  if (fnmatch(reSecond, szSecond, 0) == 0) {
    printf("%s is match %s\n", szSecond, reSecond);
  }
  if (fnmatch(reSecond, szFirst, 0) == 0) {
    printf("%s is match %s\n", szFirst, reSecond);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeac(%rip),%rsi
mov    $0x21,%edx
call   1050 <memcpy@plt>
lea    -0x70(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x22,%edx
call   1050 <memcpy@plt>
mov    0xee6(%rip),%rax
mov    %rax,-0x90(%rbp)
mov    0xee0(%rip),%rax
mov    %rax,-0x88(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0x80(%rbp)
mov    0xee1(%rip),%rax
mov    %rax,-0xb0(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0xa8(%rbp)
mov    0xed6(%rip),%eax
mov    %eax,-0xa0(%rbp)
mov    0xecd(%rip),%ax
mov    %ax,-0x9c(%rbp)
lea    -0x90(%rbp),%rdi
lea    -0x40(%rbp),%rsi
xor    %edx,%edx
call   1040 <fnmatch@plt>
cmp    $0x0,%rax
jne    1201 <main+0xd1>
lea    -0x40(%rbp),%rsi
lea    -0x90(%rbp),%rdx
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
lea    -0x90(%rbp),%rdi
lea    -0x70(%rbp),%rsi
xor    %edx,%edx
call   1040 <fnmatch@plt>
cmp    $0x0,%rax
jne    1234 <main+0x104>
lea    -0x70(%rbp),%rsi
lea    -0x90(%rbp),%rdx
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
lea    -0xb0(%rbp),%rdi
lea    -0x70(%rbp),%rsi
xor    %edx,%edx
call   1040 <fnmatch@plt>
cmp    $0x0,%rax
jne    1267 <main+0x137>
lea    -0x70(%rbp),%rsi
lea    -0xb0(%rbp),%rdx
lea    0xe34(%rip),%rdi
call   1030 <printf@plt>
lea    -0xb0(%rbp),%rdi
lea    -0x40(%rbp),%rsi
xor    %edx,%edx
call   1040 <fnmatch@plt>
cmp    $0x0,%rax
jne    129a <main+0x16a>
lea    -0x40(%rbp),%rsi
lea    -0xb0(%rbp),%rdx
lea    0xe01(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x98,%rsp
movaps 0xee2(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xec6(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movb   $0x0,0x60(%rsp)
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xed6(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movw   $0x74,0x90(%rsp)
movaps 0xef0(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x747874,0x10(%rsp)
movabs $0x7478742e2a5f2a,%rax
mov    %rax,0x2e(%rsp)
movaps 0xeee(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    %rsp,%rdi
lea    0x40(%rsp),%rsi
xor    %edx,%edx
call   1040 <fnmatch@plt>
test   %rax,%rax
jne    11bf <main+0x9f>
lea    0xee4(%rip),%rdi
lea    0x40(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <printf@plt>
mov    %rsp,%rdi
lea    0x70(%rsp),%rsi
xor    %edx,%edx
call   1040 <fnmatch@plt>
test   %rax,%rax
jne    11e7 <main+0xc7>
lea    0xebc(%rip),%rdi
lea    0x70(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <printf@plt>
lea    0x20(%rsp),%rdi
lea    0x70(%rsp),%rsi
xor    %edx,%edx
call   1040 <fnmatch@plt>
test   %rax,%rax
jne    1213 <main+0xf3>
lea    0xe92(%rip),%rdi
lea    0x70(%rsp),%rsi
lea    0x20(%rsp),%rdx
call   1030 <printf@plt>
lea    0x20(%rsp),%rdi
lea    0x40(%rsp),%rsi
xor    %edx,%edx
call   1040 <fnmatch@plt>
test   %rax,%rax
jne    123f <main+0x11f>
lea    0xe66(%rip),%rdi
lea    0x40(%rsp),%rsi
lea    0x20(%rsp),%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x98,%rsp
ret

LLVM IR (-O0):
@__const.main.szFirst = [33 x i8] c"rImport_ysb_20150921095504_1.txt\00"
@__const.main.szSecond = [34 x i8] c"rImport_ysb_201509110946_03_0.txt\00"
@__const.main.reFirst = [20 x i8] c"rImport_ysb_*_*.txt\00"
@__const.main.reSecond = [22 x i8] c"rImport_ysb_*_*_*.txt\00"
@.str = [16 x i8] c"%s is match %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [33 x i8]
%7 = alloca [34 x i8]
%8 = alloca [20 x i8]
%9 = alloca [22 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = bitcast [33 x i8]* %6 to i8*
%11 = bitcast [34 x i8]* %7 to i8*
%12 = bitcast [20 x i8]* %8 to i8*
%13 = bitcast [22 x i8]* %9 to i8*
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%15 = getelementptr inbounds [33 x i8], [33 x i8]* %6, i64 0, i64 0
%16 = call i64 @fnmatch(i8* %14, i8* %15, i32 0)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %2
%19 = getelementptr inbounds [33 x i8], [33 x i8]* %6, i64 0, i64 0
%20 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%21 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %19, i8* %20)
br label %22
22: ; preds = %18, %2
%23 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%24 = getelementptr inbounds [34 x i8], [34 x i8]* %7, i64 0, i64 0
%25 = call i64 @fnmatch(i8* %23, i8* %24, i32 0)
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %31
27: ; preds = %22
%28 = getelementptr inbounds [34 x i8], [34 x i8]* %7, i64 0, i64 0
%29 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%30 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %28, i8* %29)
br label %31
31: ; preds = %27, %22
%32 = getelementptr inbounds [22 x i8], [22 x i8]* %9, i64 0, i64 0
%33 = getelementptr inbounds [34 x i8], [34 x i8]* %7, i64 0, i64 0
%34 = call i64 @fnmatch(i8* %32, i8* %33, i32 0)
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %40
36: ; preds = %31
%37 = getelementptr inbounds [34 x i8], [34 x i8]* %7, i64 0, i64 0
%38 = getelementptr inbounds [22 x i8], [22 x i8]* %9, i64 0, i64 0
%39 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %37, i8* %38)
br label %40
40: ; preds = %36, %31
%41 = getelementptr inbounds [22 x i8], [22 x i8]* %9, i64 0, i64 0
%42 = getelementptr inbounds [33 x i8], [33 x i8]* %6, i64 0, i64 0
%43 = call i64 @fnmatch(i8* %41, i8* %42, i32 0)
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %49
45: ; preds = %40
%46 = getelementptr inbounds [33 x i8], [33 x i8]* %6, i64 0, i64 0
%47 = getelementptr inbounds [22 x i8], [22 x i8]* %9, i64 0, i64 0
%48 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %46, i8* %47)
br label %49
49: ; preds = %45, %40
ret i32 0
}

LLVM IR (-O2):
@__const.main.szFirst = [33 x i8] c"rImport_ysb_20150921095504_1.txt\00"
@__const.main.szSecond = [34 x i8] c"rImport_ysb_201509110946_03_0.txt\00"
@__const.main.reFirst = [20 x i8] c"rImport_ysb_*_*.txt\00"
@__const.main.reSecond = [22 x i8] c"rImport_ysb_*_*_*.txt\00"
@.str = [16 x i8] c"%s is match %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [33 x i8]
%4 = alloca [34 x i8]
%5 = alloca [20 x i8]
%6 = alloca [22 x i8]
%7 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [34 x i8], [34 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%10 = getelementptr inbounds [22 x i8], [22 x i8]* %6, i64 0, i64 0
%11 = call i64 @fnmatch(i8* %9, i8* %7, i32 0)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %9)
br label %15
15: ; preds = %13, %2
%16 = call i64 @fnmatch(i8* %9, i8* %8, i32 0)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
br label %20
20: ; preds = %18, %15
%21 = call i64 @fnmatch(i8* %10, i8* %8, i32 0)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %10)
br label %25
25: ; preds = %23, %20
%26 = call i64 @fnmatch(i8* %10, i8* %7, i32 0)
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %10)
br label %30
30: ; preds = %28, %25
ret i32 0
}