#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 *, char *, char *, char *,
                           char *, char *, char *, char *, char *);
int /*<<< orphan*/ stderr;
void show_help(char *name) {
  fprintf(
      stderr,
      "Usage: %s [-bvngfhc] [-[rw] filename] [tty_device | i2c_device]\n"
      "	-a bus_address	Bus address (e.g. for I2C port)\n"
      "	-b rate		Baud rate (default 57600)\n"
      "	-m mode		Serial port mode (default 8e1)\n"
      "	-r filename	Read flash to file (or - stdout)\n"
      "	-w filename	Write flash from file (or - stdout)\n"
      "	-C		Compute CRC of flash content\n"
      "	-u		Disable the flash write-protection\n"
      "	-j		Enable the flash read-protection\n"
      "	-k		Disable the flash read-protection\n"
      "	-o		Erase only\n"
      "	-e n		Only erase n pages before writing the flash\n"
      "	-v		Verify writes\n"
      "	-n count	Retry failed writes up to count times (default 10)\n"
      "	-g address	Start execution at specified address (0 = flash "
      "start)\n"
      "	-S address[:length]	Specify start address and optionally length "
      "for\n"
      "	                   	read/write/erase operations\n"
      "	-F RX_length[:TX_length]  Specify the max length of RX and TX frame\n"
      "	-s start_page	Flash at specified page (0 = flash start)\n"
      "	-f		Force binary parser\n"
      "	-h		Show this help\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 if the reset fails\n"
      "	-i GPIO_string	GPIO sequence to enter/exit bootloader mode\n"
      "			GPIO_string=[entry_seq][:[exit_seq]]\n"
      "			sequence=[-]n[,sequence]\n"
      "	-R		Reset device at exit.\n"
      "\n"
      "Examples:\n"
      "	Get device information:\n"
      "		%s /dev/ttyS0\n"
      "	  or:\n"
      "		%s /dev/i2c-0\n"
      "\n"
      "	Write with verify and then start execution:\n"
      "		%s -w filename -v -g 0x0 /dev/ttyS0\n"
      "\n"
      "	Read flash to file:\n"
      "		%s -r filename /dev/ttyS0\n"
      "\n"
      "	Read 100 bytes of flash from 0x1000 to stdout:\n"
      "		%s -r - -S 0x1000:100 /dev/ttyS0\n"
      "\n"
      "	Start execution:\n"
      "		%s -g 0x0 /dev/ttyS0\n"
      "\n"
      "	GPIO sequence:\n"
      "	- entry sequence: GPIO_3=low, GPIO_2=low, GPIO_2=high\n"
      "	- exit sequence: GPIO_3=high, GPIO_2=low, GPIO_2=high\n"
      "		%s -i -3,-2,2:3,-2,2 /dev/ttyS0\n",
      name, name, name, name, name, name, name, name);
}


