#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*/ cleanUp(int, char **, char **);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
char **getGETvars();
char **getPOSTvars();
int getRequestMethod();
int /*<<< orphan*/ htmlBody();
int /*<<< orphan*/ htmlFooter();
int /*<<< orphan*/ htmlHeader(char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ template_page(char **, int);
int main() {
  char **postvars = NULL;
  char **getvars = NULL;
  int form_method;
  form_method = getRequestMethod();
  if (form_method == 1) {
    getvars = getGETvars();
    postvars = getPOSTvars();
  } else if (form_method == 0) {
    getvars = getGETvars();
  }
  htmlHeader("Demo Web Page");
  htmlBody();
  template_page(postvars, form_method);
  htmlFooter();
  cleanUp(form_method, getvars, postvars);
  fflush(stdout);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   10b0 <getRequestMethod@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jne    11ee <main+0x4e>
mov    $0x0,%al
call   1030 <getGETvars@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <getPOSTvars@plt>
mov    %rax,-0x10(%rbp)
jmp    1208 <main+0x68>
cmpl   $0x0,-0x1c(%rbp)
jne    1203 <main+0x63>
mov    $0x0,%al
call   1030 <getGETvars@plt>
mov    %rax,-0x18(%rbp)
jmp    1208 <main+0x68>
lea    0xdf1(%rip),%rdi
call   1090 <htmlHeader@plt>
mov    $0x0,%al
call   1060 <htmlBody@plt>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1050 <template_page@plt>
mov    $0x0,%al
call   10c0 <htmlFooter@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1080 <cleanUp@plt>
mov    0x2d9b(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
xor    %edi,%edi
call   10a0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %r14d,%r14d
xor    %eax,%eax
call   10b0 <getRequestMethod@plt>
mov    %eax,%ebx
test   %eax,%eax
je     11d0 <main+0x30>
cmp    $0x1,%ebx
jne    11df <main+0x3f>
xor    %eax,%eax
call   1030 <getGETvars@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1040 <getPOSTvars@plt>
mov    %rax,%r15
jmp    11e2 <main+0x42>
xor    %r15d,%r15d
xor    %eax,%eax
call   1030 <getGETvars@plt>
mov    %rax,%r14
jmp    11e2 <main+0x42>
xor    %r15d,%r15d
lea    0xe17(%rip),%rdi
call   1090 <htmlHeader@plt>
xor    %eax,%eax
call   1060 <htmlBody@plt>
mov    %r15,%rdi
mov    %ebx,%esi
call   1050 <template_page@plt>
xor    %eax,%eax
call   10c0 <htmlFooter@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1080 <cleanUp@plt>
mov    0x2dc6(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
xor    %edi,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Demo Web Page\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8**
%3 = alloca i8**
%4 = alloca i32
store i32 0, i32* %1
store i8** null, i8*** %2
store i8** null, i8*** %3
%5 = call i32 (...) @getRequestMethod()
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = call i8** (...) @getGETvars()
store i8** %9, i8*** %3
%10 = call i8** (...) @getPOSTvars()
store i8** %10, i8*** %2
br label %17
11: ; preds = %0
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i8** (...) @getGETvars()
store i8** %15, i8*** %3
br label %16
16: ; preds = %14, %11
br label %17
17: ; preds = %16, %8
%18 = call i32 @htmlHeader(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%19 = call i32 (...) @htmlBody()
%20 = load i8**, i8*** %2
%21 = load i32, i32* %4
%22 = call i32 @template_page(i8** %20, i32 %21)
%23 = call i32 (...) @htmlFooter()
%24 = load i32, i32* %4
%25 = load i8**, i8*** %3
%26 = load i8**, i8*** %2
%27 = call i32 @cleanUp(i32 %24, i8** %25, i8** %26)
%28 = load i32, i32* @stdout
%29 = call i32 @fflush(i32 %28)
%30 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"Demo Web Page\00"
@stdout = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getRequestMethod()
switch i32 %1, label %7 [
i32 1, label %2
i32 0, label %5
]
2: ; preds = %0
%3 = tail call i8** (...) @getGETvars()
%4 = tail call i8** (...) @getPOSTvars()
br label %7
5: ; preds = %0
%6 = tail call i8** (...) @getGETvars()
br label %7
7: ; preds = %0, %5, %2
%8 = phi i8** [ %3, %2 ], [ %6, %5 ], [ null, %0 ]
%9 = phi i8** [ %4, %2 ], [ null, %5 ], [ null, %0 ]
%10 = tail call i32 @htmlHeader(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 (...) @htmlBody()
%12 = tail call i32 @template_page(i8** %9, i32 %1)
%13 = tail call i32 (...) @htmlFooter()
%14 = tail call i32 @cleanUp(i32 %1, i8** %8, i8** %9)
%15 = load i32, i32* @stdout
%16 = tail call i32 @fflush(i32 %15)
%17 = tail call i32 @exit(i32 0)
unreachable
}