#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*/ DoTrace(char *);
int /*<<< orphan*/ ParseTags(char *);
int /*<<< orphan*/ ParseXronosfmtTags(char *);
char *XTL_FindComment(char *);
scalar_t__ strlen(char *);
char *strstr(char *, char *);
int HandleLine(char *line) {
  char *p, *comment;
  char *TagSearchString = "\\tagged{";
  char *XronosfmtSearchString = "\\xronosfmt-options:";
  comment = XTL_FindComment(line);
  if (comment == NULL)
    return 0;
  p = strstr(comment, TagSearchString);
  if (p != NULL) {
    DoTrace("Found tags String");
    p += strlen(TagSearchString);
    ParseTags(p);
  }
  p = strstr(comment, XronosfmtSearchString);
  if (p != NULL) {
    DoTrace("Found Xronosfmt option String");
    p += strlen(XronosfmtSearchString);
    ParseXronosfmtTags(p);
  }
  return 0;
}


x86 assembly (clang, -O0):
<HandleLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xe8d(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe8b(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <XTL_FindComment@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    11a6 <HandleLine+0x46>
movl   $0x0,-0x4(%rbp)
jmp    1231 <HandleLine+0xd1>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1080 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11e8 <HandleLine+0x88>
lea    0xe54(%rip),%rdi
call   1030 <DoTrace@plt>
mov    -0x28(%rbp),%rdi
call   1040 <strlen@plt>
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <ParseTags@plt>
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1080 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     122a <HandleLine+0xca>
lea    0xe24(%rip),%rdi
call   1030 <DoTrace@plt>
mov    -0x30(%rbp),%rdi
call   1040 <strlen@plt>
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <ParseXronosfmtTags@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HandleLine>:
push   %r14
push   %rbx
push   %rax
call   1060 <XTL_FindComment@plt>
test   %rax,%rax
je     11bf <HandleLine+0x6f>
mov    %rax,%r14
lea    0xe98(%rip),%rsi
mov    %rax,%rdi
call   1070 <strstr@plt>
test   %rax,%rax
je     1190 <HandleLine+0x40>
mov    %rax,%rbx
lea    0xe9e(%rip),%rdi
call   1030 <DoTrace@plt>
add    $0x8,%rbx
mov    %rbx,%rdi
call   1040 <ParseTags@plt>
lea    0xe72(%rip),%rsi
mov    %r14,%rdi
call   1070 <strstr@plt>
test   %rax,%rax
je     11bf <HandleLine+0x6f>
mov    %rax,%rbx
lea    0xe81(%rip),%rdi
call   1030 <DoTrace@plt>
add    $0x13,%rbx
mov    %rbx,%rdi
call   1050 <ParseXronosfmtTags@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"\\tagged{\00"
@.str.1 = [20 x i8] c"\\xronosfmt-options:\00"
@.str.2 = [18 x i8] c"Found tags String\00"
@.str.3 = [30 x i8] c"Found Xronosfmt option String\00"
define i32 @HandleLine(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %3
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8** %7
%8 = load i8*, i8** %3
%9 = call i8* @XTL_FindComment(i8* %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 0, i32* %2
br label %42
13: ; preds = %1
%14 = load i8*, i8** %5
%15 = load i8*, i8** %6
%16 = call i8* @strstr(i8* %14, i8* %15)
store i8* %16, i8** %4
%17 = load i8*, i8** %4
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %27
19: ; preds = %13
%20 = call i32 @DoTrace(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%21 = load i8*, i8** %6
%22 = call i64 @strlen(i8* %21)
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 %22
store i8* %24, i8** %4
%25 = load i8*, i8** %4
%26 = call i32 @ParseTags(i8* %25)
br label %27
27: ; preds = %19, %13
%28 = load i8*, i8** %5
%29 = load i8*, i8** %7
%30 = call i8* @strstr(i8* %28, i8* %29)
store i8* %30, i8** %4
%31 = load i8*, i8** %4
%32 = icmp ne i8* %31, null
br i1 %32, label %33, label %41
33: ; preds = %27
%34 = call i32 @DoTrace(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%35 = load i8*, i8** %7
%36 = call i64 @strlen(i8* %35)
%37 = load i8*, i8** %4
%38 = getelementptr inbounds i8, i8* %37, i64 %36
store i8* %38, i8** %4
%39 = load i8*, i8** %4
%40 = call i32 @ParseXronosfmtTags(i8* %39)
br label %41
41: ; preds = %33, %27
store i32 0, i32* %2
br label %42
42: ; preds = %41, %12
%43 = load i32, i32* %2
ret i32 %43
}

LLVM IR (-O2):
@.str = [9 x i8] c"\\tagged{\00"
@.str.1 = [20 x i8] c"\\xronosfmt-options:\00"
@.str.2 = [18 x i8] c"Found tags String\00"
@.str.3 = [30 x i8] c"Found Xronosfmt option String\00"
define i32 @HandleLine(i8* %0) {
%2 = tail call i8* @XTL_FindComment(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %18, label %4
4: ; preds = %1
%5 = tail call i8* @strstr(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i8* %5, null
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = tail call i32 @DoTrace(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%9 = getelementptr inbounds i8, i8* %5, i64 8
%10 = tail call i32 @ParseTags(i8* %9)
br label %11
11: ; preds = %7, %4
%12 = tail call i8* @strstr(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i8* %12, null
br i1 %13, label %18, label %14
14: ; preds = %11
%15 = tail call i32 @DoTrace(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%16 = getelementptr inbounds i8, i8* %12, i64 19
%17 = tail call i32 @ParseXronosfmtTags(i8* %16)
br label %18
18: ; preds = %11, %14, %1
ret i32 0
}