#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(int);
int barent(char *s) {
  if (s == 0)
    return (1);
  if (!point((int)s))
    return (1);
  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    11d4 <barent+0xc4>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1030 <point@plt>
cmp    $0x0,%eax
jne    1153 <barent+0x43>
movl   $0x1,-0x4(%rbp)
jmp    11d4 <barent+0xc4>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    116f <barent+0x5f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     118c <barent+0x7c>
movl   $0x0,-0x4(%rbp)
jmp    11d4 <barent+0xc4>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0x3d,%eax
je     11c1 <barent+0xb1>
jmp    11a4 <barent+0x94>
mov    -0x14(%rbp),%eax
sub    $0x5f,%eax
jne    11cd <barent+0xbd>
jmp    11b5 <barent+0xa5>
movl   $0x2d,-0x4(%rbp)
jmp    11d4 <barent+0xc4>
movl   $0x3d,-0x4(%rbp)
jmp    11d4 <barent+0xc4>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<barent>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
test   %rdi,%rdi
je     1153 <barent+0x43>
mov    %rdi,%rbx
call   1030 <point@plt>
test   %eax,%eax
je     1153 <barent+0x43>
xor    %eax,%eax
cmpb   $0x5c,(%rbx)
sete   %al
xor    %ebp,%ebp
cmpb   $0x0,0x1(%rbx,%rax,1)
jne    1153 <barent+0x43>
mov    (%rbx,%rax,1),%al
xor    %ecx,%ecx
cmp    $0x3d,%al
mov    $0x3d,%edx
cmovne %ecx,%edx
cmp    $0x5f,%al
mov    $0x2d,%ebp
cmovne %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
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 %37
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = ptrtoint i8* %8 to i32
%10 = call i32 @point(i32 %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %7
store i32 1, i32* %2
br label %37
13: ; preds = %7
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 92
br i1 %18, label %19, label %22
19: ; preds = %13
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %3
br label %22
22: ; preds = %19, %13
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i64 1
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %22
store i32 0, i32* %2
br label %37
29: ; preds = %22
%30 = load i8*, i8** %3
%31 = getelementptr inbounds i8, i8* %30, i64 0
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
switch i32 %33, label %36 [
i32 95, label %34
i32 61, label %35
]
34: ; preds = %29
store i32 45, i32* %2
br label %37
35: ; preds = %29
store i32 61, i32* %2
br label %37
36: ; preds = %29
store i32 0, i32* %2
br label %37
37: ; preds = %36, %35, %34, %28, %12, %6
%38 = load i32, i32* %2
ret i32 %38
}

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