#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*/);
int cmus_is_supported(char const *);
int normal_filter(const char *name, const struct stat *s) {
  if (name[0] == '.') {
    if (name[1] == '.' && name[2] == 0)
      return 1;
    return 0;
  }
  if (S_ISDIR(s->st_mode))
    return 1;
  return cmus_is_supported(name);
}


x86 assembly (clang, -O0):
<normal_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    117a <normal_filter+0x5a>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2e,%eax
jne    116e <normal_filter+0x4e>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
jne    116e <normal_filter+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    11a7 <normal_filter+0x87>
movl   $0x0,-0x4(%rbp)
jmp    11a7 <normal_filter+0x87>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
je     119b <normal_filter+0x7b>
movl   $0x1,-0x4(%rbp)
jmp    11a7 <normal_filter+0x87>
mov    -0x10(%rbp),%rdi
call   1040 <cmus_is_supported@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normal_filter>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x2e,(%rdi)
jne    1139 <normal_filter+0x19>
cmpb   $0x2e,0x1(%rbx)
jne    1135 <normal_filter+0x15>
cmpb   $0x0,0x2(%rbx)
je     1158 <normal_filter+0x38>
xor    %eax,%eax
jmp    114d <normal_filter+0x2d>
mov    (%rsi),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     114f <normal_filter+0x2f>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <cmus_is_supported@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @normal_filter(i8* %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.stat*
store i8* %0, i8** %4
store %struct.stat* %1, %struct.stat** %5
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 46
br i1 %10, label %11, label %25
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 46
br i1 %16, label %17, label %24
17: ; preds = %11
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %17
store i32 1, i32* %3
br label %35
24: ; preds = %17, %11
store i32 0, i32* %3
br label %35
25: ; preds = %2
%26 = load %struct.stat*, %struct.stat** %5
%27 = getelementptr inbounds %struct.stat, %struct.stat* %26, i32 0, i32 0
%28 = load i32, i32* %27
%29 = call i64 @S_ISDIR(i32 %28)
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %32
31: ; preds = %25
store i32 1, i32* %3
br label %35
32: ; preds = %25
%33 = load i8*, i8** %4
%34 = call i32 @cmus_is_supported(i8* %33)
store i32 %34, i32* %3
br label %35
35: ; preds = %32, %31, %24, %23
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @normal_filter(i8* %0, %struct.stat* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 46
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 46
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %21, label %13
13: ; preds = %9, %5
br label %21
14: ; preds = %2
%15 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%16 = load i32, i32* %15
%17 = tail call i64 @S_ISDIR(i32 %16)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = tail call i32 @cmus_is_supported(i8* %0)
br label %21
21: ; preds = %14, %9, %19, %13
%22 = phi i32 [ 0, %13 ], [ %20, %19 ], [ 1, %9 ], [ 1, %14 ]
ret i32 %22
}