#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*/ point(char *);
int barent(char *s) {
  if (s == NULL)
    return (1);
  if (!point(s))
    return (0);
  if (s[0] == '\\')
    s++;
  if (s[1] != 0)
    return (0);
  switch (s[0]) {
  case '_':
    return ('-');
  case '=':
    return ('=');
  }
  return (0);
}


x86 assembly (clang, -O0):
<barent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <barent+0x23>
movl   $0x1,-0x4(%rbp)
jmp    11d2 <barent+0xc2>
mov    -0x10(%rbp),%rdi
call   1030 <point@plt>
cmp    $0x0,%eax
jne    1151 <barent+0x41>
movl   $0x0,-0x4(%rbp)
jmp    11d2 <barent+0xc2>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    116d <barent+0x5d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     118a <barent+0x7a>
movl   $0x0,-0x4(%rbp)
jmp    11d2 <barent+0xc2>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0x3d,%eax
je     11bf <barent+0xaf>
jmp    11a2 <barent+0x92>
mov    -0x14(%rbp),%eax
sub    $0x5f,%eax
jne    11cb <barent+0xbb>
jmp    11b3 <barent+0xa3>
movl   $0x2d,-0x4(%rbp)
jmp    11d2 <barent+0xc2>
movl   $0x3d,-0x4(%rbp)
jmp    11d2 <barent+0xc2>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<barent>:
push   %rbx
test   %rdi,%rdi
je     1137 <barent+0x27>
mov    %rdi,%rbx
call   1030 <point@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1135 <barent+0x25>
xor    %ecx,%ecx
cmpb   $0x5c,(%rbx)
sete   %cl
cmpb   $0x0,0x1(%rbx,%rcx,1)
je     113e <barent+0x2e>
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret
mov    (%rbx,%rcx,1),%al
xor    %ecx,%ecx
cmp    $0x3d,%al
mov    $0x3d,%edx
cmovne %ecx,%edx
cmp    $0x5f,%al
mov    $0x2d,%eax
cmovne %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @barent(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 1, i32* %2
br label %36
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @point(i8* %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %7
store i32 0, i32* %2
br label %36
12: ; preds = %7
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 0
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 92
br i1 %17, label %18, label %21
18: ; preds = %12
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
br label %21
21: ; preds = %18, %12
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 1
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %21
store i32 0, i32* %2
br label %36
28: ; preds = %21
%29 = load i8*, i8** %3
%30 = getelementptr inbounds i8, i8* %29, i64 0
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
switch i32 %32, label %35 [
i32 95, label %33
i32 61, label %34
]
33: ; preds = %28
store i32 45, i32* %2
br label %36
34: ; preds = %28
store i32 61, i32* %2
br label %36
35: ; preds = %28
store i32 0, i32* %2
br label %36
36: ; preds = %35, %34, %33, %27, %11, %6
%37 = load i32, i32* %2
ret i32 %37
}

LLVM IR (-O2):
define i32 @barent(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %20, label %3
3: ; preds = %1
%4 = tail call i32 @point(i8* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %20, label %6
6: ; preds = %3
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 92
%9 = zext i1 %8 to i64
%10 = getelementptr i8, i8* %0, i64 %9
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %6
%15 = load i8, i8* %10
%16 = icmp eq i8 %15, 61
%17 = select i1 %16, i32 61, i32 0
%18 = icmp eq i8 %15, 95
%19 = select i1 %18, i32 45, i32 %17
br label %20
20: ; preds = %14, %6, %3, %1
%21 = phi i32 [ 1, %1 ], [ 0, %3 ], [ 0, %6 ], [ %19, %14 ]
ret i32 %21
}