#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;
  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");
  if (!fp_in || !fp_out)
    return -1;
  fprintf(fp_out, "\n");
  fprintf(fp_out, "unsigned char %s[] =\n", buf_name);
  fprintf(fp_out, "{\n");
  while (1) {
    b = fgetc(fp_in);
    if (EOF == b) {
      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)
cmpl   $0x3,-0x8(%rbp)
je     11c2 <main+0x72>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe4f(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    149a <main+0x34a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x430(%rbp)
mov    -0x430(%rbp),%rax
cmpb   $0x0,(%rax)
je     11f8 <main+0xa8>
mov    -0x430(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x430(%rbp)
jmp    11d1 <main+0x81>
jmp    11fd <main+0xad>
mov    -0x430(%rbp),%rcx
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
cmp    0x8(%rdx),%rcx
mov    %al,-0x439(%rbp)
jb     1230 <main+0xe0>
mov    -0x430(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
setne  %al
mov    %al,-0x439(%rbp)
mov    -0x439(%rbp),%al
test   $0x1,%al
jne    1243 <main+0xf3>
jmp    125a <main+0x10a>
mov    -0x430(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x430(%rbp)
jmp    11fd <main+0xad>
mov    -0x430(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    127f <main+0x12f>
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     1315 <main+0x1c5>
mov    -0x430(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x2e,%eax
cmp    %ecx,%eax
je     12cb <main+0x17b>
mov    -0x430(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x20,%eax
cmp    %ecx,%eax
jne    12da <main+0x18a>
mov    -0x438(%rbp),%rax
movb   $0x5f,(%rax)
jmp    12ec <main+0x19c>
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    128d <main+0x13d>
mov    -0x438(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xcec(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xcd6(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1365 <main+0x215>
cmpq   $0x0,-0x20(%rbp)
jne    1371 <main+0x221>
movl   $0xffffffff,-0x4(%rbp)
jmp    149a <main+0x34a>
mov    -0x20(%rbp),%rdi
lea    0xcd5(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    -0x420(%rbp),%rdx
lea    0xc89(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xc8d(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %eax,-0x424(%rbp)
mov    0x2c24(%rip),%rax
mov    (%rax),%eax
cmp    -0x424(%rbp),%eax
jne    13d7 <main+0x287>
jmp    1450 <main+0x300>
xor    %eax,%eax
cmp    -0x428(%rbp),%eax
jne    13f7 <main+0x2a7>
mov    -0x20(%rbp),%rdi
lea    0xc47(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x424(%rbp),%edx
lea    0xc34(%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    144b <main+0x2fb>
movl   $0x0,-0x428(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xc0d(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    13ae <main+0x25e>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
cmpl   $0x0,-0x428(%rbp)
je     1478 <main+0x328>
mov    -0x20(%rbp),%rdi
lea    0xbe0(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xbc2(%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    138b <main+0x21b>
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    1219 <main+0xa9>
nopw   0x0(%rax,%rax,1)
mov    %edx,%ebx
mov    %bl,(%rsp,%rcx,1)
add    $0x1,%rcx
movzbl (%rax,%rcx,1),%edx
mov    $0x5f,%bl
cmp    $0x20,%dl
je     1212 <main+0xa2>
cmp    $0x2e,%dl
je     1212 <main+0xa2>
test   %dl,%dl
jne    1210 <main+0xa0>
movb   $0x0,(%rsp,%rcx,1)
lea    0xde2(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%r14
mov    0x10(%rbp),%rdi
lea    0xdd1(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%rbx
mov    $0xffffffff,%eax
test   %r14,%r14
je     138b <main+0x21b>
test   %rbx,%rbx
je     138b <main+0x21b>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1060 <fputc@plt>
lea    0xda0(%rip),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <fprintf@plt>
lea    0xda2(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1090 <fwrite@plt>
mov    %r14,%rdi
call   1050 <fgetc@plt>
mov    0x2d35(%rip),%r13
cmp    %eax,0x0(%r13)
jne    12c6 <main+0x156>
mov    %r14,%rdi
call   1030 <fclose@plt>
jmp    1368 <main+0x1f8>
mov    %eax,%ebp
lea    0xd6d(%rip),%r12
xor    %r15d,%r15d
jmp    131e <main+0x1ae>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x4,%esi
mov    $0x1,%edx
lea    0xd46(%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     134e <main+0x1de>
test   %r15d,%r15d
je     12e0 <main+0x170>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
add    $0x1,%r15d
cmp    $0x8,%r15d
jne    130e <main+0x19e>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1060 <fputc@plt>
xor    %r15d,%r15d
jmp    130e <main+0x19e>
mov    %r14,%rdi
call   1030 <fclose@plt>
test   %r15d,%r15d
je     1368 <main+0x1f8>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1060 <fputc@plt>
lea    0xcd6(%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*
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
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 3
br i1 %14, label %15, label %20
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %18)
store i32 -1, i32* %3
br label %145
20: ; preds = %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
store i8* %23, i8** %11
br label %24
24: ; preds = %28, %20
%25 = load i8*, i8** %11
%26 = load i8, i8* %25
%27 = icmp ne i8 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %24
%29 = load i8*, i8** %11
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %11
br label %24
31: ; preds = %24
br label %32
32: ; preds = %45, %31
%33 = load i8*, i8** %11
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 1
%36 = load i8*, i8** %35
%37 = icmp uge i8* %33, %36
br i1 %37, label %38, label %43
38: ; preds = %32
%39 = load i8*, i8** %11
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp ne i32 %41, 47
br label %43
43: ; preds = %38, %32
%44 = phi i1 [ false, %32 ], [ %42, %38 ]
br i1 %44, label %45, label %48
45: ; preds = %43
%46 = load i8*, i8** %11
%47 = getelementptr inbounds i8, i8* %46, i32 -1
store i8* %47, i8** %11
br label %32
48: ; preds = %43
%49 = load i8*, i8** %11
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = icmp eq i32 %51, 47
br i1 %52, label %53, label %56
53: ; preds = %48
%54 = load i8*, i8** %11
%55 = getelementptr inbounds i8, i8* %54, i32 1
store i8* %55, i8** %11
br label %56
56: ; preds = %53, %48
%57 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
store i8* %57, i8** %12
br label %58
58: ; preds = %78, %56
%59 = load i8*, i8** %11
%60 = load i8, i8* %59
%61 = icmp ne i8 %60, 0
br i1 %61, label %62, label %83
62: ; preds = %58
%63 = load i8*, i8** %11
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp eq i32 46, %65
br i1 %66, label %72, label %67
67: ; preds = %62
%68 = load i8*, i8** %11
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = icmp eq i32 32, %70
br i1 %71, label %72, label %74
72: ; preds = %67, %62
%73 = load i8*, i8** %12
store i8 95, i8* %73
br label %78
74: ; preds = %67
%75 = load i8*, i8** %11
%76 = load i8, i8* %75
%77 = load i8*, i8** %12
store i8 %76, i8* %77
br label %78
78: ; preds = %74, %72
%79 = load i8*, i8** %12
%80 = getelementptr inbounds i8, i8* %79, i32 1
store i8* %80, i8** %12
%81 = load i8*, i8** %11
%82 = getelementptr inbounds i8, i8* %81, i32 1
store i8* %82, i8** %11
br label %58
83: ; preds = %58
%84 = load i8*, i8** %12
store i8 0, i8* %84
%85 = load i8**, i8*** %5
%86 = getelementptr inbounds i8*, i8** %85, i64 1
%87 = load i8*, i8** %86
%88 = call i32* @fopen(i8* %87, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %88, i32** %6
%89 = load i8**, i8*** %5
%90 = getelementptr inbounds i8*, i8** %89, i64 2
%91 = load i8*, i8** %90
%92 = call i32* @fopen(i8* %91, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %92, i32** %7
%93 = load i32*, i32** %6
%94 = icmp ne i32* %93, null
br i1 %94, label %95, label %98
95: ; preds = %83
%96 = load i32*, i32** %7
%97 = icmp ne i32* %96, null
br i1 %97, label %99, label %98
98: ; preds = %95, %83
store i32 -1, i32* %3
br label %145
99: ; preds = %95
%100 = load i32*, i32** %7
%101 = call i32 (i32*, i8*, ...) @fprintf(i32* %100, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%102 = load i32*, i32** %7
%103 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%104 = call i32 (i32*, i8*, ...) @fprintf(i32* %102, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8* %103)
%105 = load i32*, i32** %7
%106 = call i32 (i32*, i8*, ...) @fprintf(i32* %105, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %107
107: ; preds = %99, %131
%108 = load i32*, i32** %6
%109 = call i32 @fgetc(i32* %108)
store i32 %109, i32* %9
%110 = load i32, i32* @EOF
%111 = load i32, i32* %9
%112 = icmp eq i32 %110, %111
br i1 %112, label %113, label %114
113: ; preds = %107
br label %132
114: ; preds = %107
%115 = load i32, i32* %10
%116 = icmp eq i32 0, %115
br i1 %116, label %117, label %120
117: ; preds = %114
%118 = load i32*, i32** %7
%119 = call i32 (i32*, i8*, ...) @fprintf(i32* %118, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br label %120
120: ; preds = %117, %114
%121 = load i32*, i32** %7
%122 = load i32, i32* %9
%123 = call i32 (i32*, i8*, ...) @fprintf(i32* %121, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %122)
%124 = load i32, i32* %10
%125 = add nsw i32 %124, 1
store i32 %125, i32* %10
%126 = load i32, i32* %10
%127 = icmp eq i32 8, %126
br i1 %127, label %128, label %131
128: ; preds = %120
store i32 0, i32* %10
%129 = load i32*, i32** %7
%130 = call i32 (i32*, i8*, ...) @fprintf(i32* %129, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %131
131: ; preds = %128, %120
br label %107
132: ; preds = %113
%133 = load i32*, i32** %6
%134 = call i32 @fclose(i32* %133)
%135 = load i32, i32* %10
%136 = icmp ne i32 %135, 0
br i1 %136, label %137, label %140
137: ; preds = %132
%138 = load i32*, i32** %7
%139 = call i32 (i32*, i8*, ...) @fprintf(i32* %138, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %140
140: ; preds = %137, %132
%141 = load i32*, i32** %7
%142 = call i32 (i32*, i8*, ...) @fprintf(i32* %141, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0))
%143 = load i32*, i32** %7
%144 = call i32 @fclose(i32* %143)
store i32 0, i32* %3
br label %145
145: ; preds = %140, %98, %15
%146 = load i32, i32* %3
ret i32 %146
}

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 %84
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 = icmp ne i32* %42, null
%47 = icmp ne i32* %45, null
%48 = and i1 %46, %47
br i1 %48, label %49, label %84
49: ; preds = %41
%50 = tail call i32 @fputc(i32 10, i32* %45)
%51 = call i32 (i32*, i8*, ...) @fprintf(i32* %45, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8* %4)
%52 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i64 2, i64 1, i32* %45)
%53 = call i32 @fgetc(i32* %42)
%54 = load i32, i32* @EOF
%55 = icmp eq i32 %54, %53
br i1 %55, label %56, label %58
56: ; preds = %49
%57 = call i32 @fclose(i32* %42)
br label %81
58: ; preds = %49, %71
%59 = phi i32 [ %73, %71 ], [ %53, %49 ]
%60 = phi i32 [ %72, %71 ], [ 0, %49 ]
%61 = icmp eq i32 %60, 0
br i1 %61, label %62, label %65
62: ; preds = %58
%63 = call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i64 4, i64 1, i32* %45)
%64 = call i32 (i32*, i8*, ...) @fprintf(i32* %45, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %59)
br label %71
65: ; preds = %58
%66 = call i32 (i32*, i8*, ...) @fprintf(i32* %45, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %59)
%67 = add nsw i32 %60, 1
%68 = icmp eq i32 %67, 8
br i1 %68, label %69, label %71
69: ; preds = %65
%70 = call i32 @fputc(i32 10, i32* %45)
br label %71
71: ; preds = %62, %69, %65
%72 = phi i32 [ 0, %69 ], [ %67, %65 ], [ 1, %62 ]
%73 = call i32 @fgetc(i32* %42)
%74 = load i32, i32* @EOF
%75 = icmp eq i32 %74, %73
br i1 %75, label %76, label %58
76: ; preds = %71
%77 = call i32 @fclose(i32* %42)
%78 = icmp eq i32 %72, 0
br i1 %78, label %81, label %79
79: ; preds = %76
%80 = call i32 @fputc(i32 10, i32* %45)
br label %81
81: ; preds = %56, %79, %76
%82 = call i64 @fwrite(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i64 13, i64 1, i32* %45)
%83 = call i32 @fclose(i32* %45)
br label %84
84: ; preds = %41, %81, %6
%85 = phi i32 [ -1, %6 ], [ 0, %81 ], [ -1, %41 ]
ret i32 %85
}