#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*/ printf(char *, ...);
int gCmdPrintHelp(char **argv) {
  printf("SRW(Security Read/Write) tool binary V%s\n", "0.1");
  printf("Build on %s %s\n", "Mar 16 2022", "19:20:49");
  printf("Usage:%s [options]\n", argv[0]);
  printf("-r 0xXXXXXXXX:            read from register\n");
  printf("-w 0xXXXXXXXX=0xXXXXXXXX: write value to register\n");
  printf("-i :                      read RTC and initial OS time\n");
  printf("-v :                      show verbose debug messages\n");
  printf("-h :                      show this help tips\n");
  printf("Bugs report to shell.albert@gmail.com\n");
  printf("Copyright(C) Oristar R&D Insititute,2017~2027.\n");
  return 0;
}


x86 assembly (clang, -O0):
<gCmdPrintHelp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    0xf00(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
lea    0xeff(%rip),%rsi
lea    0xf04(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xef8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfd0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gCmdPrintHelp>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
lea    0xef8(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeee(%rip),%rdi
lea    0xef7(%rip),%rsi
lea    0xefc(%rip),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%rsi
lea    0xef4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1b(%rip),%rdi
call   1030 <puts@plt>
lea    0xf41(%rip),%rdi
call   1030 <puts@plt>
lea    0xf6c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf96(%rip),%rdi
call   1030 <puts@plt>
lea    0xfb8(%rip),%rdi
call   1030 <puts@plt>
lea    0xfd2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"SRW(Security Read/Write) tool binary V%s\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
@.str.2 = [16 x i8] c"Build on %s %s\0A\00"
@.str.3 = [12 x i8] c"Mar 16 2022\00"
@.str.4 = [9 x i8] c"19:20:49\00"
@.str.5 = [20 x i8] c"Usage:%s [options]\0A\00"
@.str.6 = [46 x i8] c"-r 0xXXXXXXXX: read from register\0A\00"
@.str.7 = [51 x i8] c"-w 0xXXXXXXXX=0xXXXXXXXX: write value to register\0A\00"
@.str.8 = [56 x i8] c"-i : read RTC and initial OS time\0A\00"
@.str.9 = [55 x i8] c"-v : show verbose debug messages\0A\00"
@.str.10 = [47 x i8] c"-h : show this help tips\0A\00"
@.str.11 = [39 x i8] c"Bugs report to shell.albert@gmail.com\0A\00"
@.str.12 = [48 x i8] c"Copyright(C) Oristar R&D Insititute,2017~2027.\0A\00"
define i32 @gCmdPrintHelp(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%5 = load i8**, i8*** %2
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.7, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.8, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.9, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.12, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [42 x i8] c"SRW(Security Read/Write) tool binary V%s\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
@.str.2 = [16 x i8] c"Build on %s %s\0A\00"
@.str.3 = [12 x i8] c"Mar 16 2022\00"
@.str.4 = [9 x i8] c"19:20:49\00"
@.str.5 = [20 x i8] c"Usage:%s [options]\0A\00"
@str = [45 x i8] c"-r 0xXXXXXXXX: read from register\00"
@str.13 = [50 x i8] c"-w 0xXXXXXXXX=0xXXXXXXXX: write value to register\00"
@str.14 = [55 x i8] c"-i : read RTC and initial OS time\00"
@str.15 = [54 x i8] c"-v : show verbose debug messages\00"
@str.16 = [46 x i8] c"-h : show this help tips\00"
@str.17 = [38 x i8] c"Bugs report to shell.albert@gmail.com\00"
@str.18 = [47 x i8] c"Copyright(C) Oristar R&D Insititute,2017~2027.\00"
define i32 @gCmdPrintHelp(i8** nocapture %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%4 = load i8*, i8** %0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8* %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.13, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.14, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.15, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.16, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.17, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.18, i64 0, i64 0))
ret i32 0
}