#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*/ cmd_help(int, char const **);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ strcmp(char const *, char *);
int main(int argc, const char *argv[]) {
  const char *cmd = argv[1];
  if (argc <= 1 || !strcmp(cmd, "help")) {
    cmd_help(argc, argv);
  } else {
    printf("canopy-cli: '%s' is not a command. See 'canopy-cli help'\n", cmd);
  }
  return 0;
}


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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1175 <main+0x45>
mov    -0x18(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1186 <main+0x56>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <cmd_help@plt>
jmp    1196 <main+0x66>
mov    -0x18(%rbp),%rsi
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%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     1166 <main+0x36>
mov    0x8(%rbx),%r14
lea    0xeb7(%rip),%rsi
mov    %r14,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1166 <main+0x36>
lea    0xea9(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
jmp    1170 <main+0x40>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <cmd_help@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"help\00"
@.str.1 = [58 x i8] c"canopy-cli: '%s' is not a command. See 'canopy-cli help'\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
store i8* %9, i8** %6
%10 = load i32, i32* %4
%11 = icmp sle i32 %10, 1
br i1 %11, label %16, label %12
12: ; preds = %2
%13 = load i8*, i8** %6
%14 = call i32 @strcmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%15 = icmp ne i32 %14, 0
br i1 %15, label %20, label %16
16: ; preds = %12, %2
%17 = load i32, i32* %4
%18 = load i8**, i8*** %5
%19 = call i32 @cmd_help(i32 %17, i8** %18)
br label %23
20: ; preds = %12
%21 = load i8*, i8** %6
%22 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i8* %21)
br label %23
23: ; preds = %20, %16
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"help\00"
@.str.1 = [58 x i8] c"canopy-cli: '%s' is not a command. See 'canopy-cli help'\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = icmp slt i32 %0, 2
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6, %2
%10 = tail call i32 @cmd_help(i32 %0, i8** %1)
br label %13
11: ; preds = %6
%12 = tail call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i8* %4)
br label %13
13: ; preds = %11, %9
ret i32 0
}