#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*/ fclose(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  FILE *fp_in = NULL;
  FILE *fp_out = NULL;
  char buf_name[1024];
  int b;
  int count = 0;
  char *p = NULL;
  char *q = NULL;
  int done = 0;
  if (argc != 3) {
    printf("Usage: %s infile outfile\n", argv[0]);
    return -1;
  }
  p = argv[1];
  while (*p) {
    p++;
  }
  while ((p >= argv[1]) && (*p != '/')) {
    p--;
  }
  if (*p == '/') {
    p++;
  }
  q = buf_name;
  while (*p) {
    if (('.' == *p) || (' ' == *p)) {
      *q = '_';
    } else {
      *q = *p;
    }
    q++;
    p++;
  }
  *q = 0;
  fp_in = fopen(argv[1], "r");
  fp_out = fopen(argv[2], "w");
  fprintf(fp_out, "\n");
  fprintf(fp_out, "unsigned char %s[] =\n", buf_name);
  fprintf(fp_out, "{\n");
  while (!done) {
    b = fgetc(fp_in);
    if (EOF == b) {
      done = 1;
      break;
    }
    if (0 == count) {
      fprintf(fp_out, "    ");
    }
    fprintf(fp_out, "0x%02x, ", b);
    count++;
    if (8 == count) {
      count = 0;
      fprintf(fp_out, "\n");
    }
  }
  fclose(fp_in);
  if (count) {
    fprintf(fp_out, "\n");
  }
  fprintf(fp_out, "    0x00\n};\n\n");
  fclose(fp_out);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x440,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0x0,-0x428(%rbp)