x86 assembly (clang, -O0):
<show_help>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x28,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    -0x10(%rbp),%rbx
mov    -0x10(%rbp),%r11
mov    -0x10(%rbp),%r10
mov    -0x10(%rbp),%rax
lea    0xeb3(%rip),%rsi
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1030 <fprintf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_help>:
push   %rax
mov    %rdi,%rcx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    %rcx,%rdx
mov    %rcx,%r8
mov    %rcx,%r9
push   %rcx
push   %rcx
push   %rcx
push   %rcx
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rax
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [1735 x i8] c"Usage: %s [-bvngfhc] [-[rw] filename] [tty_device | i2c_device]\0A\09-a bus_address\09Bus address (e.g. for I2C port)\0A\09-b rate\09\09Baud rate (default 57600)\0A\09-m mode\09\09Serial port mode (default 8e1)\0A\09-r filename\09Read flash to file (or - stdout)\0A\09-w filename\09Write flash from file (or - stdout)\0A\09-C\09\09Compute CRC of flash content\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-o\09\09Erase only\0A\09-e n\09\09Only erase n pages before writing the flash\0A\09-v\09\09Verify writes\0A\09-n count\09Retry failed writes up to count times (default 10)\0A\09-g address\09Start execution at specified address (0 = flash start)\0A\09-S address[:length]\09Specify start address and optionally length for\0A\09 \09read/write/erase operations\0A\09-F RX_length[:TX_length] Specify the max length of RX and TX frame\0A\09-s start_page\09Flash at specified page (0 = flash start)\0A\09-f\09\09Force binary parser\0A\09-h\09\09Show this help\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 if the reset fails\0A\09-i GPIO_string\09GPIO sequence to enter/exit bootloader mode\0A\09\09\09GPIO_string=[entry_seq][:[exit_seq]]\0A\09\09\09sequence=[-]n[,sequence]\0A\09-R\09\09Reset device at exit.\0A\0AExamples:\0A\09Get device information:\0A\09\09%s /dev/ttyS0\0A\09 or:\0A\09\09%s /dev/i2c-0\0A\0A\09Write with verify and then start execution:\0A\09\09%s -w filename -v -g 0x0 /dev/ttyS0\0A\0A\09Read flash to file:\0A\09\09%s -r filename /dev/ttyS0\0A\0A\09Read 100 bytes of flash from 0x1000 to stdout:\0A\09\09%s -r - -S 0x1000:100 /dev/ttyS0\0A\0A\09Start execution:\0A\09\09%s -g 0x0 /dev/ttyS0\0A\0A\09GPIO sequence:\0A\09- entry sequence: GPIO_3=low, GPIO_2=low, GPIO_2=high\0A\09- exit sequence: GPIO_3=high, GPIO_2=low, GPIO_2=high\0A\09\09%s -i -3,-2,2:3,-2,2 /dev/ttyS0\0A\00"
define void @show_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = load i8*, i8** %2
%9 = load i8*, i8** %2
%10 = load i8*, i8** %2
%11 = load i8*, i8** %2
%12 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([1735 x i8], [1735 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5, i8* %6, i8* %7, i8* %8, i8* %9, i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [1735 x i8] c"Usage: %s [-bvngfhc] [-[rw] filename] [tty_device | i2c_device]\0A\09-a bus_address\09Bus address (e.g. for I2C port)\0A\09-b rate\09\09Baud rate (default 57600)\0A\09-m mode\09\09Serial port mode (default 8e1)\0A\09-r filename\09Read flash to file (or - stdout)\0A\09-w filename\09Write flash from file (or - stdout)\0A\09-C\09\09Compute CRC of flash content\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-o\09\09Erase only\0A\09-e n\09\09Only erase n pages before writing the flash\0A\09-v\09\09Verify writes\0A\09-n count\09Retry failed writes up to count times (default 10)\0A\09-g address\09Start execution at specified address (0 = flash start)\0A\09-S address[:length]\09Specify start address and optionally length for\0A\09 \09read/write/erase operations\0A\09-F RX_length[:TX_length] Specify the max length of RX and TX frame\0A\09-s start_page\09Flash at specified page (0 = flash start)\0A\09-f\09\09Force binary parser\0A\09-h\09\09Show this help\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 if the reset fails\0A\09-i GPIO_string\09GPIO sequence to enter/exit bootloader mode\0A\09\09\09GPIO_string=[entry_seq][:[exit_seq]]\0A\09\09\09sequence=[-]n[,sequence]\0A\09-R\09\09Reset device at exit.\0A\0AExamples:\0A\09Get device information:\0A\09\09%s /dev/ttyS0\0A\09 or:\0A\09\09%s /dev/i2c-0\0A\0A\09Write with verify and then start execution:\0A\09\09%s -w filename -v -g 0x0 /dev/ttyS0\0A\0A\09Read flash to file:\0A\09\09%s -r filename /dev/ttyS0\0A\0A\09Read 100 bytes of flash from 0x1000 to stdout:\0A\09\09%s -r - -S 0x1000:100 /dev/ttyS0\0A\0A\09Start execution:\0A\09\09%s -g 0x0 /dev/ttyS0\0A\0A\09GPIO sequence:\0A\09- entry sequence: GPIO_3=low, GPIO_2=low, GPIO_2=high\0A\09- exit sequence: GPIO_3=high, GPIO_2=low, GPIO_2=high\0A\09\09%s -i -3,-2,2:3,-2,2 /dev/ttyS0\0A\00"
define void @show_help(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([1735 x i8], [1735 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0, i8* %0, i8* %0, i8* %0, i8* %0, i8* %0, i8* %0)
ret void
}