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

/* Variables and functions */
int /*<<< orphan*/ command_add(char const *, char const *const *, char const *,
                               int);
int /*<<< orphan*/ command_create(char const *, char const *const *,
                                  char const *, int);
int /*<<< orphan*/ command_destroy(char const *, char const *const *,
                                   char const *, int);
int /*<<< orphan*/ command_dump(char const *, char const *const *, char const *,
                                int);
int /*<<< orphan*/ command_format(char const *, char const *const *,
                                  char const *, int);
int /*<<< orphan*/ command_help(char const *, char const *const *, char const *,
                                int);
int /*<<< orphan*/ command_next(char const *, char const *const *, char const *,
                                int);
int /*<<< orphan*/ command_scan(char const *, char const *const *, char const *,
                                int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *const);
int /*<<< orphan*/ stderr;
scalar_t__ strcasecmp(char const *const, char *);
int command(char const *progname, char const *const *argv, FILE *fp,
            char const *filename, int line) {
  if (strcasecmp(argv[0], "add") == 0)
    command_add(progname, argv, filename, line);
  else if (strcasecmp(argv[0], "create") == 0)
    command_create(progname, argv, filename, line);
  else if (strcasecmp(argv[0], "destroy") == 0)
    command_destroy(progname, argv, filename, line);
  else if (strcasecmp(argv[0], "dump") == 0)
    command_dump(progname, argv, filename, line);
  else if (strcasecmp(argv[0], "help") == 0)
    command_help(progname, argv, filename, line);
  else if (strcasecmp(argv[0], "next") == 0)
    command_next(progname, argv, filename, line);
  else if (strcasecmp(argv[0], "format") == 0)
    command_format(progname, argv, filename, line);
  else if (strcasecmp(argv[0], "scan") == 0)
    command_scan(progname, argv, filename, line);
  else if (strcasecmp(argv[0], "quit") == 0)
    return 1;
  else {
    fprintf(stderr,
            "%s:%d: unknown command \"%s\" -- "
            "try \"help\"?\n",
            filename, line, argv[0]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xe36(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    11f2 <command+0x52>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
call   1080 <command_add@plt>
jmp    13e0 <command+0x240>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xe04(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1228 <command+0x88>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
call   1070 <command_create@plt>
jmp    13db <command+0x23b>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xdd5(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    125e <command+0xbe>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
call   10a0 <command_destroy@plt>
jmp    13d6 <command+0x236>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xda7(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1294 <command+0xf4>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
call   1050 <command_dump@plt>
jmp    13d1 <command+0x231>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xd76(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    12ca <command+0x12a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
call   1040 <command_help@plt>
jmp    13cc <command+0x22c>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xd45(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1300 <command+0x160>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
call   1060 <command_next@plt>
jmp    13c7 <command+0x227>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xd14(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1336 <command+0x196>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
call   10b0 <command_format@plt>
jmp    13c2 <command+0x222>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xce5(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    136c <command+0x1cc>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
call   10c0 <command_scan@plt>
jmp    13bd <command+0x21d>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xcb4(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1395 <command+0x1f5>
movl   $0x1,-0x4(%rbp)
jmp    13e7 <command+0x247>
mov    0x2c44(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    (%rax),%r8
lea    0xc80(%rip),%rsi
call   1090 <fprintf@plt>
jmp    13bd <command+0x21d>
jmp    13c2 <command+0x222>
jmp    13c7 <command+0x227>
jmp    13cc <command+0x22c>
jmp    13d1 <command+0x231>
jmp    13d6 <command+0x236>
jmp    13db <command+0x23b>
jmp    13e0 <command+0x240>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<command>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %rcx,%r15
mov    %rsi,%rbp
mov    %rdi,%r12
mov    (%rsi),%rbx
lea    0xe42(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     12b2 <command+0x112>
lea    0xe2e(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     12c8 <command+0x128>
lea    0xe1d(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     12db <command+0x13b>
lea    0xe0d(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     12ee <command+0x14e>
lea    0xdfa(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1301 <command+0x161>
lea    0xde7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1314 <command+0x174>
lea    0xdd4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1327 <command+0x187>
lea    0xdc3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     133a <command+0x19a>
lea    0xdb0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1356 <command+0x1b6>
mov    0x2d4a(%rip),%rax
mov    (%rax),%edi
lea    0xd94(%rip),%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
mov    %rbx,%r8
call   1090 <fprintf@plt>
jmp    134b <command+0x1ab>
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1080 <command_add@plt>
jmp    134b <command+0x1ab>
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1070 <command_create@plt>
jmp    134b <command+0x1ab>
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   10a0 <command_destroy@plt>
jmp    134b <command+0x1ab>
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1050 <command_dump@plt>
jmp    134b <command+0x1ab>
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1040 <command_help@plt>
jmp    134b <command+0x1ab>
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1060 <command_next@plt>
jmp    134b <command+0x1ab>
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   10b0 <command_format@plt>
jmp    134b <command+0x1ab>
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   10c0 <command_scan@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%eax
jmp    134d <command+0x1ad>

LLVM IR (-O0):
@.str = [4 x i8] c"add\00"
@.str.1 = [7 x i8] c"create\00"
@.str.2 = [8 x i8] c"destroy\00"
@.str.3 = [5 x i8] c"dump\00"
@.str.4 = [5 x i8] c"help\00"
@.str.5 = [5 x i8] c"next\00"
@.str.6 = [7 x i8] c"format\00"
@.str.7 = [5 x i8] c"scan\00"
@.str.8 = [5 x i8] c"quit\00"
@stderr = global i32 0
@.str.9 = [44 x i8] c"%s:%d: unknown command \22%s\22 -- try \22help\22?\0A\00"
define i32 @command(i8* %0, i8** %1, i32* %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8**
%9 = alloca i32*
%10 = alloca i8*
%11 = alloca i32
store i8* %0, i8** %7
store i8** %1, i8*** %8
store i32* %2, i32** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
%12 = load i8**, i8*** %8
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i64 @strcasecmp(i8* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %23
17: ; preds = %5
%18 = load i8*, i8** %7
%19 = load i8**, i8*** %8
%20 = load i8*, i8** %10
%21 = load i32, i32* %11
%22 = call i32 @command_add(i8* %18, i8** %19, i8* %20, i32 %21)
br label %130
23: ; preds = %5
%24 = load i8**, i8*** %8
%25 = getelementptr inbounds i8*, i8** %24, i64 0
%26 = load i8*, i8** %25
%27 = call i64 @strcasecmp(i8* %26, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %35
29: ; preds = %23
%30 = load i8*, i8** %7
%31 = load i8**, i8*** %8
%32 = load i8*, i8** %10
%33 = load i32, i32* %11
%34 = call i32 @command_create(i8* %30, i8** %31, i8* %32, i32 %33)
br label %129
35: ; preds = %23
%36 = load i8**, i8*** %8
%37 = getelementptr inbounds i8*, i8** %36, i64 0
%38 = load i8*, i8** %37
%39 = call i64 @strcasecmp(i8* %38, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %47
41: ; preds = %35
%42 = load i8*, i8** %7
%43 = load i8**, i8*** %8
%44 = load i8*, i8** %10
%45 = load i32, i32* %11
%46 = call i32 @command_destroy(i8* %42, i8** %43, i8* %44, i32 %45)
br label %128
47: ; preds = %35
%48 = load i8**, i8*** %8
%49 = getelementptr inbounds i8*, i8** %48, i64 0
%50 = load i8*, i8** %49
%51 = call i64 @strcasecmp(i8* %50, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %59
53: ; preds = %47
%54 = load i8*, i8** %7
%55 = load i8**, i8*** %8
%56 = load i8*, i8** %10
%57 = load i32, i32* %11
%58 = call i32 @command_dump(i8* %54, i8** %55, i8* %56, i32 %57)
br label %127
59: ; preds = %47
%60 = load i8**, i8*** %8
%61 = getelementptr inbounds i8*, i8** %60, i64 0
%62 = load i8*, i8** %61
%63 = call i64 @strcasecmp(i8* %62, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%64 = icmp eq i64 %63, 0
br i1 %64, label %65, label %71
65: ; preds = %59
%66 = load i8*, i8** %7
%67 = load i8**, i8*** %8
%68 = load i8*, i8** %10
%69 = load i32, i32* %11
%70 = call i32 @command_help(i8* %66, i8** %67, i8* %68, i32 %69)
br label %126
71: ; preds = %59
%72 = load i8**, i8*** %8
%73 = getelementptr inbounds i8*, i8** %72, i64 0
%74 = load i8*, i8** %73
%75 = call i64 @strcasecmp(i8* %74, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%76 = icmp eq i64 %75, 0
br i1 %76, label %77, label %83
77: ; preds = %71
%78 = load i8*, i8** %7
%79 = load i8**, i8*** %8
%80 = load i8*, i8** %10
%81 = load i32, i32* %11
%82 = call i32 @command_next(i8* %78, i8** %79, i8* %80, i32 %81)
br label %125
83: ; preds = %71
%84 = load i8**, i8*** %8
%85 = getelementptr inbounds i8*, i8** %84, i64 0
%86 = load i8*, i8** %85
%87 = call i64 @strcasecmp(i8* %86, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%88 = icmp eq i64 %87, 0
br i1 %88, label %89, label %95
89: ; preds = %83
%90 = load i8*, i8** %7
%91 = load i8**, i8*** %8
%92 = load i8*, i8** %10
%93 = load i32, i32* %11
%94 = call i32 @command_format(i8* %90, i8** %91, i8* %92, i32 %93)
br label %124
95: ; preds = %83
%96 = load i8**, i8*** %8
%97 = getelementptr inbounds i8*, i8** %96, i64 0
%98 = load i8*, i8** %97
%99 = call i64 @strcasecmp(i8* %98, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%100 = icmp eq i64 %99, 0
br i1 %100, label %101, label %107
101: ; preds = %95
%102 = load i8*, i8** %7
%103 = load i8**, i8*** %8
%104 = load i8*, i8** %10
%105 = load i32, i32* %11
%106 = call i32 @command_scan(i8* %102, i8** %103, i8* %104, i32 %105)
br label %123
107: ; preds = %95
%108 = load i8**, i8*** %8
%109 = getelementptr inbounds i8*, i8** %108, i64 0
%110 = load i8*, i8** %109
%111 = call i64 @strcasecmp(i8* %110, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%112 = icmp eq i64 %111, 0
br i1 %112, label %113, label %114
113: ; preds = %107
store i32 1, i32* %6
br label %131
114: ; preds = %107
%115 = load i32, i32* @stderr
%116 = load i8*, i8** %10
%117 = load i32, i32* %11
%118 = load i8**, i8*** %8
%119 = getelementptr inbounds i8*, i8** %118, i64 0
%120 = load i8*, i8** %119
%121 = call i32 @fprintf(i32 %115, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.9, i64 0, i64 0), i8* %116, i32 %117, i8* %120)
br label %122
122: ; preds = %114
br label %123
123: ; preds = %122, %101
br label %124
124: ; preds = %123, %89
br label %125
125: ; preds = %124, %77
br label %126
126: ; preds = %125, %65
br label %127
127: ; preds = %126, %53
br label %128
128: ; preds = %127, %41
br label %129
129: ; preds = %128, %29
br label %130
130: ; preds = %129, %17
store i32 0, i32* %6
br label %131
131: ; preds = %130, %113
%132 = load i32, i32* %6
ret i32 %132
}

LLVM IR (-O2):
@.str = [4 x i8] c"add\00"
@.str.1 = [7 x i8] c"create\00"
@.str.2 = [8 x i8] c"destroy\00"
@.str.3 = [5 x i8] c"dump\00"
@.str.4 = [5 x i8] c"help\00"
@.str.5 = [5 x i8] c"next\00"
@.str.6 = [7 x i8] c"format\00"
@.str.7 = [5 x i8] c"scan\00"
@.str.8 = [5 x i8] c"quit\00"
@stderr = global i32 0
@.str.9 = [44 x i8] c"%s:%d: unknown command \22%s\22 -- try \22help\22?\0A\00"
define i32 @command(i8* %0, i8** %1, i32* nocapture readnone %2, i8* %3, i32 %4) {
%6 = load i8*, i8** %1
%7 = tail call i64 @strcasecmp(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i32 @command_add(i8* %0, i8** %1, i8* %3, i32 %4)
br label %52
11: ; preds = %5
%12 = tail call i64 @strcasecmp(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = tail call i32 @command_create(i8* %0, i8** %1, i8* %3, i32 %4)
br label %52
16: ; preds = %11
%17 = tail call i64 @strcasecmp(i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = tail call i32 @command_destroy(i8* %0, i8** %1, i8* %3, i32 %4)
br label %52
21: ; preds = %16
%22 = tail call i64 @strcasecmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = tail call i32 @command_dump(i8* %0, i8** %1, i8* %3, i32 %4)
br label %52
26: ; preds = %21
%27 = tail call i64 @strcasecmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = tail call i32 @command_help(i8* %0, i8** %1, i8* %3, i32 %4)
br label %52
31: ; preds = %26
%32 = tail call i64 @strcasecmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = tail call i32 @command_next(i8* %0, i8** %1, i8* %3, i32 %4)
br label %52
36: ; preds = %31
%37 = tail call i64 @strcasecmp(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = tail call i32 @command_format(i8* %0, i8** %1, i8* %3, i32 %4)
br label %52
41: ; preds = %36
%42 = tail call i64 @strcasecmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = tail call i32 @command_scan(i8* %0, i8** %1, i8* %3, i32 %4)
br label %52
46: ; preds = %41
%47 = tail call i64 @strcasecmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %52, label %49
49: ; preds = %46
%50 = load i32, i32* @stderr
%51 = tail call i32 @fprintf(i32 %50, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.9, i64 0, i64 0), i8* %3, i32 %4, i8* %6)
br label %52
52: ; preds = %9, %19, %29, %39, %49, %44, %34, %24, %14, %46
%53 = phi i32 [ 1, %46 ], [ 0, %14 ], [ 0, %24 ], [ 0, %34 ], [ 0, %44 ], [ 0, %49 ], [ 0, %39 ], [ 0, %29 ], [ 0, %19 ], [ 0, %9 ]
ret i32 %53
}