#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*/ puts(char *);
scalar_t__ strcmp(char *, char *);
void help_cmd(int argc, char **argv) {
  if (argc > 0 && 0 == strcmp(argv[0], "in")) {
    puts("usage: punch in <project name>");
  } else if (argc > 0 && 0 == strcmp(argv[0], "out")) {
    puts("usage: punch out");
  } else if (argc > 0 && 0 == strcmp(argv[0], "summary")) {
    puts("usage: punch summary [--csv]");
  } else {
    puts("Punch is a simple time tracker.\n\n"
         "Usage:\n\n"
         "\tpunch <command> [arguments]\n\n"
         "The commands are:\n\n"
         "\tin\tpunch in to a project\n"
         "\tout\tpunch out of a project\n"
         "\tsummary\tsummarize your time");
  }
}


x86 assembly (clang, -O0):
<help_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    116b <help_cmd+0x4b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    116b <help_cmd+0x4b>
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
jmp    11f9 <help_cmd+0xd9>
cmpl   $0x0,-0x4(%rbp)
jle    11a7 <help_cmd+0x87>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xeac(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    11a7 <help_cmd+0x87>
lea    0xe85(%rip),%rdi
call   1030 <puts@plt>
jmp    11f4 <help_cmd+0xd4>
cmpl   $0x0,-0x4(%rbp)
jle    11e3 <help_cmd+0xc3>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe74(%rip),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    11e3 <help_cmd+0xc3>
lea    0xe62(%rip),%rdi
call   1030 <puts@plt>
jmp    11ef <help_cmd+0xcf>
lea    0xe6e(%rip),%rdi
call   1030 <puts@plt>
jmp    11f4 <help_cmd+0xd4>
jmp    11f9 <help_cmd+0xd9>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help_cmd>:
push   %rbx
test   %edi,%edi
jle    1164 <help_cmd+0x44>
mov    %rsi,%rbx
mov    (%rsi),%rdi
lea    0xece(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1171 <help_cmd+0x51>
mov    (%rbx),%rdi
lea    0xee9(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     117e <help_cmd+0x5e>
mov    (%rbx),%rdi
lea    0xed9(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     118b <help_cmd+0x6b>
lea    0xeed(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
lea    0xe8b(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
lea    0xe9d(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
lea    0xea9(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"in\00"
@.str.1 = [31 x i8] c"usage: punch in <project name>\00"
@.str.2 = [4 x i8] c"out\00"
@.str.3 = [17 x i8] c"usage: punch out\00"
@.str.4 = [8 x i8] c"summary\00"
@.str.5 = [29 x i8] c"usage: punch summary [--csv]\00"
@.str.6 = [173 x i8] c"Punch is a simple time tracker.\0A\0AUsage:\0A\0A\09punch <command> [arguments]\0A\0AThe commands are:\0A\0A\09in\09punch in to a project\0A\09out\09punch out of a project\0A\09summary\09summarize your time\00"
define void @help_cmd(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i64 0, %11
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %41
15: ; preds = %7, %2
%16 = load i32, i32* %3
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %26
18: ; preds = %15
%19 = load i8**, i8*** %4
%20 = getelementptr inbounds i8*, i8** %19, i64 0
%21 = load i8*, i8** %20
%22 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%23 = icmp eq i64 0, %22
br i1 %23, label %24, label %26
24: ; preds = %18
%25 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %40
26: ; preds = %18, %15
%27 = load i32, i32* %3
%28 = icmp sgt i32 %27, 0
br i1 %28, label %29, label %37
29: ; preds = %26
%30 = load i8**, i8*** %4
%31 = getelementptr inbounds i8*, i8** %30, i64 0
%32 = load i8*, i8** %31
%33 = call i64 @strcmp(i8* %32, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%34 = icmp eq i64 0, %33
br i1 %34, label %35, label %37
35: ; preds = %29
%36 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
br label %39
37: ; preds = %29, %26
%38 = call i32 @puts(i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str.6, i64 0, i64 0))
br label %39
39: ; preds = %37, %35
br label %40
40: ; preds = %39, %24
br label %41
41: ; preds = %40, %13
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"in\00"
@.str.1 = [31 x i8] c"usage: punch in <project name>\00"
@.str.2 = [4 x i8] c"out\00"
@.str.3 = [17 x i8] c"usage: punch out\00"
@.str.4 = [8 x i8] c"summary\00"
@.str.5 = [29 x i8] c"usage: punch summary [--csv]\00"
@.str.6 = [173 x i8] c"Punch is a simple time tracker.\0A\0AUsage:\0A\0A\09punch <command> [arguments]\0A\0AThe commands are:\0A\0A\09in\09punch in to a project\0A\09out\09punch out of a project\0A\09summary\09summarize your time\00"
define void @help_cmd(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %17, label %8
8: ; preds = %4
%9 = load i8*, i8** %1
%10 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %17, label %12
12: ; preds = %8
%13 = load i8*, i8** %1
%14 = tail call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %2, %12
br label %17
17: ; preds = %12, %8, %4, %16
%18 = phi i8* [ getelementptr inbounds ([173 x i8], [173 x i8]* @.str.6, i64 0, i64 0), %16 ], [ getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), %4 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), %8 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), %12 ]
%19 = tail call i32 @puts(i8* dereferenceable(1) %18)
ret void
}