#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 *, char const *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
char *strrchr(char const *, char);
void help(int status, const char *argv0) {
  const char *name = NULL;
  if (!argv0)
    return;
  name = strrchr(argv0, '/');
  if (name)
    name++;
  else
    name = argv0;
  if (status != 0) {
    fprintf(stderr, "Try `%s -h' for more information.\n", name);
  } else {
    printf("Usage: %s [options] [vendor_id] [device_name] ...\n", name);
    printf("Smart L utility. Command line shell."
           "The part of the Smart L project.\n");
    printf("Options:\n");
    printf("\t-v, --version\tPrint version.\n");
    printf("\t-h, --help\tPrint this help.\n");
    printf("\t-s, --scan\tScand Current all of Vendor&&device "
           "\n\t\tof the daemon.\n");
    printf("\t-l, --list\tPrint Current connect all device.\n");
    printf("\t-o, --open\tOpen Specify Device.\n");
    printf("\t-c, --close\tClose Specify Device.\n");
    printf("\t-t, --test\tTest Specify Device.\n");
    printf("\t-r, --test\tReset Specify Device.\n");
  }
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1157 <help+0x27>
jmp    1253 <help+0x123>
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1185 <help+0x55>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    118d <help+0x5d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     11b5 <help+0x85>
mov    0x2e42(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xe55(%rip),%rsi
call   1050 <fprintf@plt>
jmp    1253 <help+0x123>
mov    -0x18(%rbp),%rsi
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf12(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf33(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf47(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rbp
push   %rbx
push   %rax
test   %rsi,%rsi
je     1184 <help+0x44>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
mov    $0x2f,%esi
call   1050 <strrchr@plt>
lea    0x1(%rax),%rdx
test   %rax,%rax
cmove  %rbx,%rdx
test   %ebp,%ebp
je     118b <help+0x4b>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
lea    0xe87(%rip),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <fprintf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe91(%rip),%rdi
mov    %rdx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf42(%rip),%rdi
call   1030 <puts@plt>
lea    0xf64(%rip),%rdi
call   1030 <puts@plt>
lea    0xf79(%rip),%rdi
call   1030 <puts@plt>
lea    0xf90(%rip),%rdi
call   1030 <puts@plt>
lea    0xfa5(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Try `%s -h' for more information.\0A\00"
@.str.1 = [51 x i8] c"Usage: %s [options] [vendor_id] [device_name] ...\0A\00"
@.str.2 = [70 x i8] c"Smart L utility. Command line shell.The part of the Smart L project.\0A\00"
@.str.3 = [10 x i8] c"Options:\0A\00"
@.str.4 = [31 x i8] c"\09-v, --version\09Print version.\0A\00"
@.str.5 = [30 x i8] c"\09-h, --help\09Print this help.\0A\00"
@.str.6 = [67 x i8] c"\09-s, --scan\09Scand Current all of Vendor&&device \0A\09\09of the daemon.\0A\00"
@.str.7 = [47 x i8] c"\09-l, --list\09Print Current connect all device.\0A\00"
@.str.8 = [34 x i8] c"\09-o, --open\09Open Specify Device.\0A\00"
@.str.9 = [36 x i8] c"\09-c, --close\09Close Specify Device.\0A\00"
@.str.10 = [34 x i8] c"\09-t, --test\09Test Specify Device.\0A\00"
@.str.11 = [35 x i8] c"\09-r, --test\09Reset Specify Device.\0A\00"
define void @help(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
store i8* null, i8** %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %2
br label %39
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = call i8* @strrchr(i8* %10, i8 signext 47)
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %5
br label %19
17: ; preds = %9
%18 = load i8*, i8** %4
store i8* %18, i8** %5
br label %19
19: ; preds = %17, %14
%20 = load i32, i32* %3
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %26
22: ; preds = %19
%23 = load i32, i32* @stderr
%24 = load i8*, i8** %5
%25 = call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %24)
br label %39
26: ; preds = %19
%27 = load i8*, i8** %5
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i8* %27)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.2, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.6, i64 0, i64 0))
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0))
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i64 0, i64 0))
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.10, i64 0, i64 0))
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0))
br label %39
39: ; preds = %8, %26, %22
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Try `%s -h' for more information.\0A\00"
@.str.1 = [51 x i8] c"Usage: %s [options] [vendor_id] [device_name] ...\0A\00"
@str = [69 x i8] c"Smart L utility. Command line shell.The part of the Smart L project.\00"
@str.12 = [9 x i8] c"Options:\00"
@str.13 = [30 x i8] c"\09-v, --version\09Print version.\00"
@str.14 = [29 x i8] c"\09-h, --help\09Print this help.\00"
@str.15 = [66 x i8] c"\09-s, --scan\09Scand Current all of Vendor&&device \0A\09\09of the daemon.\00"
@str.16 = [46 x i8] c"\09-l, --list\09Print Current connect all device.\00"
@str.17 = [33 x i8] c"\09-o, --open\09Open Specify Device.\00"
@str.18 = [35 x i8] c"\09-c, --close\09Close Specify Device.\00"
@str.19 = [33 x i8] c"\09-t, --test\09Test Specify Device.\00"
@str.20 = [34 x i8] c"\09-r, --test\09Reset Specify Device.\00"
define void @help(i32 %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %25, label %4
4: ; preds = %2
%5 = tail call i8* @strrchr(i8* %1, i8 signext 47)
%6 = icmp eq i8* %5, null
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = select i1 %6, i8* %1, i8* %7
%9 = icmp eq i32 %0, 0
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %25
13: ; preds = %4
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.12, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.13, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.14, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.15, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.16, i64 0, i64 0))
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.17, i64 0, i64 0))
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.18, i64 0, i64 0))
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.19, i64 0, i64 0))
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.20, i64 0, i64 0))
br label %25
25: ; preds = %10, %13, %2
ret void
}