#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*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *cmd, int exit_status) {
  printf("Usage: %s [options] <upstream-host> <upstream-port>\n"
         "\n"
         "Options:\n"
         "  -b <buffersize> size of the buffer for packets upstream (default: "
         "16)\n"
         "  -B <buffersize> size of the buffer for packets downstream "
         "(default: 16)\n"
         "  -i <interval>   delay (in microseconds) to insert after sending "
         "one packet\n"
         "                  upstream (default: 10)\n"
         "  -I <interval>   delay (in microseconds) to insert after sending "
         "one packet\n"
         "                  downstream (default: 10)\n"
         "  -p <interval>   propagation delay (in microseconds) upstream "
         "(default: 0)\n"
         "  -P <interval>   propagation delay (in microseconds) downstream "
         "(default: 0)\n"
         "  -l <port>       port number to which the command binds\n"
         "  -d <packetnum>  packet number in connection to drop upstream\n"
         "  -D <packetnum>  packet number in connection to drop downstream\n"
         "  -h              prints this help\n"
         "\n",
         cmd);
  exit(exit_status);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [822 x i8] c"Usage: %s [options] <upstream-host> <upstream-port>\0A\0AOptions:\0A -b <buffersize> size of the buffer for packets upstream (default: 16)\0A -B <buffersize> size of the buffer for packets downstream (default: 16)\0A -i <interval> delay (in microseconds) to insert after sending one packet\0A upstream (default: 10)\0A -I <interval> delay (in microseconds) to insert after sending one packet\0A downstream (default: 10)\0A -p <interval> propagation delay (in microseconds) upstream (default: 0)\0A -P <interval> propagation delay (in microseconds) downstream (default: 0)\0A -l <port> port number to which the command binds\0A -d <packetnum> packet number in connection to drop upstream\0A -D <packetnum> packet number in connection to drop downstream\0A -h prints this help\0A\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([822 x i8], [822 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %4
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [822 x i8] c"Usage: %s [options] <upstream-host> <upstream-port>\0A\0AOptions:\0A -b <buffersize> size of the buffer for packets upstream (default: 16)\0A -B <buffersize> size of the buffer for packets downstream (default: 16)\0A -i <interval> delay (in microseconds) to insert after sending one packet\0A upstream (default: 10)\0A -I <interval> delay (in microseconds) to insert after sending one packet\0A downstream (default: 10)\0A -p <interval> propagation delay (in microseconds) upstream (default: 0)\0A -P <interval> propagation delay (in microseconds) downstream (default: 0)\0A -l <port> port number to which the command binds\0A -d <packetnum> packet number in connection to drop upstream\0A -D <packetnum> packet number in connection to drop downstream\0A -h prints this help\0A\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([822 x i8], [822 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 %1)
unreachable
}