#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*/ stdout;
scalar_t__ strstr(char const *, char *);
void print_usage(const char *cmd) {
  if (strstr(cmd, "usysident")) {
    fprintf(stdout,
            "Usage:\n"
            "  %s [-P] [-l <loc_code> [-s {identify|normal}][-t]]\n"
            "  %s [-d <dev_name> [-s {identify|normal}][-t]]\n"
            "  %s [-P]\n"
            "  %s [-V]\n"
            "  %s [-h]\n\n",
            cmd, cmd, cmd, cmd, cmd);
    fprintf(stdout,
            "Options:\n"
            "  -l <loc_code>   Indicator location code\n"
            "  -d <dev_name>   Device name\n"
            "  -s identify     Turn on device/location identify indicator\n"
            "  -s normal       Turn off device/location identify indicator\n"
            "  -P              Limit the operation to only the platform "
            "indicators\n"
            "  -t              Truncate loc code if necessary\n"
            "  -V		  Print the version of the command\n"
            "  -h              Print this message and exit\n");
  } else {
    fprintf(stdout,
            "Usage:\n"
            "  %s [-P] [-l <loc_code> [-s normal][-t]]\n"
            "  %s [-P]\n"
            "  %s [-V]\n"
            "  %s [-h]\n\n",
            cmd, cmd, cmd, cmd);
    fprintf(stdout, "Options:\n"
                    "  -l <loc_code>   Indicator location code\n"
                    "  -s normal	  Turn off location fault indicator\n"
                    "  -P              Limit the operation to only the "
                    "platform indicators\n"
                    "  -t              Truncate loc code if necessary\n"
                    "  -V		  Print the version of the command\n"
                    "  -h		  Print this message\n");
  }
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     1191 <print_usage+0x71>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    -0x8(%rbp),%r9
mov    -0x8(%rbp),%rax
lea    0xea0(%rip),%rsi
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
lea    0xf11(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11cf <print_usage+0xaf>
mov    0x2e48(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    -0x8(%rbp),%r9
lea    0x1080(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e21(%rip),%rax
mov    (%rax),%edi
lea    0x10ba(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%rsi
call   1040 <strstr@plt>
mov    0x2ea6(%rip),%r14
mov    (%r14),%edi
test   %rax,%rax
je     1169 <print_usage+0x49>
mov    %rbx,(%rsp)
lea    0xebd(%rip),%rsi
mov    %rbx,%rdx
mov    %rbx,%rcx
mov    %rbx,%r8
mov    %rbx,%r9
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xf2f(%rip),%rsi
jmp    118a <print_usage+0x6a>
lea    0x10c1(%rip),%rsi
mov    %rbx,%rdx
mov    %rbx,%rcx
mov    %rbx,%r8
mov    %rbx,%r9
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0x10f8(%rip),%rsi
mov    (%r14),%edi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"usysident\00"
@stdout = global i32 0
@.str.1 = [140 x i8] c"Usage:\0A %s [-P] [-l <loc_code> [-s {identify|normal}][-t]]\0A %s [-d <dev_name> [-s {identify|normal}][-t]]\0A %s [-P]\0A %s [-V]\0A %s [-h]\0A\0A\00"
@.str.2 = [411 x i8] c"Options:\0A -l <loc_code> Indicator location code\0A -d <dev_name> Device name\0A -s identify Turn on device/location identify indicator\0A -s normal Turn off device/location identify indicator\0A -P Limit the operation to only the platform indicators\0A -t Truncate loc code if necessary\0A -V\09\09 Print the version of the command\0A -h Print this message and exit\0A\00"
@.str.3 = [81 x i8] c"Usage:\0A %s [-P] [-l <loc_code> [-s normal][-t]]\0A %s [-P]\0A %s [-V]\0A %s [-h]\0A\0A\00"
@.str.4 = [287 x i8] c"Options:\0A -l <loc_code> Indicator location code\0A -s normal\09 Turn off location fault indicator\0A -P Limit the operation to only the platform indicators\0A -t Truncate loc code if necessary\0A -V\09\09 Print the version of the command\0A -h\09\09 Print this message\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strstr(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* @stdout
%8 = load i8*, i8** %2
%9 = load i8*, i8** %2
%10 = load i8*, i8** %2
%11 = load i8*, i8** %2
%12 = load i8*, i8** %2
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i8* %8, i8* %9, i8* %10, i8* %11, i8* %12)
%14 = load i32, i32* @stdout
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([411 x i8], [411 x i8]* @.str.2, i64 0, i64 0))
br label %25
16: ; preds = %1
%17 = load i32, i32* @stdout
%18 = load i8*, i8** %2
%19 = load i8*, i8** %2
%20 = load i8*, i8** %2
%21 = load i8*, i8** %2
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.3, i64 0, i64 0), i8* %18, i8* %19, i8* %20, i8* %21)
%23 = load i32, i32* @stdout
%24 = call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([287 x i8], [287 x i8]* @.str.4, i64 0, i64 0))
br label %25
25: ; preds = %16, %6
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"usysident\00"
@stdout = global i32 0
@.str.1 = [140 x i8] c"Usage:\0A %s [-P] [-l <loc_code> [-s {identify|normal}][-t]]\0A %s [-d <dev_name> [-s {identify|normal}][-t]]\0A %s [-P]\0A %s [-V]\0A %s [-h]\0A\0A\00"
@.str.2 = [411 x i8] c"Options:\0A -l <loc_code> Indicator location code\0A -d <dev_name> Device name\0A -s identify Turn on device/location identify indicator\0A -s normal Turn off device/location identify indicator\0A -P Limit the operation to only the platform indicators\0A -t Truncate loc code if necessary\0A -V\09\09 Print the version of the command\0A -h Print this message and exit\0A\00"
@.str.3 = [81 x i8] c"Usage:\0A %s [-P] [-l <loc_code> [-s normal][-t]]\0A %s [-P]\0A %s [-V]\0A %s [-h]\0A\0A\00"
@.str.4 = [287 x i8] c"Options:\0A -l <loc_code> Indicator location code\0A -s normal\09 Turn off location fault indicator\0A -P Limit the operation to only the platform indicators\0A -t Truncate loc code if necessary\0A -V\09\09 Print the version of the command\0A -h\09\09 Print this message\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = load i32, i32* @stdout
br i1 %3, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %0, i8* %0, i8* %0, i8* %0)
br label %9
7: ; preds = %1
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.3, i64 0, i64 0), i8* %0, i8* %0, i8* %0, i8* %0)
br label %9
9: ; preds = %7, %5
%10 = phi i8* [ getelementptr inbounds ([287 x i8], [287 x i8]* @.str.4, i64 0, i64 0), %7 ], [ getelementptr inbounds ([411 x i8], [411 x i8]* @.str.2, i64 0, i64 0), %5 ]
%11 = load i32, i32* @stdout
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* %10)
ret void
}