#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void echo_server_usage(FILE *out) {
  static const char usage_str[] =
      ("Usage:                                                 \n"
       "  echo-server [options]                               \n\n"
       "Options:                                                \n"
       "  -a | --address    echo server address                 \n"
       "  -p | --port       echo server port                    \n"
       "  -d | --debug      run the program in debug mode       \n"
       "  -v | --version    show the program version and exit   \n"
       "  -h | --help       show this help and exit           \n\n"
       "Examples:                                               \n"
       "  echo-server                                         \n\n"
       "  echo-server -d --address localhost -port 7777       \n\n");
  fprintf(out, "%s", usage_str);
  fflush(out);
  return;
}


x86 assembly (clang, -O0):
<echo_server_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0x1138(%rip),%rsi
lea    0xec2(%rip),%rdx
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echo_server_usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    $0x26e,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fflush@plt>

LLVM IR (-O0):
@echo_server_usage.usage_str = internal constant [623 x i8] c"Usage: \0A echo-server [options] \0A\0AOptions: \0A -a | --address echo server address \0A -p | --port echo server port \0A -d | --debug run the program in debug mode \0A -v | --version show the program version and exit \0A -h | --help show this help and exit \0A\0AExamples: \0A echo-server \0A\0A echo-server -d --address localhost -port 7777 \0A\0A\00"
@.str = [3 x i8] c"%s\00"
define void @echo_server_usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([623 x i8], [623 x i8]* @echo_server_usage.usage_str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @fflush(i32* %5)
ret void
}

LLVM IR (-O2):
@echo_server_usage.usage_str = internal constant [623 x i8] c"Usage: \0A echo-server [options] \0A\0AOptions: \0A -a | --address echo server address \0A -p | --port echo server port \0A -d | --debug run the program in debug mode \0A -v | --version show the program version and exit \0A -h | --help show this help and exit \0A\0AExamples: \0A echo-server \0A\0A echo-server -d --address localhost -port 7777 \0A\0A\00"
define void @echo_server_usage(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([623 x i8], [623 x i8]* @echo_server_usage.usage_str, i64 0, i64 0), i64 622, i64 1, i32* %0)
%3 = tail call i32 @fflush(i32* %0)
ret void
}