#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 */
typedef int /*<<< orphan*/ filter;

/* Variables and functions */
scalar_t__ strstr(char const *, char const *);
int is_filter(char const *ifname) {
  char const *filter[] = {
      "Wireless", "Microsoft", "Virtual", "lo",   "wlan",
      "vboxnet",  "ifb",       "gre",     "teql", "br",
      "imq",      "ra",        "wds",     "sit",  "apcli",
  };
  unsigned int i;
  for (i = 0; i < (sizeof(filter) / sizeof(filter[0])); ++i) {
    if (strstr(ifname, filter[i]))
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
lea    0x2c63(%rip),%rsi
mov    $0x78,%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x94(%rbp)
mov    -0x94(%rbp),%eax
cmp    $0xf,%rax
jae    11a7 <is_filter+0x87>
mov    -0x10(%rbp),%rdi
mov    -0x94(%rbp),%eax
mov    -0x90(%rbp,%rax,8),%rsi
ff
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     118e <is_filter+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    11ae <is_filter+0x8e>
jmp    1193 <is_filter+0x73>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    1151 <is_filter+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_filter>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee3(%rip),%rsi
call   1030 <strstr@plt>
mov    $0x1,%ebp
test   %rax,%rax
jne    1268 <is_filter+0x158>
lea    0xed2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
test   %rax,%rax
jne    1268 <is_filter+0x158>
lea    0xec4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
test   %rax,%rax
jne    1268 <is_filter+0x158>
lea    0xeb4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
test   %rax,%rax
jne    1268 <is_filter+0x158>
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
test   %rax,%rax
jne    1268 <is_filter+0x158>
lea    0xe8c(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
test   %rax,%rax
jne    1268 <is_filter+0x158>
lea    0xe7c(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
test   %rax,%rax
jne    1268 <is_filter+0x158>
lea    0xe68(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
test   %rax,%rax
jne    1268 <is_filter+0x158>
lea    0xe54(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
test   %rax,%rax
jne    1268 <is_filter+0x158>
lea    0xe45(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
test   %rax,%rax
jne    1268 <is_filter+0x158>
lea    0xe34(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
test   %rax,%rax
jne    1268 <is_filter+0x158>
lea    0xe24(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
test   %rax,%rax
jne    1268 <is_filter+0x158>
lea    0xe13(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
test   %rax,%rax
jne    1268 <is_filter+0x158>
lea    0xe03(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
test   %rax,%rax
jne    1268 <is_filter+0x158>
lea    0xdf3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Wireless\00"
@.str.1 = [10 x i8] c"Microsoft\00"
@.str.2 = [8 x i8] c"Virtual\00"
@.str.3 = [3 x i8] c"lo\00"
@.str.4 = [5 x i8] c"wlan\00"
@.str.5 = [8 x i8] c"vboxnet\00"
@.str.6 = [4 x i8] c"ifb\00"
@.str.7 = [4 x i8] c"gre\00"
@.str.8 = [5 x i8] c"teql\00"
@.str.9 = [3 x i8] c"br\00"
@.str.10 = [4 x i8] c"imq\00"
@.str.11 = [3 x i8] c"ra\00"
@.str.12 = [4 x i8] c"wds\00"
@.str.13 = [4 x i8] c"sit\00"
@.str.14 = [6 x i8] c"apcli\00"
@__const.is_filter.filter = [15 x i8*] [i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i32 0, i32 0)]
define i32 @is_filter(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [15 x i8*]
%5 = alloca i32
store i8* %0, i8** %3
%6 = bitcast [15 x i8*]* %4 to i8*
store i32 0, i32* %5
br label %7
7: ; preds = %21, %1
%8 = load i32, i32* %5
%9 = zext i32 %8 to i64
%10 = icmp ult i64 %9, 15
br i1 %10, label %11, label %24
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds [15 x i8*], [15 x i8*]* %4, i64 0, i64 %14
%16 = load i8*, i8** %15
%17 = call i64 @strstr(i8* %12, i8* %16)
%18 = icmp ne 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* %5
%23 = add i32 %22, 1
store i32 %23, i32* %5
br label %7
24: ; preds = %7
store i32 0, i32* %2
br label %25
25: ; preds = %24, %19
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
@.str = [9 x i8] c"Wireless\00"
@.str.1 = [10 x i8] c"Microsoft\00"
@.str.2 = [8 x i8] c"Virtual\00"
@.str.3 = [3 x i8] c"lo\00"
@.str.4 = [5 x i8] c"wlan\00"
@.str.5 = [8 x i8] c"vboxnet\00"
@.str.6 = [4 x i8] c"ifb\00"
@.str.7 = [4 x i8] c"gre\00"
@.str.8 = [5 x i8] c"teql\00"
@.str.9 = [3 x i8] c"br\00"
@.str.10 = [4 x i8] c"imq\00"
@.str.11 = [3 x i8] c"ra\00"
@.str.12 = [4 x i8] c"wds\00"
@.str.13 = [4 x i8] c"sit\00"
@.str.14 = [6 x i8] c"apcli\00"
define i32 @is_filter(i8* %0) {
%2 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %47
4: ; preds = %1
%5 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %47
7: ; preds = %4
%8 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %47
10: ; preds = %7
%11 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %47
13: ; preds = %10
%14 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %47
16: ; preds = %13
%17 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %47
19: ; preds = %16
%20 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %47
22: ; preds = %19
%23 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %47
25: ; preds = %22
%26 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %47
28: ; preds = %25
%29 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %47
31: ; preds = %28
%32 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %47
34: ; preds = %31
%35 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %47
37: ; preds = %34
%38 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %47
40: ; preds = %37
%41 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %47
43: ; preds = %40
%44 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0))
%45 = icmp ne i64 %44, 0
%46 = zext i1 %45 to i32
br label %47
47: ; preds = %43, %40, %37, %34, %31, %28, %25, %22, %19, %16, %13, %10, %7, %4, %1
%48 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 1, %7 ], [ 1, %10 ], [ 1, %13 ], [ 1, %16 ], [ 1, %19 ], [ 1, %22 ], [ 1, %25 ], [ 1, %28 ], [ 1, %31 ], [ 1, %34 ], [ 1, %37 ], [ 1, %40 ], [ %46, %43 ]
ret i32 %48
}