#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 back_bone(int, char **);
int back_list(int, char **);
int back_pack(int, char **);
int back_spin(int, char **);
int back_stamp(int, char **);
int back_track(int, char **);
int back_up(int, char **);
int back_wash(int, char **);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  char *subcommand = "up";
  if (argc > 1) {
    subcommand = argv[1];
  }
  argc -= 2;
  if (argc != 0) {
    argv = &argv[2];
  }
  int result = -1;
  if (strcmp(subcommand, "up") == 0) {
    result = back_up(argc, argv);
  } else if (strcmp(subcommand, "bone") == 0) {
    result = back_bone(argc, argv);
  } else if (strcmp(subcommand, "list") == 0) {
    result = back_list(argc, argv);
  } else if (strcmp(subcommand, "pack") == 0) {
    result = back_pack(argc, argv);
  } else if (strcmp(subcommand, "wash") == 0) {
    result = back_wash(argc, argv);
  } else if (strcmp(subcommand, "spin") == 0) {
    result = back_spin(argc, argv);
  } else if (strcmp(subcommand, "track") == 0) {
    result = back_track(argc, argv);
  } else if (strcmp(subcommand, "stamp") == 0) {
    result = back_stamp(argc, argv);
  } else {
    fprintf(stderr,
            "[BACK] "
            "error"
            ": "
            "unknown subcommand '%s'"
            "\n",
            subcommand);
    result = -1;
  }
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe43(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    11d7 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     11f6 <main+0x56>
mov    -0x10(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x10(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xdf8(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    122b <main+0x8b>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1080 <back_up@plt>
mov    %eax,-0x1c(%rbp)
jmp    13b0 <main+0x210>
mov    -0x18(%rbp),%rdi
lea    0xdcd(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1259 <main+0xb9>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1090 <back_bone@plt>
mov    %eax,-0x1c(%rbp)
jmp    13ab <main+0x20b>
mov    -0x18(%rbp),%rdi
lea    0xda4(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1287 <main+0xe7>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <back_list@plt>
mov    %eax,-0x1c(%rbp)
jmp    13a6 <main+0x206>
mov    -0x18(%rbp),%rdi
lea    0xd7b(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    12b5 <main+0x115>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10c0 <back_pack@plt>
mov    %eax,-0x1c(%rbp)
jmp    13a1 <main+0x201>
mov    -0x18(%rbp),%rdi
lea    0xd52(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    12e3 <main+0x143>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10b0 <back_wash@plt>
mov    %eax,-0x1c(%rbp)
jmp    139c <main+0x1fc>
mov    -0x18(%rbp),%rdi
lea    0xd29(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1311 <main+0x171>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <back_spin@plt>
mov    %eax,-0x1c(%rbp)
jmp    1397 <main+0x1f7>
mov    -0x18(%rbp),%rdi
lea    0xd00(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    133f <main+0x19f>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <back_track@plt>
mov    %eax,-0x1c(%rbp)
jmp    1392 <main+0x1f2>
mov    -0x18(%rbp),%rdi
lea    0xcd8(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    136d <main+0x1cd>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10a0 <back_stamp@plt>
mov    %eax,-0x1c(%rbp)
jmp    138d <main+0x1ed>
mov    0x2c6c(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xca7(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x1c(%rbp)
jmp    1392 <main+0x1f2>
jmp    1397 <main+0x1f7>
jmp    139c <main+0x1fc>
jmp    13a1 <main+0x201>
jmp    13a6 <main+0x206>
jmp    13ab <main+0x20b>
jmp    13b0 <main+0x210>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
cmp    $0x2,%edi
jl     11b4 <main+0x14>
mov    0x8(%rbx),%r14
jmp    11bb <main+0x1b>
lea    0xe45(%rip),%r14
xor    %eax,%eax
add    $0xfffffffe,%ebp
setne  %al
shl    $0x4,%rax
add    %rax,%rbx
lea    0xe2f(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     12ac <main+0x10c>
lea    0xe1a(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     12ba <main+0x11a>
lea    0xe07(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     12c8 <main+0x128>
lea    0xdf4(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     12d6 <main+0x136>
lea    0xde1(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     12e4 <main+0x144>
lea    0xdce(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     12f2 <main+0x152>
lea    0xdbb(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1300 <main+0x160>
lea    0xda9(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     130e <main+0x16e>
mov    0x2d4f(%rip),%rax
mov    (%rax),%edi
lea    0xd8e(%rip),%rsi
mov    %r14,%rdx
call   1070 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %ebp,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1080 <back_up@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1090 <back_bone@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <back_list@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    10c0 <back_pack@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    10b0 <back_wash@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <back_spin@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <back_track@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    10a0 <back_stamp@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"up\00"
@.str.1 = [5 x i8] c"bone\00"
@.str.2 = [5 x i8] c"list\00"
@.str.3 = [5 x i8] c"pack\00"
@.str.4 = [5 x i8] c"wash\00"
@.str.5 = [5 x i8] c"spin\00"
@.str.6 = [6 x i8] c"track\00"
@.str.7 = [6 x i8] c"stamp\00"
@stderr = global i32 0
@.str.8 = [39 x i8] c"[BACK] error: unknown subcommand '%s'\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %6
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
store i8* %13, i8** %6
br label %14
14: ; preds = %10, %2
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 2
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %14
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 2
store i8** %21, i8*** %5
br label %22
22: ; preds = %19, %14
store i32 -1, i32* %7
%23 = load i8*, i8** %6
%24 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %22
%27 = load i32, i32* %4
%28 = load i8**, i8*** %5
%29 = call i32 @back_up(i32 %27, i8** %28)
store i32 %29, i32* %7
br label %97
30: ; preds = %22
%31 = load i8*, i8** %6
%32 = call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %38
34: ; preds = %30
%35 = load i32, i32* %4
%36 = load i8**, i8*** %5
%37 = call i32 @back_bone(i32 %35, i8** %36)
store i32 %37, i32* %7
br label %96
38: ; preds = %30
%39 = load i8*, i8** %6
%40 = call i64 @strcmp(i8* %39, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %46
42: ; preds = %38
%43 = load i32, i32* %4
%44 = load i8**, i8*** %5
%45 = call i32 @back_list(i32 %43, i8** %44)
store i32 %45, i32* %7
br label %95
46: ; preds = %38
%47 = load i8*, i8** %6
%48 = call i64 @strcmp(i8* %47, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %54
50: ; preds = %46
%51 = load i32, i32* %4
%52 = load i8**, i8*** %5
%53 = call i32 @back_pack(i32 %51, i8** %52)
store i32 %53, i32* %7
br label %94
54: ; preds = %46
%55 = load i8*, i8** %6
%56 = call i64 @strcmp(i8* %55, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%57 = icmp eq i64 %56, 0
br i1 %57, label %58, label %62
58: ; preds = %54
%59 = load i32, i32* %4
%60 = load i8**, i8*** %5
%61 = call i32 @back_wash(i32 %59, i8** %60)
store i32 %61, i32* %7
br label %93
62: ; preds = %54
%63 = load i8*, i8** %6
%64 = call i64 @strcmp(i8* %63, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %70
66: ; preds = %62
%67 = load i32, i32* %4
%68 = load i8**, i8*** %5
%69 = call i32 @back_spin(i32 %67, i8** %68)
store i32 %69, i32* %7
br label %92
70: ; preds = %62
%71 = load i8*, i8** %6
%72 = call i64 @strcmp(i8* %71, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%73 = icmp eq i64 %72, 0
br i1 %73, label %74, label %78
74: ; preds = %70
%75 = load i32, i32* %4
%76 = load i8**, i8*** %5
%77 = call i32 @back_track(i32 %75, i8** %76)
store i32 %77, i32* %7
br label %91
78: ; preds = %70
%79 = load i8*, i8** %6
%80 = call i64 @strcmp(i8* %79, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%81 = icmp eq i64 %80, 0
br i1 %81, label %82, label %86
82: ; preds = %78
%83 = load i32, i32* %4
%84 = load i8**, i8*** %5
%85 = call i32 @back_stamp(i32 %83, i8** %84)
store i32 %85, i32* %7
br label %90
86: ; preds = %78
%87 = load i32, i32* @stderr
%88 = load i8*, i8** %6
%89 = call i32 @fprintf(i32 %87, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.8, i64 0, i64 0), i8* %88)
store i32 -1, i32* %7
br label %90
90: ; preds = %86, %82
br label %91
91: ; preds = %90, %74
br label %92
92: ; preds = %91, %66
br label %93
93: ; preds = %92, %58
br label %94
94: ; preds = %93, %50
br label %95
95: ; preds = %94, %42
br label %96
96: ; preds = %95, %34
br label %97
97: ; preds = %96, %26
%98 = load i32, i32* %7
ret i32 %98
}

LLVM IR (-O2):
@.str = [3 x i8] c"up\00"
@.str.1 = [5 x i8] c"bone\00"
@.str.2 = [5 x i8] c"list\00"
@.str.3 = [5 x i8] c"pack\00"
@.str.4 = [5 x i8] c"wash\00"
@.str.5 = [5 x i8] c"spin\00"
@.str.6 = [6 x i8] c"track\00"
@.str.7 = [6 x i8] c"stamp\00"
@stderr = global i32 0
@.str.8 = [39 x i8] c"[BACK] error: unknown subcommand '%s'\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
br label %7
7: ; preds = %4, %2
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %2 ]
%9 = add nsw i32 %0, -2
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i64 0, i64 2
%12 = getelementptr i8*, i8** %1, i64 %11
%13 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %7
%16 = tail call i32 @back_up(i32 %9, i8** %12)
br label %55
17: ; preds = %7
%18 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = tail call i32 @back_bone(i32 %9, i8** %12)
br label %55
22: ; preds = %17
%23 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = tail call i32 @back_list(i32 %9, i8** %12)
br label %55
27: ; preds = %22
%28 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = tail call i32 @back_pack(i32 %9, i8** %12)
br label %55
32: ; preds = %27
%33 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %32
%36 = tail call i32 @back_wash(i32 %9, i8** %12)
br label %55
37: ; preds = %32
%38 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = tail call i32 @back_spin(i32 %9, i8** %12)
br label %55
42: ; preds = %37
%43 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = tail call i32 @back_track(i32 %9, i8** %12)
br label %55
47: ; preds = %42
%48 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %52
50: ; preds = %47
%51 = tail call i32 @back_stamp(i32 %9, i8** %12)
br label %55
52: ; preds = %47
%53 = load i32, i32* @stderr
%54 = tail call i32 @fprintf(i32 %53, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.8, i64 0, i64 0), i8* %8)
br label %55
55: ; preds = %20, %30, %40, %50, %52, %45, %35, %25, %15
%56 = phi i32 [ %16, %15 ], [ %21, %20 ], [ %26, %25 ], [ %31, %30 ], [ %36, %35 ], [ %41, %40 ], [ %46, %45 ], [ %51, %50 ], [ -1, %52 ]
ret i32 %56
}