#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 */
char *basename(char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
char *strdup(char const *);
void args_help(const char *argv0) {
  char *argv0_copy = strdup(argv0);
  char *argv0_base = basename(argv0_copy);
  printf("Usage: %s [OPTIONS] \n", argv0_base);
  printf("%s - \n", argv0_base);
  puts("");
  printf("  -i, --input\tinput file\n");
  printf("  -o, --output\toutput file\n");
  printf("  -f, --format\toutput format (markdown csv)\n");
  printf("  -t, --type\tdata type (hex int original)\n");
  printf("  -h, --help\tGive this help list\n");
  puts("");
  free(argv0_copy);
}


x86 assembly (clang, -O0):
<args_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <basename@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe7b(%rip),%rdi
call   1040 <puts@plt>
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe29(%rip),%rdi
call   1040 <puts@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<args_help>:
push   %r14
push   %rbx
push   %rax
call   1080 <strdup@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1070 <basename@plt>
mov    %rax,%rbx
lea    0xe82(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe87(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0xe73(%rip),%rdi
call   1050 <puts@plt>
lea    0xe80(%rip),%rdi
call   1050 <puts@plt>
lea    0xe8f(%rip),%rdi
call   1050 <puts@plt>
lea    0xeaf(%rip),%rdi
call   1050 <puts@plt>
lea    0xecd(%rip),%rdi
call   1050 <puts@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Usage: %s [OPTIONS] \0A\00"
@.str.1 = [7 x i8] c"%s - \0A\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [26 x i8] c" -i, --input\09input file\0A\00"
@.str.4 = [28 x i8] c" -o, --output\09output file\0A\00"
@.str.5 = [45 x i8] c" -f, --format\09output format (markdown csv)\0A\00"
@.str.6 = [43 x i8] c" -t, --type\09data type (hex int original)\0A\00"
@.str.7 = [34 x i8] c" -h, --help\09Give this help list\0A\00"
define void @args_help(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strdup(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @basename(i8* %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %4
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.7, i64 0, i64 0))
%19 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%20 = load i8*, i8** %3
%21 = call i32 @free(i8* %20)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Usage: %s [OPTIONS] \0A\00"
@.str.1 = [7 x i8] c"%s - \0A\00"
@str = [25 x i8] c" -i, --input\09input file\00"
@str.8 = [27 x i8] c" -o, --output\09output file\00"
@str.9 = [44 x i8] c" -f, --format\09output format (markdown csv)\00"
@str.10 = [42 x i8] c" -t, --type\09data type (hex int original)\00"
@str.11 = [33 x i8] c" -h, --help\09Give this help list\00"
define void @args_help(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = tail call i8* @basename(i8* %2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%6 = tail call i32 @putchar(i32 10)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.8, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.9, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.10, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.11, i64 0, i64 0))
%12 = tail call i32 @putchar(i32 10)
%13 = tail call i32 @free(i8* %2)
ret void
}