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

/* Variables and functions */
scalar_t__ strcmp(int /*<<< orphan*/, char *);
int file_select(const struct dirent *entry) {
  if (entry == NULL)
    return ((1 == 0));
  if ((strcmp(entry->d_name, ".") == 0) || (strcmp(entry->d_name, "..") == 0))
    return ((1 == 0));
  else
    return ((1 == 1));
}


x86 assembly (clang, -O0):
<file_select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <file_select+0x23>
movl   $0x0,-0x4(%rbp)
jmp    117e <file_select+0x6e>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     116b <file_select+0x5b>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1177 <file_select+0x67>
movl   $0x0,-0x4(%rbp)
jmp    117e <file_select+0x6e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_select>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
test   %rdi,%rdi
je     1147 <file_select+0x37>
mov    %rdi,%rbx
mov    (%rdi),%edi
lea    0xedb(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1147 <file_select+0x37>
mov    (%rbx),%edi
lea    0xec7(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

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