#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 const *const, char *, int /*<<< orphan*/);
int exclude_match(char *name) {
  int i;
  static const char *const exclude[] = {
      "README",   "readme",   "*.DIZ",    "*.diz",    "*.NFO",  "*.nfo",
      "*.DOC",    "*.Doc",    "*.doc",    "*.INFO",   "*.info", "*.Info",
      "*.TXT",    "*.txt",    "*.EXE",    "*.exe",    "*.COM",  "*.com",
      "*.README", "*.readme", "*.Readme", "*.ReadMe", NULL};
  for (i = 0; exclude[i] != NULL; i++) {
    if (fnmatch(exclude[i], name, 0) == 0) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<exclude_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rcx
lea    0x2c32(%rip),%rax
cmpq   $0x0,(%rax,%rcx,8)
je     117c <exclude_match+0x6c>
movslq -0x14(%rbp),%rcx
lea    0x2c1c(%rip),%rax
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <fnmatch@plt>
cmp    $0x0,%rax
jne    1169 <exclude_match+0x59>
movl   $0x1,-0x4(%rbp)
jmp    1183 <exclude_match+0x73>
jmp    116e <exclude_match+0x5e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <exclude_match+0x13>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exclude_match>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0x2c3f(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rbx,%r15,1),%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1030 <fnmatch@plt>
test   %rax,%rax
je     1154 <exclude_match+0x44>
add    $0x8,%rbx
cmp    $0xb0,%rbx
jne    1130 <exclude_match+0x20>
xor    %eax,%eax
jmp    1159 <exclude_match+0x49>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@exclude_match.exclude = internal constant [23 x i8*] [i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i32 0, i32 0), i8* null]
@.str = [7 x i8] c"README\00"
@.str.1 = [7 x i8] c"readme\00"
@.str.2 = [6 x i8] c"*.DIZ\00"
@.str.3 = [6 x i8] c"*.diz\00"
@.str.4 = [6 x i8] c"*.NFO\00"
@.str.5 = [6 x i8] c"*.nfo\00"
@.str.6 = [6 x i8] c"*.DOC\00"
@.str.7 = [6 x i8] c"*.Doc\00"
@.str.8 = [6 x i8] c"*.doc\00"
@.str.9 = [7 x i8] c"*.INFO\00"
@.str.10 = [7 x i8] c"*.info\00"
@.str.11 = [7 x i8] c"*.Info\00"
@.str.12 = [6 x i8] c"*.TXT\00"
@.str.13 = [6 x i8] c"*.txt\00"
@.str.14 = [6 x i8] c"*.EXE\00"
@.str.15 = [6 x i8] c"*.exe\00"
@.str.16 = [6 x i8] c"*.COM\00"
@.str.17 = [6 x i8] c"*.com\00"
@.str.18 = [9 x i8] c"*.README\00"
@.str.19 = [9 x i8] c"*.readme\00"
@.str.20 = [9 x i8] c"*.Readme\00"
@.str.21 = [9 x i8] c"*.ReadMe\00"
define i32 @exclude_match(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %21, %1
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [23 x i8*], [23 x i8*]* @exclude_match.exclude, i64 0, i64 %7
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %24
11: ; preds = %5
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [23 x i8*], [23 x i8*]* @exclude_match.exclude, i64 0, i64 %13
%15 = load i8*, i8** %14
%16 = load i8*, i8** %3
%17 = call i64 @fnmatch(i8* %15, i8* %16, i32 0)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %11
store i32 1, i32* %2
br label %25
20: ; preds = %11
br label %21
21: ; preds = %20
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %5
24: ; preds = %5
store i32 0, i32* %2
br label %25
25: ; preds = %24, %19
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
@exclude_match.exclude = internal unnamed_addr constant [23 x i8*] [i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.21, i32 0, i32 0), i8* null]
@.str = [7 x i8] c"README\00"
@.str.1 = [7 x i8] c"readme\00"
@.str.2 = [6 x i8] c"*.DIZ\00"
@.str.3 = [6 x i8] c"*.diz\00"
@.str.4 = [6 x i8] c"*.NFO\00"
@.str.5 = [6 x i8] c"*.nfo\00"
@.str.6 = [6 x i8] c"*.DOC\00"
@.str.7 = [6 x i8] c"*.Doc\00"
@.str.8 = [6 x i8] c"*.doc\00"
@.str.9 = [7 x i8] c"*.INFO\00"
@.str.10 = [7 x i8] c"*.info\00"
@.str.11 = [7 x i8] c"*.Info\00"
@.str.12 = [6 x i8] c"*.TXT\00"
@.str.13 = [6 x i8] c"*.txt\00"
@.str.14 = [6 x i8] c"*.EXE\00"
@.str.15 = [6 x i8] c"*.exe\00"
@.str.16 = [6 x i8] c"*.COM\00"
@.str.17 = [6 x i8] c"*.com\00"
@.str.18 = [9 x i8] c"*.README\00"
@.str.19 = [9 x i8] c"*.readme\00"
@.str.20 = [9 x i8] c"*.Readme\00"
@.str.21 = [9 x i8] c"*.ReadMe\00"
define i32 @exclude_match(i8* %0) {
br label %4
2: ; preds = %4
%3 = icmp eq i64 %10, 22
br i1 %3, label %11, label %4
4: ; preds = %1, %2
%5 = phi i64 [ 0, %1 ], [ %10, %2 ]
%6 = getelementptr inbounds [23 x i8*], [23 x i8*]* @exclude_match.exclude, i64 0, i64 %5
%7 = load i8*, i8** %6
%8 = tail call i64 @fnmatch(i8* %7, i8* %0, i32 0)
%9 = icmp eq i64 %8, 0
%10 = add nuw nsw i64 %5, 1
br i1 %9, label %11, label %2
11: ; preds = %2, %4
%12 = phi i32 [ 1, %4 ], [ 0, %2 ]
ret i32 %12
}