#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 strlen(char *);
int isOpenTag(char *object) {
  int lenght;
  if (object == NULL) {
    return 0;
  }
  lenght = strlen(object);
  if (lenght < 3) {
    return 0;
  }
  if ((object[0] != '<') || (object[lenght - 1] != '>')) {
    return 0;
  }
  if ((object[1] == '?') || (object[1] == '!') || (object[1] == '/')) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isOpenTag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <isOpenTag+0x23>
movl   $0x0,-0x4(%rbp)
jmp    11d1 <isOpenTag+0xc1>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    1155 <isOpenTag+0x45>
movl   $0x0,-0x4(%rbp)
jmp    11d1 <isOpenTag+0xc1>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3c,%eax
jne    117f <isOpenTag+0x6f>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3e,%eax
je     118b <isOpenTag+0x7b>
movl   $0x0,-0x4(%rbp)
jmp    11d1 <isOpenTag+0xc1>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x3f,%eax
je     11be <isOpenTag+0xae>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x21,%eax
je     11be <isOpenTag+0xae>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2f,%eax
jne    11ca <isOpenTag+0xba>
movl   $0x0,-0x4(%rbp)
jmp    11d1 <isOpenTag+0xc1>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOpenTag>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
test   %rdi,%rdi
je     1154 <isOpenTag+0x44>
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x3,%eax
jl     1154 <isOpenTag+0x44>
cmpb   $0x3c,(%rbx)
jne    1154 <isOpenTag+0x44>
add    $0xffffffff,%eax
cmpb   $0x3e,(%rbx,%rax,1)
jne    1154 <isOpenTag+0x44>
movzbl 0x1(%rbx),%eax
cmp    $0x3f,%rax
ja     114f <isOpenTag+0x3f>
movabs $0x8000800200000000,%rcx
bt     %rax,%rcx
jb     1154 <isOpenTag+0x44>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isOpenTag(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %19, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp slt i32 %4, 3
br i1 %5, label %19, label %6
6: ; preds = %3
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 60
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = add nsw i32 %4, -1
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 62
br i1 %14, label %15, label %19
15: ; preds = %9
%16 = getelementptr inbounds i8, i8* %0, i64 1
%17 = load i8, i8* %16
switch i8 %17, label %18 [
i8 63, label %19
i8 33, label %19
i8 47, label %19
]
18: ; preds = %15
br label %19
19: ; preds = %15, %15, %15, %6, %9, %3, %1, %18
%20 = phi i32 [ 1, %18 ], [ 0, %1 ], [ 0, %3 ], [ 0, %9 ], [ 0, %6 ], [ 0, %15 ], [ 0, %15 ], [ 0, %15 ]
ret i32 %20
}