#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 */

/* Variables and functions */
int /*<<< orphan*/ *strchr(char const *, char);
int /*<<< orphan*/ strcmp(char const *, char *);
int strlen(char const *);
int iso_node_is_valid_name(const char *name) {
  if (name == NULL) {
    return 0xE830FFFB;
  }
  if (name[0] == '\0')
    return 0xE830FE86;
  if (strlen(name) > 255)
    return 0xE830FE87;
  if (!strcmp(name, ".") || !strcmp(name, "..")) {
    return 0xE830FE86;
  }
  if (strchr(name, '/') != NULL) {
    return 0xE830FE86;
  }
  return 1;
}


x86 assembly (clang, -O0):
<iso_node_is_valid_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1153 <iso_node_is_valid_name+0x23>
movl   $0xe830fffb,-0x4(%rbp)
jmp    11f8 <iso_node_is_valid_name+0xc8>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    116f <iso_node_is_valid_name+0x3f>
movl   $0xe830fe86,-0x4(%rbp)
jmp    11f8 <iso_node_is_valid_name+0xc8>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0xff,%eax
jle    118f <iso_node_is_valid_name+0x5f>
movl   $0xe830fe87,-0x4(%rbp)
jmp    11f8 <iso_node_is_valid_name+0xc8>
mov    -0x10(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
je     11c1 <iso_node_is_valid_name+0x91>
mov    -0x10(%rbp),%rdi
lea    0xe4d(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    11cd <iso_node_is_valid_name+0x9d>
movl   $0xe830fe86,-0x4(%rbp)
jmp    11f8 <iso_node_is_valid_name+0xc8>
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
je     11f1 <iso_node_is_valid_name+0xc1>
movl   $0xe830fe86,-0x4(%rbp)
jmp    11f8 <iso_node_is_valid_name+0xc8>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iso_node_is_valid_name>:
push   %rbx
test   %rdi,%rdi
je     11a1 <iso_node_is_valid_name+0x71>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     11a8 <iso_node_is_valid_name+0x78>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    $0xe830fe87,%eax
cmp    $0xff,%ecx
jg     119f <iso_node_is_valid_name+0x6f>
lea    0xea5(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     11a8 <iso_node_is_valid_name+0x78>
lea    0xe91(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
mov    %eax,%ecx
mov    $0xe830fe86,%eax
test   %ecx,%ecx
je     119f <iso_node_is_valid_name+0x6f>
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1040 <strchr@plt>
test   %rax,%rax
mov    $0x1,%ecx
mov    $0xe830fe86,%eax
cmove  %ecx,%eax
pop    %rbx
ret
mov    $0xe830fffb,%eax
pop    %rbx
ret
mov    $0xe830fe86,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@.str.1 = [3 x i8] c"..\00"
define i32 @iso_node_is_valid_name(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -399441925, i32* %2
br label %34
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %7
store i32 -399442298, i32* %2
br label %34
14: ; preds = %7
%15 = load i8*, i8** %3
%16 = call i32 @strlen(i8* %15)
%17 = icmp sgt i32 %16, 255
br i1 %17, label %18, label %19
18: ; preds = %14
store i32 -399442297, i32* %2
br label %34
19: ; preds = %14
%20 = load i8*, i8** %3
%21 = call i32 @strcmp(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load i8*, i8** %3
%25 = call i32 @strcmp(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%26 = icmp ne i32 %25, 0
br i1 %26, label %28, label %27
27: ; preds = %23, %19
store i32 -399442298, i32* %2
br label %34
28: ; preds = %23
%29 = load i8*, i8** %3
%30 = call i32* @strchr(i8* %29, i8 signext 47)
%31 = icmp ne i32* %30, null
br i1 %31, label %32, label %33
32: ; preds = %28
store i32 -399442298, i32* %2
br label %34
33: ; preds = %28
store i32 1, i32* %2
br label %34
34: ; preds = %33, %32, %27, %18, %13, %6
%35 = load i32, i32* %2
ret i32 %35
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
@.str.1 = [3 x i8] c"..\00"
define i32 @iso_node_is_valid_name(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %19, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %19, label %6
6: ; preds = %3
%7 = tail call i32 @strlen(i8* %0)
%8 = icmp sgt i32 %7, 255
br i1 %8, label %19, label %9
9: ; preds = %6
%10 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %19, label %12
12: ; preds = %9
%13 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %12
%16 = tail call i32* @strchr(i8* %0, i8 signext 47)
%17 = icmp eq i32* %16, null
%18 = select i1 %17, i32 1, i32 -399442298
br label %19
19: ; preds = %15, %9, %12, %6, %3, %1
%20 = phi i32 [ -399441925, %1 ], [ -399442298, %3 ], [ -399442297, %6 ], [ -399442298, %12 ], [ -399442298, %9 ], [ %18, %15 ]
ret i32 %20
}