#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*/ SEEK_SET;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void main(int argc, char *argv[]) {
  FILE *f1, *f2;
  int c;
  int i;
  int data;
  int adr = 0;
  if (argc < 3) {
    printf("txt2mif text_file_name mif_file_name\n");
  }
  f1 = fopen(argv[1], "r");
  if (f1 == NULL) {
    printf("Error opening %s\n", argv[1]);
    return;
  }
  f2 = fopen(argv[2], "w");
  if (f2 == NULL) {
    printf("Error opening %s\n", argv[2]);
    return;
  }
  i = 0;
  while ((c = fgetc(f1)) != EOF) {
    if (i == 0) {
      fputs("-- ", f2);
    }
    i++;
    fputc(c, f2);
    if (c == '\n') {
      i = 0;
    }
    if (i == 80) {
      fputs("\n\n", f2);
    }
  }
  fseek(f1, 0, SEEK_SET);
  fprintf(f2, "DEPTH = 4096;\n");
  fprintf(f2, "WIDTH = 32;\n");
  fprintf(f2, "ADDRESS_RADIX = HEX;\n");
  fprintf(f2, "DATA_RADIX = HEX;\n");
  fprintf(f2, "CONTENT\n");
  fprintf(f2, "BEGIN\n\n");
  i = 0;
  adr = 0;
  data = 0;
  while ((c = fgetc(f1)) != EOF) {
    data = data | (c << (8 * i));
    if (i == 3) {
      fprintf(f2, "%02X : %08X;\n", adr, data);
      adr++;
      i = 0;
      data = 0;
    } else {
      i++;
    }
  }
  if (i != 0) {
    fprintf(f2, "%02X : %08X;\n", adr, data);
  }
  fprintf(f2, "\nEND;\n");
  fclose(f1);
  fclose(f2);
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x30(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    11ae <main+0x2e>
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe69(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11ec <main+0x6c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1402 <main+0x282>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe3f(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    122a <main+0xaa>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1402 <main+0x282>
movl   $0x0,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x24(%rbp)
mov    0x2da4(%rip),%rcx
cmp    (%rcx),%eax
je     12ab <main+0x12b>
cmpl   $0x0,-0x28(%rbp)
jne    1266 <main+0xe6>
mov    -0x20(%rbp),%rsi
lea    0xddb(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1070 <fputc@plt>
cmpl   $0xa,-0x24(%rbp)
jne    128c <main+0x10c>
movl   $0x0,-0x28(%rbp)
cmpl   $0x50,-0x28(%rbp)
jne    12a6 <main+0x126>
mov    -0x20(%rbp),%rsi
lea    0xdf2(%rip),%rdi
call   1050 <fputs@plt>
jmp    1231 <main+0xb1>
mov    -0x18(%rbp),%rdi
mov    0x2d22(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1090 <fseek@plt>
mov    -0x20(%rbp),%rdi
lea    0xd76(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xd73(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xd6e(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xd72(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xd73(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xd6a(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <fgetc@plt>
mov    %eax,-0x24(%rbp)
mov    0x2c95(%rip),%rcx
cmp    (%rcx),%eax
je     13bc <main+0x23c>
mov    -0x2c(%rbp),%eax
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
shl    $0x3,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x3,-0x28(%rbp)
jne    13ae <main+0x22e>
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%edx
mov    -0x2c(%rbp),%ecx
lea    0xd0b(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
jmp    13b7 <main+0x237>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1340 <main+0x1c0>
cmpl   $0x0,-0x28(%rbp)
je     13de <main+0x25e>
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%edx
mov    -0x2c(%rbp),%ecx
lea    0xcbf(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xcbb(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbp
cmp    $0x2,%edi
jg     11af <main+0x1f>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rbp),%rdi
lea    0xe46(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     131d <main+0x18d>
mov    %rax,%r14
mov    0x10(%rbp),%rdi
lea    0xe3e(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1323 <main+0x193>
mov    %rax,%rbx
mov    %r14,%rdi
call   1060 <fgetc@plt>
mov    0x2df2(%rip),%r13
cmp    0x0(%r13),%eax
jne    1343 <main+0x1b3>
mov    0x2dd1(%rip),%rax
mov    (%rax),%edx
xor    %r15d,%r15d
mov    %r14,%rdi
xor    %esi,%esi
call   1090 <fseek@plt>
lea    0xdfd(%rip),%rdi
mov    $0xe,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
lea    0xdf3(%rip),%rdi
mov    $0xc,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
lea    0xde7(%rip),%rdi
mov    $0x15,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
lea    0xde4(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
lea    0xdde(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
lea    0xdce(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
mov    %r14,%rdi
call   1060 <fgetc@plt>
cmp    0x0(%r13),%eax
je     13d3 <main+0x243>
xor    %ebp,%ebp
xor    %r12d,%r12d
jmp    12e6 <main+0x156>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%r12d
mov    %r14,%rdi
call   1060 <fgetc@plt>
cmp    0x0(%r13),%eax
je     13b8 <main+0x228>
lea    0x0(,%r12,8),%ecx
shl    %cl,%eax
mov    %ebp,%ecx
mov    %eax,%ebp
or     %ecx,%ebp
cmp    $0x3,%r12d
jne    12d0 <main+0x140>
xor    %r12d,%r12d
mov    %rbx,%rdi
lea    0xd67(%rip),%rsi
mov    %r15d,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1080 <fprintf@plt>
add    $0x1,%r15d
xor    %ebp,%ebp
jmp    12d4 <main+0x144>
mov    0x8(%rbp),%rsi
jmp    1327 <main+0x197>
mov    0x10(%rbp),%rsi
lea    0xcd4(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <printf@plt>
mov    %eax,%ebp
xor    %r15d,%r15d
xor    %r12d,%r12d
jmp    1364 <main+0x1d4>
nopl   (%rax)
mov    %r14,%rdi
call   1060 <fgetc@plt>
mov    %eax,%ebp
cmp    0x0(%r13),%eax
je     1200 <main+0x70>
test   %r12d,%r12d
jne    1382 <main+0x1f2>
mov    $0x3,%esi
mov    $0x1,%edx
lea    0xc9c(%rip),%rdi
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
add    $0x1,%r12d
mov    %ebp,%edi
mov    %rbx,%rsi
call   1070 <fputc@plt>
cmp    $0xa,%ebp
cmove  %r15d,%r12d
cmp    $0x50,%r12d
jne    1350 <main+0x1c0>
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xcbf(%rip),%rdi
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
jmp    1350 <main+0x1c0>
test   %r12d,%r12d
je     13d3 <main+0x243>
lea    0xcac(%rip),%rsi
mov    %rbx,%rdi
mov    %r15d,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1080 <fprintf@plt>
lea    0xca4(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <fwrite@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fclose@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"txt2mif text_file_name mif_file_name\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [18 x i8] c"Error opening %s\0A\00"
@.str.3 = [2 x i8] c"w\00"
@EOF = global i32 0
@.str.4 = [4 x i8] c"-- \00"
@.str.5 = [3 x i8] c"\0A\0A\00"
@SEEK_SET = global i32 0
@.str.6 = [15 x i8] c"DEPTH = 4096;\0A\00"
@.str.7 = [13 x i8] c"WIDTH = 32;\0A\00"
@.str.8 = [22 x i8] c"ADDRESS_RADIX = HEX;\0A\00"
@.str.9 = [19 x i8] c"DATA_RADIX = HEX;\0A\00"
@.str.10 = [9 x i8] c"CONTENT\0A\00"
@.str.11 = [8 x i8] c"BEGIN\0A\0A\00"
@.str.12 = [14 x i8] c"%02X : %08X;\0A\00"
@.str.13 = [7 x i8] c"\0AEND;\0A\00"
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 0, i32* %10
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 3
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
%16 = load i8**, i8*** %4
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32* @fopen(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %19, i32** %5
%20 = load i32*, i32** %5
%21 = icmp eq i32* %20, null
br i1 %21, label %22, label %27
22: ; preds = %15
%23 = load i8**, i8*** %4
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %25)
br label %123
27: ; preds = %15
%28 = load i8**, i8*** %4
%29 = getelementptr inbounds i8*, i8** %28, i64 2
%30 = load i8*, i8** %29
%31 = call i32* @fopen(i8* %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %31, i32** %6
%32 = load i32*, i32** %6
%33 = icmp eq i32* %32, null
br i1 %33, label %34, label %39
34: ; preds = %27
%35 = load i8**, i8*** %4
%36 = getelementptr inbounds i8*, i8** %35, i64 2
%37 = load i8*, i8** %36
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %37)
br label %123
39: ; preds = %27
store i32 0, i32* %8
br label %40
40: ; preds = %66, %39
%41 = load i32*, i32** %5
%42 = call i32 @fgetc(i32* %41)
store i32 %42, i32* %7
%43 = load i32, i32* @EOF
%44 = icmp ne i32 %42, %43
br i1 %44, label %45, label %67
45: ; preds = %40
%46 = load i32, i32* %8
%47 = icmp eq i32 %46, 0
br i1 %47, label %48, label %51
48: ; preds = %45
%49 = load i32*, i32** %6
%50 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32* %49)
br label %51
51: ; preds = %48, %45
%52 = load i32, i32* %8
%53 = add nsw i32 %52, 1
store i32 %53, i32* %8
%54 = load i32, i32* %7
%55 = load i32*, i32** %6
%56 = call i32 @fputc(i32 %54, i32* %55)
%57 = load i32, i32* %7
%58 = icmp eq i32 %57, 10
br i1 %58, label %59, label %60
59: ; preds = %51
store i32 0, i32* %8
br label %60
60: ; preds = %59, %51
%61 = load i32, i32* %8
%62 = icmp eq i32 %61, 80
br i1 %62, label %63, label %66
63: ; preds = %60
%64 = load i32*, i32** %6
%65 = call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %64)
br label %66
66: ; preds = %63, %60
br label %40
67: ; preds = %40
%68 = load i32*, i32** %5
%69 = load i32, i32* @SEEK_SET
%70 = call i32 @fseek(i32* %68, i32 0, i32 %69)
%71 = load i32*, i32** %6
%72 = call i32 (i32*, i8*, ...) @fprintf(i32* %71, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%73 = load i32*, i32** %6
%74 = call i32 (i32*, i8*, ...) @fprintf(i32* %73, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%75 = load i32*, i32** %6
%76 = call i32 (i32*, i8*, ...) @fprintf(i32* %75, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
%77 = load i32*, i32** %6
%78 = call i32 (i32*, i8*, ...) @fprintf(i32* %77, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0))
%79 = load i32*, i32** %6
%80 = call i32 (i32*, i8*, ...) @fprintf(i32* %79, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%81 = load i32*, i32** %6
%82 = call i32 (i32*, i8*, ...) @fprintf(i32* %81, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
store i32 0, i32* %8
store i32 0, i32* %10
store i32 0, i32* %9
br label %83
83: ; preds = %107, %67
%84 = load i32*, i32** %5
%85 = call i32 @fgetc(i32* %84)
store i32 %85, i32* %7
%86 = load i32, i32* @EOF
%87 = icmp ne i32 %85, %86
br i1 %87, label %88, label %108
88: ; preds = %83
%89 = load i32, i32* %9
%90 = load i32, i32* %7
%91 = load i32, i32* %8
%92 = mul nsw i32 8, %91
%93 = shl i32 %90, %92
%94 = or i32 %89, %93
store i32 %94, i32* %9
%95 = load i32, i32* %8
%96 = icmp eq i32 %95, 3
br i1 %96, label %97, label %104
97: ; preds = %88
%98 = load i32*, i32** %6
%99 = load i32, i32* %10
%100 = load i32, i32* %9
%101 = call i32 (i32*, i8*, ...) @fprintf(i32* %98, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), i32 %99, i32 %100)
%102 = load i32, i32* %10
%103 = add nsw i32 %102, 1
store i32 %103, i32* %10
store i32 0, i32* %8
store i32 0, i32* %9
br label %107
104: ; preds = %88
%105 = load i32, i32* %8
%106 = add nsw i32 %105, 1
store i32 %106, i32* %8
br label %107
107: ; preds = %104, %97
br label %83
108: ; preds = %83
%109 = load i32, i32* %8
%110 = icmp ne i32 %109, 0
br i1 %110, label %111, label %116
111: ; preds = %108
%112 = load i32*, i32** %6
%113 = load i32, i32* %10
%114 = load i32, i32* %9
%115 = call i32 (i32*, i8*, ...) @fprintf(i32* %112, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), i32 %113, i32 %114)
br label %116
116: ; preds = %111, %108
%117 = load i32*, i32** %6
%118 = call i32 (i32*, i8*, ...) @fprintf(i32* %117, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%119 = load i32*, i32** %5
%120 = call i32 @fclose(i32* %119)
%121 = load i32*, i32** %6
%122 = call i32 @fclose(i32* %121)
br label %123
123: ; preds = %116, %34, %22
ret void
}

LLVM IR (-O2):
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [18 x i8] c"Error opening %s\0A\00"
@.str.3 = [2 x i8] c"w\00"
@EOF = global i32 0
@.str.4 = [4 x i8] c"-- \00"
@.str.5 = [3 x i8] c"\0A\0A\00"
@SEEK_SET = global i32 0
@.str.6 = [15 x i8] c"DEPTH = 4096;\0A\00"
@.str.7 = [13 x i8] c"WIDTH = 32;\0A\00"
@.str.8 = [22 x i8] c"ADDRESS_RADIX = HEX;\0A\00"
@.str.9 = [19 x i8] c"DATA_RADIX = HEX;\0A\00"
@.str.10 = [9 x i8] c"CONTENT\0A\00"
@.str.11 = [8 x i8] c"BEGIN\0A\0A\00"
@.str.12 = [14 x i8] c"%02X : %08X;\0A\00"
@.str.13 = [7 x i8] c"\0AEND;\0A\00"
@str = [37 x i8] c"txt2mif text_file_name mif_file_name\00"
define void @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32* @fopen(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = load i8*, i8** %7
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %12)
br label %85
14: ; preds = %6
%15 = getelementptr inbounds i8*, i8** %1, i64 2
%16 = load i8*, i8** %15
%17 = tail call i32* @fopen(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp eq i32* %17, null
br i1 %18, label %23, label %19
19: ; preds = %14
%20 = tail call i32 @fgetc(i32* %9)
%21 = load i32, i32* @EOF
%22 = icmp eq i32 %20, %21
br i1 %22, label %44, label %26
23: ; preds = %14
%24 = load i8*, i8** %15
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %24)
br label %85
26: ; preds = %19, %40
%27 = phi i32 [ %41, %40 ], [ %20, %19 ]
%28 = phi i32 [ %36, %40 ], [ 0, %19 ]
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64 3, i64 1, i32* %17)
br label %32
32: ; preds = %30, %26
%33 = add nsw i32 %28, 1
%34 = tail call i32 @fputc(i32 %27, i32* %17)
%35 = icmp eq i32 %27, 10
%36 = select i1 %35, i32 0, i32 %33
%37 = icmp eq i32 %36, 80
br i1 %37, label %38, label %40
38: ; preds = %32
%39 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i64 2, i64 1, i32* %17)
br label %40
40: ; preds = %38, %32
%41 = tail call i32 @fgetc(i32* %9)
%42 = load i32, i32* @EOF
%43 = icmp eq i32 %41, %42
br i1 %43, label %44, label %26
44: ; preds = %40, %19
%45 = load i32, i32* @SEEK_SET
%46 = tail call i32 @fseek(i32* %9, i32 0, i32 %45)
%47 = tail call i64 @fwrite(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i64 14, i64 1, i32* %17)
%48 = tail call i64 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i64 12, i64 1, i32* %17)
%49 = tail call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i64 21, i64 1, i32* %17)
%50 = tail call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i64 18, i64 1, i32* %17)
%51 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i64 8, i64 1, i32* %17)
%52 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i64 7, i64 1, i32* %17)
%53 = tail call i32 @fgetc(i32* %9)
%54 = load i32, i32* @EOF
%55 = icmp eq i32 %53, %54
br i1 %55, label %81, label %56
56: ; preds = %44, %70
%57 = phi i32 [ %74, %70 ], [ %53, %44 ]
%58 = phi i32 [ %73, %70 ], [ 0, %44 ]
%59 = phi i32 [ %72, %70 ], [ 0, %44 ]
%60 = phi i32 [ %71, %70 ], [ 0, %44 ]
%61 = shl nsw i32 %60, 3
%62 = shl i32 %57, %61
%63 = or i32 %62, %59
%64 = icmp eq i32 %60, 3
br i1 %64, label %65, label %68
65: ; preds = %56
%66 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), i32 %58, i32 %63)
%67 = add nsw i32 %58, 1
br label %70
68: ; preds = %56
%69 = add nsw i32 %60, 1
br label %70
70: ; preds = %68, %65
%71 = phi i32 [ 0, %65 ], [ %69, %68 ]
%72 = phi i32 [ 0, %65 ], [ %63, %68 ]
%73 = phi i32 [ %67, %65 ], [ %58, %68 ]
%74 = tail call i32 @fgetc(i32* %9)
%75 = load i32, i32* @EOF
%76 = icmp eq i32 %74, %75
br i1 %76, label %77, label %56
77: ; preds = %70
%78 = icmp eq i32 %71, 0
br i1 %78, label %81, label %79
79: ; preds = %77
%80 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), i32 %73, i32 %72)
br label %81
81: ; preds = %44, %79, %77
%82 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i64 6, i64 1, i32* %17)
%83 = tail call i32 @fclose(i32* %9)
%84 = tail call i32 @fclose(i32* %17)
br label %85
85: ; preds = %81, %23, %11
ret void
}