#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_flat(char const *, char const *const *, char const *,
                                int);
int /*<<< orphan*/ command_gmap(char const *, char const *const *, char const *,
                                int);
int /*<<< orphan*/ command_help(char const *, char const *const *, char const *,
                                int);
int /*<<< orphan*/ command_istore(char const *, char const *const *,
                                  char const *, int);
int /*<<< orphan*/ command_time(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], "istore") == 0)
    command_istore(progname, argv, filename, line);
  else if (strcasecmp(argv[0], "flat") == 0)
    command_flat(progname, argv, filename, line);
  else if (strcasecmp(argv[0], "gmap") == 0)
    command_gmap(progname, argv, filename, line);
  else if (strcasecmp(argv[0], "help") == 0)
    command_help(progname, argv, filename, line);
  else if (strcasecmp(argv[0], "time") == 0)
    command_time(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    0xe66(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    11c2 <command+0x52>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
call   1080 <command_istore@plt>
jmp    12ff <command+0x18f>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xe37(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    11f8 <command+0x88>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
call   1050 <command_flat@plt>
jmp    12fa <command+0x18a>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xe06(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    122e <command+0xbe>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
call   1040 <command_gmap@plt>
jmp    12f5 <command+0x185>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xdd5(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1264 <command+0xf4>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
call   1060 <command_help@plt>
jmp    12f0 <command+0x180>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xda4(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    129a <command+0x12a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
call   1090 <command_time@plt>
jmp    12eb <command+0x17b>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xd73(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    12c3 <command+0x153>
movl   $0x1,-0x4(%rbp)
jmp    1306 <command+0x196>
mov    0x2d16(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    (%rax),%r8
lea    0xd3f(%rip),%rsi
call   1070 <fprintf@plt>
jmp    12eb <command+0x17b>
jmp    12f0 <command+0x180>
jmp    12f5 <command+0x185>
jmp    12fa <command+0x18a>
jmp    12ff <command+0x18f>
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,%rbx
mov    %rdi,%r12
mov    (%rsi),%rbp
lea    0xe72(%rip),%rsi
mov    %rbp,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1237 <command+0xc7>
lea    0xe61(%rip),%rsi
mov    %rbp,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     124a <command+0xda>
lea    0xe4e(%rip),%rsi
mov    %rbp,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     125d <command+0xed>
lea    0xe3b(%rip),%rsi
mov    %rbp,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1270 <command+0x100>
lea    0xe28(%rip),%rsi
mov    %rbp,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1283 <command+0x113>
lea    0xe15(%rip),%rsi
mov    %rbp,%rdi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     129f <command+0x12f>
mov    0x2dc2(%rip),%rax
mov    (%rax),%edi
lea    0xdf9(%rip),%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
mov    %rbp,%r8
call   1070 <fprintf@plt>
jmp    1294 <command+0x124>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1080 <command_istore@plt>
jmp    1294 <command+0x124>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1050 <command_flat@plt>
jmp    1294 <command+0x124>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1040 <command_gmap@plt>
jmp    1294 <command+0x124>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1060 <command_help@plt>
jmp    1294 <command+0x124>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1090 <command_time@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%eax
jmp    1296 <command+0x126>

LLVM IR (-O0):
@.str = [7 x i8] c"istore\00"
@.str.1 = [5 x i8] c"flat\00"
@.str.2 = [5 x i8] c"gmap\00"
@.str.3 = [5 x i8] c"help\00"
@.str.4 = [5 x i8] c"time\00"
@.str.5 = [5 x i8] c"quit\00"
@stderr = global i32 0
@.str.6 = [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 ([7 x i8], [7 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_istore(i8* %18, i8** %19, i8* %20, i32 %21)
br label %91
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 ([5 x i8], [5 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_flat(i8* %30, i8** %31, i8* %32, i32 %33)
br label %90
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 ([5 x i8], [5 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_gmap(i8* %42, i8** %43, i8* %44, i32 %45)
br label %89
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_help(i8* %54, i8** %55, i8* %56, i32 %57)
br label %88
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_time(i8* %66, i8** %67, i8* %68, i32 %69)
br label %87
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 %78
77: ; preds = %71
store i32 1, i32* %6
br label %92
78: ; preds = %71
%79 = load i32, i32* @stderr
%80 = load i8*, i8** %10
%81 = load i32, i32* %11
%82 = load i8**, i8*** %8
%83 = getelementptr inbounds i8*, i8** %82, i64 0
%84 = load i8*, i8** %83
%85 = call i32 @fprintf(i32 %79, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0), i8* %80, i32 %81, i8* %84)
br label %86
86: ; preds = %78
br label %87
87: ; preds = %86, %65
br label %88
88: ; preds = %87, %53
br label %89
89: ; preds = %88, %41
br label %90
90: ; preds = %89, %29
br label %91
91: ; preds = %90, %17
store i32 0, i32* %6
br label %92
92: ; preds = %91, %77
%93 = load i32, i32* %6
ret i32 %93
}

LLVM IR (-O2):
@.str = [7 x i8] c"istore\00"
@.str.1 = [5 x i8] c"flat\00"
@.str.2 = [5 x i8] c"gmap\00"
@.str.3 = [5 x i8] c"help\00"
@.str.4 = [5 x i8] c"time\00"
@.str.5 = [5 x i8] c"quit\00"
@stderr = global i32 0
@.str.6 = [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 ([7 x i8], [7 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_istore(i8* %0, i8** %1, i8* %3, i32 %4)
br label %37
11: ; preds = %5
%12 = tail call i64 @strcasecmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 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_flat(i8* %0, i8** %1, i8* %3, i32 %4)
br label %37
16: ; preds = %11
%17 = tail call i64 @strcasecmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 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_gmap(i8* %0, i8** %1, i8* %3, i32 %4)
br label %37
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_help(i8* %0, i8** %1, i8* %3, i32 %4)
br label %37
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_time(i8* %0, i8** %1, i8* %3, i32 %4)
br label %37
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 %37, label %34
34: ; preds = %31
%35 = load i32, i32* @stderr
%36 = tail call i32 @fprintf(i32 %35, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0), i8* %3, i32 %4, i8* %6)
br label %37
37: ; preds = %9, %19, %29, %34, %24, %14, %31
%38 = phi i32 [ 1, %31 ], [ 0, %14 ], [ 0, %24 ], [ 0, %34 ], [ 0, %29 ], [ 0, %19 ], [ 0, %9 ]
ret i32 %38
}