#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 *, ...);
void usage(char *command, int err) {
  if (err == -3) {
    printf("usage: %s [arguments]\n\n", command);
    printf("Arguments:\n");
    printf("  -s  or  --server       Run as server, otherwise as client\n");
    printf("  -d  or  --dest-ip      Destination IP address\n");
    printf("  -p  or  --dest-port    Destination port\n");
    printf("  -w  or  --window-size  Window size (server/client must agree)\n");
    printf("  -f  or  --file         File to read from or write to\n");
    printf("  -h  or  --help         Prints out this screen\n");
    exit(-3);
  } else if (err == -2)
    printf("Try `%s --help` for more information.\n", command);
  else {
    printf("%s: unknown error\n", command);
    printf("Try `%s --help` for more information.\n", command);
  }
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xfffffffd,-0xc(%rbp)
jne    11b7 <usage+0x97>
mov    -0x8(%rbp),%rsi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf16(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf33(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfffffffd,%edi
call   1040 <exit@plt>
cmpl   $0xfffffffe,-0xc(%rbp)
jne    11d8 <usage+0xb8>
mov    -0x8(%rbp),%rsi
lea    0xf9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11fc <usage+0xdc>
mov    -0x8(%rbp),%rsi
lea    0xfab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1201 <usage+0xe1>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
cmp    $0xfffffffe,%esi
je     114f <usage+0x1f>
cmp    $0xfffffffd,%esi
je     1161 <usage+0x31>
lea    0xefa(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>
lea    0xe98(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf4a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf7e(%rip),%rdi
call   1030 <puts@plt>
lea    0xfa9(%rip),%rdi
call   1030 <puts@plt>
mov    $0xfffffffd,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"usage: %s [arguments]\0A\0A\00"
@.str.1 = [12 x i8] c"Arguments:\0A\00"
@.str.2 = [61 x i8] c" -s or --server Run as server, otherwise as client\0A\00"
@.str.3 = [49 x i8] c" -d or --dest-ip Destination IP address\0A\00"
@.str.4 = [43 x i8] c" -p or --dest-port Destination port\0A\00"
@.str.5 = [65 x i8] c" -w or --window-size Window size (server/client must agree)\0A\00"
@.str.6 = [56 x i8] c" -f or --file File to read from or write to\0A\00"
@.str.7 = [49 x i8] c" -h or --help Prints out this screen\0A\00"
@.str.8 = [39 x i8] c"Try `%s --help` for more information.\0A\00"
@.str.9 = [19 x i8] c"%s: unknown error\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 i32, i32* %4
%6 = icmp eq i32 %5, -3
br i1 %6, label %7, label %18
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.6, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.7, i64 0, i64 0))
%17 = call i32 @exit(i32 -3)
unreachable
18: ; preds = %2
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, -2
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i8*, i8** %3
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.8, i64 0, i64 0), i8* %22)
br label %29
24: ; preds = %18
%25 = load i8*, i8** %3
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i8* %25)
%27 = load i8*, i8** %3
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.8, i64 0, i64 0), i8* %27)
br label %29
29: ; preds = %24, %21
br label %30
30: ; preds = %29
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"usage: %s [arguments]\0A\0A\00"
@.str.8 = [39 x i8] c"Try `%s --help` for more information.\0A\00"
@.str.9 = [19 x i8] c"%s: unknown error\0A\00"
@str = [11 x i8] c"Arguments:\00"
@str.10 = [60 x i8] c" -s or --server Run as server, otherwise as client\00"
@str.11 = [48 x i8] c" -d or --dest-ip Destination IP address\00"
@str.12 = [42 x i8] c" -p or --dest-port Destination port\00"
@str.13 = [64 x i8] c" -w or --window-size Window size (server/client must agree)\00"
@str.14 = [55 x i8] c" -f or --file File to read from or write to\00"
@str.15 = [48 x i8] c" -h or --help Prints out this screen\00"
define void @usage(i8* %0, i32 %1) {
switch i32 %1, label %13 [
i32 -3, label %3
i32 -2, label %15
]
3: ; preds = %2
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.10, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.11, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.12, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.13, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.14, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.15, i64 0, i64 0))
%12 = tail call i32 @exit(i32 -3)
unreachable
13: ; preds = %2
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i8* %0)
br label %15
15: ; preds = %2, %13
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.8, i64 0, i64 0), i8* %0)
ret void
}