#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 *, ...);
void my_rtfm(const char *app) {
  printf("modify the built-in cmdline of a CHRP boot image\n");
  printf("%s filename\n", app);
  printf("work with zImage named 'filename'\n");
  printf(" [-h] display this help\n");
  printf(" [-v] display version\n");
  printf(" [-a 0|1] disable/enable built-in cmdline\n");
  printf("          overrides whatever is passed from OpenFirmware\n");
  printf(" [-s STRING] store STRING in the boot image\n");
  printf(" [-c] clear previous content before update\n");
  printf(" no option will show the current settings in 'filename'\n");
  return;
}


x86 assembly (clang, -O0):
<my_rtfm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xefd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf11(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_rtfm>:
push   %rbx
mov    %rdi,%rbx
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf18(%rip),%rdi
call   1030 <puts@plt>
lea    0xf22(%rip),%rdi
call   1030 <puts@plt>
lea    0xf40(%rip),%rdi
call   1030 <puts@plt>
lea    0xf6d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf8d(%rip),%rdi
call   1030 <puts@plt>
lea    0xfac(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"modify the built-in cmdline of a CHRP boot image\0A\00"
@.str.1 = [13 x i8] c"%s filename\0A\00"
@.str.2 = [35 x i8] c"work with zImage named 'filename'\0A\00"
@.str.3 = [25 x i8] c" [-h] display this help\0A\00"
@.str.4 = [23 x i8] c" [-v] display version\0A\00"
@.str.5 = [43 x i8] c" [-a 0|1] disable/enable built-in cmdline\0A\00"
@.str.6 = [58 x i8] c" overrides whatever is passed from OpenFirmware\0A\00"
@.str.7 = [45 x i8] c" [-s STRING] store STRING in the boot image\0A\00"
@.str.8 = [44 x i8] c" [-c] clear previous content before update\0A\00"
@.str.9 = [57 x i8] c" no option will show the current settings in 'filename'\0A\00"
define void @my_rtfm(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.6, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.9, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"%s filename\0A\00"
@str = [49 x i8] c"modify the built-in cmdline of a CHRP boot image\00"
@str.10 = [34 x i8] c"work with zImage named 'filename'\00"
@str.11 = [24 x i8] c" [-h] display this help\00"
@str.12 = [22 x i8] c" [-v] display version\00"
@str.13 = [42 x i8] c" [-a 0|1] disable/enable built-in cmdline\00"
@str.14 = [57 x i8] c" overrides whatever is passed from OpenFirmware\00"
@str.15 = [44 x i8] c" [-s STRING] store STRING in the boot image\00"
@str.16 = [43 x i8] c" [-c] clear previous content before update\00"
@str.17 = [56 x i8] c" no option will show the current settings in 'filename'\00"
define void @my_rtfm(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.10, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.11, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.12, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.13, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.14, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.15, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.16, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.17, i64 0, i64 0))
ret void
}