#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void show_help(char *name, char *ser_port) {
  fprintf(stderr, "stmflasher v0.6.3 current - "
                  "http://developer.berlios.de/projects/stmflasher/\n\n");
  fprintf(
      stderr,
      "Usage: %s -p ser_port [-b rate] [-EvKfc] [-S [+]address[:length]] [-s "
      "start_page[:n_pages]]\n"
      "	[-n count] [-r|w filename] [-M f|r|e|a] [-ujkeiR] [-g [+]address] [-V "
      "level] [-h]\n"
      "\n"
      "	-p ser_port	Serial port name\n"
      "	-b ser_port	Serial port baud rate (default 57600)\n"
      "\n"
      "	-r filename	Read flash to file (stdout if \"-\")\n"
      "	-w filename	Write flash from file (stdin if \"-\")\n"
      "	-u		Disable the flash write-protection\n"
      "	-j		Enable the flash read-protection\n"
      "	-k		Disable the flash read-protection\n"
      "	-e		Erase only\n"
      "	-g [+]address	Start execution at specified address (0 = flash "
      "start)\n"
      "	-i		Print information about target device and serial mode\n"
      "	-R 		Reset controller (default for read/write/erase/etc)\n"
      "\n"
      "	-E		Full erase\n"
      "	-v		Verify writes\n"
      "	-n count	Retry failed writes up to count times (default 10)\n"
      "	-S [+]address[:length]	Specify start address and optionally length "
      "for\n"
      "				read/write/erase operations\n"
      "	-s start_page[:n_pages]	Specify start address at page <start_page> (0 "
      "= flash start)\n"
      "				and optionally number of pages to erase\n"
      "	-M f|r|e|a	Work with specified memory type (read/write/erase "
      "operation)\n"
      "			f - Flash (default), r - RAM, e - EEPROM, a - entire "
      "address space\n"
      "	-K 		Don`t Reset controller after operation (keep in "
      "bootloader)\n"
      "	-f		Force binary parser\n"
      "	-c		Resume the connection (don't send initial INIT)\n"
      "			*Baud rate must be kept the same as the first init*\n"
      "			This is useful with -K or if the reset fails\n"
      "	-V level	Verbose output level (0 - silent, 1 - default, 2 - "
      "debug)\n"
      "\n"
      "	-h		Show this help\n"
      "\n"
      "Examples:\n"
      "	Get device information:\n"
      "		%s -p %s -i\n"
      "	Write with verify and then start execution:\n"
      "		%s -p %s -w filename -v -g +0\n"
      "	Show information and read flash to file:\n"
      "		%s -p %s -i -r filename\n"
      "	Read 100 bytes of RAM with offset 0x1000 to stdout:\n"
      "		%s -p %s -r - -Mr -S +0x1000:100\n"
      "	Read first page of flash to file in verbose mode:\n"
      "		%s -p %s -r readed.bin -S :1 -V2\n"
      "	Start execution:\n"
      "		%s -p %s -g 0x0\n",
      name, name, ser_port, name, ser_port, name, ser_port, name, ser_port,
      name, ser_port, name, ser_port);
}


