#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void Usage(char *exefile) {
  fprintf(stderr, "#=======================================\n");
  fprintf(stderr, "# TieMa Mini Http Server\n");
  fprintf(stderr, "# Version %s\n", "1.0.0 alpha");
  fprintf(stderr, "# \n");
  fprintf(stderr, "# heiyeluren <blog.csdn.net/heiyeshuwu>\n");
  fprintf(stderr, "#=======================================\n\n");
  fprintf(stderr, "Usage: %s [OPTION] ... \n", exefile);
  fprintf(stderr,
          "\nOptions: \n  -D, --is-deubg	Is open debug mode, default "
          "No\n  -d, --is-daemon	Is daemon running, default No\n  -p, "
          "--port=PORT	Server listen port, default 80\n  -m, "
          "--max-client=SIZE	Max connection requests, default 100\n  -L, "
          "--is-log		Is write access log, default No\n  -l, "
          "--log-path=PATH	Access log path, default /tmp/tmhttpd.log\n  "
          "-b, --is-browse	Is allow browse file/dir list, default No\n  "
          "-r, --doc-root=PATH	Web document root directory, default programe "
          "current directory ./\n  -i, --dir-index=FILE	Directory default "
          "index file name, default index.html\n  -h, --help		Print "
          "help information\n");
  fprintf(stderr,
          "\nExample: \n  %s -d -p 80 -m 128 -L -l /tmp/access.log -b -r "
          "/var/www -i index.html\n  %s -d -p80 -m128 -L -l/tmp/access.log -b "
          "-r/var/www -iindex.html\n  %s --is-daemon --port=80 "
          "--max-client=128 --is-log --log-path=/tmp/access.log --is-browse "
          "--doc-root=/var/www --dir-index=index.html\n\n",
          exefile, exefile, exefile);
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xee7(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xeea(%rip),%rsi
lea    0xef1(%rip),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
lea    0xee6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
lea    0xed3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e43(%rip),%rax
mov    (%rax),%edi
lea    0xee5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xef5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e11(%rip),%rax
mov    (%rax),%edi
lea    0xef7(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dfa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x8(%rbp),%r8
lea    0x1125(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x2ec2(%rip),%rbx
mov    (%rbx),%edi
lea    0xed9(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef3(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xefd(%rip),%rsi
lea    0xf04(%rip),%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf00(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef4(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf0d(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf28(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf2e(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x116f(%rip),%rsi
mov    %r14,%rdx
mov    %r14,%rcx
mov    %r14,%r8
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"#=======================================\0A\00"
@.str.1 = [26 x i8] c"# TieMa Mini Http Server\0A\00"
@.str.2 = [14 x i8] c"# Version %s\0A\00"
@.str.3 = [12 x i8] c"1.0.0 alpha\00"
@.str.4 = [4 x i8] c"# \0A\00"
@.str.5 = [41 x i8] c"# heiyeluren <blog.csdn.net/heiyeshuwu>\0A\00"
@.str.6 = [43 x i8] c"#=======================================\0A\0A\00"
@.str.7 = [25 x i8] c"Usage: %s [OPTION] ... \0A\00"
@.str.8 = [593 x i8] c"\0AOptions: \0A -D, --is-deubg\09Is open debug mode, default No\0A -d, --is-daemon\09Is daemon running, default No\0A -p, --port=PORT\09Server listen port, default 80\0A -m, --max-client=SIZE\09Max connection requests, default 100\0A -L, --is-log\09\09Is write access log, default No\0A -l, --log-path=PATH\09Access log path, default /tmp/tmhttpd.log\0A -b, --is-browse\09Is allow browse file/dir list, default No\0A -r, --doc-root=PATH\09Web document root directory, default programe current directory ./\0A -i, --dir-index=FILE\09Directory default index file name, default index.html\0A -h, --help\09\09Print help information\0A\00"
@.str.9 = [287 x i8] c"\0AExample: \0A %s -d -p 80 -m 128 -L -l /tmp/access.log -b -r /var/www -i index.html\0A %s -d -p80 -m128 -L -l/tmp/access.log -b -r/var/www -iindex.html\0A %s --is-daemon --port=80 --max-client=128 --is-log --log-path=/tmp/access.log --is-browse --doc-root=/var/www --dir-index=index.html\0A\0A\00"
define void @Usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0))
%15 = load i32, i32* @stderr
%16 = load i8*, i8** %2
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i8* %16)
%18 = load i32, i32* @stderr
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([593 x i8], [593 x i8]* @.str.8, i64 0, i64 0))
%20 = load i32, i32* @stderr
%21 = load i8*, i8** %2
%22 = load i8*, i8** %2
%23 = load i8*, i8** %2
%24 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([287 x i8], [287 x i8]* @.str.9, i64 0, i64 0), i8* %21, i8* %22, i8* %23)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"#=======================================\0A\00"
@.str.1 = [26 x i8] c"# TieMa Mini Http Server\0A\00"
@.str.2 = [14 x i8] c"# Version %s\0A\00"
@.str.3 = [12 x i8] c"1.0.0 alpha\00"
@.str.4 = [4 x i8] c"# \0A\00"
@.str.5 = [41 x i8] c"# heiyeluren <blog.csdn.net/heiyeshuwu>\0A\00"
@.str.6 = [43 x i8] c"#=======================================\0A\0A\00"
@.str.7 = [25 x i8] c"Usage: %s [OPTION] ... \0A\00"
@.str.8 = [593 x i8] c"\0AOptions: \0A -D, --is-deubg\09Is open debug mode, default No\0A -d, --is-daemon\09Is daemon running, default No\0A -p, --port=PORT\09Server listen port, default 80\0A -m, --max-client=SIZE\09Max connection requests, default 100\0A -L, --is-log\09\09Is write access log, default No\0A -l, --log-path=PATH\09Access log path, default /tmp/tmhttpd.log\0A -b, --is-browse\09Is allow browse file/dir list, default No\0A -r, --doc-root=PATH\09Web document root directory, default programe current directory ./\0A -i, --dir-index=FILE\09Directory default index file name, default index.html\0A -h, --help\09\09Print help information\0A\00"
@.str.9 = [287 x i8] c"\0AExample: \0A %s -d -p 80 -m 128 -L -l /tmp/access.log -b -r /var/www -i index.html\0A %s -d -p80 -m128 -L -l/tmp/access.log -b -r/var/www -iindex.html\0A %s --is-daemon --port=80 --max-client=128 --is-log --log-path=/tmp/access.log --is-browse --doc-root=/var/www --dir-index=index.html\0A\0A\00"
define void @Usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%10 = load i32, i32* @stderr
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0))
%14 = load i32, i32* @stderr
%15 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i8* %0)
%16 = load i32, i32* @stderr
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([593 x i8], [593 x i8]* @.str.8, i64 0, i64 0))
%18 = load i32, i32* @stderr
%19 = tail call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([287 x i8], [287 x i8]* @.str.9, i64 0, i64 0), i8* %0, i8* %0, i8* %0)
ret void
}