#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 */
struct cymkd_parser {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ consume(struct cymkd_parser *);
int literal_html_comment(struct cymkd_parser *);
char lookahead(struct cymkd_parser *, int);
int next(struct cymkd_parser *);
int /*<<< orphan*/ parser_emit_unescaped_char(struct cymkd_parser *, int);
bool literal_html(struct cymkd_parser *parser) {
  int ch;
  if (next(parser) != '<') {
    return false;
  }
  if (lookahead(parser, 1) == '!') {
    return literal_html_comment(parser);
  }
  while (!(next(parser) == '\n' && lookahead(parser, 1) == '\n') &&
         next(parser) != -1) {
    ch = next(parser);
    parser_emit_unescaped_char(parser, ch);
    consume(parser);
  }
  return true;
}


x86 assembly (clang, -O0):
<literal_html>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <next@plt>
cmp    $0x3c,%eax
je     117a <literal_html+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    122a <literal_html+0xda>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1070 <lookahead@plt>
movsbl %al,%eax
cmp    $0x21,%eax
jne    11a5 <literal_html+0x55>
mov    -0x10(%rbp),%rdi
call   1030 <literal_html_comment@plt>
mov    %eax,-0x4(%rbp)
jmp    122a <literal_html+0xda>
jmp    11aa <literal_html+0x5a>
mov    -0x10(%rbp),%rdi
call   1050 <next@plt>
cmp    $0xa,%eax
jne    11db <literal_html+0x8b>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1070 <lookahead@plt>
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x15(%rbp)
je     11ed <literal_html+0x9d>
mov    -0x10(%rbp),%rdi
call   1050 <next@plt>
cmp    $0xffffffff,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    11fd <literal_html+0xad>
jmp    1223 <literal_html+0xd3>
mov    -0x10(%rbp),%rdi
call   1050 <next@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <parser_emit_unescaped_char@plt>
mov    -0x10(%rbp),%rdi
call   1060 <consume@plt>
jmp    11aa <literal_html+0x5a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<literal_html>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <next@plt>
xor    %ebp,%ebp
cmp    $0x3c,%eax
jne    11dc <literal_html+0x8c>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1070 <lookahead@plt>
cmp    $0x21,%al
jne    1181 <literal_html+0x31>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <literal_html_comment@plt>
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <next@plt>
cmp    $0xa,%eax
jne    11ae <literal_html+0x5e>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1070 <lookahead@plt>
cmp    $0xa,%al
je     11dc <literal_html+0x8c>
mov    %rbx,%rdi
call   1050 <next@plt>
cmp    $0xffffffff,%eax
je     11d7 <literal_html+0x87>
mov    %rbx,%rdi
call   1050 <next@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <parser_emit_unescaped_char@plt>
mov    %rbx,%rdi
call   1060 <consume@plt>
jmp    1190 <literal_html+0x40>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.cymkd_parser = type { i32 }
define i32 @literal_html(%struct.cymkd_parser* %0) {
%2 = alloca i32
%3 = alloca %struct.cymkd_parser*
%4 = alloca i32
store %struct.cymkd_parser* %0, %struct.cymkd_parser** %3
%5 = load %struct.cymkd_parser*, %struct.cymkd_parser** %3
%6 = call i32 @next(%struct.cymkd_parser* %5)
%7 = icmp ne i32 %6, 60
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %42
9: ; preds = %1
%10 = load %struct.cymkd_parser*, %struct.cymkd_parser** %3
%11 = call signext i8 @lookahead(%struct.cymkd_parser* %10, i32 1)
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 33
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = load %struct.cymkd_parser*, %struct.cymkd_parser** %3
%16 = call i32 @literal_html_comment(%struct.cymkd_parser* %15)
store i32 %16, i32* %2
br label %42
17: ; preds = %9
br label %18
18: ; preds = %33, %17
%19 = load %struct.cymkd_parser*, %struct.cymkd_parser** %3
%20 = call i32 @next(%struct.cymkd_parser* %19)
%21 = icmp eq i32 %20, 10
br i1 %21, label %22, label %27
22: ; preds = %18
%23 = load %struct.cymkd_parser*, %struct.cymkd_parser** %3
%24 = call signext i8 @lookahead(%struct.cymkd_parser* %23, i32 1)
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 10
br i1 %26, label %31, label %27
27: ; preds = %22, %18
%28 = load %struct.cymkd_parser*, %struct.cymkd_parser** %3
%29 = call i32 @next(%struct.cymkd_parser* %28)
%30 = icmp ne i32 %29, -1
br label %31
31: ; preds = %27, %22
%32 = phi i1 [ false, %22 ], [ %30, %27 ]
br i1 %32, label %33, label %41
33: ; preds = %31
%34 = load %struct.cymkd_parser*, %struct.cymkd_parser** %3
%35 = call i32 @next(%struct.cymkd_parser* %34)
store i32 %35, i32* %4
%36 = load %struct.cymkd_parser*, %struct.cymkd_parser** %3
%37 = load i32, i32* %4
%38 = call i32 @parser_emit_unescaped_char(%struct.cymkd_parser* %36, i32 %37)
%39 = load %struct.cymkd_parser*, %struct.cymkd_parser** %3
%40 = call i32 @consume(%struct.cymkd_parser* %39)
br label %18
41: ; preds = %31
store i32 1, i32* %2
br label %42
42: ; preds = %41, %14, %8
%43 = load i32, i32* %2
ret i32 %43
}

LLVM IR (-O2):
%struct.cymkd_parser = type { i32 }
define i32 @literal_html(%struct.cymkd_parser* %0) {
%2 = tail call i32 @next(%struct.cymkd_parser* %0)
%3 = icmp eq i32 %2, 60
br i1 %3, label %4, label %22
4: ; preds = %1
%5 = tail call signext i8 @lookahead(%struct.cymkd_parser* %0, i32 1)
%6 = icmp eq i8 %5, 33
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @literal_html_comment(%struct.cymkd_parser* %0)
br label %22
9: ; preds = %4, %18
%10 = tail call i32 @next(%struct.cymkd_parser* %0)
%11 = icmp eq i32 %10, 10
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = tail call signext i8 @lookahead(%struct.cymkd_parser* %0, i32 1)
%14 = icmp eq i8 %13, 10
br i1 %14, label %22, label %15
15: ; preds = %12, %9
%16 = tail call i32 @next(%struct.cymkd_parser* %0)
%17 = icmp eq i32 %16, -1
br i1 %17, label %22, label %18
18: ; preds = %15
%19 = tail call i32 @next(%struct.cymkd_parser* %0)
%20 = tail call i32 @parser_emit_unescaped_char(%struct.cymkd_parser* %0, i32 %19)
%21 = tail call i32 @consume(%struct.cymkd_parser* %0)
br label %9
22: ; preds = %15, %12, %1, %7
%23 = phi i32 [ %8, %7 ], [ 0, %1 ], [ 1, %12 ], [ 1, %15 ]
ret i32 %23
}