#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*/ printf(char *, char const *const);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strcasecmp(char const *const, char *);
void command_help(char const *progname, char const *const *argv,
                  char const *filename, int line) {
  if (argv[1]) {
    if (!strcasecmp(argv[1], "flat"))
      puts(
          "FLAT is a very simple single piece of storage that can be read and\n"
          "written as a whole.  It never changes its size.\n"
          "Commands:\n"
          "    flat open [path] [data]    -- open or create the database in "
          "<path>;\n"
          "                                  if new, fill it with <data> "
          "(default:\n"
          "                                  \"Hello, World!\")\n"
          "    flat close                 -- close the currently open "
          "database\n"
          "    flat remove [path]         -- remove the database file <path>\n"
          "    flat write [data]	        -- write <data> into the flat "
          "database\n"
          "    flat read [N]              -- read data (and dump N bytes)\n");
    else if (!strcasecmp(argv[1], "help"))
      puts("To get more detailed help on a subject, type \"help <subject>\".\n"
           "Subjects are:\n"
           "    help   -- you're reading it\n"
           "    flat   -- flat database commands\n"
           "    istore -- indexed database commands\n"
           "    gmap   -- map database commands\n"
           "    time   -- monitoring execution time\n");
    else if (!strcasecmp(argv[1], "istore"))
      puts(
          "ISTORE is an indexed table of fixed- but variable-sized "
          "structures.\n"
          "Commands:\n"
          "    istore open [path]         -- open or create the database in "
          "<path>\n"
          "    istore close               -- close the currently open "
          "database\n"
          "    istore remove [path]       -- rm -rf the database files\n"
          "    istore write [[N] size]    -- create 1 (or <N>) objects of size "
          "<size>\n"
          "    istore read N [size]       -- access object #n (and print "
          "<size> bytes)\n"
          "    istore next-id             -- print the next ID that would be "
          "allocated\n");
    else if (!strcasecmp(argv[1], "gmap"))
      puts(
          "GMAP maps indices to sets of indices.\n"
          "Commands:\n"
          "    gmap open [path]           -- open or create the database in "
          "<path>\n"
          "    gmap close                 -- close the currently open "
          "database\n"
          "    gmap remove [path]         -- rm -rf the database files\n"
          "    gmap add N M               -- add <M> to the index set for <N>\n"
          "    gmap read N                -- print the index set for <N>\n");
    else if (!strcasecmp(argv[1], "time"))
      puts("A special \"time\" flag, if set, causes command execution times\n"
           "to be printed along with the results.  It can be set "
           "interactively,\n"
           "or from the addb command line with -t.\n"
           "Commands:\n"
           "    time                       -- print whether timing is on or "
           "off\n"
           "    time now                   -- print current time\n"
           "    time on                    -- start printing execution times\n"
           "    time off                   -- stop printing execution times\n");
    else if (!strcasecmp(argv[1], "quit"))
      puts("Quit.  It quits.\n");
    else {
      printf("Sorry, no help on \"%s\"\n", argv[1]);
      puts("Available: flat help istore time");
      return;
    }
    return;
  }
  puts(
      "Addb is a test client for libaddb.a, the attention deficit datab--OOH, "
      "SHINY!\n"
      "For help on a command, use \"help command\".  Quickreference:\n"
      "    help [command]       flat open [path [data]]    istore open [path]\n"
      "    quit                 flat close                 istore close\n"
      "    time                 flat remove [path]         istore remove "
      "[path]\n"
      "    time [on / off]      flat read [nbytes]         istore read N "
      "[nbytes]\n"
      "    time now             flat write data            istore write [[N] "
      "size]\n");
}


