#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 */
char *basename(char *);
int /*<<< orphan*/ printf(char *, ...);
void help_menu(int argc, char **argv) {
  printf("Updateloader 0.2: A upload bootloader software for GNU/linux\n");
  printf("Usage: %s -t comname -b bootloader "
         "[-e|c|p [ALL|NAND|NOR|SPI]]"
         "[-k|s filename]"
         "[-B blocknum]\n",
         basename(argv[0]));
  printf("Options:\n");
  printf("\t-b, --bootloader\t\tUpdate bootloader file name\n");
  printf("\t-B, --Block\t\t\tThe number of block\n");
  printf("\t-c, --check [ALL|NAND|NOR|SPI]\t"
         "Check code in Flash/Memory is aviliable \n");
  printf("\t-e, --erase [ALL|NAND|NOR|SPI]\tErase Flash/Memory\n");
  printf("\t-k, --kickstart\t\t\tUpdate kickstart file name\n");
  printf("\t-p, --program\t\t\tProgram in Flash/Memory\n");
  printf("\t-s, --stage1\t\t\tUpdate stage1 file name\n");
  printf("\t-t, --terminal\t\t\tChioce which ttyS to open\n");
  printf("\t-h, --help\t\t\tHelp for updateloader\n");
}


x86 assembly (clang, -O0):
<help_menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <basename@plt>
mov    %rax,%rsi
lea    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf35(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfa9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfcf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xff0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x100c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1027(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1046(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help_menu>:
push   %rbx
mov    %rsi,%rbx
lea    0xf21(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rdi
call   1050 <basename@plt>
lea    0xeb1(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf39(%rip),%rdi
call   1030 <puts@plt>
lea    0xf36(%rip),%rdi
call   1030 <puts@plt>
lea    0xf59(%rip),%rdi
call   1030 <puts@plt>
lea    0xf70(%rip),%rdi
call   1030 <puts@plt>
lea    0xfad(%rip),%rdi
call   1030 <puts@plt>
lea    0xfd4(%rip),%rdi
call   1030 <puts@plt>
lea    0xff6(%rip),%rdi
call   1030 <puts@plt>
lea    0x1013(%rip),%rdi
call   1030 <puts@plt>
lea    0x102f(%rip),%rdi
call   1030 <puts@plt>
lea    0x104f(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [62 x i8] c"Updateloader 0.2: A upload bootloader software for GNU/linux\0A\00"
@.str.1 = [92 x i8] c"Usage: %s -t comname -b bootloader [-e|c|p [ALL|NAND|NOR|SPI]][-k|s filename][-B blocknum]\0A\00"
@.str.2 = [10 x i8] c"Options:\0A\00"
@.str.3 = [48 x i8] c"\09-b, --bootloader\09\09Update bootloader file name\0A\00"
@.str.4 = [36 x i8] c"\09-B, --Block\09\09\09The number of block\0A\00"
@.str.5 = [74 x i8] c"\09-c, --check [ALL|NAND|NOR|SPI]\09Check code in Flash/Memory is aviliable \0A\00"
@.str.6 = [52 x i8] c"\09-e, --erase [ALL|NAND|NOR|SPI]\09Erase Flash/Memory\0A\00"
@.str.7 = [47 x i8] c"\09-k, --kickstart\09\09\09Update kickstart file name\0A\00"
@.str.8 = [42 x i8] c"\09-p, --program\09\09\09Program in Flash/Memory\0A\00"
@.str.9 = [41 x i8] c"\09-s, --stage1\09\09\09Update stage1 file name\0A\00"
@.str.10 = [45 x i8] c"\09-t, --terminal\09\09\09Chioce which ttyS to open\0A\00"
@.str.11 = [37 x i8] c"\09-h, --help\09\09\09Help for updateloader\0A\00"
define void @help_menu(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i8* @basename(i8* %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.6, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.10, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [92 x i8] c"Usage: %s -t comname -b bootloader [-e|c|p [ALL|NAND|NOR|SPI]][-k|s filename][-B blocknum]\0A\00"
@str = [61 x i8] c"Updateloader 0.2: A upload bootloader software for GNU/linux\00"
@str.12 = [9 x i8] c"Options:\00"
@str.13 = [47 x i8] c"\09-b, --bootloader\09\09Update bootloader file name\00"
@str.14 = [35 x i8] c"\09-B, --Block\09\09\09The number of block\00"
@str.15 = [73 x i8] c"\09-c, --check [ALL|NAND|NOR|SPI]\09Check code in Flash/Memory is aviliable \00"
@str.16 = [51 x i8] c"\09-e, --erase [ALL|NAND|NOR|SPI]\09Erase Flash/Memory\00"
@str.17 = [46 x i8] c"\09-k, --kickstart\09\09\09Update kickstart file name\00"
@str.18 = [41 x i8] c"\09-p, --program\09\09\09Program in Flash/Memory\00"
@str.19 = [40 x i8] c"\09-s, --stage1\09\09\09Update stage1 file name\00"
@str.20 = [44 x i8] c"\09-t, --terminal\09\09\09Chioce which ttyS to open\00"
@str.21 = [36 x i8] c"\09-h, --help\09\09\09Help for updateloader\00"
define void @help_menu(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%4 = load i8*, i8** %1
%5 = tail call i8* @basename(i8* %4)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([92 x i8], [92 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.12, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.13, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.14, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.15, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.16, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.17, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.18, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.19, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.20, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.21, i64 0, i64 0))
ret void
}