#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 {
  char *d_name;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ isdigit(char const);
int /*<<< orphan*/ stderr;
int __selector_2(const struct dirent *restrict b) {
  if (b->d_name[0] == '.') {
    return 0;
  }
  for (const char *p = b->d_name; *p != '\0'; ++p) {
    if (!isdigit(*p)) {
      fputs("the name of a hsperfdata file contains non digits", stderr);
      fprintf(stderr, "the name is %s\n", b->d_name);
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<__selector_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    115b <__selector_2+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    11e5 <__selector_2+0xb5>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11de <__selector_2+0xae>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    11c8 <__selector_2+0x98>
mov    0x2e4e(%rip),%rax
mov    (%rax),%esi
lea    0xe65(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe7b(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11e5 <__selector_2+0xb5>
jmp    11cd <__selector_2+0x9d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1166 <__selector_2+0x36>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__selector_2>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%rbx
mov    (%rbx),%al
test   %al,%al
je     1168 <__selector_2+0x38>
xor    %r14d,%r14d
cmp    $0x2e,%al
je     1198 <__selector_2+0x68>
lea    0x1(%rbx),%rbp
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1170 <__selector_2+0x40>
movzbl 0x0(%rbp),%eax
add    $0x1,%rbp
test   %al,%al
jne    1150 <__selector_2+0x20>
mov    $0x1,%r14d
jmp    1198 <__selector_2+0x68>
mov    0x2e69(%rip),%rbp
mov    0x0(%rbp),%esi
lea    0xe7f(%rip),%rdi
call   1040 <fputs@plt>
mov    0x0(%rbp),%edi
lea    0xea2(%rip),%rsi
mov    %rbx,%rdx
call   1050 <fprintf@plt>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.dirent = type { i8* }
@.str = [50 x i8] c"the name of a hsperfdata file contains non digits\00"
@stderr = global i32 0
@.str.1 = [16 x i8] c"the name is %s\0A\00"
define i32 @__selector_2(%struct.dirent* noalias %0) {
%2 = alloca i32
%3 = alloca %struct.dirent*
%4 = alloca i8*
store %struct.dirent* %0, %struct.dirent** %3
%5 = load %struct.dirent*, %struct.dirent** %3
%6 = getelementptr inbounds %struct.dirent, %struct.dirent* %5, i32 0, i32 0
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 46
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 0, i32* %2
br label %40
13: ; preds = %1
%14 = load %struct.dirent*, %struct.dirent** %3
%15 = getelementptr inbounds %struct.dirent, %struct.dirent* %14, i32 0, i32 0
%16 = load i8*, i8** %15
store i8* %16, i8** %4
br label %17
17: ; preds = %36, %13
%18 = load i8*, i8** %4
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %39
22: ; preds = %17
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = call i32 @isdigit(i8 signext %24)
%26 = icmp ne i32 %25, 0
br i1 %26, label %35, label %27
27: ; preds = %22
%28 = load i32, i32* @stderr
%29 = call i32 @fputs(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %28)
%30 = load i32, i32* @stderr
%31 = load %struct.dirent*, %struct.dirent** %3
%32 = getelementptr inbounds %struct.dirent, %struct.dirent* %31, i32 0, i32 0
%33 = load i8*, i8** %32
%34 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %33)
store i32 0, i32* %2
br label %40
35: ; preds = %22
br label %36
36: ; preds = %35
%37 = load i8*, i8** %4
%38 = getelementptr inbounds i8, i8* %37, i32 1
store i8* %38, i8** %4
br label %17
39: ; preds = %17
store i32 1, i32* %2
br label %40
40: ; preds = %39, %27, %12
%41 = load i32, i32* %2
ret i32 %41
}

LLVM IR (-O2):
%struct.dirent = type { i8* }
@.str = [50 x i8] c"the name of a hsperfdata file contains non digits\00"
@stderr = global i32 0
@.str.1 = [16 x i8] c"the name is %s\0A\00"
define i32 @__selector_2(%struct.dirent* noalias nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 46, label %20
i8 0, label %19
]
5: ; preds = %1, %15
%6 = phi i8* [ %16, %15 ], [ %3, %1 ]
%7 = phi i8 [ %17, %15 ], [ %4, %1 ]
%8 = tail call i32 @isdigit(i8 signext %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = load i32, i32* @stderr
%12 = tail call i32 @fputs(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* @stderr
%14 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %3)
br label %20
15: ; preds = %5
%16 = getelementptr inbounds i8, i8* %6, i64 1
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %20, label %5
19: ; preds = %1
br label %20
20: ; preds = %15, %1, %19, %10
%21 = phi i32 [ 0, %1 ], [ 0, %10 ], [ 1, %19 ], [ 1, %15 ]
ret i32 %21
}