#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_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ print_eeprom();
int /*<<< orphan*/ printf(char *, ...);
void print_usage(const char *program_name, int flag_print_eeprom) {
  printf("\nUsage: %s [OPTIONS...]\n", program_name);
  printf("\n");
  printf("  -t, --tty=/dev/*         tty the arduino is connected to.\n");
  printf("  -b, --baudrate=N         baudrate of tty. Default sketch is "
         "115200.\n");
  printf("  -n, --num-bytes=N[k]     the number of bytes or Kbytes to read "
         "from the tty.\n");
  printf("  -d, --dev-type=type      read datasheet and see compatible type "
         "then set number 1 or 2 [REQUIRED IF NOT DEFAULT].\n");
  printf("  -o, --output-file=FILE   name to save FILE. Default is "
         "\"eeprom.bin\".\n");
  printf("  -f, --format=format      output format (a = ascii, d = dec, h = "
         "hex). Default is hexadecimal.\n");
  printf("  -p, --print=y/n          print the read content to screen. Default "
         "is yes.\n");
  printf("  -h, --help               print this screen.\n");
  if (flag_print_eeprom)
    print_eeprom();
  printf("\nExamples:\n");
  printf("  %s -t /dev/ttyACM0 -n 2k -p n -d 1\n", program_name);
  printf("  %s -t /dev/ttyACM0 -n 128k -o teste.bin\n", program_name);
  printf("  %s -t /dev/ttyACM0 -n 128K -d 2 -o teste.bin\n", program_name);
  printf("  %s -t /dev/ttyACM0 -n 256K -p n\n", program_name);
  printf("  %s -t /dev/ttyACM0 -n 64k -p n\n", program_name);
  printf("  %s -t /dev/ttyACM0 -n 64\n", program_name);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1050(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfc4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xffe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1051(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1091(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
je     11e0 <print_usage+0xb0>
mov    $0x0,%al
call   1040 <print_eeprom@plt>
lea    0x10a1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0x109b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0x10af(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0x10c8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0x10e6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0x10f7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0x1107(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2d7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xea1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xf81(%rip),%rdi
call   1040 <puts@plt>
lea    0xfb1(%rip),%rdi
call   1040 <puts@plt>
lea    0xfeb(%rip),%rdi
call   1040 <puts@plt>
lea    0x102e(%rip),%rdi
call   1040 <puts@plt>
lea    0x1096(%rip),%rdi
call   1040 <puts@plt>
lea    0x10d1(%rip),%rdi
call   1040 <puts@plt>
lea    0x1125(%rip),%rdi
call   1040 <puts@plt>
lea    0x1166(%rip),%rdi
call   1040 <puts@plt>
test   %ebp,%ebp
je     11de <print_usage+0x8e>
xor    %eax,%eax
call   1060 <print_eeprom@plt>
lea    0x117d(%rip),%rdi
call   1040 <puts@plt>
lea    0xe28(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe3d(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe57(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe76(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe88(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe99(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2d89(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"\0AUsage: %s [OPTIONS...]\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [61 x i8] c" -t, --tty=/dev/* tty the arduino is connected to.\0A\00"
@.str.3 = [71 x i8] c" -b, --baudrate=N baudrate of tty. Default sketch is 115200.\0A\00"
@.str.4 = [80 x i8] c" -n, --num-bytes=N[k] the number of bytes or Kbytes to read from the tty.\0A\00"
@.str.5 = [117 x i8] c" -d, --dev-type=type read datasheet and see compatible type then set number 1 or 2 [REQUIRED IF NOT DEFAULT].\0A\00"
@.str.6 = [72 x i8] c" -o, --output-file=FILE name to save FILE. Default is \22eeprom.bin\22.\0A\00"
@.str.7 = [97 x i8] c" -f, --format=format output format (a = ascii, d = dec, h = hex). Default is hexadecimal.\0A\00"
@.str.8 = [78 x i8] c" -p, --print=y/n print the read content to screen. Default is yes.\0A\00"
@.str.9 = [47 x i8] c" -h, --help print this screen.\0A\00"
@.str.10 = [12 x i8] c"\0AExamples:\0A\00"
@.str.11 = [38 x i8] c" %s -t /dev/ttyACM0 -n 2k -p n -d 1\0A\00"
@.str.12 = [43 x i8] c" %s -t /dev/ttyACM0 -n 128k -o teste.bin\0A\00"
@.str.13 = [48 x i8] c" %s -t /dev/ttyACM0 -n 128K -d 2 -o teste.bin\0A\00"
@.str.14 = [35 x i8] c" %s -t /dev/ttyACM0 -n 256K -p n\0A\00"
@.str.15 = [34 x i8] c" %s -t /dev/ttyACM0 -n 64k -p n\0A\00"
@.str.16 = [28 x i8] c" %s -t /dev/ttyACM0 -n 64\0A\00"
@EXIT_FAILURE = global i32 0
define void @print_usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str.5, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.6, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str.7, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.8, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.9, i64 0, i64 0))
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = call i32 (...) @print_eeprom()
br label %20
20: ; preds = %18, %2
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0))
%22 = load i8*, i8** %3
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.11, i64 0, i64 0), i8* %22)
%24 = load i8*, i8** %3
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0), i8* %24)
%26 = load i8*, i8** %3
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.13, i64 0, i64 0), i8* %26)
%28 = load i8*, i8** %3
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.14, i64 0, i64 0), i8* %28)
%30 = load i8*, i8** %3
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.15, i64 0, i64 0), i8* %30)
%32 = load i8*, i8** %3
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.16, i64 0, i64 0), i8* %32)
%34 = load i32, i32* @EXIT_FAILURE
%35 = call i32 @exit(i32 %34)
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"\0AUsage: %s [OPTIONS...]\0A\00"
@.str.11 = [38 x i8] c" %s -t /dev/ttyACM0 -n 2k -p n -d 1\0A\00"
@.str.12 = [43 x i8] c" %s -t /dev/ttyACM0 -n 128k -o teste.bin\0A\00"
@.str.13 = [48 x i8] c" %s -t /dev/ttyACM0 -n 128K -d 2 -o teste.bin\0A\00"
@.str.14 = [35 x i8] c" %s -t /dev/ttyACM0 -n 256K -p n\0A\00"
@.str.15 = [34 x i8] c" %s -t /dev/ttyACM0 -n 64k -p n\0A\00"
@.str.16 = [28 x i8] c" %s -t /dev/ttyACM0 -n 64\0A\00"
@EXIT_FAILURE = global i32 0
@str = [60 x i8] c" -t, --tty=/dev/* tty the arduino is connected to.\00"
@str.17 = [70 x i8] c" -b, --baudrate=N baudrate of tty. Default sketch is 115200.\00"
@str.18 = [79 x i8] c" -n, --num-bytes=N[k] the number of bytes or Kbytes to read from the tty.\00"
@str.19 = [116 x i8] c" -d, --dev-type=type read datasheet and see compatible type then set number 1 or 2 [REQUIRED IF NOT DEFAULT].\00"
@str.20 = [71 x i8] c" -o, --output-file=FILE name to save FILE. Default is \22eeprom.bin\22.\00"
@str.21 = [96 x i8] c" -f, --format=format output format (a = ascii, d = dec, h = hex). Default is hexadecimal.\00"
@str.22 = [77 x i8] c" -p, --print=y/n print the read content to screen. Default is yes.\00"
@str.23 = [46 x i8] c" -h, --help print this screen.\00"
@str.24 = [11 x i8] c"\0AExamples:\00"
define void @print_usage(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str.17, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str.18, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([116 x i8], [116 x i8]* @str.19, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.20, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([96 x i8], [96 x i8]* @str.21, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.22, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.23, i64 0, i64 0))
%13 = icmp eq i32 %1, 0
br i1 %13, label %16, label %14
14: ; preds = %2
%15 = tail call i32 (...) @print_eeprom()
br label %16
16: ; preds = %14, %2
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.24, i64 0, i64 0))
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.11, i64 0, i64 0), i8* %0)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0), i8* %0)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.13, i64 0, i64 0), i8* %0)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.14, i64 0, i64 0), i8* %0)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.15, i64 0, i64 0), i8* %0)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.16, i64 0, i64 0), i8* %0)
%24 = load i32, i32* @EXIT_FAILURE
%25 = tail call i32 @exit(i32 %24)
unreachable
}