#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 */
char EOF;
int /*<<< orphan*/ EOVERFLOW;
char *calloc(int, int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ ferror(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
char getchar();
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strlen(char *);
int main(int argc, char **argv) {
  int i = 0, bnl_ind = 0;
  char input;
  FILE *filestream = NULL;
  char *buffer = NULL, *buf_with_nl = NULL;
  char rel_path[1024] = "./";
  if ((buffer = calloc((14096 / 2), sizeof(char))) == NULL) {
    perror("Calloc");
    return -1;
  }
  if ((buf_with_nl = calloc(14096, sizeof(char))) == NULL) {
    perror("Calloc");
    goto errjmp;
  }
  if (argc <= 1) {
    i = 0;
    while ((input = getchar()) != EOF && input != '\0') {
      if (i + 1 >= 14096 / 2) {
        errno = EOVERFLOW;
        perror("Input");
        goto errjmp;
      }
      buffer[i++] = input;
    }
    buffer[i] = '\0';
  } else {
    strcat(rel_path, argv[1]);
    if ((filestream = fopen(rel_path, "r")) == NULL) {
      perror("Fopen");
      goto errjmp;
    }
    fread(buffer, sizeof(char), 14096 / 2, filestream);
    if (ferror(filestream)) {
      perror("Fread");
      goto errjmp;
    }
    if (filestream) {
      fclose(filestream);
      filestream = NULL;
    }
  }
  bnl_ind = 0;
  i = 0;
  while (i < (int)strlen(buffer)) {
    if (buffer[i] == '\n') {
      buf_with_nl[bnl_ind++] = '\\';
      buf_with_nl[bnl_ind++] = 'n';
      buf_with_nl[bnl_ind++] = '\n';
      ++i;
    } else
      buf_with_nl[bnl_ind++] = buffer[i++];
  }
  buf_with_nl[bnl_ind] = '\0';
  printf("\nYour file with printed newlines:\n%s\n\n", buf_with_nl);
  if (buffer) {
    free(buffer);
    buffer = NULL;
  }
  if (buf_with_nl) {
    free(buf_with_nl);
    buf_with_nl = NULL;
  }
  if (filestream) {
    fclose(filestream);
    filestream = NULL;
  }
  return 0;
errjmp:
  if (buffer) {
    free(buffer);
    buffer = NULL;
  }
  if (buf_with_nl) {
    free(buf_with_nl);
    buf_with_nl = NULL;
  }
  if (filestream) {
    fclose(filestream);
    filestream = NULL;
  }
  return -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
lea    -0x440(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1090 <memset@plt>
movb   $0x2e,-0x440(%rbp)
movb   $0x2f,-0x43f(%rbp)
mov    $0x1b88,%edi
mov    $0x1,%esi
call   10a0 <calloc@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    1255 <main+0x95>
lea    0xdbc(%rip),%rdi
call   10d0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    157e <main+0x3be>
mov    $0x3710,%edi
mov    $0x1,%esi
call   10a0 <calloc@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    1283 <main+0xc3>
lea    0xd87(%rip),%rdi
call   10d0 <perror@plt>
jmp    1523 <main+0x363>
cmpl   $0x1,-0x8(%rbp)
jg     1340 <main+0x180>
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   10b0 <getchar@plt>
mov    %al,-0x19(%rbp)
movsbl %al,%ecx
mov    0x2d38(%rip),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x441(%rbp)
je     12cb <main+0x10b>
movsbl -0x19(%rbp),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x441(%rbp)
mov    -0x441(%rbp),%al
test   $0x1,%al
jne    12de <main+0x11e>
jmp    132f <main+0x16f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cmp    $0x1b88,%eax
jl     1312 <main+0x152>
mov    0x2cfa(%rip),%rax
mov    (%rax),%ecx
mov    0x2cd1(%rip),%rax
mov    %ecx,(%rax)
lea    0xcff(%rip),%rdi
call   10d0 <perror@plt>
jmp    1523 <main+0x363>
mov    -0x19(%rbp),%dl
mov    -0x30(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1294 <main+0xd4>
mov    -0x30(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    13e2 <main+0x222>
lea    -0x440(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   10e0 <strcat@plt>
lea    -0x440(%rbp),%rdi
lea    0xcab(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    1386 <main+0x1c6>
lea    0xc93(%rip),%rdi
call   10d0 <perror@plt>
jmp    1523 <main+0x363>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rcx
mov    $0x1,%esi
mov    $0x1b88,%edx
call   1050 <fread@plt>
mov    -0x28(%rbp),%rdi
call   1040 <ferror@plt>
cmp    $0x0,%rax
je     13c1 <main+0x201>
lea    0xc5e(%rip),%rdi
call   10d0 <perror@plt>
jmp    1523 <main+0x363>
cmpq   $0x0,-0x28(%rbp)
je     13dd <main+0x21d>
mov    -0x28(%rbp),%rdi
call   1060 <fclose@plt>
movq   $0x0,-0x28(%rbp)
jmp    13e2 <main+0x222>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x448(%rbp)
mov    -0x30(%rbp),%rdi
call   1070 <strlen@plt>
mov    %rax,%rcx
mov    -0x448(%rbp),%eax
cmp    %ecx,%eax
jge    14a7 <main+0x2e7>
mov    -0x30(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1478 <main+0x2b8>
mov    -0x38(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
movslq %ecx,%rcx
movb   $0x5c,(%rax,%rcx,1)
mov    -0x38(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
movslq %ecx,%rcx
movb   $0x6e,(%rax,%rcx,1)
mov    -0x38(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
movslq %ecx,%rcx
movb   $0xa,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    14a2 <main+0x2e2>
mov    -0x30(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x38(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x18(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    13f0 <main+0x230>
mov    -0x38(%rbp),%rax
movslq -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x38(%rbp),%rsi
lea    0xb5d(%rip),%rdi
call   1080 <printf@plt>
cmpq   $0x0,-0x30(%rbp)
je     14df <main+0x31f>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x30(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     14fb <main+0x33b>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x38(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1517 <main+0x357>
mov    -0x28(%rbp),%rdi
call   1060 <fclose@plt>
movq   $0x0,-0x28(%rbp)
movl   $0x0,-0x4(%rbp)
jmp    157e <main+0x3be>
cmpq   $0x0,-0x30(%rbp)
je     153f <main+0x37f>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x30(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     155b <main+0x39b>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x38(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1577 <main+0x3b7>
mov    -0x28(%rbp),%rdi
call   1060 <fclose@plt>
movq   $0x0,-0x28(%rbp)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x450,%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,%r15
mov    %edi,%ebp
mov    %rsp,%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   1090 <memset@plt>
movw   $0x2f2e,(%rsp)
mov    $0x1b88,%edi
mov    $0x1,%esi
call   10a0 <calloc@plt>
test   %rax,%rax
je     1361 <main+0x1a1>
mov    %rax,%r14
mov    $0x3710,%edi
mov    $0x1,%esi
call   10a0 <calloc@plt>
test   %rax,%rax
je     136f <main+0x1af>
mov    %rax,%r13
cmp    $0x1,%ebp
jg     127c <main+0xbc>
xor    %ebp,%ebp
xor    %eax,%eax
call   10b0 <getchar@plt>
test   %al,%al
je     1275 <main+0xb5>
mov    0x2da6(%rip),%r15
cmp    (%r15),%al
je     1275 <main+0xb5>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    $0x1b87,%rbp
je     13ba <main+0x1fa>
mov    %al,(%r14,%rbp,1)
add    $0x1,%rbp
xor    %eax,%eax
call   10b0 <getchar@plt>
test   %al,%al
je     1275 <main+0xb5>
cmp    (%r15),%al
jne    1250 <main+0x90>
movb   $0x0,(%r14,%rbp,1)
jmp    12d4 <main+0x114>
mov    0x8(%r15),%rsi
mov    %rsp,%rbp
mov    %rbp,%rdi
call   10e0 <strcat@plt>
lea    0xd7b(%rip),%rsi
mov    %rbp,%rdi
call   10c0 <fopen@plt>
test   %rax,%rax
je     1380 <main+0x1c0>
mov    %rax,%r12
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x1b88,%edx
mov    %rax,%rcx
call   1050 <fread@plt>
mov    %r12,%rdi
call   1040 <ferror@plt>
test   %rax,%rax
jne    1389 <main+0x1c9>
mov    %r12,%rdi
call   1060 <fclose@plt>
mov    %r14,%rdi
call   1070 <strlen@plt>
xor    %r15d,%r15d
test   %eax,%eax
jle    1325 <main+0x165>
mov    %eax,%eax
xor    %ecx,%ecx
xor    %edx,%edx
jmp    1304 <main+0x144>
nopl   0x0(%rax,%rax,1)
movslq %edx,%rdx
mov    %bl,0x0(%r13,%rdx,1)
add    $0x1,%edx
add    $0x1,%rcx
cmp    %rcx,%rax
je     1320 <main+0x160>
movzbl (%r14,%rcx,1),%ebx
cmp    $0xa,%bl
jne    12f0 <main+0x130>
movslq %edx,%rdx
movw   $0x6e5c,0x0(%r13,%rdx,1)
6e
add    $0x2,%edx
mov    $0xa,%bl
jmp    12f0 <main+0x130>
movslq %edx,%rax
jmp    1327 <main+0x167>
xor    %eax,%eax
movb   $0x0,0x0(%r13,%rax,1)
lea    0xce7(%rip),%rdi
mov    %r13,%rsi
call   1080 <printf@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r15d,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc98(%rip),%rdi
call   10d0 <perror@plt>
jmp    13e8 <main+0x228>
lea    0xc8a(%rip),%rdi
call   10d0 <perror@plt>
mov    %r14,%rdi
jmp    13e3 <main+0x223>
lea    0xc88(%rip),%rdi
jmp    13d3 <main+0x213>
lea    0xc85(%rip),%rdi
call   10d0 <perror@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    $0xffffffff,%r15d
test   %r12,%r12
je     134c <main+0x18c>
mov    %r12,%rdi
call   1060 <fclose@plt>
jmp    134c <main+0x18c>
mov    0x2c2f(%rip),%rax
mov    (%rax),%eax
mov    0x2c06(%rip),%rcx
mov    %eax,(%rcx)
lea    0xc34(%rip),%rdi
call   10d0 <perror@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    $0xffffffff,%r15d
jmp    134c <main+0x18c>

LLVM IR (-O0):
@.str = [7 x i8] c"Calloc\00"
@EOF = global i8 0
@EOVERFLOW = global i32 0
@errno = global i32 0
@.str.1 = [6 x i8] c"Input\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [6 x i8] c"Fopen\00"
@.str.4 = [6 x i8] c"Fread\00"
@.str.5 = [39 x i8] c"\0AYour file with printed newlines:\0A%s\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 i8
%9 = alloca i32*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca [1024 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32* null, i32** %9
store i8* null, i8** %10
store i8* null, i8** %11
%13 = bitcast [1024 x i8]* %12 to i8*
%14 = bitcast i8* %13 to [1024 x i8]*
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %14, i32 0, i32 0
store i8 46, i8* %15
%16 = getelementptr inbounds [1024 x i8], [1024 x i8]* %14, i32 0, i32 1
store i8 47, i8* %16
%17 = call i8* @calloc(i32 7048, i32 1)
store i8* %17, i8** %10
%18 = icmp eq i8* %17, null
br i1 %18, label %19, label %21
19: ; preds = %2
%20 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %178
21: ; preds = %2
%22 = call i8* @calloc(i32 14096, i32 1)
store i8* %22, i8** %11
%23 = icmp eq i8* %22, null
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %159
26: ; preds = %21
%27 = load i32, i32* %4
%28 = icmp sle i32 %27, 1
br i1 %28, label %29, label %61
29: ; preds = %26
store i32 0, i32* %6
br label %30
30: ; preds = %49, %29
%31 = call signext i8 (...) @getchar()
store i8 %31, i8* %8
%32 = sext i8 %31 to i32
%33 = load i8, i8* @EOF
%34 = sext i8 %33 to i32
%35 = icmp ne i32 %32, %34
br i1 %35, label %36, label %40
36: ; preds = %30
%37 = load i8, i8* %8
%38 = sext i8 %37 to i32
%39 = icmp ne i32 %38, 0
br label %40
40: ; preds = %36, %30
%41 = phi i1 [ false, %30 ], [ %39, %36 ]
br i1 %41, label %42, label %56
42: ; preds = %40
%43 = load i32, i32* %6
%44 = add nsw i32 %43, 1
%45 = icmp sge i32 %44, 7048
br i1 %45, label %46, label %49
46: ; preds = %42
%47 = load i32, i32* @EOVERFLOW
store i32 %47, i32* @errno
%48 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %159
49: ; preds = %42
%50 = load i8, i8* %8
%51 = load i8*, i8** %10
%52 = load i32, i32* %6
%53 = add nsw i32 %52, 1
store i32 %53, i32* %6
%54 = sext i32 %52 to i64
%55 = getelementptr inbounds i8, i8* %51, i64 %54
store i8 %50, i8* %55
br label %30
56: ; preds = %40
%57 = load i8*, i8** %10
%58 = load i32, i32* %6
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i8, i8* %57, i64 %59
store i8 0, i8* %60
br label %88
61: ; preds = %26
%62 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i64 1
%65 = load i8*, i8** %64
%66 = call i32 @strcat(i8* %62, i8* %65)
%67 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
%68 = call i32* @fopen(i8* %67, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %68, i32** %9
%69 = icmp eq i32* %68, null
br i1 %69, label %70, label %72
70: ; preds = %61
%71 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %159
72: ; preds = %61
%73 = load i8*, i8** %10
%74 = load i32*, i32** %9
%75 = call i32 @fread(i8* %73, i32 1, i32 7048, i32* %74)
%76 = load i32*, i32** %9
%77 = call i64 @ferror(i32* %76)
%78 = icmp ne i64 %77, 0
br i1 %78, label %79, label %81
79: ; preds = %72
%80 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %159
81: ; preds = %72
%82 = load i32*, i32** %9
%83 = icmp ne i32* %82, null
br i1 %83, label %84, label %87
84: ; preds = %81
%85 = load i32*, i32** %9
%86 = call i32 @fclose(i32* %85)
store i32* null, i32** %9
br label %87
87: ; preds = %84, %81
br label %88
88: ; preds = %87, %56
store i32 0, i32* %7
store i32 0, i32* %6
br label %89
89: ; preds = %133, %88
%90 = load i32, i32* %6
%91 = load i8*, i8** %10
%92 = call i64 @strlen(i8* %91)
%93 = trunc i64 %92 to i32
%94 = icmp slt i32 %90, %93
br i1 %94, label %95, label %134
95: ; preds = %89
%96 = load i8*, i8** %10
%97 = load i32, i32* %6
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds i8, i8* %96, i64 %98
%100 = load i8, i8* %99
%101 = sext i8 %100 to i32
%102 = icmp eq i32 %101, 10
br i1 %102, label %103, label %121
103: ; preds = %95
%104 = load i8*, i8** %11
%105 = load i32, i32* %7
%106 = add nsw i32 %105, 1
store i32 %106, i32* %7
%107 = sext i32 %105 to i64
%108 = getelementptr inbounds i8, i8* %104, i64 %107
store i8 92, i8* %108
%109 = load i8*, i8** %11
%110 = load i32, i32* %7
%111 = add nsw i32 %110, 1
store i32 %111, i32* %7
%112 = sext i32 %110 to i64
%113 = getelementptr inbounds i8, i8* %109, i64 %112
store i8 110, i8* %113
%114 = load i8*, i8** %11
%115 = load i32, i32* %7
%116 = add nsw i32 %115, 1
store i32 %116, i32* %7
%117 = sext i32 %115 to i64
%118 = getelementptr inbounds i8, i8* %114, i64 %117
store i8 10, i8* %118
%119 = load i32, i32* %6
%120 = add nsw i32 %119, 1
store i32 %120, i32* %6
br label %133
121: ; preds = %95
%122 = load i8*, i8** %10
%123 = load i32, i32* %6
%124 = add nsw i32 %123, 1
store i32 %124, i32* %6
%125 = sext i32 %123 to i64
%126 = getelementptr inbounds i8, i8* %122, i64 %125
%127 = load i8, i8* %126
%128 = load i8*, i8** %11
%129 = load i32, i32* %7
%130 = add nsw i32 %129, 1
store i32 %130, i32* %7
%131 = sext i32 %129 to i64
%132 = getelementptr inbounds i8, i8* %128, i64 %131
store i8 %127, i8* %132
br label %133
133: ; preds = %121, %103
br label %89
134: ; preds = %89
%135 = load i8*, i8** %11
%136 = load i32, i32* %7
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds i8, i8* %135, i64 %137
store i8 0, i8* %138
%139 = load i8*, i8** %11
%140 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i8* %139)
%141 = load i8*, i8** %10
%142 = icmp ne i8* %141, null
br i1 %142, label %143, label %146
143: ; preds = %134
%144 = load i8*, i8** %10
%145 = call i32 @free(i8* %144)
store i8* null, i8** %10
br label %146
146: ; preds = %143, %134
%147 = load i8*, i8** %11
%148 = icmp ne i8* %147, null
br i1 %148, label %149, label %152
149: ; preds = %146
%150 = load i8*, i8** %11
%151 = call i32 @free(i8* %150)
store i8* null, i8** %11
br label %152
152: ; preds = %149, %146
%153 = load i32*, i32** %9
%154 = icmp ne i32* %153, null
br i1 %154, label %155, label %158
155: ; preds = %152
%156 = load i32*, i32** %9
%157 = call i32 @fclose(i32* %156)
store i32* null, i32** %9
br label %158
158: ; preds = %155, %152
store i32 0, i32* %3
br label %178
159: ; preds = %79, %70, %46, %24
%160 = load i8*, i8** %10
%161 = icmp ne i8* %160, null
br i1 %161, label %162, label %165
162: ; preds = %159
%163 = load i8*, i8** %10
%164 = call i32 @free(i8* %163)
store i8* null, i8** %10
br label %165
165: ; preds = %162, %159
%166 = load i8*, i8** %11
%167 = icmp ne i8* %166, null
br i1 %167, label %168, label %171
168: ; preds = %165
%169 = load i8*, i8** %11
%170 = call i32 @free(i8* %169)
store i8* null, i8** %11
br label %171
171: ; preds = %168, %165
%172 = load i32*, i32** %9
%173 = icmp ne i32* %172, null
br i1 %173, label %174, label %177
174: ; preds = %171
%175 = load i32*, i32** %9
%176 = call i32 @fclose(i32* %175)
store i32* null, i32** %9
br label %177
177: ; preds = %174, %171
store i32 -1, i32* %3
br label %178
178: ; preds = %177, %158, %19
%179 = load i32, i32* %3
ret i32 %179
}

LLVM IR (-O2):
@.str = [7 x i8] c"Calloc\00"
@EOF = global i8 0
@EOVERFLOW = global i32 0
@errno = global i32 0
@.str.1 = [6 x i8] c"Input\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [6 x i8] c"Fopen\00"
@.str.4 = [6 x i8] c"Fread\00"
@.str.5 = [39 x i8] c"\0AYour file with printed newlines:\0A%s\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
store i8 46, i8* %4
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 1
store i8 47, i8* %5
%6 = tail call dereferenceable_or_null(7048) i8* @calloc(i32 7048, i32 1)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %103
10: ; preds = %2
%11 = tail call dereferenceable_or_null(14096) i8* @calloc(i32 14096, i32 1)
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%15 = tail call i32 @free(i8* %6)
br label %103
16: ; preds = %10
%17 = icmp slt i32 %0, 2
br i1 %17, label %18, label %41
18: ; preds = %16
%19 = tail call signext i8 (...) @getchar()
%20 = load i8, i8* @EOF
%21 = icmp ne i8 %19, %20
%22 = icmp ne i8 %19, 0
%23 = and i1 %22, %21
br i1 %23, label %24, label %38
24: ; preds = %18, %28
%25 = phi i64 [ %29, %28 ], [ 0, %18 ]
%26 = phi i8 [ %31, %28 ], [ %19, %18 ]
%27 = icmp eq i64 %25, 7047
br i1 %27, label %88, label %28
28: ; preds = %24
%29 = add nuw nsw i64 %25, 1
%30 = getelementptr inbounds i8, i8* %6, i64 %25
store i8 %26, i8* %30
%31 = tail call signext i8 (...) @getchar()
%32 = load i8, i8* @EOF
%33 = icmp ne i8 %31, %32
%34 = icmp ne i8 %31, 0
%35 = and i1 %34, %33
br i1 %35, label %24, label %36
36: ; preds = %28
%37 = and i64 %29, 4294967295
br label %38
38: ; preds = %36, %18
%39 = phi i64 [ 0, %18 ], [ %37, %36 ]
%40 = getelementptr inbounds i8, i8* %6, i64 %39
store i8 0, i8* %40
br label %53
41: ; preds = %16
%42 = getelementptr inbounds i8*, i8** %1, i64 1
%43 = load i8*, i8** %42
%44 = call i32 @strcat(i8* %4, i8* %43)
%45 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%46 = icmp eq i32* %45, null
br i1 %46, label %99, label %47
47: ; preds = %41
%48 = call i32 @fread(i8* %6, i32 1, i32 7048, i32* %45)
%49 = call i64 @ferror(i32* %45)
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %93
51: ; preds = %47
%52 = call i32 @fclose(i32* %45)
br label %53
53: ; preds = %51, %38
%54 = call i64 @strlen(i8* %6)
%55 = trunc i64 %54 to i32
%56 = icmp sgt i32 %55, 0
br i1 %56, label %57, label %82
57: ; preds = %53
%58 = and i64 %54, 4294967295
br label %59
59: ; preds = %57, %72
%60 = phi i64 [ 0, %57 ], [ %78, %72 ]
%61 = phi i32 [ 0, %57 ], [ %77, %72 ]
%62 = getelementptr inbounds i8, i8* %6, i64 %60
%63 = load i8, i8* %62
%64 = icmp eq i8 %63, 10
br i1 %64, label %65, label %72
65: ; preds = %59
%66 = add nsw i32 %61, 1
%67 = sext i32 %61 to i64
%68 = getelementptr inbounds i8, i8* %11, i64 %67
store i8 92, i8* %68
%69 = add nsw i32 %61, 2
%70 = sext i32 %66 to i64
%71 = getelementptr inbounds i8, i8* %11, i64 %70
store i8 110, i8* %71
br label %72
72: ; preds = %59, %65
%73 = phi i32 [ %69, %65 ], [ %61, %59 ]
%74 = phi i8 [ 10, %65 ], [ %63, %59 ]
%75 = sext i32 %73 to i64
%76 = getelementptr inbounds i8, i8* %11, i64 %75
store i8 %74, i8* %76
%77 = add nsw i32 %73, 1
%78 = add nuw nsw i64 %60, 1
%79 = icmp eq i64 %78, %58
br i1 %79, label %80, label %59
80: ; preds = %72
%81 = sext i32 %77 to i64
br label %82
82: ; preds = %80, %53
%83 = phi i64 [ 0, %53 ], [ %81, %80 ]
%84 = getelementptr inbounds i8, i8* %11, i64 %83
store i8 0, i8* %84
%85 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i8* %11)
%86 = call i32 @free(i8* %6)
%87 = call i32 @free(i8* %11)
br label %103
88: ; preds = %24
%89 = load i32, i32* @EOVERFLOW
store i32 %89, i32* @errno
%90 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%91 = tail call i32 @free(i8* %6)
%92 = tail call i32 @free(i8* %11)
br label %103
93: ; preds = %47
%94 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%95 = call i32 @free(i8* %6)
%96 = call i32 @free(i8* %11)
br i1 %46, label %103, label %97
97: ; preds = %93
%98 = call i32 @fclose(i32* %45)
br label %103
99: ; preds = %41
%100 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%101 = call i32 @free(i8* %6)
%102 = call i32 @free(i8* %11)
br label %103
103: ; preds = %99, %13, %88, %93, %97, %82, %8
%104 = phi i32 [ -1, %8 ], [ 0, %82 ], [ -1, %97 ], [ -1, %93 ], [ -1, %88 ], [ -1, %13 ], [ -1, %99 ]
ret i32 %104
}