#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;
char *basename(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
scalar_t__ strlen(char *);
int main(int argc, char **argv) {
  FILE *fpin, *fpout;
  long size;
  int i;
  int argv_len;
  if (argc < 2) {
    printf("Usage: datatoc <data_file_from> <data_file_to>\n");
    exit(1);
  }
  fpin = fopen(argv[1], "rb");
  if (!fpin) {
    printf("Unable to open input <%s>\n", argv[1]);
    exit(1);
  }
  argv[1] = basename(argv[1]);
  fseek(fpin, 0L, SEEK_END);
  size = ftell(fpin);
  fseek(fpin, 0L, SEEK_SET);
  if (argv[1][0] == '.')
    argv[1]++;
  argv_len = (int)strlen(argv[1]);
  for (i = 0; i < argv_len; i++)
    if (argv[1][i] == '.')
      argv[1][i] = '_';
  fpout = fopen(argv[2], "w");
  if (!fpout) {
    fprintf(stderr, "Unable to open output <%s>\n", argv[2]);
    exit(1);
  }
  fprintf(fpout, "/* DataToC output of file <%s> */\n\n", argv[1]);
  fprintf(fpout, "int datatoc_%s_size = %d;\n", argv[1], (int)size);
  fprintf(fpout, "char datatoc_%s[] = {\n", argv[1]);
  while (size--) {
    fprintf(fpout, "%3d,", getc(fpin));
  }
  fprintf(fpout, "0\n};\n\n");
  fclose(fpin);
  fclose(fpout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11d8 <main+0x38>
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe49(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    121b <main+0x7b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1080 <basename@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x18(%rbp),%rdi
mov    0x2daa(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1090 <fseek@plt>
mov    -0x18(%rbp),%rdi
call   1070 <ftell@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2d6f(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1090 <fseek@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1290 <main+0xf0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
add    $0x1,%rcx
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x30(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    12ef <main+0x14f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x2c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    12dc <main+0x13c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x2c(%rbp),%rcx
movb   $0x5f,(%rax,%rcx,1)
jmp    12e1 <main+0x141>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    12a7 <main+0x107>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd50(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    133c <main+0x19c>
mov    0x2cbf(%rip),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xd25(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd1d(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x28(%rbp),%rax
mov    %eax,%ecx
lea    0xd21(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd22(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x28(%rbp)
cmp    $0x0,%rax
je     13d3 <main+0x233>
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
call   10c0 <getc@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%edx
lea    0xcfb(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    1390 <main+0x1f0>
mov    -0x20(%rbp),%rdi
lea    0xce9(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x1,%edi
jle    1344 <main+0x184>
mov    %rsi,%r15
mov    0x8(%rsi),%rdi
lea    0xe21(%rip),%rsi
call   10b0 <fopen@plt>
mov    0x8(%r15),%rsi
test   %rax,%rax
je     135a <main+0x19a>
mov    %rax,%r14
mov    %rsi,%rdi
call   1090 <basename@plt>
mov    %rax,0x8(%r15)
mov    0x2de1(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    %r14,%rdi
call   1080 <ftell@plt>
mov    %rax,%rbx
mov    0x2dab(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    0x8(%r15),%r12
cmpb   $0x2e,(%r12)
jne    1244 <main+0x84>
add    $0x1,%r12
mov    %r12,0x8(%r15)
mov    %r12,%rdi
call   1050 <strlen@plt>
test   %eax,%eax
jle    127b <main+0xbb>
mov    %eax,%eax
add    $0xffffffffffffffff,%rax
xor    %ecx,%ecx
cmpb   $0x2e,(%r12,%rcx,1)
jne    1265 <main+0xa5>
nop
movb   $0x5f,(%r12,%rcx,1)
cmp    %rcx,%rax
je     127b <main+0xbb>
mov    0x8(%r15),%r12
add    $0x1,%rcx
cmpb   $0x2e,(%r12,%rcx,1)
je     1260 <main+0xa0>
jmp    1265 <main+0xa5>
mov    0x10(%r15),%rdi
lea    0xd98(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1372 <main+0x1b2>
mov    %rax,%r12
mov    0x8(%r15),%rdx
lea    0xd9a(%rip),%rsi
mov    %rax,%rdi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    0x8(%r15),%rdx
lea    0xda9(%rip),%rsi
mov    %r12,%rdi
mov    %ebx,%ecx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    0x8(%r15),%rdx
lea    0xdad(%rip),%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   1070 <fprintf@plt>
test   %rbx,%rbx
je     130d <main+0x14d>
lea    0xdae(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   10e0 <getc@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
add    $0xffffffffffffffff,%rbx
jne    12f0 <main+0x130>
lea    0xd83(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   10d0 <fwrite@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    %r12,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0xd53(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
lea    0xca2(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    0x2c5f(%rip),%rax
movslq (%rax),%rdi
mov    0x10(%r15),%rdx
lea    0xc99(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"Usage: datatoc <data_file_from> <data_file_to>\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [27 x i8] c"Unable to open input <%s>\0A\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.3 = [2 x i8] c"w\00"
@stderr = global i32 0
@.str.4 = [28 x i8] c"Unable to open output <%s>\0A\00"
@.str.5 = [36 x i8] c"/* DataToC output of file <%s> */\0A\0A\00"
@.str.6 = [27 x i8] c"int datatoc_%s_size = %d;\0A\00"
@.str.7 = [23 x i8] c"char datatoc_%s[] = {\0A\00"
@.str.8 = [5 x i8] c"%3d,\00"
@.str.9 = [7 x i8] c"0\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 i64
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 2
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32* @fopen(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %20, i32** %6
%21 = load i32*, i32** %6
%22 = icmp ne i32* %21, null
br i1 %22, label %29, label %23
23: ; preds = %16
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* %26)
%28 = call i32 @exit(i32 1)
unreachable
29: ; preds = %16
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call i8* @basename(i8* %32)
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 1
store i8* %33, i8** %35
%36 = load i32*, i32** %6
%37 = load i32, i32* @SEEK_END
%38 = call i32 @fseek(i32* %36, i64 0, i32 %37)
%39 = load i32*, i32** %6
%40 = call i64 @ftell(i32* %39)
store i64 %40, i64* %8
%41 = load i32*, i32** %6
%42 = load i32, i32* @SEEK_SET
%43 = call i32 @fseek(i32* %41, i64 0, i32 %42)
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 1
%46 = load i8*, i8** %45
%47 = getelementptr inbounds i8, i8* %46, i64 0
%48 = load i8, i8* %47
%49 = sext i8 %48 to i32
%50 = icmp eq i32 %49, 46
br i1 %50, label %51, label %56
51: ; preds = %29
%52 = load i8**, i8*** %5
%53 = getelementptr inbounds i8*, i8** %52, i64 1
%54 = load i8*, i8** %53
%55 = getelementptr inbounds i8, i8* %54, i32 1
store i8* %55, i8** %53
br label %56
56: ; preds = %51, %29
%57 = load i8**, i8*** %5
%58 = getelementptr inbounds i8*, i8** %57, i64 1
%59 = load i8*, i8** %58
%60 = call i64 @strlen(i8* %59)
%61 = trunc i64 %60 to i32
store i32 %61, i32* %10
store i32 0, i32* %9
br label %62
62: ; preds = %84, %56
%63 = load i32, i32* %9
%64 = load i32, i32* %10
%65 = icmp slt i32 %63, %64
br i1 %65, label %66, label %87
66: ; preds = %62
%67 = load i8**, i8*** %5
%68 = getelementptr inbounds i8*, i8** %67, i64 1
%69 = load i8*, i8** %68
%70 = load i32, i32* %9
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i8, i8* %69, i64 %71
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = icmp eq i32 %74, 46
br i1 %75, label %76, label %83
76: ; preds = %66
%77 = load i8**, i8*** %5
%78 = getelementptr inbounds i8*, i8** %77, i64 1
%79 = load i8*, i8** %78
%80 = load i32, i32* %9
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i8, i8* %79, i64 %81
store i8 95, i8* %82
br label %83
83: ; preds = %76, %66
br label %84
84: ; preds = %83
%85 = load i32, i32* %9
%86 = add nsw i32 %85, 1
store i32 %86, i32* %9
br label %62
87: ; preds = %62
%88 = load i8**, i8*** %5
%89 = getelementptr inbounds i8*, i8** %88, i64 2
%90 = load i8*, i8** %89
%91 = call i32* @fopen(i8* %90, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %91, i32** %7
%92 = load i32*, i32** %7
%93 = icmp ne i32* %92, null
br i1 %93, label %103, label %94
94: ; preds = %87
%95 = load i32, i32* @stderr
%96 = sext i32 %95 to i64
%97 = inttoptr i64 %96 to i32*
%98 = load i8**, i8*** %5
%99 = getelementptr inbounds i8*, i8** %98, i64 2
%100 = load i8*, i8** %99
%101 = call i32 (i32*, i8*, ...) @fprintf(i32* %97, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i8* %100)
%102 = call i32 @exit(i32 1)
unreachable
103: ; preds = %87
%104 = load i32*, i32** %7
%105 = load i8**, i8*** %5
%106 = getelementptr inbounds i8*, i8** %105, i64 1
%107 = load i8*, i8** %106
%108 = call i32 (i32*, i8*, ...) @fprintf(i32* %104, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i8* %107)
%109 = load i32*, i32** %7
%110 = load i8**, i8*** %5
%111 = getelementptr inbounds i8*, i8** %110, i64 1
%112 = load i8*, i8** %111
%113 = load i64, i64* %8
%114 = trunc i64 %113 to i32
%115 = call i32 (i32*, i8*, ...) @fprintf(i32* %109, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i8* %112, i32 %114)
%116 = load i32*, i32** %7
%117 = load i8**, i8*** %5
%118 = getelementptr inbounds i8*, i8** %117, i64 1
%119 = load i8*, i8** %118
%120 = call i32 (i32*, i8*, ...) @fprintf(i32* %116, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i8* %119)
br label %121
121: ; preds = %125, %103
%122 = load i64, i64* %8
%123 = add nsw i64 %122, -1
store i64 %123, i64* %8
%124 = icmp ne i64 %122, 0
br i1 %124, label %125, label %130
125: ; preds = %121
%126 = load i32*, i32** %7
%127 = load i32*, i32** %6
%128 = call i32 @getc(i32* %127)
%129 = call i32 (i32*, i8*, ...) @fprintf(i32* %126, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i32 %128)
br label %121
130: ; preds = %121
%131 = load i32*, i32** %7
%132 = call i32 (i32*, i8*, ...) @fprintf(i32* %131, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%133 = load i32*, i32** %6
%134 = call i32 @fclose(i32* %133)
%135 = load i32*, i32** %7
%136 = call i32 @fclose(i32* %135)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [27 x i8] c"Unable to open input <%s>\0A\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.3 = [2 x i8] c"w\00"
@stderr = global i32 0
@.str.4 = [28 x i8] c"Unable to open output <%s>\0A\00"
@.str.5 = [36 x i8] c"/* DataToC output of file <%s> */\0A\0A\00"
@.str.6 = [27 x i8] c"int datatoc_%s_size = %d;\0A\00"
@.str.7 = [23 x i8] c"char datatoc_%s[] = {\0A\00"
@.str.8 = [5 x i8] c"%3d,\00"
@.str.9 = [7 x i8] c"0\0A};\0A\0A\00"
@str = [47 x i8] c"Usage: datatoc <data_file_from> <data_file_to>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32* @fopen(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i32* %10, null
%12 = load i8*, i8** %8
br i1 %11, label %13, label %16
13: ; preds = %7
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* %12)
%15 = tail call i32 @exit(i32 1)
unreachable
16: ; preds = %7
%17 = tail call i8* @basename(i8* %12)
store i8* %17, i8** %8
%18 = load i32, i32* @SEEK_END
%19 = tail call i32 @fseek(i32* %10, i64 0, i32 %18)
%20 = tail call i64 @ftell(i32* %10)
%21 = load i32, i32* @SEEK_SET
%22 = tail call i32 @fseek(i32* %10, i64 0, i32 %21)
%23 = load i8*, i8** %8
%24 = load i8, i8* %23
%25 = icmp eq i8 %24, 46
br i1 %25, label %26, label %28
26: ; preds = %16
%27 = getelementptr inbounds i8, i8* %23, i64 1
store i8* %27, i8** %8
br label %28
28: ; preds = %26, %16
%29 = phi i8* [ %27, %26 ], [ %23, %16 ]
%30 = tail call i64 @strlen(i8* dereferenceable(1) %29)
%31 = trunc i64 %30 to i32
%32 = icmp sgt i32 %31, 0
br i1 %32, label %33, label %47
33: ; preds = %28
%34 = and i64 %30, 4294967295
br label %35
35: ; preds = %45, %33
%36 = phi i8* [ %29, %33 ], [ %46, %45 ]
%37 = phi i64 [ 0, %33 ], [ %43, %45 ]
%38 = getelementptr inbounds i8, i8* %36, i64 %37
%39 = load i8, i8* %38
%40 = icmp eq i8 %39, 46
br i1 %40, label %41, label %42
41: ; preds = %35
store i8 95, i8* %38
br label %42
42: ; preds = %35, %41
%43 = add nuw nsw i64 %37, 1
%44 = icmp eq i64 %43, %34
br i1 %44, label %47, label %45
45: ; preds = %42
%46 = load i8*, i8** %8
br label %35
47: ; preds = %42, %28
%48 = getelementptr inbounds i8*, i8** %1, i64 2
%49 = load i8*, i8** %48
%50 = tail call i32* @fopen(i8* %49, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%51 = icmp eq i32* %50, null
br i1 %51, label %52, label %59
52: ; preds = %47
%53 = load i32, i32* @stderr
%54 = sext i32 %53 to i64
%55 = inttoptr i64 %54 to i32*
%56 = load i8*, i8** %48
%57 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %55, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i8* %56)
%58 = tail call i32 @exit(i32 1)
unreachable
59: ; preds = %47
%60 = load i8*, i8** %8
%61 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %50, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i8* %60)
%62 = load i8*, i8** %8
%63 = trunc i64 %20 to i32
%64 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %50, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), i8* %62, i32 %63)
%65 = load i8*, i8** %8
%66 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %50, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i8* %65)
%67 = icmp eq i64 %20, 0
br i1 %67, label %74, label %68
68: ; preds = %59, %68
%69 = phi i64 [ %70, %68 ], [ %20, %59 ]
%70 = add nsw i64 %69, -1
%71 = tail call i32 @getc(i32* %10)
%72 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %50, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i32 %71)
%73 = icmp eq i64 %70, 0
br i1 %73, label %74, label %68
74: ; preds = %68, %59
%75 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i64 6, i64 1, i32* %50)
%76 = tail call i32 @fclose(i32* %10)
%77 = tail call i32 @fclose(i32* %50)
ret i32 0
}