#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ prog_usage();
int /*<<< orphan*/ stderr;
void usage(const char *name) {
  fprintf(
      stderr,
      "usage: %s %s\n"
      "               [-q] [-b|-i] [-c] [-D] [-e] [-f prot_file|-F prot_mode]\n"
      "               [-r|-w] [-z] [-s [-s]] [chip] [file]\n"
      "       %s -l\n"
      "       %s -V\n\n"
      "  -b           use binary format (overrides auto-detection on input)\n"
      "  -c           compare Flash with file, can be combined with all other\n"
      "               operations\n"
      "  -e           erase the Flash (this is implied by -w)\n"
      "  -f prot_file read Flash protection from the specified file\n"
      "  -F prot_mode force Flash protection to specified mode (U, R, or W)\n"
      "  -i           write Intel HEX format (ignored for input; default: "
      "\"ROM\"\n"
      "               format)\n"
      "  -q           quiet operation, don't show progress bars\n"
      "  -r           read Flash content from chip to file\n"
      "  -s           read protection data from chip (with -c or -r: use to "
      "skip\n"
      "               over inaccessible blocks and include in HEX file;\n"
      "               with -e and -w: check; alone: decode and print)\n"
      "  -s -s        dump the entire block(s) of security data to standard "
      "output\n"
      "  -V           only print the version number and exit\n"
      "  -w           write Flash and security data from file to chip\n"
      "  -z           zero read-protected blocks when reading or comparing\n",
      name, "[-3|-5] [-d driver] [-D] [-p port] [-O option] [-P] [-R] [-v ...]",
      name, name);
  prog_usage();
  fprintf(stderr,
          "  chip      chip name, e.g., CY8C21323 (default: auto-detect)\n"
          "  file      binary or hex file to program/verify, \"-\" for "
          "stdin/stdout\n"
          "            (default: stdin/stdout)\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%r8
mov    -0x8(%rbp),%r9
lea    0xea8(%rip),%rsi
lea    0x1340(%rip),%rcx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <prog_usage@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
lea    0x1364(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ea5(%rip),%rbx
mov    (%rbx),%edi
lea    0xebc(%rip),%rsi
lea    0x1354(%rip),%rcx
mov    %rdx,%r8
mov    %rdx,%r9
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <prog_usage@plt>
mov    (%rbx),%edi
lea    0x1379(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [1183 x i8] c"usage: %s %s\0A [-q] [-b|-i] [-c] [-D] [-e] [-f prot_file|-F prot_mode]\0A [-r|-w] [-z] [-s [-s]] [chip] [file]\0A %s -l\0A %s -V\0A\0A -b use binary format (overrides auto-detection on input)\0A -c compare Flash with file, can be combined with all other\0A operations\0A -e erase the Flash (this is implied by -w)\0A -f prot_file read Flash protection from the specified file\0A -F prot_mode force Flash protection to specified mode (U, R, or W)\0A -i write Intel HEX format (ignored for input; default: \22ROM\22\0A format)\0A -q quiet operation, don't show progress bars\0A -r read Flash content from chip to file\0A -s read protection data from chip (with -c or -r: use to skip\0A over inaccessible blocks and include in HEX file;\0A with -e and -w: check; alone: decode and print)\0A -s -s dump the entire block(s) of security data to standard output\0A -V only print the version number and exit\0A -w write Flash and security data from file to chip\0A -z zero read-protected blocks when reading or comparing\0A\00"
@.str.1 = [66 x i8] c"[-3|-5] [-d driver] [-D] [-p port] [-O option] [-P] [-R] [-v ...]\00"
@.str.2 = [170 x i8] c" chip chip name, e.g., CY8C21323 (default: auto-detect)\0A file binary or hex file to program/verify, \22-\22 for stdin/stdout\0A (default: stdin/stdout)\0A\00"
define void @usage(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 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([1183 x i8], [1183 x i8]* @.str, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8* %6)
%8 = call i32 (...) @prog_usage()
%9 = load i32, i32* @stderr
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [1183 x i8] c"usage: %s %s\0A [-q] [-b|-i] [-c] [-D] [-e] [-f prot_file|-F prot_mode]\0A [-r|-w] [-z] [-s [-s]] [chip] [file]\0A %s -l\0A %s -V\0A\0A -b use binary format (overrides auto-detection on input)\0A -c compare Flash with file, can be combined with all other\0A operations\0A -e erase the Flash (this is implied by -w)\0A -f prot_file read Flash protection from the specified file\0A -F prot_mode force Flash protection to specified mode (U, R, or W)\0A -i write Intel HEX format (ignored for input; default: \22ROM\22\0A format)\0A -q quiet operation, don't show progress bars\0A -r read Flash content from chip to file\0A -s read protection data from chip (with -c or -r: use to skip\0A over inaccessible blocks and include in HEX file;\0A with -e and -w: check; alone: decode and print)\0A -s -s dump the entire block(s) of security data to standard output\0A -V only print the version number and exit\0A -w write Flash and security data from file to chip\0A -z zero read-protected blocks when reading or comparing\0A\00"
@.str.1 = [66 x i8] c"[-3|-5] [-d driver] [-D] [-p port] [-O option] [-P] [-R] [-v ...]\00"
@.str.2 = [170 x i8] c" chip chip name, e.g., CY8C21323 (default: auto-detect)\0A file binary or hex file to program/verify, \22-\22 for stdin/stdout\0A (default: stdin/stdout)\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([1183 x i8], [1183 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %0)
%4 = tail call i32 (...) @prog_usage()
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
}