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

/* Variables and functions */
int /*<<< orphan*/ aqueue_run(int);
int atoi(char *);
char getopt(int, char **, char *);
int /*<<< orphan*/ netio_run(int);
char *optarg;
int /*<<< orphan*/ pipeio_run(int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
scalar_t__ strcasecmp(char *, char *);
int /*<<< orphan*/ unixio_run(int);
int /*<<< orphan*/ usage(char *);
int main(int argc, char *argv[]) {
  char ch;
  int max = 0;
  char method[24];
  method[0] = 0;
  while ((ch = getopt(argc, argv, "hn:m:")) > 0) {
    switch (ch) {
    case 'h':
      usage(argv[0]);
      return (0);
    case 'n':
      max = atoi(optarg);
      break;
    case 'm':
      snprintf(method, sizeof(method), "%s", optarg);
      break;
    default:
      break;
    }
  }
  if (method[0] == 0) {
    usage(argv[0]);
    return (0);
  }
  if (strcasecmp(method, "netio") == 0)
    netio_run(max);
  else if (strcasecmp(method, "aqueue") == 0)
    aqueue_run(max);
  else if (strcasecmp(method, "pipeio") == 0)
    pipeio_run(max);
  else if (strcasecmp(method, "unixio") == 0)
    unixio_run(max);
  else if (strcasecmp(method, "all") == 0) {
    netio_run(max);
    aqueue_run(max);
    pipeio_run(max);
    unixio_run(max);
  } else
    usage(argv[0]);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movb   $0x0,-0x30(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe41(%rip),%rdx
call   1090 <getopt@plt>
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
jle    1267 <main+0xd7>
movsbl -0x11(%rbp),%eax
mov    %eax,-0x34(%rbp)
sub    $0x68,%eax
je     120a <main+0x7a>
jmp    11e8 <main+0x58>
mov    -0x34(%rbp),%eax
sub    $0x6d,%eax
je     1239 <main+0xa9>
jmp    11f9 <main+0x69>
mov    -0x34(%rbp),%eax
sub    $0x6e,%eax
je     1222 <main+0x92>
jmp    125d <main+0xcd>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1080 <usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    138e <main+0x1fe>
mov    0x2dcf(%rip),%rax
mov    (%rax),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x18(%rbp)
jmp    1262 <main+0xd2>
lea    -0x30(%rbp),%rdi
mov    0x2db4(%rip),%rax
mov    (%rax),%rcx
mov    $0x18,%esi
lea    0xdb3(%rip),%rdx
call   1070 <snprintf@plt>
jmp    1262 <main+0xd2>
jmp    1262 <main+0xd2>
jmp    11b1 <main+0x21>
movsbl -0x30(%rbp),%eax
cmp    $0x0,%eax
jne    128c <main+0xfc>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1080 <usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    138e <main+0x1fe>
lea    -0x30(%rbp),%rdi
lea    0xd72(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
jne    12b3 <main+0x123>
mov    -0x18(%rbp),%edi
call   1060 <netio_run@plt>
jmp    1387 <main+0x1f7>
lea    -0x30(%rbp),%rdi
lea    0xd51(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
jne    12da <main+0x14a>
mov    -0x18(%rbp),%edi
call   10b0 <aqueue_run@plt>
jmp    1382 <main+0x1f2>
lea    -0x30(%rbp),%rdi
lea    0xd31(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1301 <main+0x171>
mov    -0x18(%rbp),%edi
call   1030 <pipeio_run@plt>
jmp    137d <main+0x1ed>
lea    -0x30(%rbp),%rdi
lea    0xd11(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1328 <main+0x198>
mov    -0x18(%rbp),%edi
call   1050 <unixio_run@plt>
jmp    1378 <main+0x1e8>
lea    -0x30(%rbp),%rdi
lea    0xcf1(%rip),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1367 <main+0x1d7>
mov    -0x18(%rbp),%edi
call   1060 <netio_run@plt>
mov    -0x18(%rbp),%edi
call   10b0 <aqueue_run@plt>
mov    -0x18(%rbp),%edi
call   1030 <pipeio_run@plt>
mov    -0x18(%rbp),%edi
call   1050 <unixio_run@plt>
jmp    1373 <main+0x1e3>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1080 <usage@plt>
jmp    1378 <main+0x1e8>
jmp    137d <main+0x1ed>
jmp    1382 <main+0x1f2>
jmp    1387 <main+0x1f7>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
movb   $0x0,(%rsp)
lea    0xe52(%rip),%rdx
call   1090 <getopt@plt>
test   %al,%al
jle    1297 <main+0x107>
xor    %r14d,%r14d
mov    0x2e33(%rip),%r15
mov    %rsp,%r12
lea    0xe31(%rip),%r13
jmp    1208 <main+0x78>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15),%rcx
mov    %r12,%rdi
mov    $0x18,%esi
lea    0xe14(%rip),%rdx
call   1070 <snprintf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r13,%rdx
call   1090 <getopt@plt>
test   %al,%al
jle    122d <main+0x9d>
cmp    $0x6d,%al
je     11e0 <main+0x50>
cmp    $0x6e,%al
je     1220 <main+0x90>
cmp    $0x68,%al
jne    11f7 <main+0x67>
jmp    1297 <main+0x107>
nopl   0x0(%rax)
mov    (%r15),%rdi
call   10a0 <atoi@plt>
mov    %eax,%r14d
jmp    11f7 <main+0x67>
cmpb   $0x0,(%rsp)
je     1297 <main+0x107>
lea    0xdcf(%rip),%rsi
mov    %rsp,%rdi
call   1040 <strcasecmp@plt>
test   %rax,%rax
je     12b0 <main+0x120>
lea    0xdc1(%rip),%rsi
mov    %rsp,%rdi
call   1040 <strcasecmp@plt>
test   %rax,%rax
je     12ba <main+0x12a>
lea    0xdb4(%rip),%rsi
mov    %rsp,%rdi
call   1040 <strcasecmp@plt>
test   %rax,%rax
je     12c4 <main+0x134>
lea    0xda7(%rip),%rsi
mov    %rsp,%rdi
call   1040 <strcasecmp@plt>
test   %rax,%rax
je     12e6 <main+0x156>
lea    0xd9a(%rip),%rsi
mov    %rsp,%rdi
call   1040 <strcasecmp@plt>
test   %rax,%rax
je     12ce <main+0x13e>
mov    (%rbx),%rdi
call   1080 <usage@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r14d,%edi
call   1060 <netio_run@plt>
jmp    129f <main+0x10f>
mov    %r14d,%edi
call   10b0 <aqueue_run@plt>
jmp    129f <main+0x10f>
mov    %r14d,%edi
call   1030 <pipeio_run@plt>
jmp    129f <main+0x10f>
mov    %r14d,%edi
call   1060 <netio_run@plt>
mov    %r14d,%edi
call   10b0 <aqueue_run@plt>
mov    %r14d,%edi
call   1030 <pipeio_run@plt>
mov    %r14d,%edi
call   1050 <unixio_run@plt>
jmp    129f <main+0x10f>

LLVM IR (-O0):
@.str = [6 x i8] c"hn:m:\00"
@optarg = global i8* null
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [6 x i8] c"netio\00"
@.str.3 = [7 x i8] c"aqueue\00"
@.str.4 = [7 x i8] c"pipeio\00"
@.str.5 = [7 x i8] c"unixio\00"
@.str.6 = [4 x i8] c"all\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i32
%8 = alloca [24 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%9 = getelementptr inbounds [24 x i8], [24 x i8]* %8, i64 0, i64 0
store i8 0, i8* %9
br label %10
10: ; preds = %32, %2
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call signext i8 @getopt(i32 %11, i8** %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i8 %13, i8* %6
%14 = sext i8 %13 to i32
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %33
16: ; preds = %10
%17 = load i8, i8* %6
%18 = sext i8 %17 to i32
switch i32 %18, label %31 [
i32 104, label %19
i32 110, label %24
i32 109, label %27
]
19: ; preds = %16
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 0
%22 = load i8*, i8** %21
%23 = call i32 @usage(i8* %22)
store i32 0, i32* %3
br label %94
24: ; preds = %16
%25 = load i8*, i8** @optarg
%26 = call i32 @atoi(i8* %25)
store i32 %26, i32* %7
br label %32
27: ; preds = %16
%28 = getelementptr inbounds [24 x i8], [24 x i8]* %8, i64 0, i64 0
%29 = load i8*, i8** @optarg
%30 = call i32 @snprintf(i8* %28, i32 24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %29)
br label %32
31: ; preds = %16
br label %32
32: ; preds = %31, %27, %24
br label %10
33: ; preds = %10
%34 = getelementptr inbounds [24 x i8], [24 x i8]* %8, i64 0, i64 0
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %43
38: ; preds = %33
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 0
%41 = load i8*, i8** %40
%42 = call i32 @usage(i8* %41)
store i32 0, i32* %3
br label %94
43: ; preds = %33
%44 = getelementptr inbounds [24 x i8], [24 x i8]* %8, i64 0, i64 0
%45 = call i64 @strcasecmp(i8* %44, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %50
47: ; preds = %43
%48 = load i32, i32* %7
%49 = call i32 @netio_run(i32 %48)
br label %93
50: ; preds = %43
%51 = getelementptr inbounds [24 x i8], [24 x i8]* %8, i64 0, i64 0
%52 = call i64 @strcasecmp(i8* %51, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %57
54: ; preds = %50
%55 = load i32, i32* %7
%56 = call i32 @aqueue_run(i32 %55)
br label %92
57: ; preds = %50
%58 = getelementptr inbounds [24 x i8], [24 x i8]* %8, i64 0, i64 0
%59 = call i64 @strcasecmp(i8* %58, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %64
61: ; preds = %57
%62 = load i32, i32* %7
%63 = call i32 @pipeio_run(i32 %62)
br label %91
64: ; preds = %57
%65 = getelementptr inbounds [24 x i8], [24 x i8]* %8, i64 0, i64 0
%66 = call i64 @strcasecmp(i8* %65, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %71
68: ; preds = %64
%69 = load i32, i32* %7
%70 = call i32 @unixio_run(i32 %69)
br label %90
71: ; preds = %64
%72 = getelementptr inbounds [24 x i8], [24 x i8]* %8, i64 0, i64 0
%73 = call i64 @strcasecmp(i8* %72, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%74 = icmp eq i64 %73, 0
br i1 %74, label %75, label %84
75: ; preds = %71
%76 = load i32, i32* %7
%77 = call i32 @netio_run(i32 %76)
%78 = load i32, i32* %7
%79 = call i32 @aqueue_run(i32 %78)
%80 = load i32, i32* %7
%81 = call i32 @pipeio_run(i32 %80)
%82 = load i32, i32* %7
%83 = call i32 @unixio_run(i32 %82)
br label %89
84: ; preds = %71
%85 = load i8**, i8*** %5
%86 = getelementptr inbounds i8*, i8** %85, i64 0
%87 = load i8*, i8** %86
%88 = call i32 @usage(i8* %87)
br label %89
89: ; preds = %84, %75
br label %90
90: ; preds = %89, %68
br label %91
91: ; preds = %90, %61
br label %92
92: ; preds = %91, %54
br label %93
93: ; preds = %92, %47
store i32 0, i32* %3
br label %94
94: ; preds = %93, %38, %19
%95 = load i32, i32* %3
ret i32 %95
}

LLVM IR (-O2):
@.str = [6 x i8] c"hn:m:\00"
@optarg = global i8* null
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [6 x i8] c"netio\00"
@.str.3 = [7 x i8] c"aqueue\00"
@.str.4 = [7 x i8] c"pipeio\00"
@.str.5 = [7 x i8] c"unixio\00"
@.str.6 = [4 x i8] c"all\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [24 x i8]
%4 = getelementptr inbounds [24 x i8], [24 x i8]* %3, i64 0, i64 0
store i8 0, i8* %4
%5 = call signext i8 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = icmp sgt i8 %5, 0
br i1 %6, label %7, label %26
7: ; preds = %2, %19
%8 = phi i8 [ %21, %19 ], [ %5, %2 ]
%9 = phi i32 [ %20, %19 ], [ 0, %2 ]
switch i8 %8, label %19 [
i8 104, label %10
i8 110, label %13
i8 109, label %16
]
10: ; preds = %7
%11 = load i8*, i8** %1
%12 = call i32 @usage(i8* %11)
br label %60
13: ; preds = %7
%14 = load i8*, i8** @optarg
%15 = call i32 @atoi(i8* %14)
br label %19
16: ; preds = %7
%17 = load i8*, i8** @optarg
%18 = call i32 @snprintf(i8* %4, i32 24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %7, %16, %13
%20 = phi i32 [ %9, %7 ], [ %9, %16 ], [ %15, %13 ]
%21 = call signext i8 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%22 = icmp sgt i8 %21, 0
br i1 %22, label %7, label %23
23: ; preds = %19
%24 = load i8, i8* %4
%25 = icmp eq i8 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %2, %23
%27 = load i8*, i8** %1
%28 = call i32 @usage(i8* %27)
br label %60
29: ; preds = %23
%30 = call i64 @strcasecmp(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = call i32 @netio_run(i32 %20)
br label %60
34: ; preds = %29
%35 = call i64 @strcasecmp(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %34
%38 = call i32 @aqueue_run(i32 %20)
br label %60
39: ; preds = %34
%40 = call i64 @strcasecmp(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %44
42: ; preds = %39
%43 = call i32 @pipeio_run(i32 %20)
br label %60
44: ; preds = %39
%45 = call i64 @strcasecmp(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %49
47: ; preds = %44
%48 = call i32 @unixio_run(i32 %20)
br label %60
49: ; preds = %44
%50 = call i64 @strcasecmp(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %57
52: ; preds = %49
%53 = call i32 @netio_run(i32 %20)
%54 = call i32 @aqueue_run(i32 %20)
%55 = call i32 @pipeio_run(i32 %20)
%56 = call i32 @unixio_run(i32 %20)
br label %60
57: ; preds = %49
%58 = load i8*, i8** %1
%59 = call i32 @usage(i8* %58)
br label %60
60: ; preds = %32, %42, %52, %57, %47, %37, %26, %10
ret i32 0
}