#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*/ compare_tag_cd(char const *, char *, int);
int /*<<< orphan*/ return_chars_until_chr_cd(char const *, char);
int is_that_text_html(const char *content) {
  const char *rpos = content;
  char xchar;
  int ends_now;
  while (*rpos != '\0') {
    switch (*rpos) {
    case '<':
      rpos++;
      if (compare_tag_cd(rpos, "HTML", 4) == 0)
        return (1);
      rpos += return_chars_until_chr_cd(rpos, '>');
      break;
    case '\'':
    case '"':
    case '(':
    case '[':
    case '{':
      xchar = *rpos;
      rpos++;
      rpos += return_chars_until_chr_cd(rpos, xchar);
      break;
    case '/':
      if (*(rpos + 1) == '/') {
        while ((*rpos != '\0') && (*rpos != '\n') && (*rpos != '\r'))
          rpos++;
      } else if (*(rpos + 1) == '*') {
        ends_now = 0;
        while ((*rpos != '\0') && (ends_now == 0)) {
          if ((*rpos == '*') && (*(rpos + 1) == '/')) {
            ends_now = 1;
            rpos++;
          }
          rpos++;
        }
      } else {
        rpos++;
      }
      break;
    case '\\':
      if (*(rpos + 1) != '\0')
        rpos += 2;
      else
        rpos++;
      break;
    default:
      rpos++;
      break;
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<is_that_text_html>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     13b6 <is_that_text_html+0x296>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x24(%rbp)
sub    $0x22,%eax
je     121e <is_that_text_html+0xfe>
jmp    115c <is_that_text_html+0x3c>
mov    -0x24(%rbp),%eax
add    $0xffffffd9,%eax
sub    $0x2,%eax
jb     121e <is_that_text_html+0xfe>
jmp    1170 <is_that_text_html+0x50>
mov    -0x24(%rbp),%eax
sub    $0x2f,%eax
je     1255 <is_that_text_html+0x135>
jmp    1181 <is_that_text_html+0x61>
mov    -0x24(%rbp),%eax
sub    $0x3c,%eax
je     11c5 <is_that_text_html+0xa5>
jmp    1192 <is_that_text_html+0x72>
mov    -0x24(%rbp),%eax
sub    $0x5b,%eax
je     121e <is_that_text_html+0xfe>
jmp    11a3 <is_that_text_html+0x83>
mov    -0x24(%rbp),%eax
sub    $0x5c,%eax
je     1372 <is_that_text_html+0x252>
jmp    11b4 <is_that_text_html+0x94>
mov    -0x24(%rbp),%eax
sub    $0x7b,%eax
je     121e <is_that_text_html+0xfe>
jmp    13a5 <is_that_text_html+0x285>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe24(%rip),%rsi
mov    $0x4,%edx
call   1030 <compare_tag_cd@plt>
cmp    $0x0,%eax
jne    11fb <is_that_text_html+0xdb>
movl   $0x1,-0x4(%rbp)
jmp    13bd <is_that_text_html+0x29d>
mov    -0x18(%rbp),%rdi
mov    $0x3e,%esi
call   1040 <return_chars_until_chr_cd@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    13b1 <is_that_text_html+0x291>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
movsbl -0x19(%rbp),%esi
call   1040 <return_chars_until_chr_cd@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    13b1 <is_that_text_html+0x291>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2f,%eax
jne    12cb <is_that_text_html+0x1ab>
jmp    126b <is_that_text_html+0x14b>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x25(%rbp)
je     12a5 <is_that_text_html+0x185>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x25(%rbp)
je     12a5 <is_that_text_html+0x185>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
setne  %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
test   $0x1,%al
jne    12b5 <is_that_text_html+0x195>
jmp    12c6 <is_that_text_html+0x1a6>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    126b <is_that_text_html+0x14b>
jmp    136d <is_that_text_html+0x24d>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2a,%eax
jne    135c <is_that_text_html+0x23c>
movl   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x26(%rbp)
je     1302 <is_that_text_html+0x1e2>
cmpl   $0x0,-0x20(%rbp)
sete   %al
mov    %al,-0x26(%rbp)
mov    -0x26(%rbp),%al
test   $0x1,%al
jne    1312 <is_that_text_html+0x1f2>
jmp    1357 <is_that_text_html+0x237>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2a,%eax
jne    1346 <is_that_text_html+0x226>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2f,%eax
jne    1346 <is_that_text_html+0x226>
movl   $0x1,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    12e3 <is_that_text_html+0x1c3>
jmp    1368 <is_that_text_html+0x248>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    136d <is_that_text_html+0x24d>
jmp    13b1 <is_that_text_html+0x291>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     1394 <is_that_text_html+0x274>
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
jmp    13a0 <is_that_text_html+0x280>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    13b1 <is_that_text_html+0x291>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1134 <is_that_text_html+0x14>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_that_text_html>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    (%rdi),%al
xor    %r15d,%r15d
test   %al,%al
je     124a <is_that_text_html+0x12a>
mov    %rdi,%rbx
lea    0xec1(%rip),%rbp
mov    $0x2401,%r12d
lea    0xfa0(%rip),%r14
nopl   0x0(%rax)
movsbl %al,%esi
lea    -0x22(%rsi),%ecx
cmp    $0x3a,%ecx
ja     117c <is_that_text_html+0x5c>
movslq 0x0(%rbp,%rcx,4),%rcx
add    %rbp,%rcx
jmp    *%rcx
lea    0x1(%rbx),%rdi
call   1040 <return_chars_until_chr_cd@plt>
cltq
add    %rax,%rbx
add    $0x1,%rbx
jmp    1230 <is_that_text_html+0x110>
cmp    $0x7b,%esi
je     1165 <is_that_text_html+0x45>
add    $0x1,%rbx
jmp    1230 <is_that_text_html+0x110>
mov    0x1(%rbx),%cl
cmp    $0x2f,%cl
je     11d8 <is_that_text_html+0xb8>
cmp    $0x2a,%cl
jne    123e <is_that_text_html+0x11e>
mov    %eax,%ecx
nopl   (%rax)
xor    %eax,%eax
cmp    $0x2a,%cl
jne    11b8 <is_that_text_html+0x98>
xor    %eax,%eax
cmpb   $0x2f,0x1(%rbx)
sete   %cl
jne    11b6 <is_that_text_html+0x96>
add    $0x1,%rbx
mov    %cl,%al
movzbl 0x1(%rbx),%ecx
add    $0x1,%rbx
test   %eax,%eax
jne    1232 <is_that_text_html+0x112>
test   %cl,%cl
jne    11a0 <is_that_text_html+0x80>
jmp    1232 <is_that_text_html+0x112>
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
cmp    $0xd,%al
ja     11d0 <is_that_text_html+0xb0>
movzbl %al,%eax
bt     %rax,%r12
jae    11d0 <is_that_text_html+0xb0>
jmp    1230 <is_that_text_html+0x110>
add    $0x1,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <compare_tag_cd@plt>
test   %eax,%eax
je     1244 <is_that_text_html+0x124>
mov    %rbx,%rdi
mov    $0x3e,%esi
call   1040 <return_chars_until_chr_cd@plt>
cltq
add    %rax,%rbx
jmp    1230 <is_that_text_html+0x110>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rax
lea    0x2(%rbx),%rbx
cmove  %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rbx),%cl
mov    %ecx,%eax
test   %cl,%cl
jne    1150 <is_that_text_html+0x30>
jmp    124a <is_that_text_html+0x12a>
add    $0x1,%rbx
jmp    1232 <is_that_text_html+0x112>
mov    $0x1,%r15d
mov    %r15d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"HTML\00"
define i32 @is_that_text_html(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %3
%7 = load i8*, i8** %3
store i8* %7, i8** %4
br label %8
8: ; preds = %125, %1
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %126
13: ; preds = %8
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
switch i32 %16, label %122 [
i32 60, label %17
i32 39, label %30
i32 34, label %30
i32 40, label %30
i32 91, label %30
i32 123, label %30
i32 47, label %41
i32 92, label %109
]
17: ; preds = %13
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %4
%20 = load i8*, i8** %4
%21 = call i32 @compare_tag_cd(i8* %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %17
store i32 1, i32* %2
br label %127
24: ; preds = %17
%25 = load i8*, i8** %4
%26 = call i32 @return_chars_until_chr_cd(i8* %25, i8 signext 62)
%27 = load i8*, i8** %4
%28 = sext i32 %26 to i64
%29 = getelementptr inbounds i8, i8* %27, i64 %28
store i8* %29, i8** %4
br label %125
30: ; preds = %13, %13, %13, %13, %13
%31 = load i8*, i8** %4
%32 = load i8, i8* %31
store i8 %32, i8* %5
%33 = load i8*, i8** %4
%34 = getelementptr inbounds i8, i8* %33, i32 1
store i8* %34, i8** %4
%35 = load i8*, i8** %4
%36 = load i8, i8* %5
%37 = call i32 @return_chars_until_chr_cd(i8* %35, i8 signext %36)
%38 = load i8*, i8** %4
%39 = sext i32 %37 to i64
%40 = getelementptr inbounds i8, i8* %38, i64 %39
store i8* %40, i8** %4
br label %125
41: ; preds = %13
%42 = load i8*, i8** %4
%43 = getelementptr inbounds i8, i8* %42, i64 1
%44 = load i8, i8* %43
%45 = sext i8 %44 to i32
%46 = icmp eq i32 %45, 47
br i1 %46, label %47, label %69
47: ; preds = %41
br label %48
48: ; preds = %65, %47
%49 = load i8*, i8** %4
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = icmp ne i32 %51, 0
br i1 %52, label %53, label %63
53: ; preds = %48
%54 = load i8*, i8** %4
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp ne i32 %56, 10
br i1 %57, label %58, label %63
58: ; preds = %53
%59 = load i8*, i8** %4
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = icmp ne i32 %61, 13
br label %63
63: ; preds = %58, %53, %48
%64 = phi i1 [ false, %53 ], [ false, %48 ], [ %62, %58 ]
br i1 %64, label %65, label %68
65: ; preds = %63
%66 = load i8*, i8** %4
%67 = getelementptr inbounds i8, i8* %66, i32 1
store i8* %67, i8** %4
br label %48
68: ; preds = %63
br label %108
69: ; preds = %41
%70 = load i8*, i8** %4
%71 = getelementptr inbounds i8, i8* %70, i64 1
%72 = load i8, i8* %71
%73 = sext i8 %72 to i32
%74 = icmp eq i32 %73, 42
br i1 %74, label %75, label %104
75: ; preds = %69
store i32 0, i32* %6
br label %76
76: ; preds = %100, %75
%77 = load i8*, i8** %4
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = icmp ne i32 %79, 0
br i1 %80, label %81, label %84
81: ; preds = %76
%82 = load i32, i32* %6
%83 = icmp eq i32 %82, 0
br label %84
84: ; preds = %81, %76
%85 = phi i1 [ false, %76 ], [ %83, %81 ]
br i1 %85, label %86, label %103
86: ; preds = %84
%87 = load i8*, i8** %4
%88 = load i8, i8* %87
%89 = sext i8 %88 to i32
%90 = icmp eq i32 %89, 42
br i1 %90, label %91, label %100
91: ; preds = %86
%92 = load i8*, i8** %4
%93 = getelementptr inbounds i8, i8* %92, i64 1
%94 = load i8, i8* %93
%95 = sext i8 %94 to i32
%96 = icmp eq i32 %95, 47
br i1 %96, label %97, label %100
97: ; preds = %91
store i32 1, i32* %6
%98 = load i8*, i8** %4
%99 = getelementptr inbounds i8, i8* %98, i32 1
store i8* %99, i8** %4
br label %100
100: ; preds = %97, %91, %86
%101 = load i8*, i8** %4
%102 = getelementptr inbounds i8, i8* %101, i32 1
store i8* %102, i8** %4
br label %76
103: ; preds = %84
br label %107
104: ; preds = %69
%105 = load i8*, i8** %4
%106 = getelementptr inbounds i8, i8* %105, i32 1
store i8* %106, i8** %4
br label %107
107: ; preds = %104, %103
br label %108
108: ; preds = %107, %68
br label %125
109: ; preds = %13
%110 = load i8*, i8** %4
%111 = getelementptr inbounds i8, i8* %110, i64 1
%112 = load i8, i8* %111
%113 = sext i8 %112 to i32
%114 = icmp ne i32 %113, 0
br i1 %114, label %115, label %118
115: ; preds = %109
%116 = load i8*, i8** %4
%117 = getelementptr inbounds i8, i8* %116, i64 2
store i8* %117, i8** %4
br label %121
118: ; preds = %109
%119 = load i8*, i8** %4
%120 = getelementptr inbounds i8, i8* %119, i32 1
store i8* %120, i8** %4
br label %121
121: ; preds = %118, %115
br label %125
122: ; preds = %13
%123 = load i8*, i8** %4
%124 = getelementptr inbounds i8, i8* %123, i32 1
store i8* %124, i8** %4
br label %125
125: ; preds = %122, %121, %108, %30, %24
br label %8
126: ; preds = %8
store i32 0, i32* %2
br label %127
127: ; preds = %126, %23
%128 = load i32, i32* %2
ret i32 %128
}

LLVM IR (-O2):
@.str = [5 x i8] c"HTML\00"
define i32 @is_that_text_html(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %63, label %4
4: ; preds = %1, %59
%5 = phi i8 [ %60, %59 ], [ %2, %1 ]
%6 = phi i8* [ %61, %59 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
switch i32 %7, label %54 [
i32 60, label %8
i32 39, label %16
i32 34, label %16
i32 40, label %16
i32 91, label %16
i32 123, label %16
i32 47, label %21
i32 92, label %48
]
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = tail call i32 @compare_tag_cd(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%11 = icmp eq i32 %10, 0
br i1 %11, label %63, label %12
12: ; preds = %8
%13 = tail call i32 @return_chars_until_chr_cd(i8* %9, i8 signext 62)
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %9, i64 %14
br label %56
16: ; preds = %4, %4, %4, %4, %4
%17 = getelementptr inbounds i8, i8* %6, i64 1
%18 = tail call i32 @return_chars_until_chr_cd(i8* %17, i8 signext %5)
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
br label %56
21: ; preds = %4
%22 = getelementptr inbounds i8, i8* %6, i64 1
%23 = load i8, i8* %22
switch i8 %23, label %59 [
i8 47, label %24
i8 42, label %30
]
24: ; preds = %21, %27
%25 = phi i8 [ %29, %27 ], [ %5, %21 ]
%26 = phi i8* [ %28, %27 ], [ %6, %21 ]
switch i8 %25, label %27 [
i8 0, label %56
i8 10, label %56
i8 13, label %56
]
27: ; preds = %24
%28 = getelementptr inbounds i8, i8* %26, i64 1
%29 = load i8, i8* %28
br label %24
30: ; preds = %21, %40
%31 = phi i8 [ %44, %40 ], [ %5, %21 ]
%32 = phi i8* [ %43, %40 ], [ %6, %21 ]
%33 = icmp eq i8 %31, 42
br i1 %33, label %34, label %40
34: ; preds = %30
%35 = getelementptr inbounds i8, i8* %32, i64 1
%36 = load i8, i8* %35
%37 = icmp eq i8 %36, 47
%38 = select i1 %37, i8* %35, i8* %32
%39 = zext i1 %37 to i32
br label %40
40: ; preds = %34, %30
%41 = phi i8* [ %32, %30 ], [ %38, %34 ]
%42 = phi i32 [ 0, %30 ], [ %39, %34 ]
%43 = getelementptr inbounds i8, i8* %41, i64 1
%44 = load i8, i8* %43
%45 = icmp ne i8 %44, 0
%46 = icmp eq i32 %42, 0
%47 = and i1 %46, %45
br i1 %47, label %30, label %59
48: ; preds = %4
%49 = getelementptr inbounds i8, i8* %6, i64 1
%50 = load i8, i8* %49
%51 = icmp eq i8 %50, 0
%52 = getelementptr inbounds i8, i8* %6, i64 2
%53 = select i1 %51, i8* %49, i8* %52
br label %56
54: ; preds = %4
%55 = getelementptr inbounds i8, i8* %6, i64 1
br label %56
56: ; preds = %24, %24, %24, %12, %16, %54, %48
%57 = phi i8* [ %53, %48 ], [ %15, %12 ], [ %20, %16 ], [ %55, %54 ], [ %26, %24 ], [ %26, %24 ], [ %26, %24 ]
%58 = load i8, i8* %57
br label %59
59: ; preds = %40, %56, %21
%60 = phi i8 [ %58, %56 ], [ %23, %21 ], [ %44, %40 ]
%61 = phi i8* [ %57, %56 ], [ %22, %21 ], [ %43, %40 ]
%62 = icmp eq i8 %60, 0
br i1 %62, label %63, label %4
63: ; preds = %8, %59, %1
%64 = phi i32 [ 0, %1 ], [ 0, %59 ], [ 1, %8 ]
ret i32 %64
}