#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 dirent {
  scalar_t__ d_type;
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
scalar_t__ DT_REG;
scalar_t__ strcmp(int /*<<< orphan*/, char *);
int exec_dir_filter(const struct dirent *de) {
  return strcmp(de->d_name, ".") && strcmp(de->d_name, "..") &&
         de->d_type == DT_REG;
}


x86 assembly (clang, -O0):
<exec_dir_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%edi
lea    0xed7(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     117d <exec_dir_filter+0x6d>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%edi
lea    0xeb1(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     117d <exec_dir_filter+0x6d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2e6c(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec_dir_filter>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x8(%rdi),%edi
lea    0xee0(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1154 <exec_dir_filter+0x44>
mov    0x8(%r14),%edi
lea    0xec8(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1154 <exec_dir_filter+0x44>
mov    (%r14),%rax
mov    0x2e94(%rip),%rcx
xor    %ebx,%ebx
cmp    (%rcx),%rax
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.dirent = type { i64, i32 }
@.str = [2 x i8] c".\00"
@.str.1 = [3 x i8] c"..\00"
@DT_REG = global i64 0
define i32 @exec_dir_filter(%struct.dirent* %0) {
%2 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %2
%3 = load %struct.dirent*, %struct.dirent** %2
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i32 0, i32 1
%5 = load i32, i32* %4
%6 = call i64 @strcmp(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %1
%9 = load %struct.dirent*, %struct.dirent** %2
%10 = getelementptr inbounds %struct.dirent, %struct.dirent* %9, i32 0, i32 1
%11 = load i32, i32* %10
%12 = call i64 @strcmp(i32 %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %8
%15 = load %struct.dirent*, %struct.dirent** %2
%16 = getelementptr inbounds %struct.dirent, %struct.dirent* %15, i32 0, i32 0
%17 = load i64, i64* %16
%18 = load i64, i64* @DT_REG
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %14, %8, %1
%21 = phi i1 [ false, %8 ], [ false, %1 ], [ %19, %14 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
%struct.dirent = type { i64, i32 }
@.str = [2 x i8] c".\00"
@.str.1 = [3 x i8] c"..\00"
@DT_REG = global i64 0
define i32 @exec_dir_filter(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 1
%3 = load i32, i32* %2
%4 = tail call i64 @strcmp(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = tail call i64 @strcmp(i32 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %16, label %10
10: ; preds = %6
%11 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%12 = load i64, i64* %11
%13 = load i64, i64* @DT_REG
%14 = icmp eq i64 %12, %13
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %10, %6, %1
%17 = phi i32 [ 0, %6 ], [ 0, %1 ], [ %15, %10 ]
ret i32 %17
}