#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 *, char);
int is_fileaddr(char *name) {
  char *cp;
  if (strchr(name, '@') != NULL)
    return 0;
  if (*name == '+')
    return 1;
  for (cp = name; *cp; cp++) {
    if (*cp == '!' || *cp == '%')
      return 0;
    if (*cp == '/')
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_fileaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x40,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1140 <is_fileaddr+0x30>
movl   $0x0,-0x4(%rbp)
jmp    11d6 <is_fileaddr+0xc6>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
jne    115c <is_fileaddr+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    11d6 <is_fileaddr+0xc6>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     11cf <is_fileaddr+0xbf>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x21,%eax
je     1191 <is_fileaddr+0x81>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x25,%eax
jne    119d <is_fileaddr+0x8d>
movl   $0x0,-0x4(%rbp)
jmp    11d6 <is_fileaddr+0xc6>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    11b9 <is_fileaddr+0xa9>
movl   $0x1,-0x4(%rbp)
jmp    11d6 <is_fileaddr+0xc6>
jmp    11be <is_fileaddr+0xae>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1164 <is_fileaddr+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_fileaddr>:
push   %rbx
mov    %rdi,%rbx
mov    $0x40,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     112a <is_fileaddr+0x1a>
pop    %rbx
ret
mov    (%rbx),%cl
cmp    $0x2b,%cl
jne    1143 <is_fileaddr+0x33>
mov    $0x1,%eax
pop    %rbx
ret
nopl   0x0(%rax,%rax,1)
movzbl (%rbx),%ecx
add    $0x1,%rbx
cmp    $0x24,%cl
jg     1160 <is_fileaddr+0x50>
test   %cl,%cl
je     1128 <is_fileaddr+0x18>
cmp    $0x21,%cl
jne    1140 <is_fileaddr+0x30>
jmp    1128 <is_fileaddr+0x18>
nopw   0x0(%rax,%rax,1)
cmp    $0x25,%cl
je     1128 <is_fileaddr+0x18>
cmp    $0x2f,%cl
jne    1140 <is_fileaddr+0x30>
jmp    1131 <is_fileaddr+0x21>

LLVM IR (-O0):
define i32 @is_fileaddr(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @strchr(i8* %5, i8 signext 64)
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %43
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 43
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 1, i32* %2
br label %43
15: ; preds = %9
%16 = load i8*, i8** %3
store i8* %16, i8** %4
br label %17
17: ; preds = %39, %15
%18 = load i8*, i8** %4
%19 = load i8, i8* %18
%20 = icmp ne i8 %19, 0
br i1 %20, label %21, label %42
21: ; preds = %17
%22 = load i8*, i8** %4
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 33
br i1 %25, label %31, label %26
26: ; preds = %21
%27 = load i8*, i8** %4
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 37
br i1 %30, label %31, label %32
31: ; preds = %26, %21
store i32 0, i32* %2
br label %43
32: ; preds = %26
%33 = load i8*, i8** %4
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 47
br i1 %36, label %37, label %38
37: ; preds = %32
store i32 1, i32* %2
br label %43
38: ; preds = %32
br label %39
39: ; preds = %38
%40 = load i8*, i8** %4
%41 = getelementptr inbounds i8, i8* %40, i32 1
store i8* %41, i8** %4
br label %17
42: ; preds = %17
store i32 0, i32* %2
br label %43
43: ; preds = %42, %37, %31, %14, %8
%44 = load i32, i32* %2
ret i32 %44
}

LLVM IR (-O2):
define i32 @is_fileaddr(i8* %0) {
%2 = tail call i32* @strchr(i8* %0, i8 signext 64)
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 43
br i1 %6, label %14, label %7
7: ; preds = %4, %10
%8 = phi i8 [ %12, %10 ], [ %5, %4 ]
%9 = phi i8* [ %11, %10 ], [ %0, %4 ]
switch i8 %8, label %10 [
i8 0, label %13
i8 33, label %13
i8 37, label %13
i8 47, label %14
]
10: ; preds = %7
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %11
br label %7
13: ; preds = %7, %7, %7
br label %14
14: ; preds = %7, %13, %4, %1
%15 = phi i32 [ 0, %1 ], [ 1, %4 ], [ 0, %13 ], [ 1, %7 ]
ret i32 %15
}