#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 EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void usage(const char *argv0, int error_code) {
  FILE *out = error_code == EXIT_SUCCESS ? stdout : stderr;
  fprintf(out,
          "Usage: %s [OPTIONS] address port [content]\n"
          "\n"
          "Options:\n"
          "  -h  show this message\n"
          "  -n  no UDP checksum\n",
          argv0);
  exit(error_code);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e97(%rip),%rcx
cmp    (%rcx),%eax
jne    1154 <usage+0x34>
mov    0x2e90(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    1162 <usage+0x42>
mov    0x2e85(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe87(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2ea3(%rip),%rax
cmp    %esi,(%rax)
jne    113a <usage+0x1a>
mov    0x2ea0(%rip),%rax
jmp    1141 <usage+0x21>
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@stderr = global i32* null
@.str = [100 x i8] c"Usage: %s [OPTIONS] address port [content]\0A\0AOptions:\0A -h show this message\0A -n no UDP checksum\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* @EXIT_SUCCESS
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32*, i32** @stdout
br label %13
11: ; preds = %2
%12 = load i32*, i32** @stderr
br label %13
13: ; preds = %11, %9
%14 = phi i32* [ %10, %9 ], [ %12, %11 ]
store i32* %14, i32** %5
%15 = load i32*, i32** %5
%16 = load i8*, i8** %3
%17 = call i32 @fprintf(i32* %15, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = load i32, i32* %4
%19 = call i32 @exit(i32 %18)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@stderr = global i32* null
@.str = [100 x i8] c"Usage: %s [OPTIONS] address port [content]\0A\0AOptions:\0A -h show this message\0A -n no UDP checksum\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = icmp eq i32 %3, %1
%5 = load i32*, i32** @stdout
%6 = load i32*, i32** @stderr
%7 = select i1 %4, i32* %5, i32* %6
%8 = tail call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 %1)
unreachable
}