#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 showhelp(const char *argv0) {
  printf("genromfs %s\n", "0.5.1");
  printf("Usage: %s [OPTIONS] -f IMAGE\n", argv0);
  printf("Create a romfs filesystem image from a directory\n");
  printf("\n");
  printf("  -f IMAGE               Output the image into this file\n");
  printf("  -d DIRECTORY           Use this directory as source\n");
  printf("  -v                     (Too) verbose operation\n");
  printf("  -V VOLUME              Use the specified volume name\n");
  printf("  -a ALIGN               Align regular file data to ALIGN bytes\n");
  printf("  -A ALIGN,PATTERN       Align all objects matching pattern to at "
         "least ALIGN bytes\n");
  printf("  -x PATTERN             Exclude all objects matching pattern\n");
  printf("  -h                     Show this help\n");
  printf("\n");
  printf("Report bugs to chexum@shadow.banki.hu\n");
}


x86 assembly (clang, -O0):
<showhelp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfa0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfd3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x101a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x104b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1058(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showhelp>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
lea    0xecb(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec3(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xed0(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeeb(%rip),%rdi
call   1040 <puts@plt>
lea    0xf18(%rip),%rdi
call   1040 <puts@plt>
lea    0xf42(%rip),%rdi
call   1040 <puts@plt>
lea    0xf67(%rip),%rdi
call   1040 <puts@plt>
lea    0xf92(%rip),%rdi
call   1040 <puts@plt>
lea    0xfc6(%rip),%rdi
call   1040 <puts@plt>
lea    0x100e(%rip),%rdi
call   1040 <puts@plt>
lea    0x1040(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1052(%rip),%rdi
pop    %rbx
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"genromfs %s\0A\00"
@.str.1 = [6 x i8] c"0.5.1\00"
@.str.2 = [30 x i8] c"Usage: %s [OPTIONS] -f IMAGE\0A\00"
@.str.3 = [50 x i8] c"Create a romfs filesystem image from a directory\0A\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [58 x i8] c" -f IMAGE Output the image into this file\0A\00"
@.str.6 = [55 x i8] c" -d DIRECTORY Use this directory as source\0A\00"
@.str.7 = [50 x i8] c" -v (Too) verbose operation\0A\00"
@.str.8 = [56 x i8] c" -V VOLUME Use the specified volume name\0A\00"
@.str.9 = [65 x i8] c" -a ALIGN Align regular file data to ALIGN bytes\0A\00"
@.str.10 = [85 x i8] c" -A ALIGN,PATTERN Align all objects matching pattern to at least ALIGN bytes\0A\00"
@.str.11 = [63 x i8] c" -x PATTERN Exclude all objects matching pattern\0A\00"
@.str.12 = [41 x i8] c" -h Show this help\0A\00"
@.str.13 = [39 x i8] c"Report bugs to chexum@shadow.banki.hu\0A\00"
define void @showhelp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.5, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.6, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 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 ([65 x i8], [65 x i8]* @.str.9, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.10, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.11, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.12, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.13, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"genromfs %s\0A\00"
@.str.1 = [6 x i8] c"0.5.1\00"
@.str.2 = [30 x i8] c"Usage: %s [OPTIONS] -f IMAGE\0A\00"
@str = [49 x i8] c"Create a romfs filesystem image from a directory\00"
@str.14 = [57 x i8] c" -f IMAGE Output the image into this file\00"
@str.15 = [54 x i8] c" -d DIRECTORY Use this directory as source\00"
@str.16 = [49 x i8] c" -v (Too) verbose operation\00"
@str.17 = [55 x i8] c" -V VOLUME Use the specified volume name\00"
@str.18 = [64 x i8] c" -a ALIGN Align regular file data to ALIGN bytes\00"
@str.19 = [84 x i8] c" -A ALIGN,PATTERN Align all objects matching pattern to at least ALIGN bytes\00"
@str.20 = [62 x i8] c" -x PATTERN Exclude all objects matching pattern\00"
@str.21 = [40 x i8] c" -h Show this help\00"
@str.22 = [38 x i8] c"Report bugs to chexum@shadow.banki.hu\00"
define void @showhelp(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.14, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.15, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.16, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.17, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.18, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([84 x i8], [84 x i8]* @str.19, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.20, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.21, i64 0, i64 0))
%14 = tail call i32 @putchar(i32 10)
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.22, i64 0, i64 0))
ret void
}