#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 */
char EOF;
int checkForStyle();
int /*<<< orphan*/ closeHTMLBody();
int /*<<< orphan*/ closeHTMLHeader();
int /*<<< orphan*/ closeTitle();
scalar_t__ loadTitle();
int /*<<< orphan*/ openHTMLHeader();
int /*<<< orphan*/ printf(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ renderFormat();
int /*<<< orphan*/ renderStyle();
scalar_t__ start();
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ zeroBuffer();
int main() {
  extern char BUFFER[];
  extern char lastRead;
  zeroBuffer();
  if (start() == 0) {
    return 1;
  }
  openHTMLHeader();
  if (loadTitle() == 0) {
    return 1;
  }
  printf("%s\n", BUFFER, stdout);
  closeTitle();
  if (checkForStyle() == 1)
    renderStyle();
  closeHTMLHeader();
  zeroBuffer();
  while (lastRead != EOF)
    renderFormat();
  closeHTMLBody();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <zeroBuffer@plt>
mov    $0x0,%al
call   1090 <start@plt>
cmp    $0x0,%rax
jne    11e3 <main+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1285 <main+0xd5>
mov    $0x0,%al
call   1050 <openHTMLHeader@plt>
mov    $0x0,%al
call   1060 <loadTitle@plt>
cmp    $0x0,%rax
jne    1207 <main+0x57>
movl   $0x1,-0x4(%rbp)
jmp    1285 <main+0xd5>
mov    0x2dc2(%rip),%rax
mov    (%rax),%edx
lea    0xde9(%rip),%rdi
mov    0x2dca(%rip),%rsi
call   1070 <printf@plt>
mov    $0x0,%al
call   10a0 <closeTitle@plt>
mov    $0x0,%al
call   1030 <checkForStyle@plt>
cmp    $0x1,%eax
jne    1241 <main+0x91>
mov    $0x0,%al
call   1080 <renderStyle@plt>
mov    $0x0,%al
call   10c0 <closeHTMLHeader@plt>
mov    $0x0,%al
call   1040 <zeroBuffer@plt>
mov    0x2d6a(%rip),%rax
movsbl (%rax),%eax
mov    0x2d80(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1277 <main+0xc7>
mov    $0x0,%al
call   10d0 <renderFormat@plt>
jmp    124f <main+0x9f>
mov    $0x0,%al
call   10b0 <closeHTMLBody@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <zeroBuffer@plt>
xor    %eax,%eax
call   1090 <start@plt>
mov    $0x1,%r14d
test   %rax,%rax
je     1256 <main+0xa6>
xor    %eax,%eax
call   1050 <openHTMLHeader@plt>
xor    %eax,%eax
call   1060 <loadTitle@plt>
test   %rax,%rax
je     1256 <main+0xa6>
mov    0x2de5(%rip),%rax
mov    (%rax),%edx
lea    0xe0c(%rip),%rdi
mov    0x2ded(%rip),%rsi
call   1070 <printf@plt>
xor    %eax,%eax
call   10a0 <closeTitle@plt>
xor    %eax,%eax
call   1030 <checkForStyle@plt>
cmp    $0x1,%eax
jne    121a <main+0x6a>
xor    %eax,%eax
call   1080 <renderStyle@plt>
xor    %r14d,%r14d
xor    %eax,%eax
call   10c0 <closeHTMLHeader@plt>
xor    %eax,%eax
call   1040 <zeroBuffer@plt>
mov    0x2d8e(%rip),%rbx
mov    (%rbx),%al
mov    0x2da5(%rip),%rbp
cmp    0x0(%rbp),%al
je     124f <main+0x9f>
xor    %eax,%eax
call   10d0 <renderFormat@plt>
movzbl (%rbx),%eax
cmp    0x0(%rbp),%al
jne    1240 <main+0x90>
xor    %eax,%eax
call   10b0 <closeHTMLBody@plt>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@BUFFER = external global [0 x i8]
@stdout = global i32 0
@lastRead = external global i8
@EOF = global i8 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @zeroBuffer()
%3 = call i64 (...) @start()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 1, i32* %1
br label %32
6: ; preds = %0
%7 = call i32 (...) @openHTMLHeader()
%8 = call i64 (...) @loadTitle()
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %6
store i32 1, i32* %1
br label %32
11: ; preds = %6
%12 = load i32, i32* @stdout
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([0 x i8], [0 x i8]* @BUFFER, i64 0, i64 0), i32 %12)
%14 = call i32 (...) @closeTitle()
%15 = call i32 (...) @checkForStyle()
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = call i32 (...) @renderStyle()
br label %19
19: ; preds = %17, %11
%20 = call i32 (...) @closeHTMLHeader()
%21 = call i32 (...) @zeroBuffer()
br label %22
22: ; preds = %28, %19
%23 = load i8, i8* @lastRead
%24 = sext i8 %23 to i32
%25 = load i8, i8* @EOF
%26 = sext i8 %25 to i32
%27 = icmp ne i32 %24, %26
br i1 %27, label %28, label %30
28: ; preds = %22
%29 = call i32 (...) @renderFormat()
br label %22
30: ; preds = %22
%31 = call i32 (...) @closeHTMLBody()
store i32 0, i32* %1
br label %32
32: ; preds = %30, %10, %5
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@BUFFER = external global [0 x i8]
@stdout = global i32 0
@lastRead = external global i8
@EOF = global i8 0
define i32 @main() {
%1 = tail call i32 (...) @zeroBuffer()
%2 = tail call i64 (...) @start()
%3 = icmp eq i64 %2, 0
br i1 %3, label %29, label %4
4: ; preds = %0
%5 = tail call i32 (...) @openHTMLHeader()
%6 = tail call i64 (...) @loadTitle()
%7 = icmp eq i64 %6, 0
br i1 %7, label %29, label %8
8: ; preds = %4
%9 = load i32, i32* @stdout
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([0 x i8], [0 x i8]* @BUFFER, i64 0, i64 0), i32 %9)
%11 = tail call i32 (...) @closeTitle()
%12 = tail call i32 (...) @checkForStyle()
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %8
%15 = tail call i32 (...) @renderStyle()
br label %16
16: ; preds = %14, %8
%17 = tail call i32 (...) @closeHTMLHeader()
%18 = tail call i32 (...) @zeroBuffer()
%19 = load i8, i8* @lastRead
%20 = load i8, i8* @EOF
%21 = icmp eq i8 %19, %20
br i1 %21, label %27, label %22
22: ; preds = %16, %22
%23 = tail call i32 (...) @renderFormat()
%24 = load i8, i8* @lastRead
%25 = load i8, i8* @EOF
%26 = icmp eq i8 %24, %25
br i1 %26, label %27, label %22
27: ; preds = %22, %16
%28 = tail call i32 (...) @closeHTMLBody()
br label %29
29: ; preds = %4, %0, %27
%30 = phi i32 [ 0, %27 ], [ 1, %0 ], [ 1, %4 ]
ret i32 %30
}