#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 EOF;
int /*<<< orphan*/ clean(char *);
scalar_t__ fclose(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *strrchr(char *, char);
int main(int argc, char **argv) {
  FILE *fi, *fo;
  char name[256];
  char *realname;
  int i, j, c;
  if (argc < 3) {
    fprintf(stderr, "usage: bin2hex output.h lots of text files\n");
    return 1;
  }
  fo = fopen(argv[1], "wb");
  if (!fo) {
    fprintf(stderr, "cquote: could not open output file '%s'\n", argv[1]);
    return 1;
  }
  fprintf(fo, "/* This is an automatically generated file. Do not edit. */\n");
  for (i = 2; i < argc; i++) {
    realname = strrchr(argv[i], '/');
    if (!realname)
      realname = strrchr(argv[i], '\\');
    if (realname)
      realname++;
    else
      realname = argv[i];
    if (strlen(realname) > (sizeof name - 1)) {
      fprintf(stderr, "bin2hex: file name too long\n");
      if (fclose(fo)) {
        fprintf(stderr, "bin2hex: could not close output file '%s'\n", argv[1]);
        return 1;
      }
      return 1;
    }
    strcpy(name, realname);
    clean(name);
    fi = fopen(argv[i], "rb");
    j = 0;
    while ((c = fgetc(fi)) != EOF) {
      if (j != 0) {
        fputc(',', fo);
        fputc(j % 8 == 0 ? '\n' : ' ', fo);
      }
      fprintf(fo, "0x%02x", c);
      j++;
    }
    fputc('\n', fo);
    if (fclose(fi)) {
      fprintf(stderr, "bin2hex: could not close input file '%s'\n", argv[i]);
      return 1;
    }
  }
  if (fclose(fo)) {
    fprintf(stderr, "bin2hex: could not close output file '%s'\n", argv[1]);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11d6 <main+0x46>
mov    0x2e1e(%rip),%rax
mov    (%rax),%edi
lea    0xe3d(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14df <main+0x34f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe47(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1224 <main+0x94>
mov    0x2dd8(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe1e(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14df <main+0x34f>
mov    -0x20(%rbp),%rax
mov    %eax,%edi
lea    0xe27(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x2,-0x12c(%rbp)
mov    -0x12c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    149a <main+0x30a>
mov    -0x10(%rbp),%rax
movslq -0x12c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x2f,%esi
call   1060 <strrchr@plt>
mov    %rax,-0x128(%rbp)
cmpq   $0x0,-0x128(%rbp)
jne    129f <main+0x10f>
mov    -0x10(%rbp),%rax
movslq -0x12c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x5c,%esi
call   1060 <strrchr@plt>
mov    %rax,-0x128(%rbp)
cmpq   $0x0,-0x128(%rbp)
je     12c4 <main+0x134>
mov    -0x128(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x128(%rbp)
jmp    12da <main+0x14a>
mov    -0x10(%rbp),%rax
movslq -0x12c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x128(%rbp)
mov    -0x128(%rbp),%rdi
call   1050 <strlen@plt>
cltq
cmp    $0xff,%rax
jbe    1355 <main+0x1c5>
mov    0x2cdd(%rip),%rax
mov    (%rax),%edi
lea    0xd91(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
cmp    $0x0,%rax
je     1349 <main+0x1b9>
mov    0x2cb3(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd7c(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14df <main+0x34f>
movl   $0x1,-0x4(%rbp)
jmp    14df <main+0x34f>
lea    -0x120(%rbp),%rdi
mov    -0x128(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x120(%rbp),%rdi
call   10a0 <clean@plt>
mov    -0x10(%rbp),%rax
movslq -0x12c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd53(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x130(%rbp)
mov    -0x18(%rbp),%rdi
call   1070 <fgetc@plt>
mov    %eax,-0x134(%rbp)
mov    0x2c35(%rip),%rcx
cmp    (%rcx),%eax
je     142e <main+0x29e>
cmpl   $0x0,-0x130(%rbp)
je     1400 <main+0x270>
mov    -0x20(%rbp),%rsi
mov    $0x2c,%edi
call   1080 <fputc@plt>
mov    -0x130(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    $0x20,%eax
mov    $0xa,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
mov    -0x20(%rbp),%rsi
movsbl %al,%edi
call   1080 <fputc@plt>
mov    -0x20(%rbp),%rax
mov    %eax,%edi
mov    -0x134(%rbp),%edx
lea    0xccd(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x130(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x130(%rbp)
jmp    139d <main+0x20d>
mov    -0x20(%rbp),%rsi
mov    $0xa,%edi
call   1080 <fputc@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
cmp    $0x0,%rax
je     1481 <main+0x2f1>
mov    0x2b82(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x12c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xc79(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14df <main+0x34f>
jmp    1486 <main+0x2f6>
mov    -0x12c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x12c(%rbp)
jmp    1242 <main+0xb2>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
cmp    $0x0,%rax
je     14d8 <main+0x348>
mov    0x2b24(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xbed(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14df <main+0x34f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
cmp    $0x2,%edi
jg     11c2 <main+0x32>
mov    0x2e2b(%rip),%rax
mov    (%rax),%edi
lea    0xe4a(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    13f3 <main+0x263>
mov    %rsi,%r13
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
lea    0xe5a(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1377 <main+0x1e7>
mov    %rax,%rbx
lea    0xe6e(%rip),%rsi
mov    %ebx,%edi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %ebp,%eax
mov    %rax,0x18(%rsp)
mov    $0x2,%ebp
mov    0x2de2(%rip),%r14
lea    0xed3(%rip),%r15
mov    %r13,0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x0(%r13,%rbp,8),%r12
mov    %r12,%rdi
mov    $0x2f,%esi
call   1060 <strrchr@plt>
test   %rax,%rax
jne    1249 <main+0xb9>
mov    %r12,%rdi
mov    $0x5c,%esi
call   1060 <strrchr@plt>
test   %rax,%rax
je     1250 <main+0xc0>
add    $0x1,%rax
mov    %rax,%r12
mov    %r12,%rdi
call   1050 <strlen@plt>
cmp    $0x100,%eax
jae    138d <main+0x1fd>
mov    %r12,%rsi
mov    %r13,%r12
lea    0x20(%rsp),%r13
mov    %r13,%rdi
call   1030 <strcpy@plt>
mov    %r13,%rdi
call   10a0 <clean@plt>
mov    %rbp,0x10(%rsp)
mov    (%r12,%rbp,8),%rdi
lea    0xe4f(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%rbp
mov    %rax,%rdi
call   1070 <fgetc@plt>
cmp    (%r14),%eax
je     1319 <main+0x189>
mov    %ebx,%edi
mov    %r15,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %rbp,%rdi
call   1070 <fgetc@plt>
cmp    (%r14),%eax
je     1319 <main+0x189>
mov    %eax,%r12d
mov    $0x1,%r13d
nopw   0x0(%rax,%rax,1)
mov    $0x2c,%edi
mov    %rbx,%rsi
call   1080 <fputc@plt>
test   $0x7,%r13b
mov    $0x20,%edi
mov    $0xa,%eax
cmove  %eax,%edi
mov    %rbx,%rsi
call   1080 <fputc@plt>
mov    %ebx,%edi
mov    %r15,%rsi
mov    %r12d,%edx
xor    %eax,%eax
call   1090 <fprintf@plt>
add    $0x1,%r13d
mov    %rbp,%rdi
call   1070 <fgetc@plt>
mov    %eax,%r12d
cmp    (%r14),%eax
jne    12d0 <main+0x140>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1080 <fputc@plt>
mov    %rbp,%rdi
call   1040 <fclose@plt>
test   %rax,%rax
jne    13ce <main+0x23e>
mov    0x10(%rsp),%rbp
add    $0x1,%rbp
cmp    0x18(%rsp),%rbp
mov    0x8(%rsp),%r13
jne    1220 <main+0x90>
mov    %rbx,%rdi
call   1040 <fclose@plt>
test   %rax,%rax
je     140c <main+0x27c>
mov    0x2c70(%rip),%rax
mov    (%rax),%edi
mov    0x8(%r13),%rdx
lea    0xd3d(%rip),%rsi
jmp    13ec <main+0x25c>
mov    0x2c5a(%rip),%rax
mov    (%rax),%edi
mov    0x8(%r13),%rdx
lea    0xca4(%rip),%rsi
jmp    13ec <main+0x25c>
mov    0x2c44(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0xcf7(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    $0x1,%ebx
test   %rax,%rax
je     13f8 <main+0x268>
mov    0x0(%rbp),%edi
mov    0x8(%r13),%rdx
lea    0xced(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    13f8 <main+0x268>
mov    0x2c03(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rsp),%rax
mov    0x10(%rsp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xcfb(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x128,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ebx,%ebx
jmp    13f8 <main+0x268>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"usage: bin2hex output.h lots of text files\0A\00"
@.str.1 = [3 x i8] c"wb\00"
@.str.2 = [41 x i8] c"cquote: could not open output file '%s'\0A\00"
@.str.3 = [61 x i8] c"/* This is an automatically generated file. Do not edit. */\0A\00"
@.str.4 = [29 x i8] c"bin2hex: file name too long\0A\00"
@.str.5 = [43 x i8] c"bin2hex: could not close output file '%s'\0A\00"
@.str.6 = [3 x i8] c"rb\00"
@EOF = global i32 0
@.str.7 = [7 x i8] c"0x%02x\00"
@.str.8 = [42 x i8] c"bin2hex: could not close input file '%s'\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca [256 x i8]
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 3
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %152
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32* @fopen(i8* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %22, i32** %7
%23 = load i32*, i32** %7
%24 = icmp ne i32* %23, null
br i1 %24, label %31, label %25
25: ; preds = %18
%26 = load i32, i32* @stderr
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i8* %29)
store i32 1, i32* %3
br label %152
31: ; preds = %18
%32 = load i32*, i32** %7
%33 = ptrtoint i32* %32 to i32
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0))
store i32 2, i32* %10
br label %35
35: ; preds = %138, %31
%36 = load i32, i32* %10
%37 = load i32, i32* %4
%38 = icmp slt i32 %36, %37
br i1 %38, label %39, label %141
39: ; preds = %35
%40 = load i8**, i8*** %5
%41 = load i32, i32* %10
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i8*, i8** %40, i64 %42
%44 = load i8*, i8** %43
%45 = call i8* @strrchr(i8* %44, i8 signext 47)
store i8* %45, i8** %9
%46 = load i8*, i8** %9
%47 = icmp ne i8* %46, null
br i1 %47, label %55, label %48
48: ; preds = %39
%49 = load i8**, i8*** %5
%50 = load i32, i32* %10
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8*, i8** %49, i64 %51
%53 = load i8*, i8** %52
%54 = call i8* @strrchr(i8* %53, i8 signext 92)
store i8* %54, i8** %9
br label %55
55: ; preds = %48, %39
%56 = load i8*, i8** %9
%57 = icmp ne i8* %56, null
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = load i8*, i8** %9
%60 = getelementptr inbounds i8, i8* %59, i32 1
store i8* %60, i8** %9
br label %67
61: ; preds = %55
%62 = load i8**, i8*** %5
%63 = load i32, i32* %10
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i8*, i8** %62, i64 %64
%66 = load i8*, i8** %65
store i8* %66, i8** %9
br label %67
67: ; preds = %61, %58
%68 = load i8*, i8** %9
%69 = call i32 @strlen(i8* %68)
%70 = sext i32 %69 to i64
%71 = icmp ugt i64 %70, 255
br i1 %71, label %72, label %85
72: ; preds = %67
%73 = load i32, i32* @stderr
%74 = call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
%75 = load i32*, i32** %7
%76 = call i64 @fclose(i32* %75)
%77 = icmp ne i64 %76, 0
br i1 %77, label %78, label %84
78: ; preds = %72
%79 = load i32, i32* @stderr
%80 = load i8**, i8*** %5
%81 = getelementptr inbounds i8*, i8** %80, i64 1
%82 = load i8*, i8** %81
%83 = call i32 (i32, i8*, ...) @fprintf(i32 %79, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i8* %82)
store i32 1, i32* %3
br label %152
84: ; preds = %72
store i32 1, i32* %3
br label %152
85: ; preds = %67
%86 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%87 = load i8*, i8** %9
%88 = call i32 @strcpy(i8* %86, i8* %87)
%89 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%90 = call i32 @clean(i8* %89)
%91 = load i8**, i8*** %5
%92 = load i32, i32* %10
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i8*, i8** %91, i64 %93
%95 = load i8*, i8** %94
%96 = call i32* @fopen(i8* %95, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
store i32* %96, i32** %6
store i32 0, i32* %11
br label %97
97: ; preds = %116, %85
%98 = load i32*, i32** %6
%99 = call i32 @fgetc(i32* %98)
store i32 %99, i32* %12
%100 = load i32, i32* @EOF
%101 = icmp ne i32 %99, %100
br i1 %101, label %102, label %123
102: ; preds = %97
%103 = load i32, i32* %11
%104 = icmp ne i32 %103, 0
br i1 %104, label %105, label %116
105: ; preds = %102
%106 = load i32*, i32** %7
%107 = call i32 @fputc(i8 signext 44, i32* %106)
%108 = load i32, i32* %11
%109 = srem i32 %108, 8
%110 = icmp eq i32 %109, 0
%111 = zext i1 %110 to i64
%112 = select i1 %110, i32 10, i32 32
%113 = trunc i32 %112 to i8
%114 = load i32*, i32** %7
%115 = call i32 @fputc(i8 signext %113, i32* %114)
br label %116
116: ; preds = %105, %102
%117 = load i32*, i32** %7
%118 = ptrtoint i32* %117 to i32
%119 = load i32, i32* %12
%120 = call i32 (i32, i8*, ...) @fprintf(i32 %118, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i32 %119)
%121 = load i32, i32* %11
%122 = add nsw i32 %121, 1
store i32 %122, i32* %11
br label %97
123: ; preds = %97
%124 = load i32*, i32** %7
%125 = call i32 @fputc(i8 signext 10, i32* %124)
%126 = load i32*, i32** %6
%127 = call i64 @fclose(i32* %126)
%128 = icmp ne i64 %127, 0
br i1 %128, label %129, label %137
129: ; preds = %123
%130 = load i32, i32* @stderr
%131 = load i8**, i8*** %5
%132 = load i32, i32* %10
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds i8*, i8** %131, i64 %133
%135 = load i8*, i8** %134
%136 = call i32 (i32, i8*, ...) @fprintf(i32 %130, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0), i8* %135)
store i32 1, i32* %3
br label %152
137: ; preds = %123
br label %138
138: ; preds = %137
%139 = load i32, i32* %10
%140 = add nsw i32 %139, 1
store i32 %140, i32* %10
br label %35
141: ; preds = %35
%142 = load i32*, i32** %7
%143 = call i64 @fclose(i32* %142)
%144 = icmp ne i64 %143, 0
br i1 %144, label %145, label %151
145: ; preds = %141
%146 = load i32, i32* @stderr
%147 = load i8**, i8*** %5
%148 = getelementptr inbounds i8*, i8** %147, i64 1
%149 = load i8*, i8** %148
%150 = call i32 (i32, i8*, ...) @fprintf(i32 %146, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i8* %149)
store i32 1, i32* %3
br label %152
151: ; preds = %141
store i32 0, i32* %3
br label %152
152: ; preds = %151, %145, %129, %84, %78, %25, %15
%153 = load i32, i32* %3
ret i32 %153
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"usage: bin2hex output.h lots of text files\0A\00"
@.str.1 = [3 x i8] c"wb\00"
@.str.2 = [41 x i8] c"cquote: could not open output file '%s'\0A\00"
@.str.3 = [61 x i8] c"/* This is an automatically generated file. Do not edit. */\0A\00"
@.str.4 = [29 x i8] c"bin2hex: file name too long\0A\00"
@.str.5 = [43 x i8] c"bin2hex: could not close output file '%s'\0A\00"
@.str.6 = [3 x i8] c"rb\00"
@EOF = global i32 0
@.str.7 = [7 x i8] c"0x%02x\00"
@.str.8 = [42 x i8] c"bin2hex: could not close input file '%s'\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = icmp slt i32 %0, 3
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %92
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32* @fopen(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %18
14: ; preds = %9
%15 = load i32, i32* @stderr
%16 = load i8*, i8** %10
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i8* %16)
br label %92
18: ; preds = %9
%19 = ptrtoint i32* %12 to i64
%20 = trunc i64 %19 to i32
%21 = tail call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0))
%22 = zext i32 %0 to i64
br label %25
23: ; preds = %76
%24 = icmp eq i64 %80, %22
br i1 %24, label %85, label %25
25: ; preds = %18, %23
%26 = phi i64 [ 2, %18 ], [ %80, %23 ]
%27 = getelementptr inbounds i8*, i8** %1, i64 %26
%28 = load i8*, i8** %27
%29 = call i8* @strrchr(i8* dereferenceable(1) %28, i8 signext 47)
%30 = icmp eq i8* %29, null
br i1 %30, label %31, label %34
31: ; preds = %25
%32 = call i8* @strrchr(i8* dereferenceable(1) %28, i8 signext 92)
%33 = icmp eq i8* %32, null
br i1 %33, label %37, label %34
34: ; preds = %25, %31
%35 = phi i8* [ %32, %31 ], [ %29, %25 ]
%36 = getelementptr inbounds i8, i8* %35, i64 1
br label %37
37: ; preds = %31, %34
%38 = phi i8* [ %36, %34 ], [ %28, %31 ]
%39 = call i32 @strlen(i8* %38)
%40 = icmp ugt i32 %39, 255
br i1 %40, label %41, label %50
41: ; preds = %37
%42 = load i32, i32* @stderr
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
%44 = call i64 @fclose(i32* %12)
%45 = icmp eq i64 %44, 0
br i1 %45, label %92, label %46
46: ; preds = %41
%47 = load i32, i32* @stderr
%48 = load i8*, i8** %10
%49 = call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i8* %48)
br label %92
50: ; preds = %37
%51 = call i32 @strcpy(i8* %4, i8* %38)
%52 = call i32 @clean(i8* %4)
%53 = load i8*, i8** %27
%54 = call i32* @fopen(i8* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%55 = call i32 @fgetc(i32* %54)
%56 = load i32, i32* @EOF
%57 = icmp eq i32 %55, %56
br i1 %57, label %76, label %58
58: ; preds = %50
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i32 %55)
%60 = call i32 @fgetc(i32* %54)
%61 = load i32, i32* @EOF
%62 = icmp eq i32 %60, %61
br i1 %62, label %76, label %63
63: ; preds = %58, %63
%64 = phi i32 [ %73, %63 ], [ %60, %58 ]
%65 = phi i32 [ %72, %63 ], [ 1, %58 ]
%66 = call i32 @fputc(i8 signext 44, i32* %12)
%67 = and i32 %65, 7
%68 = icmp eq i32 %67, 0
%69 = select i1 %68, i8 10, i8 32
%70 = call i32 @fputc(i8 signext %69, i32* %12)
%71 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i32 %64)
%72 = add nuw nsw i32 %65, 1
%73 = call i32 @fgetc(i32* %54)
%74 = load i32, i32* @EOF
%75 = icmp eq i32 %73, %74
br i1 %75, label %76, label %63
76: ; preds = %63, %58, %50
%77 = call i32 @fputc(i8 signext 10, i32* %12)
%78 = call i64 @fclose(i32* %54)
%79 = icmp eq i64 %78, 0
%80 = add nuw nsw i64 %26, 1
br i1 %79, label %23, label %81
81: ; preds = %76
%82 = load i32, i32* @stderr
%83 = load i8*, i8** %27
%84 = call i32 (i32, i8*, ...) @fprintf(i32 %82, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0), i8* %83)
br label %92
85: ; preds = %23
%86 = call i64 @fclose(i32* %12)
%87 = icmp eq i64 %86, 0
br i1 %87, label %92, label %88
88: ; preds = %85
%89 = load i32, i32* @stderr
%90 = load i8*, i8** %10
%91 = call i32 (i32, i8*, ...) @fprintf(i32 %89, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i8* %90)
br label %92
92: ; preds = %85, %41, %88, %81, %46, %14, %6
%93 = phi i32 [ 1, %6 ], [ 1, %46 ], [ 1, %81 ], [ 1, %88 ], [ 1, %14 ], [ 1, %41 ], [ 0, %85 ]
ret i32 %93
}