#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void help(char *argv[]) {
  fprintf(stderr, "\n");
  fprintf(stderr, "usage %s --hostname localhost --port 10000 COMMAND ARGS \n",
          argv[0]);
  fprintf(stderr, "\n");
  fprintf(stderr, "COMMAND and ARGS:\n");
  fprintf(stderr, "     quit            : Stop listening for commands.\n");
  fprintf(stderr, "     add             : Learn a new image file by putting a "
                  "new PPM into SQL and RAM.\n");
  fprintf(stderr,
          "     del             : Forget a PPM from both SQL and RAM.\n");
  fprintf(stderr, "     info            : Print statistics on e.g. how many "
                  "PPMs in RAM, number of CPUs.\n");
  fprintf(stderr,
          "     load            : Load all PPM images from SQL into RAM.\n");
  fprintf(stderr, "     quickcompare    : Compare a single file to all PPMs in "
                  "RAM and report potential duplicates.\n");
  fprintf(stderr, "     fullcompare     : Compare all PPMs in RAM and report "
                  "potential duplicates.\n");
  fprintf(stderr, "     refresh_similar_but_different : Refresh details that "
                  "help avoid false matches.\n");
  fprintf(stderr, "     unload          : Free all PPM images from RAM.\n");
  fprintf(stderr, "     debug_sleep     : fork() then sleep for 60 seconds. "
                  "Used to test fork()\n");
  fprintf(stderr, "     debug_show_tree : Show the memory structure of the PPM "
                  "tree. Used to check structure.\n");
  fprintf(stderr, "     help            : Show this message\n");
  fprintf(stderr, "\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xf0c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xeb6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
lea    0xebe(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e43(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
lea    0xf1b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e15(%rip),%rax
mov    (%rax),%edi
lea    0xf40(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dfe(%rip),%rax
mov    (%rax),%edi
lea    0xf80(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2de7(%rip),%rax
mov    (%rax),%edi
lea    0xfa8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dd0(%rip),%rax
mov    (%rax),%edi
lea    0xff3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2db9(%rip),%rax
mov    (%rax),%edi
lea    0x102d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2da2(%rip),%rax
mov    (%rax),%edi
lea    0x106b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d8b(%rip),%rax
mov    (%rax),%edi
lea    0x108a(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d74(%rip),%rax
mov    (%rax),%edi
lea    0x10c1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d5d(%rip),%rax
mov    (%rax),%edi
lea    0x1106(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d46(%rip),%rax
mov    (%rax),%edi
lea    0xd95(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
mov    0x2ec1(%rip),%rbx
mov    (%rbx),%edi
lea    0xf10(%rip),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    (%r15),%rdx
lea    0xec2(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee0(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee3(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf08(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf4e(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf7a(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xfc1(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xff0(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1042(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1083(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x10c8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x10ee(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x112c(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x1178(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
@.str.1 = [58 x i8] c"usage %s --hostname localhost --port 10000 COMMAND ARGS \0A\00"
@.str.2 = [19 x i8] c"COMMAND and ARGS:\0A\00"
@.str.3 = [53 x i8] c" quit : Stop listening for commands.\0A\00"
@.str.4 = [86 x i8] c" add : Learn a new image file by putting a new PPM into SQL and RAM.\0A\00"
@.str.5 = [60 x i8] c" del : Forget a PPM from both SQL and RAM.\0A\00"
@.str.6 = [87 x i8] c" info : Print statistics on e.g. how many PPMs in RAM, number of CPUs.\0A\00"
@.str.7 = [63 x i8] c" load : Load all PPM images from SQL into RAM.\0A\00"
@.str.8 = [98 x i8] c" quickcompare : Compare a single file to all PPMs in RAM and report potential duplicates.\0A\00"
@.str.9 = [81 x i8] c" fullcompare : Compare all PPMs in RAM and report potential duplicates.\0A\00"
@.str.10 = [85 x i8] c" refresh_similar_but_different : Refresh details that help avoid false matches.\0A\00"
@.str.11 = [54 x i8] c" unload : Free all PPM images from RAM.\0A\00"
@.str.12 = [78 x i8] c" debug_sleep : fork() then sleep for 60 seconds. Used to test fork()\0A\00"
@.str.13 = [92 x i8] c" debug_show_tree : Show the memory structure of the PPM tree. Used to check structure.\0A\00"
@.str.14 = [42 x i8] c" help : Show this message\0A\00"
define void @help(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = load i8**, i8*** %2
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @stderr
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%14 = load i32, i32* @stderr
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0))
%16 = load i32, i32* @stderr
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.4, i64 0, i64 0))
%18 = load i32, i32* @stderr
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.5, i64 0, i64 0))
%20 = load i32, i32* @stderr
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.6, i64 0, i64 0))
%22 = load i32, i32* @stderr
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.7, i64 0, i64 0))
%24 = load i32, i32* @stderr
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str.8, i64 0, i64 0))
%26 = load i32, i32* @stderr
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.9, i64 0, i64 0))
%28 = load i32, i32* @stderr
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.10, i64 0, i64 0))
%30 = load i32, i32* @stderr
%31 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.11, i64 0, i64 0))
%32 = load i32, i32* @stderr
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.12, i64 0, i64 0))
%34 = load i32, i32* @stderr
%35 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.13, i64 0, i64 0))
%36 = load i32, i32* @stderr
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.14, i64 0, i64 0))
%38 = load i32, i32* @stderr
%39 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
@.str.1 = [58 x i8] c"usage %s --hostname localhost --port 10000 COMMAND ARGS \0A\00"
@.str.2 = [19 x i8] c"COMMAND and ARGS:\0A\00"
@.str.3 = [53 x i8] c" quit : Stop listening for commands.\0A\00"
@.str.4 = [86 x i8] c" add : Learn a new image file by putting a new PPM into SQL and RAM.\0A\00"
@.str.5 = [60 x i8] c" del : Forget a PPM from both SQL and RAM.\0A\00"
@.str.6 = [87 x i8] c" info : Print statistics on e.g. how many PPMs in RAM, number of CPUs.\0A\00"
@.str.7 = [63 x i8] c" load : Load all PPM images from SQL into RAM.\0A\00"
@.str.8 = [98 x i8] c" quickcompare : Compare a single file to all PPMs in RAM and report potential duplicates.\0A\00"
@.str.9 = [81 x i8] c" fullcompare : Compare all PPMs in RAM and report potential duplicates.\0A\00"
@.str.10 = [85 x i8] c" refresh_similar_but_different : Refresh details that help avoid false matches.\0A\00"
@.str.11 = [54 x i8] c" unload : Free all PPM images from RAM.\0A\00"
@.str.12 = [78 x i8] c" debug_sleep : fork() then sleep for 60 seconds. Used to test fork()\0A\00"
@.str.13 = [92 x i8] c" debug_show_tree : Show the memory structure of the PPM tree. Used to check structure.\0A\00"
@.str.14 = [42 x i8] c" help : Show this message\0A\00"
define void @help(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = load i8*, i8** %0
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.4, i64 0, i64 0))
%15 = load i32, i32* @stderr
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.5, i64 0, i64 0))
%17 = load i32, i32* @stderr
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.6, i64 0, i64 0))
%19 = load i32, i32* @stderr
%20 = tail call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.7, i64 0, i64 0))
%21 = load i32, i32* @stderr
%22 = tail call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str.8, i64 0, i64 0))
%23 = load i32, i32* @stderr
%24 = tail call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.9, i64 0, i64 0))
%25 = load i32, i32* @stderr
%26 = tail call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.10, i64 0, i64 0))
%27 = load i32, i32* @stderr
%28 = tail call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.11, i64 0, i64 0))
%29 = load i32, i32* @stderr
%30 = tail call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.12, i64 0, i64 0))
%31 = load i32, i32* @stderr
%32 = tail call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.13, i64 0, i64 0))
%33 = load i32, i32* @stderr
%34 = tail call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.14, i64 0, i64 0))
%35 = load i32, i32* @stderr
%36 = tail call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}