#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ bin2c(char *, int, int /*<<< orphan*/ *,
                         int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ bin2h(char *, int, int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ syntax(char *);
int main(int argc, char *argv[]) {
  int l;
  FILE *in = NULL, *out = NULL, *outh = NULL;
  char *inname, *outname, *outhname;
  char *name = "bindata";
  int x = 1;
  char n[255];
  if (argc > 1 && strncmp(argv[1], "-N", 2) == 0) {
    name = argv[1] + 2;
    x++;
  }
  if (argc >= x + 1) {
    inname = argv[x];
  } else {
    syntax(argv[0]);
  }
  in = fopen(inname, "rb");
  if (!in) {
    printf("error: "
           "can't open input file: %s",
           inname);
    puts("\n");
    exit(1);
  };
  if (argc >= x + 2) {
    outname = argv[x + 1];
    if (argc >= x + 3) {
      outhname = argv[x + 2];
    } else {
      int k = strlen(outname);
      strcpy(n, outname);
      if (k > 2 && strncmp(argv[x + 1] + k - 2, ".c", 2) == 0) {
        strcpy(n + k - 2, ".h");
      } else {
        strcpy(n + k, ".h");
      }
      outhname = n;
    }
    outh = fopen(outhname, "wb");
    if (!outh) {
      printf("error: "
             "can't open .h output file: %s",
             outhname);
      puts("\n");
      exit(1);
    };
  } else {
    {
      printf("error: "
             "no output file");
      puts("\n");
      exit(1);
    };
  }
  out = fopen(outname, "wb");
  if (!out) {
    printf("error: "
           "can't open .c output file: %s",
           outname);
    puts("\n");
    exit(1);
  };
  fseek(in, 0, SEEK_END);
  l = ftell(in);
  fseek(in, 0, SEEK_SET);
  bin2c(name, l, in, out, inname);
  bin2h(name, l, outh, outhname);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x170,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
lea    0xe08(%rip),%rax
mov    %rax,-0x50(%rbp)
movl   $0x1,-0x54(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1249 <main+0x89>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdec(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1249 <main+0x89>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
add    $0x2,%rax
mov    %rax,-0x50(%rbp)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jl     126f <main+0xaf>
mov    -0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x38(%rbp)
jmp    127b <main+0xbb>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10a0 <syntax@plt>
mov    -0x38(%rbp),%rdi
lea    0xd85(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    12c2 <main+0x102>
mov    -0x38(%rbp),%rsi
lea    0xd69(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xd7c(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x8(%rbp),%eax
mov    -0x54(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jl     1413 <main+0x253>
mov    -0x10(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x54(%rbp),%ecx
add    $0x3,%ecx
cmp    %ecx,%eax
jl     1313 <main+0x153>
mov    -0x10(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x48(%rbp)
jmp    13c7 <main+0x207>
mov    -0x40(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,-0x164(%rbp)
lea    -0x160(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1040 <strcpy@plt>
cmpl   $0x2,-0x164(%rbp)
jle    139f <main+0x1df>
mov    -0x10(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
movslq -0x164(%rbp),%rax
add    %rax,%rdi
add    $0xfffffffffffffffe,%rdi
lea    0xccc(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    139f <main+0x1df>
lea    -0x160(%rbp),%rdi
movslq -0x164(%rbp),%rax
add    %rax,%rdi
add    $0xfffffffffffffffe,%rdi
lea    0xc9f(%rip),%rsi
call   1040 <strcpy@plt>
jmp    13bc <main+0x1fc>
lea    -0x160(%rbp),%rdi
movslq -0x164(%rbp),%rax
add    %rax,%rdi
lea    0xc7d(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x160(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
lea    0xc65(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    140e <main+0x24e>
mov    -0x48(%rbp),%rsi
lea    0xc49(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xc30(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
jmp    1437 <main+0x277>
lea    0xc45(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xc07(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x40(%rbp),%rdi
lea    0xbf5(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    147e <main+0x2be>
mov    -0x40(%rbp),%rsi
lea    0xc14(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xbc0(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x20(%rbp),%rdi
mov    0x2b5f(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    -0x20(%rbp),%rdi
call   1090 <ftell@plt>
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x2b2f(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    -0x50(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x38(%rbp),%r8
call   10c0 <bin2c@plt>
mov    -0x50(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x30(%rbp),%rdx
mov    -0x48(%rbp),%rcx
call   1060 <bin2h@plt>
xor    %eax,%eax
add    $0x170,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    %rsi,%r13
mov    %edi,%r14d
mov    $0x1,%ebx
lea    0xe1d(%rip),%r12
cmp    $0x2,%edi
jl     1202 <main+0x42>
mov    0x8(%r13),%rdi
lea    0xe15(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1210 <main+0x50>
cmp    %r14d,%ebx
jge    1222 <main+0x62>
mov    %ebx,%eax
mov    0x0(%r13,%rax,8),%rbp
jmp    122b <main+0x6b>
mov    0x8(%r13),%r12
add    $0x2,%r12
mov    $0x2,%ebx
cmp    %r14d,%ebx
jl     1207 <main+0x47>
mov    0x0(%r13),%rdi
call   10a0 <syntax@plt>
lea    0xdd9(%rip),%rsi
mov    %rbp,%rdi
call   10d0 <fopen@plt>
test   %rax,%rax
je     1389 <main+0x1c9>
mov    %rax,%r15
mov    %rbp,(%rsp)
mov    %r12,0x8(%rsp)
lea    0x2(%rbx),%eax
cmp    %r14d,%eax
jg     1392 <main+0x1d2>
lea    0x1(%rbx),%ecx
mov    %ecx,%r12d
mov    0x0(%r13,%r12,8),%rbp
add    $0x3,%ebx
cmp    %r14d,%ebx
jle    12d2 <main+0x112>
mov    %rbp,%rdi
call   1070 <strlen@plt>
mov    %eax,%ebx
lea    0x10(%rsp),%rdi
mov    %rbp,%rsi
call   1040 <strcpy@plt>
cmp    $0x3,%ebx
jl     12b4 <main+0xf4>
mov    0x0(%r13,%r12,8),%rax
mov    %ebx,%r14d
lea    (%rax,%r14,1),%rdi
add    $0xfffffffffffffffe,%rdi
lea    0xd90(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     137c <main+0x1bc>
movslq %ebx,%rax
lea    (%rsp,%rax,1),%rdi
add    $0x10,%rdi
lea    0xd6e(%rip),%rsi
call   1040 <strcpy@plt>
lea    0x10(%rsp),%r14
jmp    12d9 <main+0x119>
mov    %eax,%eax
mov    0x0(%r13,%rax,8),%r14
lea    0xd57(%rip),%rsi
mov    %r14,%rdi
call   10d0 <fopen@plt>
test   %rax,%rax
je     13a2 <main+0x1e2>
mov    %rax,%r13
lea    0xd3c(%rip),%rsi
mov    %rbp,%rdi
call   10d0 <fopen@plt>
test   %rax,%rax
je     13ae <main+0x1ee>
mov    %rax,%r12
mov    0x2cd2(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    %r15,%rdi
call   1090 <ftell@plt>
mov    %eax,%ebp
mov    0x2ca5(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r15,%rdx
mov    %r12,%rcx
mov    (%rsp),%r8
call   10c0 <bin2c@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r13,%rdx
mov    %r14,%rcx
call   1060 <bin2h@plt>
xor    %eax,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    (%rsp,%r14,1),%rdi
add    $0xe,%rdi
jmp    12bf <main+0xff>
lea    0xc7e(%rip),%rdi
jmp    13b5 <main+0x1f5>
lea    0xcc6(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
jmp    13bf <main+0x1ff>
lea    0xc91(%rip),%rdi
mov    %r14,%rsi
jmp    13b8 <main+0x1f8>
lea    0xcc0(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xc69(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"bindata\00"
@.str.1 = [3 x i8] c"-N\00"
@.str.2 = [3 x i8] c"rb\00"
@.str.3 = [33 x i8] c"error: can't open input file: %s\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [3 x i8] c".c\00"
@.str.6 = [3 x i8] c".h\00"
@.str.7 = [3 x i8] c"wb\00"
@.str.8 = [37 x i8] c"error: can't open .h output file: %s\00"
@.str.9 = [22 x i8] c"error: no output file\00"
@.str.10 = [37 x i8] c"error: can't open .c output file: %s\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
%15 = alloca [255 x i8]
%16 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %7
store i32* null, i32** %8
store i32* null, i32** %9
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %13
store i32 1, i32* %14
%17 = load i32, i32* %4
%18 = icmp sgt i32 %17, 1
br i1 %18, label %19, label %32
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i64 @strncmp(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %32
25: ; preds = %19
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = getelementptr inbounds i8, i8* %28, i64 2
store i8* %29, i8** %13
%30 = load i32, i32* %14
%31 = add nsw i32 %30, 1
store i32 %31, i32* %14
br label %32
32: ; preds = %25, %19, %2
%33 = load i32, i32* %4
%34 = load i32, i32* %14
%35 = add nsw i32 %34, 1
%36 = icmp sge i32 %33, %35
br i1 %36, label %37, label %43
37: ; preds = %32
%38 = load i8**, i8*** %5
%39 = load i32, i32* %14
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8*, i8** %38, i64 %40
%42 = load i8*, i8** %41
store i8* %42, i8** %10
br label %48
43: ; preds = %32
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 0
%46 = load i8*, i8** %45
%47 = call i32 @syntax(i8* %46)
br label %48
48: ; preds = %43, %37
%49 = load i8*, i8** %10
%50 = call i32* @fopen(i8* %49, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %50, i32** %7
%51 = load i32*, i32** %7
%52 = icmp ne i32* %51, null
br i1 %52, label %58, label %53
53: ; preds = %48
%54 = load i8*, i8** %10
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i8* %54)
%56 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%57 = call i32 @exit(i32 1)
unreachable
58: ; preds = %48
%59 = load i32, i32* %4
%60 = load i32, i32* %14
%61 = add nsw i32 %60, 2
%62 = icmp sge i32 %59, %61
br i1 %62, label %63, label %128
63: ; preds = %58
%64 = load i8**, i8*** %5
%65 = load i32, i32* %14
%66 = add nsw i32 %65, 1
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i8*, i8** %64, i64 %67
%69 = load i8*, i8** %68
store i8* %69, i8** %11
%70 = load i32, i32* %4
%71 = load i32, i32* %14
%72 = add nsw i32 %71, 3
%73 = icmp sge i32 %70, %72
br i1 %73, label %74, label %81
74: ; preds = %63
%75 = load i8**, i8*** %5
%76 = load i32, i32* %14
%77 = add nsw i32 %76, 2
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i8*, i8** %75, i64 %78
%80 = load i8*, i8** %79
store i8* %80, i8** %12
br label %117
81: ; preds = %63
%82 = load i8*, i8** %11
%83 = call i32 @strlen(i8* %82)
store i32 %83, i32* %16
%84 = getelementptr inbounds [255 x i8], [255 x i8]* %15, i64 0, i64 0
%85 = load i8*, i8** %11
%86 = call i32 @strcpy(i8* %84, i8* %85)
%87 = load i32, i32* %16
%88 = icmp sgt i32 %87, 2
br i1 %88, label %89, label %109
89: ; preds = %81
%90 = load i8**, i8*** %5
%91 = load i32, i32* %14
%92 = add nsw i32 %91, 1
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i8*, i8** %90, i64 %93
%95 = load i8*, i8** %94
%96 = load i32, i32* %16
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds i8, i8* %95, i64 %97
%99 = getelementptr inbounds i8, i8* %98, i64 -2
%100 = call i64 @strncmp(i8* %99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2)
%101 = icmp eq i64 %100, 0
br i1 %101, label %102, label %109
102: ; preds = %89
%103 = getelementptr inbounds [255 x i8], [255 x i8]* %15, i64 0, i64 0
%104 = load i32, i32* %16
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i8, i8* %103, i64 %105
%107 = getelementptr inbounds i8, i8* %106, i64 -2
%108 = call i32 @strcpy(i8* %107, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %115
109: ; preds = %89, %81
%110 = getelementptr inbounds [255 x i8], [255 x i8]* %15, i64 0, i64 0
%111 = load i32, i32* %16
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds i8, i8* %110, i64 %112
%114 = call i32 @strcpy(i8* %113, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %115
115: ; preds = %109, %102
%116 = getelementptr inbounds [255 x i8], [255 x i8]* %15, i64 0, i64 0
store i8* %116, i8** %12
br label %117
117: ; preds = %115, %74
%118 = load i8*, i8** %12
%119 = call i32* @fopen(i8* %118, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
store i32* %119, i32** %9
%120 = load i32*, i32** %9
%121 = icmp ne i32* %120, null
br i1 %121, label %127, label %122
122: ; preds = %117
%123 = load i8*, i8** %12
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i8* %123)
%125 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%126 = call i32 @exit(i32 1)
unreachable
127: ; preds = %117
br label %132
128: ; preds = %58
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0))
%130 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%131 = call i32 @exit(i32 1)
unreachable
132: ; preds = %127
%133 = load i8*, i8** %11
%134 = call i32* @fopen(i8* %133, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
store i32* %134, i32** %8
%135 = load i32*, i32** %8
%136 = icmp ne i32* %135, null
br i1 %136, label %142, label %137
137: ; preds = %132
%138 = load i8*, i8** %11
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), i8* %138)
%140 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%141 = call i32 @exit(i32 1)
unreachable
142: ; preds = %132
%143 = load i32*, i32** %7
%144 = load i32, i32* @SEEK_END
%145 = call i32 @fseek(i32* %143, i32 0, i32 %144)
%146 = load i32*, i32** %7
%147 = call i32 @ftell(i32* %146)
store i32 %147, i32* %6
%148 = load i32*, i32** %7
%149 = load i32, i32* @SEEK_SET
%150 = call i32 @fseek(i32* %148, i32 0, i32 %149)
%151 = load i8*, i8** %13
%152 = load i32, i32* %6
%153 = load i32*, i32** %7
%154 = load i32*, i32** %8
%155 = load i8*, i8** %10
%156 = call i32 @bin2c(i8* %151, i32 %152, i32* %153, i32* %154, i8* %155)
%157 = load i8*, i8** %13
%158 = load i32, i32* %6
%159 = load i32*, i32** %9
%160 = load i8*, i8** %12
%161 = call i32 @bin2h(i8* %157, i32 %158, i32* %159, i8* %160)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"bindata\00"
@.str.1 = [3 x i8] c"-N\00"
@.str.2 = [3 x i8] c"rb\00"
@.str.3 = [33 x i8] c"error: can't open input file: %s\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [3 x i8] c".c\00"
@.str.6 = [3 x i8] c".h\00"
@.str.7 = [3 x i8] c"wb\00"
@.str.8 = [37 x i8] c"error: can't open .h output file: %s\00"
@.str.9 = [22 x i8] c"error: no output file\00"
@.str.10 = [37 x i8] c"error: can't open .c output file: %s\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [255 x i8]
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %14
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @strncmp(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = load i8*, i8** %7
%13 = getelementptr inbounds i8, i8* %12, i64 2
br label %14
14: ; preds = %11, %6, %2
%15 = phi i8* [ %13, %11 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %6 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %2 ]
%16 = phi i32 [ 2, %11 ], [ 1, %6 ], [ 1, %2 ]
%17 = add nuw nsw i32 %16, 1
%18 = icmp slt i32 %16, %0
br i1 %18, label %19, label %23
19: ; preds = %14
%20 = zext i32 %16 to i64
%21 = getelementptr inbounds i8*, i8** %1, i64 %20
%22 = load i8*, i8** %21
br label %26
23: ; preds = %14
%24 = load i8*, i8** %1
%25 = tail call i32 @syntax(i8* %24)
br label %26
26: ; preds = %23, %19
%27 = phi i8* [ %22, %19 ], [ undef, %23 ]
%28 = tail call i32* @fopen(i8* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%29 = icmp eq i32* %28, null
br i1 %29, label %30, label %34
30: ; preds = %26
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i8* %27)
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%33 = tail call i32 @exit(i32 1)
unreachable
34: ; preds = %26
%35 = add nuw nsw i32 %16, 2
%36 = icmp sgt i32 %35, %0
br i1 %36, label %74, label %37
37: ; preds = %34
%38 = zext i32 %17 to i64
%39 = getelementptr inbounds i8*, i8** %1, i64 %38
%40 = load i8*, i8** %39
%41 = add nuw nsw i32 %16, 3
%42 = icmp sgt i32 %41, %0
br i1 %42, label %47, label %43
43: ; preds = %37
%44 = zext i32 %35 to i64
%45 = getelementptr inbounds i8*, i8** %1, i64 %44
%46 = load i8*, i8** %45
br label %66
47: ; preds = %37
%48 = tail call i32 @strlen(i8* %40)
%49 = call i32 @strcpy(i8* %4, i8* %40)
%50 = icmp sgt i32 %48, 2
br i1 %50, label %51, label %62
51: ; preds = %47
%52 = load i8*, i8** %39
%53 = zext i32 %48 to i64
%54 = getelementptr inbounds i8, i8* %52, i64 %53
%55 = getelementptr inbounds i8, i8* %54, i64 -2
%56 = call i64 @strncmp(i8* %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 2)
%57 = icmp eq i64 %56, 0
br i1 %57, label %58, label %62
58: ; preds = %51
%59 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 %53
%60 = getelementptr inbounds i8, i8* %59, i64 -2
%61 = call i32 @strcpy(i8* %60, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %66
62: ; preds = %51, %47
%63 = sext i32 %48 to i64
%64 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 %63
%65 = call i32 @strcpy(i8* %64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %66
66: ; preds = %58, %62, %43
%67 = phi i8* [ %46, %43 ], [ %4, %62 ], [ %4, %58 ]
%68 = call i32* @fopen(i8* %67, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%69 = icmp eq i32* %68, null
br i1 %69, label %70, label %78
70: ; preds = %66
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i8* %67)
%72 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%73 = call i32 @exit(i32 1)
unreachable
74: ; preds = %34
%75 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0))
%76 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%77 = tail call i32 @exit(i32 1)
unreachable
78: ; preds = %66
%79 = call i32* @fopen(i8* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%80 = icmp eq i32* %79, null
br i1 %80, label %81, label %85
81: ; preds = %78
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), i8* %40)
%83 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%84 = call i32 @exit(i32 1)
unreachable
85: ; preds = %78
%86 = load i32, i32* @SEEK_END
%87 = call i32 @fseek(i32* %28, i32 0, i32 %86)
%88 = call i32 @ftell(i32* %28)
%89 = load i32, i32* @SEEK_SET
%90 = call i32 @fseek(i32* %28, i32 0, i32 %89)
%91 = call i32 @bin2c(i8* %15, i32 %88, i32* %28, i32* %79, i8* %27)
%92 = call i32 @bin2h(i8* %15, i32 %88, i32* %68, i8* %67)
ret i32 0
}