x86 assembly (clang, -O0):
<command_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     12ad <command_help+0x17d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe9b(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1184 <command_help+0x54>
lea    0xe8b(%rip),%rdi
call   1040 <puts@plt>
jmp    12a8 <command_help+0x178>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0x10be(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11b2 <command_help+0x82>
lea    0x10ae(%rip),%rdi
call   1040 <puts@plt>
jmp    12a3 <command_help+0x173>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0x119c(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11e0 <command_help+0xb0>
lea    0x118e(%rip),%rdi
call   1040 <puts@plt>
jmp    129e <command_help+0x16e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0x136f(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    120e <command_help+0xde>
lea    0x135f(%rip),%rdi
call   1040 <puts@plt>
jmp    1299 <command_help+0x169>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0x16b9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    123c <command_help+0x10c>
lea    0x14ab(%rip),%rdi
call   1040 <puts@plt>
jmp    1294 <command_help+0x164>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0x1640(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    126a <command_help+0x13a>
lea    0x1630(%rip),%rdi
call   1040 <puts@plt>
jmp    128f <command_help+0x15f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0x1629(%rip),%rdi
call   1050 <printf@plt>
lea    0x1635(%rip),%rdi
call   1040 <puts@plt>
jmp    12b9 <command_help+0x189>
jmp    1294 <command_help+0x164>
jmp    1299 <command_help+0x169>
jmp    129e <command_help+0x16e>
jmp    12a3 <command_help+0x173>
jmp    12a8 <command_help+0x178>
jmp    12b9 <command_help+0x189>
lea    0x1627(%rip),%rdi
call   1040 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<command_help>:
push   %rbx
mov    0x8(%rsi),%rbx
test   %rbx,%rbx
je     11d4 <command_help+0xa4>
lea    0xebb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11e1 <command_help+0xb1>
lea    0x10f5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11ee <command_help+0xbe>
lea    0x11ea(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     11fb <command_help+0xcb>
lea    0x13d8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1208 <command_help+0xd8>
lea    0x173d(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1215 <command_help+0xe5>
lea    0x16df(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1222 <command_help+0xf2>
lea    0x16e3(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
lea    0x16ec(%rip),%rdi
pop    %rbx
jmp    1040 <puts@plt>
lea    0x1700(%rip),%rdi
pop    %rbx
jmp    1040 <puts@plt>
lea    0xe1d(%rip),%rdi
pop    %rbx
jmp    1040 <puts@plt>
lea    0x1061(%rip),%rdi
pop    %rbx
jmp    1040 <puts@plt>
lea    0x1162(%rip),%rdi
pop    %rbx
jmp    1040 <puts@plt>
lea    0x1354(%rip),%rdi
pop    %rbx
jmp    1040 <puts@plt>
lea    0x14c1(%rip),%rdi
pop    %rbx
jmp    1040 <puts@plt>
lea    0x1667(%rip),%rdi
pop    %rbx
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"flat\00"
@.str.1 = [588 x i8] c"FLAT is a very simple single piece of storage that can be read and\0Awritten as a whole. It never changes its size.\0ACommands:\0A flat open [path] [data] -- open or create the database in <path>;\0A if new, fill it with <data> (default:\0A \22Hello, World!\22)\0A flat close -- close the currently open database\0A flat remove [path] -- remove the database file <path>\0A flat write [data]\09 -- write <data> into the flat database\0A flat read [N] -- read data (and dump N bytes)\0A\00"
@.str.2 = [5 x i8] c"help\00"
@.str.3 = [263 x i8] c"To get more detailed help on a subject, type \22help <subject>\22.\0ASubjects are:\0A help -- you're reading it\0A flat -- flat database commands\0A istore -- indexed database commands\0A gmap -- map database commands\0A time -- monitoring execution time\0A\00"
@.str.4 = [7 x i8] c"istore\00"
@.str.5 = [506 x i8] c"ISTORE is an indexed table of fixed- but variable-sized structures.\0ACommands:\0A istore open [path] -- open or create the database in <path>\0A istore close -- close the currently open database\0A istore remove [path] -- rm -rf the database files\0A istore write [[N] size] -- create 1 (or <N>) objects of size <size>\0A istore read N [size] -- access object #n (and print <size> bytes)\0A istore next-id -- print the next ID that would be allocated\0A\00"
@.str.6 = [5 x i8] c"gmap\00"
@.str.7 = [378 x i8] c"GMAP maps indices to sets of indices.\0ACommands:\0A gmap open [path] -- open or create the database in <path>\0A gmap close -- close the currently open database\0A gmap remove [path] -- rm -rf the database files\0A gmap add N M -- add <M> to the index set for <N>\0A gmap read N -- print the index set for <N>\0A\00"
@.str.8 = [5 x i8] c"time\00"
@.str.9 = [430 x i8] c"A special \22time\22 flag, if set, causes command execution times\0Ato be printed along with the results. It can be set interactively,\0Aor from the addb command line with -t.\0ACommands:\0A time -- print whether timing is on or off\0A time now -- print current time\0A time on -- start printing execution times\0A time off -- stop printing execution times\0A\00"
@.str.10 = [5 x i8] c"quit\00"
@.str.11 = [18 x i8] c"Quit. It quits.\0A\00"
@.str.12 = [24 x i8] c"Sorry, no help on \22%s\22\0A\00"
@.str.13 = [33 x i8] c"Available: flat help istore time\00"
@.str.14 = [499 x i8] c"Addb is a test client for libaddb.a, the attention deficit datab--OOH, SHINY!\0AFor help on a command, use \22help command\22. Quickreference:\0A help [command] flat open [path [data]] istore open [path]\0A quit flat close istore close\0A time flat remove [path] istore remove [path]\0A time [on / off] flat read [nbytes] istore read N [nbytes]\0A time now flat write data istore write [[N] size]\0A\00"
define void @command_help(i8* %0, i8** %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8**, i8*** %6
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %73
13: ; preds = %4
%14 = load i8**, i8*** %6
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @strcasecmp(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%18 = icmp ne i32 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %13
%20 = call i32 @puts(i8* getelementptr inbounds ([588 x i8], [588 x i8]* @.str.1, i64 0, i64 0))
br label %72
21: ; preds = %13
%22 = load i8**, i8*** %6
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i32 @strcasecmp(i8* %24, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%26 = icmp ne i32 %25, 0
br i1 %26, label %29, label %27
27: ; preds = %21
%28 = call i32 @puts(i8* getelementptr inbounds ([263 x i8], [263 x i8]* @.str.3, i64 0, i64 0))
br label %71
29: ; preds = %21
%30 = load i8**, i8*** %6
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i32 @strcasecmp(i8* %32, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%34 = icmp ne i32 %33, 0
br i1 %34, label %37, label %35
35: ; preds = %29
%36 = call i32 @puts(i8* getelementptr inbounds ([506 x i8], [506 x i8]* @.str.5, i64 0, i64 0))
br label %70
37: ; preds = %29
%38 = load i8**, i8*** %6
%39 = getelementptr inbounds i8*, i8** %38, i64 1
%40 = load i8*, i8** %39
%41 = call i32 @strcasecmp(i8* %40, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%42 = icmp ne i32 %41, 0
br i1 %42, label %45, label %43
43: ; preds = %37
%44 = call i32 @puts(i8* getelementptr inbounds ([378 x i8], [378 x i8]* @.str.7, i64 0, i64 0))
br label %69
45: ; preds = %37
%46 = load i8**, i8*** %6
%47 = getelementptr inbounds i8*, i8** %46, i64 1
%48 = load i8*, i8** %47
%49 = call i32 @strcasecmp(i8* %48, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%50 = icmp ne i32 %49, 0
br i1 %50, label %53, label %51
51: ; preds = %45
%52 = call i32 @puts(i8* getelementptr inbounds ([430 x i8], [430 x i8]* @.str.9, i64 0, i64 0))
br label %68
53: ; preds = %45
%54 = load i8**, i8*** %6
%55 = getelementptr inbounds i8*, i8** %54, i64 1
%56 = load i8*, i8** %55
%57 = call i32 @strcasecmp(i8* %56, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%58 = icmp ne i32 %57, 0
br i1 %58, label %61, label %59
59: ; preds = %53
%60 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0))
br label %67
61: ; preds = %53
%62 = load i8**, i8*** %6
%63 = getelementptr inbounds i8*, i8** %62, i64 1
%64 = load i8*, i8** %63
%65 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), i8* %64)
%66 = call i32 @puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.13, i64 0, i64 0))
br label %75
67: ; preds = %59
br label %68
68: ; preds = %67, %51
br label %69
69: ; preds = %68, %43
br label %70
70: ; preds = %69, %35
br label %71
71: ; preds = %70, %27
br label %72
72: ; preds = %71, %19
br label %75
73: ; preds = %4
%74 = call i32 @puts(i8* getelementptr inbounds ([499 x i8], [499 x i8]* @.str.14, i64 0, i64 0))
br label %75
75: ; preds = %73, %72, %61
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"flat\00"
@.str.1 = [588 x i8] c"FLAT is a very simple single piece of storage that can be read and\0Awritten as a whole. It never changes its size.\0ACommands:\0A flat open [path] [data] -- open or create the database in <path>;\0A if new, fill it with <data> (default:\0A \22Hello, World!\22)\0A flat close -- close the currently open database\0A flat remove [path] -- remove the database file <path>\0A flat write [data]\09 -- write <data> into the flat database\0A flat read [N] -- read data (and dump N bytes)\0A\00"
@.str.2 = [5 x i8] c"help\00"
@.str.3 = [263 x i8] c"To get more detailed help on a subject, type \22help <subject>\22.\0ASubjects are:\0A help -- you're reading it\0A flat -- flat database commands\0A istore -- indexed database commands\0A gmap -- map database commands\0A time -- monitoring execution time\0A\00"
@.str.4 = [7 x i8] c"istore\00"
@.str.5 = [506 x i8] c"ISTORE is an indexed table of fixed- but variable-sized structures.\0ACommands:\0A istore open [path] -- open or create the database in <path>\0A istore close -- close the currently open database\0A istore remove [path] -- rm -rf the database files\0A istore write [[N] size] -- create 1 (or <N>) objects of size <size>\0A istore read N [size] -- access object #n (and print <size> bytes)\0A istore next-id -- print the next ID that would be allocated\0A\00"
@.str.6 = [5 x i8] c"gmap\00"
@.str.7 = [378 x i8] c"GMAP maps indices to sets of indices.\0ACommands:\0A gmap open [path] -- open or create the database in <path>\0A gmap close -- close the currently open database\0A gmap remove [path] -- rm -rf the database files\0A gmap add N M -- add <M> to the index set for <N>\0A gmap read N -- print the index set for <N>\0A\00"
@.str.8 = [5 x i8] c"time\00"
@.str.9 = [430 x i8] c"A special \22time\22 flag, if set, causes command execution times\0Ato be printed along with the results. It can be set interactively,\0Aor from the addb command line with -t.\0ACommands:\0A time -- print whether timing is on or off\0A time now -- print current time\0A time on -- start printing execution times\0A time off -- stop printing execution times\0A\00"
@.str.10 = [5 x i8] c"quit\00"
@.str.11 = [18 x i8] c"Quit. It quits.\0A\00"
@.str.12 = [24 x i8] c"Sorry, no help on \22%s\22\0A\00"
@.str.13 = [33 x i8] c"Available: flat help istore time\00"
@.str.14 = [499 x i8] c"Addb is a test client for libaddb.a, the attention deficit datab--OOH, SHINY!\0AFor help on a command, use \22help command\22. Quickreference:\0A help [command] flat open [path [data]] istore open [path]\0A quit flat close istore close\0A time flat remove [path] istore remove [path]\0A time [on / off] flat read [nbytes] istore read N [nbytes]\0A time now flat write data istore write [[N] size]\0A\00"
define void @command_help(i8* nocapture readnone %0, i8** nocapture %1, i8* nocapture readnone %2, i32 %3) {
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
br i1 %7, label %28, label %8
8: ; preds = %4
%9 = tail call i32 @strcasecmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
br i1 %10, label %28, label %11
11: ; preds = %8
%12 = tail call i32 @strcasecmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %28, label %14
14: ; preds = %11
%15 = tail call i32 @strcasecmp(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%16 = icmp eq i32 %15, 0
br i1 %16, label %28, label %17
17: ; preds = %14
%18 = tail call i32 @strcasecmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%19 = icmp eq i32 %18, 0
br i1 %19, label %28, label %20
20: ; preds = %17
%21 = tail call i32 @strcasecmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%22 = icmp eq i32 %21, 0
br i1 %22, label %28, label %23
23: ; preds = %20
%24 = tail call i32 @strcasecmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%25 = icmp eq i32 %24, 0
br i1 %25, label %28, label %26
26: ; preds = %23
%27 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), i8* %6)
br label %28
28: ; preds = %4, %23, %20, %17, %14, %11, %8, %26
%29 = phi i8* [ getelementptr inbounds ([33 x i8], [33 x i8]* @.str.13, i64 0, i64 0), %26 ], [ getelementptr inbounds ([588 x i8], [588 x i8]* @.str.1, i64 0, i64 0), %8 ], [ getelementptr inbounds ([263 x i8], [263 x i8]* @.str.3, i64 0, i64 0), %11 ], [ getelementptr inbounds ([506 x i8], [506 x i8]* @.str.5, i64 0, i64 0), %14 ], [ getelementptr inbounds ([378 x i8], [378 x i8]* @.str.7, i64 0, i64 0), %17 ], [ getelementptr inbounds ([430 x i8], [430 x i8]* @.str.9, i64 0, i64 0), %20 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), %23 ], [ getelementptr inbounds ([499 x i8], [499 x i8]* @.str.14, i64 0, i64 0), %4 ]
%30 = tail call i32 @puts(i8* dereferenceable(1) %29)
ret void
}