#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*/ set_color();
void xml_colorize_line(unsigned int *p, int state) {
  int c;
  switch (state) {
  case 1:
    goto parse_tag;
  case 2:
    goto parse_comment;
  }
  for (;;) {
    c = *p;
    if (c == '<' && state == 0) {
    parse_comment:;
      while (*p != '\n')
        state = 3;
    parse_tag:;
      while (*p != '\n')
        state = 0;
      set_color();
    } else
      p++;
  }
}


x86 assembly (clang, -O0):
<xml_colorize_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x1,%eax
je     1144 <xml_colorize_line+0x34>
jmp    1133 <xml_colorize_line+0x23>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
je     1149 <xml_colorize_line+0x39>
jmp    114e <xml_colorize_line+0x3e>
jmp    1198 <xml_colorize_line+0x88>
jmp    1175 <xml_colorize_line+0x65>
jmp    1153 <xml_colorize_line+0x43>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x3c,-0x10(%rbp)
jne    11c2 <xml_colorize_line+0xb2>
cmpl   $0x0,-0xc(%rbp)
jne    11c2 <xml_colorize_line+0xb2>
jmp    1175 <xml_colorize_line+0x65>
jmp    117a <xml_colorize_line+0x6a>
mov    -0x8(%rbp),%rax
cmpl   $0xa,(%rax)
je     1193 <xml_colorize_line+0x83>
movl   $0x3,-0xc(%rbp)
jmp    117a <xml_colorize_line+0x6a>
jmp    1198 <xml_colorize_line+0x88>
jmp    119d <xml_colorize_line+0x8d>
mov    -0x8(%rbp),%rax
cmpl   $0xa,(%rax)
je     11b6 <xml_colorize_line+0xa6>
movl   $0x0,-0xc(%rbp)
jmp    119d <xml_colorize_line+0x8d>
mov    $0x0,%al
call   1030 <set_color@plt>
jmp    11ce <xml_colorize_line+0xbe>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <xml_colorize_line+0x43>

x86 assembly (clang, -O2):
<xml_colorize_line>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    -0x1(%rsi),%eax
mov    %esi,%ebp
cmp    $0x2,%eax
jb     113d <xml_colorize_line+0x2d>
xor    %ebp,%ebp
jmp    1134 <xml_colorize_line+0x24>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x4,%rbx
cmpl   $0x3c,(%rbx)
jne    1130 <xml_colorize_line+0x20>
test   %esi,%esi
jne    1130 <xml_colorize_line+0x20>
xor    %eax,%eax
call   1030 <set_color@plt>
mov    %ebp,%esi
jmp    1120 <xml_colorize_line+0x10>

LLVM IR (-O0):
define void @xml_colorize_line(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
switch i32 %6, label %9 [
i32 1, label %7
i32 2, label %8
]
7: ; preds = %2
br label %26
8: ; preds = %2
br label %19
9: ; preds = %2
br label %10
10: ; preds = %37, %9
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = icmp eq i32 %13, 60
br i1 %14, label %15, label %34
15: ; preds = %10
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %34
18: ; preds = %15
br label %19
19: ; preds = %18, %8
br label %20
20: ; preds = %24, %19
%21 = load i32*, i32** %3
%22 = load i32, i32* %21
%23 = icmp ne i32 %22, 10
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 3, i32* %4
br label %20
25: ; preds = %20
br label %26
26: ; preds = %25, %7
br label %27
27: ; preds = %31, %26
%28 = load i32*, i32** %3
%29 = load i32, i32* %28
%30 = icmp ne i32 %29, 10
br i1 %30, label %31, label %32
31: ; preds = %27
store i32 0, i32* %4
br label %27
32: ; preds = %27
%33 = call i32 (...) @set_color()
br label %37
34: ; preds = %15, %10
%35 = load i32*, i32** %3
%36 = getelementptr inbounds i32, i32* %35, i32 1
store i32* %36, i32** %3
br label %37
37: ; preds = %34, %32
br label %10
}

LLVM IR (-O2):
define void @xml_colorize_line(i32* nocapture %0, i32 %1) {
%3 = add i32 %1, -1
%4 = icmp ult i32 %3, 2
br i1 %4, label %14, label %5
5: ; preds = %14, %2
%6 = phi i32 [ %15, %14 ], [ %1, %2 ]
%7 = phi i32* [ %16, %14 ], [ %0, %2 ]
%8 = icmp eq i32 %6, 0
br label %9
9: ; preds = %5, %18
%10 = phi i32* [ %19, %18 ], [ %7, %5 ]
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 60
%13 = and i1 %12, %8
br i1 %13, label %14, label %18
14: ; preds = %9, %2
%15 = phi i32 [ %1, %2 ], [ 0, %9 ]
%16 = phi i32* [ %0, %2 ], [ %10, %9 ]
%17 = tail call i32 (...) @set_color()
br label %5
18: ; preds = %9
%19 = getelementptr inbounds i32, i32* %10, i64 1
br label %9
}