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

/* Variables and functions */
scalar_t__ DT_DIR;
int /*<<< orphan*/ isdigit(char const);
int process_is_int(const struct dirent *_entry) {
  const char *c;
  if (_entry->d_type == DT_DIR) {
    for (c = _entry->d_name; *c != '\0'; c++) {
      if (!isdigit(*c)) {
        return 0;
      }
    }
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<process_is_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    0x2eb6(%rip),%rcx
cmp    (%rcx),%rax
jne    1192 <process_is_int+0x82>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1186 <process_is_int+0x76>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1170 <process_is_int+0x60>
movl   $0x0,-0x4(%rbp)
jmp    1199 <process_is_int+0x89>
jmp    1175 <process_is_int+0x65>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113f <process_is_int+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1199 <process_is_int+0x89>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_is_int>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%rax
mov    0x2ec3(%rip),%rcx
xor    %ebp,%ebp
cmp    (%rcx),%rax
jne    115c <process_is_int+0x4c>
mov    0x8(%rdi),%rbx
mov    (%rbx),%al
test   %al,%al
je     1157 <process_is_int+0x47>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     115c <process_is_int+0x4c>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <process_is_int+0x30>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.dirent = type { i64, i8* }
@DT_DIR = global i64 0
define i32 @process_is_int(%struct.dirent* %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 i64, i64* %6
%8 = load i64, i64* @DT_DIR
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %30
10: ; preds = %1
%11 = load %struct.dirent*, %struct.dirent** %3
%12 = getelementptr inbounds %struct.dirent, %struct.dirent* %11, i32 0, i32 1
%13 = load i8*, i8** %12
store i8* %13, i8** %4
br label %14
14: ; preds = %26, %10
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %29
19: ; preds = %14
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = call i32 @isdigit(i8 signext %21)
%23 = icmp ne i32 %22, 0
br i1 %23, label %25, label %24
24: ; preds = %19
store i32 0, i32* %2
br label %31
25: ; preds = %19
br label %26
26: ; preds = %25
%27 = load i8*, i8** %4
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %4
br label %14
29: ; preds = %14
store i32 1, i32* %2
br label %31
30: ; preds = %1
store i32 0, i32* %2
br label %31
31: ; preds = %30, %29, %24
%32 = load i32, i32* %2
ret i32 %32
}

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