#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 /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void print_help(char *name) {
  printf("CMSIS-DAP SWD programmer "
         "v0.5"
         ", built "
         "Mar 15 2022"
         " "
         "15:09:22"
         " \n");
  printf("Usage: %s [options]\n", name);
  printf("Options:\n");
  printf("  -h, --help                 print this help message and exit\n");
  printf("  -b, --verbose              print verbose messages\n");
  printf(
      "  -e, --erase                perform a chip erase before programming\n");
  printf("  -p, --program              program the chip\n");
  printf("  -v, --verify               verify memory\n");
  printf("  -k, --lock                 lock the chip (set security bit)\n");
  printf("  -r, --read                 read the whole content of the chip "
         "flash\n");
  printf("  -f, --file <file>          binary file to be programmed or "
         "verified\n");
  printf("  -t, --target <name>        specify a target type (use '-t list' "
         "for a list of supported target types)\n");
  printf("  -l, --list                 list all available debuggers\n");
  printf("  -s, --serial <number>      use a debugger with a specified serial "
         "number\n");
  printf("  -o, --offset <number>      offset for the operation\n");
  printf("  -z, --size <number>        size for the operation\n");
  exit(0);
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfc9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xffa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1033(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x106c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x10c7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x10f4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1132(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x115b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_help>:
push   %rbx
mov    %rdi,%rbx
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf27(%rip),%rdi
call   1030 <puts@plt>
lea    0xf4f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf88(%rip),%rdi
call   1030 <puts@plt>
lea    0xfaa(%rip),%rdi
call   1030 <puts@plt>
lea    0xfc9(%rip),%rdi
call   1030 <puts@plt>
lea    0xffb(%rip),%rdi
call   1030 <puts@plt>
lea    0x1035(%rip),%rdi
call   1030 <puts@plt>
lea    0x106f(%rip),%rdi
call   1030 <puts@plt>
lea    0x10cb(%rip),%rdi
call   1030 <puts@plt>
lea    0x10f9(%rip),%rdi
call   1030 <puts@plt>
lea    0x1138(%rip),%rdi
call   1030 <puts@plt>
lea    0x1162(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"CMSIS-DAP SWD programmer v0.5, built Mar 15 2022 15:09:22 \0A\00"
@.str.1 = [21 x i8] c"Usage: %s [options]\0A\00"
@.str.2 = [10 x i8] c"Options:\0A\00"
@.str.3 = [63 x i8] c" -h, --help print this help message and exit\0A\00"
@.str.4 = [53 x i8] c" -b, --verbose print verbose messages\0A\00"
@.str.5 = [70 x i8] c" -e, --erase perform a chip erase before programming\0A\00"
@.str.6 = [47 x i8] c" -p, --program program the chip\0A\00"
@.str.7 = [44 x i8] c" -v, --verify verify memory\0A\00"
@.str.8 = [63 x i8] c" -k, --lock lock the chip (set security bit)\0A\00"
@.str.9 = [71 x i8] c" -r, --read read the whole content of the chip flash\0A\00"
@.str.10 = [71 x i8] c" -f, --file <file> binary file to be programmed or verified\0A\00"
@.str.11 = [105 x i8] c" -t, --target <name> specify a target type (use '-t list' for a list of supported target types)\0A\00"
@.str.12 = [59 x i8] c" -l, --list list all available debuggers\0A\00"
@.str.13 = [76 x i8] c" -s, --serial <number> use a debugger with a specified serial number\0A\00"
@.str.14 = [55 x i8] c" -o, --offset <number> offset for the operation\0A\00"
@.str.15 = [53 x i8] c" -z, --size <number> size for the operation\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.8, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.9, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.10, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str.11, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.12, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.13, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.14, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.15, i64 0, i64 0))
%20 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"Usage: %s [options]\0A\00"
@str = [59 x i8] c"CMSIS-DAP SWD programmer v0.5, built Mar 15 2022 15:09:22 \00"
@str.16 = [9 x i8] c"Options:\00"
@str.17 = [62 x i8] c" -h, --help print this help message and exit\00"
@str.18 = [52 x i8] c" -b, --verbose print verbose messages\00"
@str.19 = [69 x i8] c" -e, --erase perform a chip erase before programming\00"
@str.20 = [46 x i8] c" -p, --program program the chip\00"
@str.21 = [43 x i8] c" -v, --verify verify memory\00"
@str.22 = [62 x i8] c" -k, --lock lock the chip (set security bit)\00"
@str.23 = [70 x i8] c" -r, --read read the whole content of the chip flash\00"
@str.24 = [70 x i8] c" -f, --file <file> binary file to be programmed or verified\00"
@str.25 = [104 x i8] c" -t, --target <name> specify a target type (use '-t list' for a list of supported target types)\00"
@str.26 = [58 x i8] c" -l, --list list all available debuggers\00"
@str.27 = [75 x i8] c" -s, --serial <number> use a debugger with a specified serial number\00"
@str.28 = [54 x i8] c" -o, --offset <number> offset for the operation\00"
@str.29 = [52 x i8] c" -z, --size <number> size for the operation\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.16, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.17, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.18, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str.19, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.20, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.21, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.22, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str.23, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str.24, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([104 x i8], [104 x i8]* @str.25, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.26, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.27, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.28, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.29, i64 0, i64 0))
%18 = tail call i32 @exit(i32 0)
unreachable
}