#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 */
int /*<<< orphan*/ strcmp(char *, int /*<<< orphan*/);
int myselect(const struct dirent *dasdirent) {
  if (!strcmp("..", dasdirent->d_name))
    return 0;
  if (!strcmp(".", dasdirent->d_name))
    return 0;
  if (!strcmp("vstservant.so", dasdirent->d_name))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<myselect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1143 <myselect+0x33>
movl   $0x0,-0x4(%rbp)
jmp    1198 <myselect+0x88>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xeb1(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    116a <myselect+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    1198 <myselect+0x88>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xe8c(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1191 <myselect+0x81>
movl   $0x0,-0x4(%rbp)
jmp    1198 <myselect+0x88>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myselect>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%esi
lea    0xee0(%rip),%rdi
call   1030 <strcmp@plt>
xor    %ebx,%ebx
test   %eax,%eax
je     1154 <myselect+0x44>
mov    (%r14),%esi
lea    0xecc(%rip),%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1154 <myselect+0x44>
mov    (%r14),%esi
lea    0xebb(%rip),%rdi
call   1030 <strcmp@plt>
xor    %ebx,%ebx
test   %eax,%eax
setne  %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
@.str = [3 x i8] c"..\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [14 x i8] c"vstservant.so\00"
define i32 @myselect(%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 = getelementptr inbounds %struct.dirent, %struct.dirent* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = call i32 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %1
store i32 0, i32* %2
br label %25
10: ; preds = %1
%11 = load %struct.dirent*, %struct.dirent** %3
%12 = getelementptr inbounds %struct.dirent, %struct.dirent* %11, i32 0, i32 0
%13 = load i32, i32* %12
%14 = call i32 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %10
store i32 0, i32* %2
br label %25
17: ; preds = %10
%18 = load %struct.dirent*, %struct.dirent** %3
%19 = getelementptr inbounds %struct.dirent, %struct.dirent* %18, i32 0, i32 0
%20 = load i32, i32* %19
%21 = call i32 @strcmp(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %20)
%22 = icmp ne i32 %21, 0
br i1 %22, label %24, label %23
23: ; preds = %17
store i32 0, i32* %2
br label %25
24: ; preds = %17
store i32 1, i32* %2
br label %25
25: ; preds = %24, %23, %16, %9
%26 = load i32, i32* %2
ret i32 %26
}

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