#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*/ printf(char *, ...);
void printHelp() {
  printf("%s v%s\n", "binny", "1.2");
  printf("A simple in-place binary editor.\n");
  printf("Usage:\n\t%s [OPTIONS] FILENAME\n", "binny");
  printf("Options:\n\t-h\t\tPrint Help\n\t-a\t\tShow ASCII\n\t-l bytes\tSet "
         "bytes displayed per line, default 0x10\n\t-g bytes\tSet byte "
         "grouping, default 4\n");
  printf("Commands:\nAll commands are issued with shift-<command key>.\n");
  printf("\tQ\t\tquit - Exit the program\n");
  printf("\tS\t\tsave - Save the buffer to the file\n");
  printf("\tG\t\tgoto - Jump to a position in the buffer\n");
  printf("\tR\t\tresize - Resize the current buffer\n");
  printf("\tA\t\tascii_insert - Insert a string of ascii\n");
  printf("\tB\t\tbatch_insert - Insert a value repeatedly\n");
}


x86 assembly (clang, -O0):
<printHelp>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee6(%rip),%rsi
lea    0xee5(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
lea    0xebc(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfa0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfc9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfe8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1002(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1021(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHelp>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xed9(%rip),%rbx
lea    0xed8(%rip),%rdx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
lea    0xf67(%rip),%rdi
call   1030 <puts@plt>
lea    0xf97(%rip),%rdi
call   1030 <puts@plt>
lea    0xfa7(%rip),%rdi
call   1030 <puts@plt>
lea    0xfc2(%rip),%rdi
call   1030 <puts@plt>
lea    0xfe2(%rip),%rdi
call   1030 <puts@plt>
lea    0xffd(%rip),%rdi
call   1030 <puts@plt>
lea    0x101d(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s v%s\0A\00"
@.str.1 = [6 x i8] c"binny\00"
@.str.2 = [4 x i8] c"1.2\00"
@.str.3 = [34 x i8] c"A simple in-place binary editor.\0A\00"
@.str.4 = [31 x i8] c"Usage:\0A\09%s [OPTIONS] FILENAME\0A\00"
@.str.5 = [134 x i8] c"Options:\0A\09-h\09\09Print Help\0A\09-a\09\09Show ASCII\0A\09-l bytes\09Set bytes displayed per line, default 0x10\0A\09-g bytes\09Set byte grouping, default 4\0A\00"
@.str.6 = [61 x i8] c"Commands:\0AAll commands are issued with shift-<command key>.\0A\00"
@.str.7 = [29 x i8] c"\09Q\09\09quit - Exit the program\0A\00"
@.str.8 = [40 x i8] c"\09S\09\09save - Save the buffer to the file\0A\00"
@.str.9 = [45 x i8] c"\09G\09\09goto - Jump to a position in the buffer\0A\00"
@.str.10 = [40 x i8] c"\09R\09\09resize - Resize the current buffer\0A\00"
@.str.11 = [45 x i8] c"\09A\09\09ascii_insert - Insert a string of ascii\0A\00"
@.str.12 = [46 x i8] c"\09B\09\09batch_insert - Insert a value repeatedly\0A\00"
define void @printHelp() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str.5, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.6, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.9, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.10, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.11, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.12, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s v%s\0A\00"
@.str.1 = [6 x i8] c"binny\00"
@.str.2 = [4 x i8] c"1.2\00"
@.str.4 = [31 x i8] c"Usage:\0A\09%s [OPTIONS] FILENAME\0A\00"
@str = [33 x i8] c"A simple in-place binary editor.\00"
@str.13 = [133 x i8] c"Options:\0A\09-h\09\09Print Help\0A\09-a\09\09Show ASCII\0A\09-l bytes\09Set bytes displayed per line, default 0x10\0A\09-g bytes\09Set byte grouping, default 4\00"
@str.14 = [60 x i8] c"Commands:\0AAll commands are issued with shift-<command key>.\00"
@str.15 = [28 x i8] c"\09Q\09\09quit - Exit the program\00"
@str.16 = [39 x i8] c"\09S\09\09save - Save the buffer to the file\00"
@str.17 = [44 x i8] c"\09G\09\09goto - Jump to a position in the buffer\00"
@str.18 = [39 x i8] c"\09R\09\09resize - Resize the current buffer\00"
@str.19 = [44 x i8] c"\09A\09\09ascii_insert - Insert a string of ascii\00"
@str.20 = [45 x i8] c"\09B\09\09batch_insert - Insert a value repeatedly\00"
define void @printHelp() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([133 x i8], [133 x i8]* @str.13, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.14, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.15, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.16, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.17, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.18, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.19, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.20, i64 0, i64 0))
ret void
}