#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 usage(void) {
  printf("usage:\n");
  printf("\tbinaryzebra n_files image [n_bytes]\n");
  printf("\n");
  printf("\tsplit an image into multiple files\n");
  printf("\te.g. with n_files=2 one file will get all odd bytes, the other "
         "every even byte\n");
  printf("\te.g. with n_files=4 file1 will get all 4th bytes,\n");
  printf("\t                    file2          all 4th+1 bytes\n");
  printf("\t                    file3          all 4th+2 bytes\n");
  printf("\t                    file4          all 4th+3 bytes\n");
  printf("\tetc.\n");
  printf("\tn_bytes is optional, and can be given dec or hex\n");
  printf("\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xfa3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
call   1030 <printf@plt>
lea    0xf08(%rip),%rdi
call   1030 <printf@plt>
lea    0xf4d(%rip),%rdi
call   1030 <printf@plt>
lea    0xf75(%rip),%rdi
call   1030 <printf@plt>
lea    0xf9e(%rip),%rdi
call   1030 <printf@plt>
lea    0xfc7(%rip),%rdi
call   1030 <printf@plt>
lea    0xff0(%rip),%rdi
call   1030 <printf@plt>
lea    0xfeb(%rip),%rdi
call   1030 <printf@plt>
lea    0xf37(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
lea    0xed3(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xee2(%rip),%rdi
call   1040 <puts@plt>
lea    0xefa(%rip),%rdi
call   1040 <puts@plt>
lea    0xf3e(%rip),%rdi
call   1040 <puts@plt>
lea    0xf65(%rip),%rdi
call   1040 <puts@plt>
lea    0xf8d(%rip),%rdi
call   1040 <puts@plt>
lea    0xfb5(%rip),%rdi
call   1040 <puts@plt>
lea    0xfdd(%rip),%rdi
call   1040 <puts@plt>
lea    0xfd7(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"usage:\0A\00"
@.str.1 = [38 x i8] c"\09binaryzebra n_files image [n_bytes]\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [37 x i8] c"\09split an image into multiple files\0A\00"
@.str.4 = [81 x i8] c"\09e.g. with n_files=2 one file will get all odd bytes, the other every even byte\0A\00"
@.str.5 = [52 x i8] c"\09e.g. with n_files=4 file1 will get all 4th bytes,\0A\00"
@.str.6 = [53 x i8] c"\09 file2 all 4th+1 bytes\0A\00"
@.str.7 = [53 x i8] c"\09 file3 all 4th+2 bytes\0A\00"
@.str.8 = [53 x i8] c"\09 file4 all 4th+3 bytes\0A\00"
@.str.9 = [7 x i8] c"\09etc.\0A\00"
@.str.10 = [51 x i8] c"\09n_bytes is optional, and can be given dec or hex\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.6, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.7, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.8, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.10, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"usage:\00"
@str.11 = [37 x i8] c"\09binaryzebra n_files image [n_bytes]\00"
@str.12 = [36 x i8] c"\09split an image into multiple files\00"
@str.13 = [80 x i8] c"\09e.g. with n_files=2 one file will get all odd bytes, the other every even byte\00"
@str.14 = [51 x i8] c"\09e.g. with n_files=4 file1 will get all 4th bytes,\00"
@str.15 = [52 x i8] c"\09 file2 all 4th+1 bytes\00"
@str.16 = [52 x i8] c"\09 file3 all 4th+2 bytes\00"
@str.17 = [52 x i8] c"\09 file4 all 4th+3 bytes\00"
@str.18 = [6 x i8] c"\09etc.\00"
@str.19 = [50 x i8] c"\09n_bytes is optional, and can be given dec or hex\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.11, i64 0, i64 0))
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.12, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str.13, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.14, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.15, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.16, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.17, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.18, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.19, i64 0, i64 0))
%12 = tail call i32 @putchar(i32 10)
ret void
}