#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 */
typedef int /*<<< orphan*/ fbuf;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int /*<<< orphan*/ stderr;
void ShowUsage() {
  do {
    char fbuf[1024] = {0};
    snprintf(fbuf, sizeof(fbuf), "\033[31m[ERR]\033[0m  %s\n",
             "Usage: \n-h\tthis help\n"
             "-l\tstart login server,default use etc/start_login.sh\n"
             "-g\tstart game server,default use etc/start_game.sh\n"
             "-b\tstart battle server,default use etc/start_battle.sh\n"
             "-m\tstart monitor server,default use etc/start_monitor.sh\n"
             "-w\tstart world server,default use etc/start_world.sh\n"
             "-s\t[name]\tstop server by name\n");
    fprintf(stderr, fbuf);
    exit(EXIT_FAILURE);
  } while (0);
}


x86 assembly (clang, -O0):
<ShowUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
lea    -0x400(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
lea    -0x400(%rbp),%rdi
mov    $0x400,%esi
lea    0xe8f(%rip),%rdx
lea    0xe9c(%rip),%rcx
call   1030 <snprintf@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
lea    -0x400(%rbp),%rsi
call   1050 <fprintf@plt>
mov    0x2e3f(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<ShowUsage>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rbx
mov    $0x400,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
lea    0xe9f(%rip),%rdx
lea    0xeac(%rip),%rcx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1030 <snprintf@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1050 <fprintf@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"\1B[31m[ERR]\1B[0m %s\0A\00"
@.str.1 = [321 x i8] c"Usage: \0A-h\09this help\0A-l\09start login server,default use etc/start_login.sh\0A-g\09start game server,default use etc/start_game.sh\0A-b\09start battle server,default use etc/start_battle.sh\0A-m\09start monitor server,default use etc/start_monitor.sh\0A-w\09start world server,default use etc/start_world.sh\0A-s\09[name]\09stop server by name\0A\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @ShowUsage() {
%1 = alloca [1024 x i8]
br label %2
2: ; preds = %0
%3 = bitcast [1024 x i8]* %1 to i8*
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 1024, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([321 x i8], [321 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%8 = call i32 @fprintf(i32 %6, i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; No predecessors!
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"\1B[31m[ERR]\1B[0m %s\0A\00"
@.str.1 = [321 x i8] c"Usage: \0A-h\09this help\0A-l\09start login server,default use etc/start_login.sh\0A-g\09start game server,default use etc/start_game.sh\0A-b\09start battle server,default use etc/start_battle.sh\0A-m\09start monitor server,default use etc/start_monitor.sh\0A-w\09start world server,default use etc/start_world.sh\0A-s\09[name]\09stop server by name\0A\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @ShowUsage() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @snprintf(i8* %2, i32 1024, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([321 x i8], [321 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* %2)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}