x86 assembly (clang, -O0):
<show_help>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rdi,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    -0x38(%rbp),%rax
mov    -0x30(%rbp),%r13
mov    -0x38(%rbp),%r12
mov    -0x30(%rbp),%r15
mov    -0x38(%rbp),%r14
mov    -0x30(%rbp),%rbx
mov    -0x38(%rbp),%r11
mov    -0x30(%rbp),%r10
mov    -0x38(%rbp),%rsi
mov    %rsi,-0x40(%rbp)
lea    0xec7(%rip),%rsi
mov    %rax,(%rsp)
mov    -0x40(%rbp),%rax
mov    %r13,0x8(%rsp)
mov    %r12,0x10(%rsp)
mov    %r15,0x18(%rsp)
mov    %r14,0x20(%rsp)
mov    %rbx,0x28(%rsp)
mov    %r11,0x30(%rsp)
mov    %r10,0x38(%rsp)
mov    %rax,0x40(%rsp)
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_help>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2ebe(%rip),%r15
mov    (%r15),%edi
lea    0xed4(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
sub    $0x8,%rsp
lea    0xf0e(%rip),%rsi
mov    %rbx,%rdx
mov    %rbx,%rcx
mov    %r14,%r8
mov    %rbx,%r9
xor    %eax,%eax
push   %r14
push   %rbx
push   %r14
push   %rbx
push   %r14
push   %rbx
push   %r14
push   %rbx
push   %r14
call   1030 <fprintf@plt>
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [79 x i8] c"stmflasher v0.6.3 current - http://developer.berlios.de/projects/stmflasher/\0A\0A\00"
@.str.1 = [1892 x i8] c"Usage: %s -p ser_port [-b rate] [-EvKfc] [-S [+]address[:length]] [-s start_page[:n_pages]]\0A\09[-n count] [-r|w filename] [-M f|r|e|a] [-ujkeiR] [-g [+]address] [-V level] [-h]\0A\0A\09-p ser_port\09Serial port name\0A\09-b ser_port\09Serial port baud rate (default 57600)\0A\0A\09-r filename\09Read flash to file (stdout if \22-\22)\0A\09-w filename\09Write flash from file (stdin if \22-\22)\0A\09-u\09\09Disable the flash write-protection\0A\09-j\09\09Enable the flash read-protection\0A\09-k\09\09Disable the flash read-protection\0A\09-e\09\09Erase only\0A\09-g [+]address\09Start execution at specified address (0 = flash start)\0A\09-i\09\09Print information about target device and serial mode\0A\09-R \09\09Reset controller (default for read/write/erase/etc)\0A\0A\09-E\09\09Full erase\0A\09-v\09\09Verify writes\0A\09-n count\09Retry failed writes up to count times (default 10)\0A\09-S [+]address[:length]\09Specify start address and optionally length for\0A\09\09\09\09read/write/erase operations\0A\09-s start_page[:n_pages]\09Specify start address at page <start_page> (0 = flash start)\0A\09\09\09\09and optionally number of pages to erase\0A\09-M f|r|e|a\09Work with specified memory type (read/write/erase operation)\0A\09\09\09f - Flash (default), r - RAM, e - EEPROM, a - entire address space\0A\09-K \09\09Don`t Reset controller after operation (keep in bootloader)\0A\09-f\09\09Force binary parser\0A\09-c\09\09Resume the connection (don't send initial INIT)\0A\09\09\09*Baud rate must be kept the same as the first init*\0A\09\09\09This is useful with -K or if the reset fails\0A\09-V level\09Verbose output level (0 - silent, 1 - default, 2 - debug)\0A\0A\09-h\09\09Show this help\0A\0AExamples:\0A\09Get device information:\0A\09\09%s -p %s -i\0A\09Write with verify and then start execution:\0A\09\09%s -p %s -w filename -v -g +0\0A\09Show information and read flash to file:\0A\09\09%s -p %s -i -r filename\0A\09Read 100 bytes of RAM with offset 0x1000 to stdout:\0A\09\09%s -p %s -r - -Mr -S +0x1000:100\0A\09Read first page of flash to file in verbose mode:\0A\09\09%s -p %s -r readed.bin -S :1 -V2\0A\09Start execution:\0A\09\09%s -p %s -g 0x0\0A\00"
define void @show_help(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = load i8*, i8** %3
%14 = load i8*, i8** %4
%15 = load i8*, i8** %3
%16 = load i8*, i8** %4
%17 = load i8*, i8** %3
%18 = load i8*, i8** %4
%19 = load i8*, i8** %3
%20 = load i8*, i8** %4
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([1892 x i8], [1892 x i8]* @.str.1, i64 0, i64 0), i8* %8, i8* %9, i8* %10, i8* %11, i8* %12, i8* %13, i8* %14, i8* %15, i8* %16, i8* %17, i8* %18, i8* %19, i8* %20)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [79 x i8] c"stmflasher v0.6.3 current - http://developer.berlios.de/projects/stmflasher/\0A\0A\00"
@.str.1 = [1892 x i8] c"Usage: %s -p ser_port [-b rate] [-EvKfc] [-S [+]address[:length]] [-s start_page[:n_pages]]\0A\09[-n count] [-r|w filename] [-M f|r|e|a] [-ujkeiR] [-g [+]address] [-V level] [-h]\0A\0A\09-p ser_port\09Serial port name\0A\09-b ser_port\09Serial port baud rate (default 57600)\0A\0A\09-r filename\09Read flash to file (stdout if \22-\22)\0A\09-w filename\09Write flash from file (stdin if \22-\22)\0A\09-u\09\09Disable the flash write-protection\0A\09-j\09\09Enable the flash read-protection\0A\09-k\09\09Disable the flash read-protection\0A\09-e\09\09Erase only\0A\09-g [+]address\09Start execution at specified address (0 = flash start)\0A\09-i\09\09Print information about target device and serial mode\0A\09-R \09\09Reset controller (default for read/write/erase/etc)\0A\0A\09-E\09\09Full erase\0A\09-v\09\09Verify writes\0A\09-n count\09Retry failed writes up to count times (default 10)\0A\09-S [+]address[:length]\09Specify start address and optionally length for\0A\09\09\09\09read/write/erase operations\0A\09-s start_page[:n_pages]\09Specify start address at page <start_page> (0 = flash start)\0A\09\09\09\09and optionally number of pages to erase\0A\09-M f|r|e|a\09Work with specified memory type (read/write/erase operation)\0A\09\09\09f - Flash (default), r - RAM, e - EEPROM, a - entire address space\0A\09-K \09\09Don`t Reset controller after operation (keep in bootloader)\0A\09-f\09\09Force binary parser\0A\09-c\09\09Resume the connection (don't send initial INIT)\0A\09\09\09*Baud rate must be kept the same as the first init*\0A\09\09\09This is useful with -K or if the reset fails\0A\09-V level\09Verbose output level (0 - silent, 1 - default, 2 - debug)\0A\0A\09-h\09\09Show this help\0A\0AExamples:\0A\09Get device information:\0A\09\09%s -p %s -i\0A\09Write with verify and then start execution:\0A\09\09%s -p %s -w filename -v -g +0\0A\09Show information and read flash to file:\0A\09\09%s -p %s -i -r filename\0A\09Read 100 bytes of RAM with offset 0x1000 to stdout:\0A\09\09%s -p %s -r - -Mr -S +0x1000:100\0A\09Read first page of flash to file in verbose mode:\0A\09\09%s -p %s -r readed.bin -S :1 -V2\0A\09Start execution:\0A\09\09%s -p %s -g 0x0\0A\00"
define void @show_help(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([1892 x i8], [1892 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %0, i8* %1, i8* %0, i8* %1, i8* %0, i8* %1, i8* %0, i8* %1, i8* %0, i8* %1, i8* %0, i8* %1)
ret void
}