#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 */
typedef int /*<<< orphan*/ help_page;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_help(void) {
  static char *help_page[] = {
      "mknspimg version 1.0, Texas Instruments, 2004",
      "Syntax:",
      "        mknspimg -o outfile -i image1 image2 -a align1 align2 [-v] [-b] "
      "[-p prod_id] [-r rel_id] [-s rel_name] [-f flags]",
      "Example:",
      "        mknspimg -o nsp_image.bin -i kernel.bin files.img -a 0 4096",
      "This generates 'nsp_image.bin' from two input files aligning first to 0 "
      "and second to 4096 bytes."};
  int num_lines = sizeof(help_page) / sizeof(char *);
  int i;
  for (i = 0; i < num_lines; i++) {
    printf("%s\n", help_page[i]);
  }
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x6,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115b <print_help+0x4b>
movslq -0x8(%rbp),%rcx
lea    0x2ef3(%rip),%rax
mov    (%rax,%rcx,8),%rsi
lea    0x1017(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <print_help+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %rbx
lea    0x1047(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xf00(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xef9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xf64(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xf5e(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xf93(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@print_help.help_page = internal global [6 x i8*] [i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str.5, i32 0, i32 0)]
@.str = [46 x i8] c"mknspimg version 1.0, Texas Instruments, 2004\00"
@.str.1 = [8 x i8] c"Syntax:\00"
@.str.2 = [122 x i8] c" mknspimg -o outfile -i image1 image2 -a align1 align2 [-v] [-b] [-p prod_id] [-r rel_id] [-s rel_name] [-f flags]\00"
@.str.3 = [9 x i8] c"Example:\00"
@.str.4 = [68 x i8] c" mknspimg -o nsp_image.bin -i kernel.bin files.img -a 0 4096\00"
@.str.5 = [98 x i8] c"This generates 'nsp_image.bin' from two input files aligning first to 0 and second to 4096 bytes.\00"
@.str.6 = [4 x i8] c"%s\0A\00"
define void @print_help() {
%1 = alloca i32
%2 = alloca i32
store i32 6, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %13, %0
%4 = load i32, i32* %2
%5 = load i32, i32* %1
%6 = icmp slt i32 %4, %5
br i1 %6, label %7, label %16
7: ; preds = %3
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [6 x i8*], [6 x i8*]* @print_help.help_page, i64 0, i64 %9
%11 = load i8*, i8** %10
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %7
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %3
16: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"mknspimg version 1.0, Texas Instruments, 2004\00"
@.str.1 = [8 x i8] c"Syntax:\00"
@.str.2 = [122 x i8] c" mknspimg -o outfile -i image1 image2 -a align1 align2 [-v] [-b] [-p prod_id] [-r rel_id] [-s rel_name] [-f flags]\00"
@.str.3 = [9 x i8] c"Example:\00"
@.str.4 = [68 x i8] c" mknspimg -o nsp_image.bin -i kernel.bin files.img -a 0 4096\00"
@.str.5 = [98 x i8] c"This generates 'nsp_image.bin' from two input files aligning first to 0 and second to 4096 bytes.\00"
@.str.6 = [4 x i8] c"%s\0A\00"
define void @print_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.4, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str.5, i64 0, i64 0))
ret void
}