movq   $0x0,-0x430(%rbp)
movq   $0x0,-0x438(%rbp)
movl   $0x0,-0x43c(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11cc <main+0x7c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe45(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    14a5 <main+0x355>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x430(%rbp)
mov    -0x430(%rbp),%rax
cmpb   $0x0,(%rax)
je     1202 <main+0xb2>
mov    -0x430(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x430(%rbp)
jmp    11db <main+0x8b>
jmp    1207 <main+0xb7>
mov    -0x430(%rbp),%rcx
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
cmp    0x8(%rdx),%rcx
mov    %al,-0x43d(%rbp)
jb     123a <main+0xea>
mov    -0x430(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
setne  %al
mov    %al,-0x43d(%rbp)
mov    -0x43d(%rbp),%al
test   $0x1,%al
jne    124d <main+0xfd>
jmp    1264 <main+0x114>
mov    -0x430(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x430(%rbp)
jmp    1207 <main+0xb7>
mov    -0x430(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1289 <main+0x139>
mov    -0x430(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x430(%rbp)
lea    -0x420(%rbp),%rax
mov    %rax,-0x438(%rbp)
mov    -0x430(%rbp),%rax
cmpb   $0x0,(%rax)
je     131f <main+0x1cf>
mov    -0x430(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x2e,%eax
cmp    %ecx,%eax
je     12d5 <main+0x185>
mov    -0x430(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x20,%eax
cmp    %ecx,%eax
jne    12e4 <main+0x194>
mov    -0x438(%rbp),%rax
movb   $0x5f,(%rax)
jmp    12f6 <main+0x1a6>
mov    -0x430(%rbp),%rax
mov    (%rax),%cl
mov    -0x438(%rbp),%rax
mov    %cl,(%rax)
mov    -0x438(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x438(%rbp)
mov    -0x430(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x430(%rbp)
jmp    1297 <main+0x147>
mov    -0x438(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xce2(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xccc(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xced(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    -0x420(%rbp),%rdx
lea    0xca1(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xca5(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
cmpl   $0x0,-0x43c(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    13af <main+0x25f>
jmp    145b <main+0x30b>
mov    -0x18(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %eax,-0x424(%rbp)
mov    0x2c23(%rip),%rax
mov    (%rax),%eax
cmp    -0x424(%rbp),%eax
jne    13e2 <main+0x292>
movl   $0x1,-0x43c(%rbp)
jmp    145b <main+0x30b>
xor    %eax,%eax
cmp    -0x428(%rbp),%eax
jne    1402 <main+0x2b2>
mov    -0x20(%rbp),%rdi
lea    0xc3c(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x424(%rbp),%edx
lea    0xc29(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x428(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x428(%rbp)
mov    $0x8,%eax
cmp    -0x428(%rbp),%eax
jne    1456 <main+0x306>
movl   $0x0,-0x428(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xc02(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    1396 <main+0x246>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
cmpl   $0x0,-0x428(%rbp)
je     1483 <main+0x333>
mov    -0x20(%rbp),%rdi
lea    0xbd5(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xbb7(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x408,%rsp
mov    %rsi,%rbp
cmp    $0x3,%edi
jne    11b3 <main+0x43>
mov    0x8(%rbp),%rdi
lea    -0x1(%rdi),%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rcx)
lea    0x1(%rcx),%rcx
jne    11a0 <main+0x30>
cmp    %rdi,%rcx
jae    11cd <main+0x5d>
xor    %eax,%eax
jmp    1203 <main+0x93>
mov    0x0(%rbp),%rsi
lea    0xe42(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%eax
jmp    136b <main+0x1fb>
add    $0xffffffffffffffff,%rcx
mov    %rcx,%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,%rcx
movzbl (%rax),%edx
cmp    %rdi,%rax
jb     11fb <main+0x8b>
lea    -0x1(%rcx),%rax
cmp    $0x2f,%dl
jne    11e0 <main+0x70>
mov    $0x1,%eax
jmp    1203 <main+0x93>
xor    %eax,%eax
cmp    $0x2f,%dl
sete   %al
add    %rcx,%rax
xor    %ecx,%ecx
jmp    1217 <main+0xa7>
nopw   0x0(%rax,%rax,1)
mov    %bl,(%rsp,%rcx,1)
add    $0x1,%rcx
movzbl (%rax,%rcx,1),%edx
mov    $0x5f,%bl
cmp    $0x20,%dl
je     1210 <main+0xa0>
cmp    $0x2e,%dl
je     1210 <main+0xa0>
test   %dl,%dl
je     122f <main+0xbf>
mov    %edx,%ebx
jmp    1210 <main+0xa0>
movb   $0x0,(%rsp,%rcx,1)
lea    0xde0(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%r14
mov    0x10(%rbp),%rdi
lea    0xdcf(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%rbx
mov    $0xa,%edi
mov    %rax,%rsi
call   1060 <fputc@plt>
lea    0xdb5(%rip),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xdb7(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
mov    %r14,%rdi
call   1050 <fgetc@plt>
mov    0x2d4a(%rip),%r13
cmp    %eax,0x0(%r13)
jne    12b1 <main+0x141>
mov    %r14,%rdi
call   1030 <fclose@plt>
jmp    1348 <main+0x1d8>
mov    %eax,%ebp
lea    0xd82(%rip),%r12
xor    %r15d,%r15d
jmp    12fe <main+0x18e>
nop
mov    $0x4,%esi
mov    $0x1,%edx
lea    0xd66(%rip),%rdi
mov    %rbx,%rcx
call   1090 <fwrite@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x1,%r15d
mov    %r14,%rdi
call   1050 <fgetc@plt>
mov    %eax,%ebp
cmp    %eax,0x0(%r13)
je     132e <main+0x1be>
test   %r15d,%r15d
je     12c0 <main+0x150>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
add    $0x1,%r15d
cmp    $0x8,%r15d
jne    12ee <main+0x17e>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1060 <fputc@plt>
xor    %r15d,%r15d
jmp    12ee <main+0x17e>
mov    %r14,%rdi
call   1030 <fclose@plt>
test   %r15d,%r15d
je     1348 <main+0x1d8>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1060 <fputc@plt>
lea    0xcf6(%rip),%rdi
mov    $0xd,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Usage: %s infile outfile\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [22 x i8] c"unsigned char %s[] =\0A\00"
@.str.5 = [3 x i8] c"{\0A\00"
@EOF = global i32 0
@.str.6 = [5 x i8] c" \00"
@.str.7 = [9 x i8] c"0x%02x, \00"
@.str.8 = [14 x i8] c" 0x00\0A};\0A\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 [1024 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
store i32* null, i32** %7
store i32 0, i32* %10
store i8* null, i8** %11
store i8* null, i8** %12
store i32 0, i32* %13
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 3
br i1 %15, label %16, label %21
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %19)
store i32 -1, i32* %3
br label %143
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
store i8* %24, i8** %11
br label %25
25: ; preds = %29, %21
%26 = load i8*, i8** %11
%27 = load i8, i8* %26
%28 = icmp ne i8 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %25
%30 = load i8*, i8** %11
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %11
br label %25
32: ; preds = %25
br label %33
33: ; preds = %46, %32
%34 = load i8*, i8** %11
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 1
%37 = load i8*, i8** %36
%38 = icmp uge i8* %34, %37
br i1 %38, label %39, label %44
39: ; preds = %33
%40 = load i8*, i8** %11
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = icmp ne i32 %42, 47
br label %44
44: ; preds = %39, %33
%45 = phi i1 [ false, %33 ], [ %43, %39 ]
br i1 %45, label %46, label %49
46: ; preds = %44
%47 = load i8*, i8** %11
%48 = getelementptr inbounds i8, i8* %47, i32 -1
store i8* %48, i8** %11
br label %33
49: ; preds = %44
%50 = load i8*, i8** %11
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = icmp eq i32 %52, 47
br i1 %53, label %54, label %57
54: ; preds = %49
%55 = load i8*, i8** %11
%56 = getelementptr inbounds i8, i8* %55, i32 1
store i8* %56, i8** %11
br label %57
57: ; preds = %54, %49
%58 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
store i8* %58, i8** %12
br label %59
59: ; preds = %79, %57
%60 = load i8*, i8** %11
%61 = load i8, i8* %60
%62 = icmp ne i8 %61, 0
br i1 %62, label %63, label %84
63: ; preds = %59
%64 = load i8*, i8** %11
%65 = load i8, i8* %64
%66 = sext i8 %65 to i32
%67 = icmp eq i32 46, %66
br i1 %67, label %73, label %68
68: ; preds = %63
%69 = load i8*, i8** %11
%70 = load i8, i8* %69
%71 = sext i8 %70 to i32
%72 = icmp eq i32 32, %71
br i1 %72, label %73, label %75
73: ; preds = %68, %63
%74 = load i8*, i8** %12
store i8 95, i8* %74
br label %79
75: ; preds = %68
%76 = load i8*, i8** %11
%77 = load i8, i8* %76
%78 = load i8*, i8** %12
store i8 %77, i8* %78
br label %79
79: ; preds = %75, %73
%80 = load i8*, i8** %12
%81 = getelementptr inbounds i8, i8* %80, i32 1
store i8* %81, i8** %12
%82 = load i8*, i8** %11
%83 = getelementptr inbounds i8, i8* %82, i32 1
store i8* %83, i8** %11
br label %59
84: ; preds = %59
%85 = load i8*, i8** %12
store i8 0, i8* %85
%86 = load i8**, i8*** %5
%87 = getelementptr inbounds i8*, i8** %86, i64 1
%88 = load i8*, i8** %87
%89 = call i32* @fopen(i8* %88, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %89, i32** %6
%90 = load i8**, i8*** %5
%91 = getelementptr inbounds i8*, i8** %90, i64 2
%92 = load i8*, i8** %91
%93 = call i32* @fopen(i8* %92, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %93, i32** %7
%94 = load i32*, i32** %7
%95 = call i32 (i32*, i8*, ...) @fprintf(i32* %94, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%96 = load i32*, i32** %7
%97 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%98 = call i32 (i32*, i8*, ...) @fprintf(i32* %96, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8* %97)
%99 = load i32*, i32** %7
%100 = call i32 (i32*, i8*, ...) @fprintf(i32* %99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %101
101: ; preds = %129, %84
%102 = load i32, i32* %13
%103 = icmp ne i32 %102, 0
%104 = xor i1 %103, true
br i1 %104, label %105, label %130
105: ; preds = %101
%106 = load i32*, i32** %6
%107 = call i32 @fgetc(i32* %106)
store i32 %107, i32* %9
%108 = load i32, i32* @EOF
%109 = load i32, i32* %9
%110 = icmp eq i32 %108, %109
br i1 %110, label %111, label %112
111: ; preds = %105
store i32 1, i32* %13
br label %130
112: ; preds = %105
%113 = load i32, i32* %10
%114 = icmp eq i32 0, %113
br i1 %114, label %115, label %118
115: ; preds = %112
%116 = load i32*, i32** %7
%117 = call i32 (i32*, i8*, ...) @fprintf(i32* %116, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br label %118
118: ; preds = %115, %112
%119 = load i32*, i32** %7
%120 = load i32, i32* %9
%121 = call i32 (i32*, i8*, ...) @fprintf(i32* %119, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %120)
%122 = load i32, i32* %10
%123 = add nsw i32 %122, 1
store i32 %123, i32* %10
%124 = load i32, i32* %10
%125 = icmp eq i32 8, %124
br i1 %125, label %126, label %129
126: ; preds = %118
store i32 0, i32* %10
%127 = load i32*, i32** %7
%128 = call i32 (i32*, i8*, ...) @fprintf(i32* %127, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %129
129: ; preds = %126, %118
br label %101
130: ; preds = %111, %101
%131 = load i32*, i32** %6
%132 = call i32 @fclose(i32* %131)
%133 = load i32, i32* %10
%134 = icmp ne i32 %133, 0
br i1 %134, label %135, label %138
135: ; preds = %130
%136 = load i32*, i32** %7
%137 = call i32 (i32*, i8*, ...) @fprintf(i32* %136, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %138
138: ; preds = %135, %130
%139 = load i32*, i32** %7
%140 = call i32 (i32*, i8*, ...) @fprintf(i32* %139, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
%141 = load i32*, i32** %7
%142 = call i32 @fclose(i32* %141)
store i32 0, i32* %3
br label %143
143: ; preds = %138, %16
%144 = load i32, i32* %3
ret i32 %144
}

LLVM IR (-O2):
@.str = [26 x i8] c"Usage: %s infile outfile\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c"w\00"
@.str.4 = [22 x i8] c"unsigned char %s[] =\0A\00"
@.str.5 = [3 x i8] c"{\0A\00"
@EOF = global i32 0
@.str.6 = [5 x i8] c" \00"
@.str.7 = [9 x i8] c"0x%02x, \00"
@.str.8 = [14 x i8] c" 0x00\0A};\0A\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 3
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %80
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
br label %12
12: ; preds = %12, %9
%13 = phi i8* [ %11, %9 ], [ %16, %12 ]
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
%16 = getelementptr inbounds i8, i8* %13, i64 1
br i1 %15, label %17, label %12
17: ; preds = %12
%18 = icmp ult i8* %13, %11
br i1 %18, label %28, label %19
19: ; preds = %17, %27
%20 = phi i8* [ %21, %27 ], [ %13, %17 ]
%21 = getelementptr inbounds i8, i8* %20, i64 -1
%22 = icmp ult i8* %21, %11
%23 = load i8, i8* %21
%24 = icmp eq i8 %23, 47
br i1 %22, label %25, label %27
25: ; preds = %19
%26 = zext i1 %24 to i64
br label %28
27: ; preds = %19
br i1 %24, label %28, label %19
28: ; preds = %27, %25, %17
%29 = phi i64 [ 0, %17 ], [ %26, %25 ], [ 1, %27 ]
%30 = phi i8* [ %13, %17 ], [ %21, %25 ], [ %21, %27 ]
%31 = getelementptr i8, i8* %30, i64 %29
br label %32
32: ; preds = %37, %28
%33 = phi i8* [ %31, %28 ], [ %40, %37 ]
%34 = phi i8* [ %4, %28 ], [ %39, %37 ]
%35 = load i8, i8* %33
switch i8 %35, label %36 [
i8 0, label %41
i8 46, label %37
i8 32, label %37
]
36: ; preds = %32
br label %37
37: ; preds = %32, %32, %36
%38 = phi i8 [ %35, %36 ], [ 95, %32 ], [ 95, %32 ]
store i8 %38, i8* %34
%39 = getelementptr inbounds i8, i8* %34, i64 1
%40 = getelementptr inbounds i8, i8* %33, i64 1
br label %32
41: ; preds = %32
store i8 0, i8* %34
%42 = tail call i32* @fopen(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%43 = getelementptr inbounds i8*, i8** %1, i64 2
%44 = load i8*, i8** %43
%45 = tail call i32* @fopen(i8* %44, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%46 = tail call i32 @fputc(i32 10, i32* %45)
%47 = call i32 (i32*, i8*, ...) @fprintf(i32* %45, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8* %4)
%48 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i64 2, i64 1, i32* %45)
%49 = call i32 @fgetc(i32* %42)
%50 = load i32, i32* @EOF
%51 = icmp eq i32 %50, %49
br i1 %51, label %52, label %54
52: ; preds = %41
%53 = call i32 @fclose(i32* %42)
br label %77
54: ; preds = %41, %67
%55 = phi i32 [ %69, %67 ], [ %49, %41 ]
%56 = phi i32 [ %68, %67 ], [ 0, %41 ]
%57 = icmp eq i32 %56, 0
br i1 %57, label %58, label %61
58: ; preds = %54
%59 = call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i64 4, i64 1, i32* %45)
%60 = call i32 (i32*, i8*, ...) @fprintf(i32* %45, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %55)
br label %67
61: ; preds = %54
%62 = call i32 (i32*, i8*, ...) @fprintf(i32* %45, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %55)
%63 = add nsw i32 %56, 1
%64 = icmp eq i32 %63, 8
br i1 %64, label %65, label %67
65: ; preds = %61
%66 = call i32 @fputc(i32 10, i32* %45)
br label %67
67: ; preds = %58, %65, %61
%68 = phi i32 [ 0, %65 ], [ %63, %61 ], [ 1, %58 ]
%69 = call i32 @fgetc(i32* %42)
%70 = load i32, i32* @EOF
%71 = icmp eq i32 %70, %69
br i1 %71, label %72, label %54
72: ; preds = %67
%73 = call i32 @fclose(i32* %42)
%74 = icmp eq i32 %68, 0
br i1 %74, label %77, label %75
75: ; preds = %72
%76 = call i32 @fputc(i32 10, i32* %45)
br label %77
77: ; preds = %52, %75, %72
%78 = call i64 @fwrite(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i64 13, i64 1, i32* %45)
%79 = call i32 @fclose(i32* %45)
br label %80
80: ; preds = %77, %6
%81 = phi i32 [ -1, %6 ], [ 0, %77 ]
ret i32 %81
}