#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 clean_command_links();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int list_commands();
int make_command_links();
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
scalar_t__ strcmp(char const *, char *);
int /*<<< orphan*/ usage(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ version(char const *);
int iotools_fallback(int argc, const char *argv[]) {
  if (argc != 2) {
    usage(argv[0], stderr);
    return -1;
  }
  if (strcmp(argv[1], "--help") == 0) {
    usage(argv[0], stdout);
    return 0;
  }
  if (strcmp(argv[1], "--make-links") == 0) {
    return make_command_links();
  }
  if (strcmp(argv[1], "--clean-links") == 0) {
    return clean_command_links();
  }
  if (strcmp(argv[1], "--list-cmds") == 0) {
    return list_commands();
  }
  if (strcmp(argv[1], "-v") == 0 || strcmp(argv[1], "--version") == 0) {
    version(argv[0]);
    return 0;
  }
  fprintf(stderr, "'%s' sub-command not supported by iotools\n", argv[1]);
  usage(argv[0], stderr);
  return -1;
}


x86 assembly (clang, -O0):
<iotools_fallback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11aa <iotools_fallback+0x3a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    0x2e49(%rip),%rax
mov    (%rax),%esi
call   1070 <usage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    12fd <iotools_fallback+0x18d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe47(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11e9 <iotools_fallback+0x79>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    0x2e02(%rip),%rax
mov    (%rax),%esi
call   1070 <usage@plt>
movl   $0x0,-0x4(%rbp)
jmp    12fd <iotools_fallback+0x18d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe0f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1216 <iotools_fallback+0xa6>
mov    $0x0,%al
call   1080 <make_command_links@plt>
mov    %eax,-0x4(%rbp)
jmp    12fd <iotools_fallback+0x18d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdef(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1243 <iotools_fallback+0xd3>
mov    $0x0,%al
call   1030 <clean_command_links@plt>
mov    %eax,-0x4(%rbp)
jmp    12fd <iotools_fallback+0x18d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdd0(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1270 <iotools_fallback+0x100>
mov    $0x0,%al
call   1090 <list_commands@plt>
mov    %eax,-0x4(%rbp)
jmp    12fd <iotools_fallback+0x18d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdaf(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     12ac <iotools_fallback+0x13c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd94(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    12c4 <iotools_fallback+0x154>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <version@plt>
movl   $0x0,-0x4(%rbp)
jmp    12fd <iotools_fallback+0x18d>
mov    0x2d15(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd5f(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    0x2cf1(%rip),%rax
mov    (%rax),%esi
call   1070 <usage@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iotools_fallback>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    1234 <iotools_fallback+0xc4>
mov    0x8(%rbx),%rdi
lea    0xe75(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     124c <iotools_fallback+0xdc>
mov    0x8(%rbx),%rdi
lea    0xe63(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1267 <iotools_fallback+0xf7>
mov    0x8(%rbx),%rdi
lea    0xe57(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1275 <iotools_fallback+0x105>
mov    0x8(%rbx),%rdi
lea    0xe4c(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1283 <iotools_fallback+0x113>
mov    0x8(%rbx),%rdi
lea    0xe3f(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1291 <iotools_fallback+0x121>
mov    0x8(%rbx),%rdi
lea    0xe29(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1291 <iotools_fallback+0x121>
mov    0x2dc7(%rip),%r14
mov    (%r14),%edi
mov    0x8(%rbx),%rdx
lea    0xe14(%rip),%rsi
call   1050 <fprintf@plt>
mov    (%rbx),%rdi
mov    (%r14),%esi
jmp    1240 <iotools_fallback+0xd0>
mov    (%rbx),%rdi
mov    0x2da2(%rip),%rax
mov    (%rax),%esi
call   1070 <usage@plt>
mov    $0xffffffff,%eax
jmp    125f <iotools_fallback+0xef>
mov    (%rbx),%rdi
mov    0x2d82(%rip),%rax
mov    (%rax),%esi
call   1070 <usage@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1080 <make_command_links@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <clean_command_links@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1090 <list_commands@plt>
mov    (%rbx),%rdi
call   1060 <version@plt>
jmp    125d <iotools_fallback+0xed>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"--help\00"
@stdout = global i32 0
@.str.1 = [13 x i8] c"--make-links\00"
@.str.2 = [14 x i8] c"--clean-links\00"
@.str.3 = [12 x i8] c"--list-cmds\00"
@.str.4 = [3 x i8] c"-v\00"
@.str.5 = [10 x i8] c"--version\00"
@.str.6 = [43 x i8] c"'%s' sub-command not supported by iotools\0A\00"
define i32 @iotools_fallback(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = load i32, i32* @stderr
%13 = call i32 @usage(i8* %11, i32 %12)
store i32 -1, i32* %3
br label %78
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %26
20: ; preds = %14
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 0
%23 = load i8*, i8** %22
%24 = load i32, i32* @stdout
%25 = call i32 @usage(i8* %23, i32 %24)
store i32 0, i32* %3
br label %78
26: ; preds = %14
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %26
%33 = call i32 (...) @make_command_links()
store i32 %33, i32* %3
br label %78
34: ; preds = %26
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 1
%37 = load i8*, i8** %36
%38 = call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %34
%41 = call i32 (...) @clean_command_links()
store i32 %41, i32* %3
br label %78
42: ; preds = %34
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 1
%45 = load i8*, i8** %44
%46 = call i64 @strcmp(i8* %45, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %42
%49 = call i32 (...) @list_commands()
store i32 %49, i32* %3
br label %78
50: ; preds = %42
%51 = load i8**, i8*** %5
%52 = getelementptr inbounds i8*, i8** %51, i64 1
%53 = load i8*, i8** %52
%54 = call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %62, label %56
56: ; preds = %50
%57 = load i8**, i8*** %5
%58 = getelementptr inbounds i8*, i8** %57, i64 1
%59 = load i8*, i8** %58
%60 = call i64 @strcmp(i8* %59, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %67
62: ; preds = %56, %50
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i64 0
%65 = load i8*, i8** %64
%66 = call i32 @version(i8* %65)
store i32 0, i32* %3
br label %78
67: ; preds = %56
%68 = load i32, i32* @stderr
%69 = load i8**, i8*** %5
%70 = getelementptr inbounds i8*, i8** %69, i64 1
%71 = load i8*, i8** %70
%72 = call i32 @fprintf(i32 %68, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0), i8* %71)
%73 = load i8**, i8*** %5
%74 = getelementptr inbounds i8*, i8** %73, i64 0
%75 = load i8*, i8** %74
%76 = load i32, i32* @stderr
%77 = call i32 @usage(i8* %75, i32 %76)
store i32 -1, i32* %3
br label %78
78: ; preds = %67, %62, %48, %40, %32, %20, %8
%79 = load i32, i32* %3
ret i32 %79
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"--help\00"
@stdout = global i32 0
@.str.1 = [13 x i8] c"--make-links\00"
@.str.2 = [14 x i8] c"--clean-links\00"
@.str.3 = [12 x i8] c"--list-cmds\00"
@.str.4 = [3 x i8] c"-v\00"
@.str.5 = [10 x i8] c"--version\00"
@.str.6 = [43 x i8] c"'%s' sub-command not supported by iotools\0A\00"
define i32 @iotools_fallback(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @usage(i8* %5, i32 %6)
br label %53
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %8
%14 = load i8*, i8** %1
%15 = load i32, i32* @stdout
%16 = tail call i32 @usage(i8* %14, i32 %15)
br label %53
17: ; preds = %8
%18 = load i8*, i8** %9
%19 = tail call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = tail call i32 (...) @make_command_links()
br label %53
23: ; preds = %17
%24 = load i8*, i8** %9
%25 = tail call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = tail call i32 (...) @clean_command_links()
br label %53
29: ; preds = %23
%30 = load i8*, i8** %9
%31 = tail call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = tail call i32 (...) @list_commands()
br label %53
35: ; preds = %29
%36 = load i8*, i8** %9
%37 = tail call i64 @strcmp(i8* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %43, label %39
39: ; preds = %35
%40 = load i8*, i8** %9
%41 = tail call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %46
43: ; preds = %39, %35
%44 = load i8*, i8** %1
%45 = tail call i32 @version(i8* %44)
br label %53
46: ; preds = %39
%47 = load i32, i32* @stderr
%48 = load i8*, i8** %9
%49 = tail call i32 @fprintf(i32 %47, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0), i8* %48)
%50 = load i8*, i8** %1
%51 = load i32, i32* @stderr
%52 = tail call i32 @usage(i8* %50, i32 %51)
br label %53
53: ; preds = %46, %43, %33, %27, %21, %13, %4
%54 = phi i32 [ -1, %4 ], [ 0, %13 ], [ %22, %21 ], [ %28, %27 ], [ %34, %33 ], [ 0, %43 ], [ -1, %46 ]
ret i32 %54
}