#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 */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ has_child_file(char const *, char *);
int filter_is_mh(const char *path, const struct stat *sb) {
  int result = 0;
  if (S_ISDIR(sb->st_mode)) {
    if (has_child_file(path, ".xmhcache") ||
        has_child_file(path, ".mh_sequences") ||
        has_child_file(path, ".sylpheed_cache") ||
        has_child_file(path, ".sylpheed_mark") ||
        has_child_file(path, ".claws_cache") ||
        has_child_file(path, ".claws_mark") || has_child_file(path, ".marks") ||
        has_child_file(path, ".overview") || has_child_file(path, "cmeta") ||
        has_child_file(path, "summary") ||
        has_child_file(path, ".mew-summary") || has_child_file(path, "index")) {
      result = 1;
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<filter_is_mh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
je     1290 <filter_is_mh+0x170>
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1040 <has_child_file@plt>
cmp    $0x0,%rax
jne    1284 <filter_is_mh+0x164>
mov    -0x8(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1040 <has_child_file@plt>
cmp    $0x0,%rax
jne    1284 <filter_is_mh+0x164>
mov    -0x8(%rbp),%rdi
lea    0xe8d(%rip),%rsi
call   1040 <has_child_file@plt>
cmp    $0x0,%rax
jne    1284 <filter_is_mh+0x164>
mov    -0x8(%rbp),%rdi
lea    0xe83(%rip),%rsi
call   1040 <has_child_file@plt>
cmp    $0x0,%rax
jne    1284 <filter_is_mh+0x164>
mov    -0x8(%rbp),%rdi
lea    0xe78(%rip),%rsi
call   1040 <has_child_file@plt>
cmp    $0x0,%rax
jne    1284 <filter_is_mh+0x164>
mov    -0x8(%rbp),%rdi
lea    0xe6b(%rip),%rsi
call   1040 <has_child_file@plt>
cmp    $0x0,%rax
jne    1284 <filter_is_mh+0x164>
mov    -0x8(%rbp),%rdi
lea    0xe5d(%rip),%rsi
call   1040 <has_child_file@plt>
cmp    $0x0,%rax
jne    1284 <filter_is_mh+0x164>
mov    -0x8(%rbp),%rdi
lea    0xe4a(%rip),%rsi
call   1040 <has_child_file@plt>
cmp    $0x0,%rax
jne    1284 <filter_is_mh+0x164>
mov    -0x8(%rbp),%rdi
lea    0xe3a(%rip),%rsi
call   1040 <has_child_file@plt>
cmp    $0x0,%rax
jne    1284 <filter_is_mh+0x164>
mov    -0x8(%rbp),%rdi
lea    0xe2b(%rip),%rsi
call   1040 <has_child_file@plt>
cmp    $0x0,%rax
jne    1284 <filter_is_mh+0x164>
mov    -0x8(%rbp),%rdi
lea    0xe0c(%rip),%rsi
call   1040 <has_child_file@plt>
cmp    $0x0,%rax
jne    1284 <filter_is_mh+0x164>
mov    -0x8(%rbp),%rdi
lea    0xdff(%rip),%rsi
call   1040 <has_child_file@plt>
cmp    $0x0,%rax
je     128b <filter_is_mh+0x16b>
movl   $0x1,-0x14(%rbp)
jmp    1290 <filter_is_mh+0x170>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filter_is_mh>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rsi),%edi
call   1030 <S_ISDIR@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1242 <filter_is_mh+0x122>
lea    0xec0(%rip),%rsi
mov    %r14,%rdi
call   1040 <has_child_file@plt>
test   %rax,%rax
jne    123d <filter_is_mh+0x11d>
lea    0xeb2(%rip),%rsi
mov    %r14,%rdi
call   1040 <has_child_file@plt>
test   %rax,%rax
jne    123d <filter_is_mh+0x11d>
lea    0xea8(%rip),%rsi
mov    %r14,%rdi
call   1040 <has_child_file@plt>
test   %rax,%rax
jne    123d <filter_is_mh+0x11d>
lea    0xea0(%rip),%rsi
mov    %r14,%rdi
call   1040 <has_child_file@plt>
test   %rax,%rax
jne    123d <filter_is_mh+0x11d>
lea    0xe97(%rip),%rsi
mov    %r14,%rdi
call   1040 <has_child_file@plt>
test   %rax,%rax
jne    123d <filter_is_mh+0x11d>
lea    0xe8c(%rip),%rsi
mov    %r14,%rdi
call   1040 <has_child_file@plt>
test   %rax,%rax
jne    123d <filter_is_mh+0x11d>
lea    0xe84(%rip),%rsi
mov    %r14,%rdi
call   1040 <has_child_file@plt>
test   %rax,%rax
jne    123d <filter_is_mh+0x11d>
lea    0xe77(%rip),%rsi
mov    %r14,%rdi
call   1040 <has_child_file@plt>
test   %rax,%rax
jne    123d <filter_is_mh+0x11d>
lea    0xe6d(%rip),%rsi
mov    %r14,%rdi
call   1040 <has_child_file@plt>
test   %rax,%rax
jne    123d <filter_is_mh+0x11d>
lea    0xe64(%rip),%rsi
mov    %r14,%rdi
call   1040 <has_child_file@plt>
test   %rax,%rax
jne    123d <filter_is_mh+0x11d>
lea    0xe4b(%rip),%rsi
mov    %r14,%rdi
call   1040 <has_child_file@plt>
test   %rax,%rax
jne    123d <filter_is_mh+0x11d>
lea    0xe44(%rip),%rsi
mov    %r14,%rdi
call   1040 <has_child_file@plt>
test   %rax,%rax
je     1242 <filter_is_mh+0x122>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [10 x i8] c".xmhcache\00"
@.str.1 = [14 x i8] c".mh_sequences\00"
@.str.2 = [16 x i8] c".sylpheed_cache\00"
@.str.3 = [15 x i8] c".sylpheed_mark\00"
@.str.4 = [13 x i8] c".claws_cache\00"
@.str.5 = [12 x i8] c".claws_mark\00"
@.str.6 = [7 x i8] c".marks\00"
@.str.7 = [10 x i8] c".overview\00"
@.str.8 = [6 x i8] c"cmeta\00"
@.str.9 = [8 x i8] c"summary\00"
@.str.10 = [13 x i8] c".mew-summary\00"
@.str.11 = [6 x i8] c"index\00"
define i32 @filter_is_mh(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
%5 = alloca i32
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
store i32 0, i32* %5
%6 = load %struct.stat*, %struct.stat** %4
%7 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISDIR(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %61
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i64 @has_child_file(i8* %12, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%14 = icmp ne i64 %13, 0
br i1 %14, label %59, label %15
15: ; preds = %11
%16 = load i8*, i8** %3
%17 = call i64 @has_child_file(i8* %16, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp ne i64 %17, 0
br i1 %18, label %59, label %19
19: ; preds = %15
%20 = load i8*, i8** %3
%21 = call i64 @has_child_file(i8* %20, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp ne i64 %21, 0
br i1 %22, label %59, label %23
23: ; preds = %19
%24 = load i8*, i8** %3
%25 = call i64 @has_child_file(i8* %24, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%26 = icmp ne i64 %25, 0
br i1 %26, label %59, label %27
27: ; preds = %23
%28 = load i8*, i8** %3
%29 = call i64 @has_child_file(i8* %28, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%30 = icmp ne i64 %29, 0
br i1 %30, label %59, label %31
31: ; preds = %27
%32 = load i8*, i8** %3
%33 = call i64 @has_child_file(i8* %32, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%34 = icmp ne i64 %33, 0
br i1 %34, label %59, label %35
35: ; preds = %31
%36 = load i8*, i8** %3
%37 = call i64 @has_child_file(i8* %36, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%38 = icmp ne i64 %37, 0
br i1 %38, label %59, label %39
39: ; preds = %35
%40 = load i8*, i8** %3
%41 = call i64 @has_child_file(i8* %40, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%42 = icmp ne i64 %41, 0
br i1 %42, label %59, label %43
43: ; preds = %39
%44 = load i8*, i8** %3
%45 = call i64 @has_child_file(i8* %44, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%46 = icmp ne i64 %45, 0
br i1 %46, label %59, label %47
47: ; preds = %43
%48 = load i8*, i8** %3
%49 = call i64 @has_child_file(i8* %48, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%50 = icmp ne i64 %49, 0
br i1 %50, label %59, label %51
51: ; preds = %47
%52 = load i8*, i8** %3
%53 = call i64 @has_child_file(i8* %52, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
%54 = icmp ne i64 %53, 0
br i1 %54, label %59, label %55
55: ; preds = %51
%56 = load i8*, i8** %3
%57 = call i64 @has_child_file(i8* %56, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0))
%58 = icmp ne i64 %57, 0
br i1 %58, label %59, label %60
59: ; preds = %55, %51, %47, %43, %39, %35, %31, %27, %23, %19, %15, %11
store i32 1, i32* %5
br label %60
60: ; preds = %59, %55
br label %61
61: ; preds = %60, %2
%62 = load i32, i32* %5
ret i32 %62
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [10 x i8] c".xmhcache\00"
@.str.1 = [14 x i8] c".mh_sequences\00"
@.str.2 = [16 x i8] c".sylpheed_cache\00"
@.str.3 = [15 x i8] c".sylpheed_mark\00"
@.str.4 = [13 x i8] c".claws_cache\00"
@.str.5 = [12 x i8] c".claws_mark\00"
@.str.6 = [7 x i8] c".marks\00"
@.str.7 = [10 x i8] c".overview\00"
@.str.8 = [6 x i8] c"cmeta\00"
@.str.9 = [8 x i8] c"summary\00"
@.str.10 = [13 x i8] c".mew-summary\00"
@.str.11 = [6 x i8] c"index\00"
define i32 @filter_is_mh(i8* %0, %struct.stat* nocapture %1) {
%3 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%4 = load i32, i32* %3
%5 = tail call i64 @S_ISDIR(i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %44, label %7
7: ; preds = %2
%8 = tail call i64 @has_child_file(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %43
10: ; preds = %7
%11 = tail call i64 @has_child_file(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %43
13: ; preds = %10
%14 = tail call i64 @has_child_file(i8* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %43
16: ; preds = %13
%17 = tail call i64 @has_child_file(i8* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %43
19: ; preds = %16
%20 = tail call i64 @has_child_file(i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %43
22: ; preds = %19
%23 = tail call i64 @has_child_file(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %43
25: ; preds = %22
%26 = tail call i64 @has_child_file(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %43
28: ; preds = %25
%29 = tail call i64 @has_child_file(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %43
31: ; preds = %28
%32 = tail call i64 @has_child_file(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %43
34: ; preds = %31
%35 = tail call i64 @has_child_file(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %43
37: ; preds = %34
%38 = tail call i64 @has_child_file(i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %43
40: ; preds = %37
%41 = tail call i64 @has_child_file(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %44, label %43
43: ; preds = %40, %37, %34, %31, %28, %25, %22, %19, %16, %13, %10, %7
br label %44
44: ; preds = %40, %43, %2
%45 = phi i32 [ 1, %43 ], [ 0, %40 ], [ 0, %2 ]
ret i32 %45
}