#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*/ GreedyHTML();
int /*<<< orphan*/ InvalidInputHTML();
int /*<<< orphan*/ printf(char *, ...);
void StartHTML(int _userId, char mode) {
  printf("%s%c%c\n", "Content-Type:text/html;charset=UTF-8", 13, 10);
  printf("<!DOCTYPE html>");
  printf("<html lang=\"pt-BR\">");
  printf("<head>");
  printf("<meta charset=\"utf-8\">");
  printf("<title>Game</title>");
  printf("<link rel=\"stylesheet\" type=\"text/css\" "
         "href=\"/~743586/game_style.css\">");
  printf("<link href=\"https://fonts.googleapis.com/css?family=Dosis\" "
         "rel=\"stylesheet\">");
  printf("</head>");
  printf("<body>");
  printf("<img "
         "src=\"https://upload.wikimedia.org/wikipedia/en/6/62/"
         "League_of_Legends_Champion_Series_Logo.jpg.png\">");
  if (mode == 'g') {
    GreedyHTML();
  } else if (mode == 'i') {
    InvalidInputHTML();
  }
  printf("<form method=\"GET\">");
  printf("<input name=\"userId\" type=\"hidden\" value=\"%d\"/>", _userId);
  printf("<table border=\"1\">");
  printf("<thead>");
  printf("<tr><th>Valor R$</th><th>Time X Time</th><th>Valor R$</th></tr>");
  printf("</thead>");
  printf("<tbody>");
}


x86 assembly (clang, -O0):
<StartHTML>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
lea    0xeb8(%rip),%rdi
lea    0xeb9(%rip),%rsi
mov    $0xd,%edx
mov    $0xa,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf41(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x67,%eax
jne    1205 <StartHTML+0xd5>
mov    $0x0,%al
call   1040 <GreedyHTML@plt>
jmp    121e <StartHTML+0xee>
movsbl -0x5(%rbp),%eax
cmp    $0x69,%eax
jne    1219 <StartHTML+0xe9>
mov    $0x0,%al
call   1050 <InvalidInputHTML@plt>
jmp    121e <StartHTML+0xee>
lea    0xf6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xf6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfc1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfbc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StartHTML>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xec2(%rip),%rdi
lea    0xec3(%rip),%rsi
mov    $0xd,%edx
mov    $0xa,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf19(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf58(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf52(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf4b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    $0x69,%bpl
je     11f7 <StartHTML+0xc7>
cmp    $0x67,%bpl
jne    11fe <StartHTML+0xce>
xor    %eax,%eax
call   1040 <GreedyHTML@plt>
jmp    11fe <StartHTML+0xce>
xor    %eax,%eax
call   1050 <InvalidInputHTML@plt>
lea    0xf8b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf91(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xfb1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xfb6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xfb0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xfe2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xfdd(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s%c%c\0A\00"
@.str.1 = [37 x i8] c"Content-Type:text/html;charset=UTF-8\00"
@.str.2 = [16 x i8] c"<!DOCTYPE html>\00"
@.str.3 = [20 x i8] c"<html lang=\22pt-BR\22>\00"
@.str.4 = [7 x i8] c"<head>\00"
@.str.5 = [23 x i8] c"<meta charset=\22utf-8\22>\00"
@.str.6 = [20 x i8] c"<title>Game</title>\00"
@.str.7 = [71 x i8] c"<link rel=\22stylesheet\22 type=\22text/css\22 href=\22/~743586/game_style.css\22>\00"
@.str.8 = [77 x i8] c"<link href=\22https://fonts.googleapis.com/css?family=Dosis\22 rel=\22stylesheet\22>\00"
@.str.9 = [8 x i8] c"</head>\00"
@.str.10 = [7 x i8] c"<body>\00"
@.str.11 = [106 x i8] c"<img src=\22https://upload.wikimedia.org/wikipedia/en/6/62/League_of_Legends_Champion_Series_Logo.jpg.png\22>\00"
@.str.12 = [20 x i8] c"<form method=\22GET\22>\00"
@.str.13 = [48 x i8] c"<input name=\22userId\22 type=\22hidden\22 value=\22%d\22/>\00"
@.str.14 = [19 x i8] c"<table border=\221\22>\00"
@.str.15 = [8 x i8] c"<thead>\00"
@.str.16 = [64 x i8] c"<tr><th>Valor R$</th><th>Time X Time</th><th>Valor R$</th></tr>\00"
@.str.17 = [9 x i8] c"</thead>\00"
@.str.18 = [8 x i8] c"<tbody>\00"
define void @StartHTML(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 13, i32 10)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.7, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.8, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str.11, i64 0, i64 0))
%16 = load i8, i8* %4
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 103
br i1 %18, label %19, label %21
19: ; preds = %2
%20 = call i32 (...) @GreedyHTML()
br label %28
21: ; preds = %2
%22 = load i8, i8* %4
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 105
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = call i32 (...) @InvalidInputHTML()
br label %27
27: ; preds = %25, %21
br label %28
28: ; preds = %27, %19
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0))
%30 = load i32, i32* %3
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.13, i64 0, i64 0), i32 %30)
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.14, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.16, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0))
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.18, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s%c%c\0A\00"
@.str.1 = [37 x i8] c"Content-Type:text/html;charset=UTF-8\00"
@.str.2 = [16 x i8] c"<!DOCTYPE html>\00"
@.str.3 = [20 x i8] c"<html lang=\22pt-BR\22>\00"
@.str.4 = [7 x i8] c"<head>\00"
@.str.5 = [23 x i8] c"<meta charset=\22utf-8\22>\00"
@.str.6 = [20 x i8] c"<title>Game</title>\00"
@.str.7 = [71 x i8] c"<link rel=\22stylesheet\22 type=\22text/css\22 href=\22/~743586/game_style.css\22>\00"
@.str.8 = [77 x i8] c"<link href=\22https://fonts.googleapis.com/css?family=Dosis\22 rel=\22stylesheet\22>\00"
@.str.9 = [8 x i8] c"</head>\00"
@.str.10 = [7 x i8] c"<body>\00"
@.str.11 = [106 x i8] c"<img src=\22https://upload.wikimedia.org/wikipedia/en/6/62/League_of_Legends_Champion_Series_Logo.jpg.png\22>\00"
@.str.12 = [20 x i8] c"<form method=\22GET\22>\00"
@.str.13 = [48 x i8] c"<input name=\22userId\22 type=\22hidden\22 value=\22%d\22/>\00"
@.str.14 = [19 x i8] c"<table border=\221\22>\00"
@.str.15 = [8 x i8] c"<thead>\00"
@.str.16 = [64 x i8] c"<tr><th>Valor R$</th><th>Time X Time</th><th>Valor R$</th></tr>\00"
@.str.17 = [9 x i8] c"</thead>\00"
@.str.18 = [8 x i8] c"<tbody>\00"
define void @StartHTML(i32 %0, i8 signext %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 13, i32 10)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @.str.7, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str.8, i64 0, i64 0))
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str.11, i64 0, i64 0))
switch i8 %1, label %18 [
i8 103, label %14
i8 105, label %16
]
14: ; preds = %2
%15 = tail call i32 (...) @GreedyHTML()
br label %18
16: ; preds = %2
%17 = tail call i32 (...) @InvalidInputHTML()
br label %18
18: ; preds = %2, %16, %14
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0))
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.13, i64 0, i64 0), i32 %0)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.14, i64 0, i64 0))
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.16, i64 0, i64 0))
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0))
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.18, i64 0, i64 0))
ret void
}