#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*/ EXIT_FAILURE;
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
char *malloc(int);
char *realloc(char *, int);
int /*<<< orphan*/ stderr;
void writeFile(char *inputPath, FILE *outStream) {
  FILE *file = fopen(inputPath, "r");
  if (file == NULL) {
    fprintf(stderr, "Failed to open file at %s\n", inputPath);
    exit(EXIT_FAILURE);
  }
  char c;
  int currentIndex = 0;
  int fileLength = 64;
  char *filePath = malloc(sizeof(char) * fileLength);
  int filePathIndex = 0;
  int matchIndex = 0;
  int quotes = 0;
  int search = 1;
  while ((c = fgetc(file)) != EOF) {
    currentIndex++;
    fprintf(outStream, "%c", c);
    if (c == '\n') {
      search = 1;
      matchIndex = 0;
      continue;
    }
    if (search == 0) {
      continue;
    }
    if ((matchIndex == 0 || matchIndex == 3 || matchIndex == 10) &&
        (c == '\t' || c == ' ')) {
      continue;
    }
    if ((matchIndex == 0 && c == '/') || (matchIndex == 1 && c == '/') ||
        (matchIndex == 2 && c == '=') || (matchIndex == 3 && c == 'r') ||
        (matchIndex == 4 && c == 'e') || (matchIndex == 5 && c == 'q') ||
        (matchIndex == 6 && c == 'u') || (matchIndex == 7 && c == 'i') ||
        (matchIndex == 8 && c == 'r') || (matchIndex == 9 && c == 'e')) {
      matchIndex++;
      continue;
    }
    if (matchIndex >= 0 && matchIndex <= 9) {
      search = 0;
      continue;
    }
    if (matchIndex == 10 && c == '\'') {
      quotes = 1;
      filePathIndex = 0;
      matchIndex++;
      continue;
    }
    if (matchIndex == 10 && c == '"') {
      quotes = 2;
      filePathIndex = 0;
      matchIndex++;
      continue;
    }
    if (matchIndex == 10) {
      search = 0;
      continue;
    }
    if (matchIndex == 11 &&
        ((quotes == 1 && c == '\'') || (quotes == 2 && c == '"'))) {
      search = 0;
      filePath[filePathIndex] = '\0';
      fprintf(outStream, "\n");
      filePath = realloc(filePath, sizeof(char) * filePathIndex);
      fclose(file);
      writeFile(filePath, outStream);
      file = fopen(inputPath, "r");
      fseek(file, currentIndex, SEEK_CUR);
      continue;
    }
    if (matchIndex == 11) {
      if (currentIndex > fileLength) {
        fileLength += 64;
        filePath = realloc(filePath, sizeof(char) * fileLength);
      }
      filePath[filePathIndex++] = c;
      continue;
    }
  }
  free(filePath);
  fclose(file);
}


x86 assembly (clang, -O0):
<writeFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe45(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11f9 <writeFile+0x59>
mov    0x2dfa(%rip),%rax
movslq (%rax),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe1e(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2dd6(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
movl   $0x0,-0x20(%rbp)
movl   $0x40,-0x24(%rbp)
movslq -0x24(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x1,-0x40(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x19(%rbp)
movsbl %al,%eax
mov    0x2d94(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1582 <writeFile+0x3e2>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x19(%rbp),%edx
lea    0xdae(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
movsbl -0x19(%rbp),%eax
cmp    $0xa,%eax
jne    1296 <writeFile+0xf6>
movl   $0x1,-0x40(%rbp)
movl   $0x0,-0x38(%rbp)
jmp    1236 <writeFile+0x96>
cmpl   $0x0,-0x40(%rbp)
jne    12a5 <writeFile+0x105>
jmp    1236 <writeFile+0x96>
cmpl   $0x0,-0x38(%rbp)
je     12c3 <writeFile+0x123>
cmpl   $0x3,-0x38(%rbp)
je     12c3 <writeFile+0x123>
cmpl   $0xa,-0x38(%rbp)
jne    12e2 <writeFile+0x142>
movsbl -0x19(%rbp),%eax
cmp    $0x9,%eax
je     12dd <writeFile+0x13d>
movsbl -0x19(%rbp),%eax
cmp    $0x20,%eax
jne    12e2 <writeFile+0x142>
jmp    1236 <writeFile+0x96>
cmpl   $0x0,-0x38(%rbp)
jne    12f9 <writeFile+0x159>
movsbl -0x19(%rbp),%eax
cmp    $0x2f,%eax
je     13c8 <writeFile+0x228>
cmpl   $0x1,-0x38(%rbp)
jne    1310 <writeFile+0x170>
movsbl -0x19(%rbp),%eax
cmp    $0x2f,%eax
je     13c8 <writeFile+0x228>
cmpl   $0x2,-0x38(%rbp)
jne    1327 <writeFile+0x187>
movsbl -0x19(%rbp),%eax
cmp    $0x3d,%eax
je     13c8 <writeFile+0x228>
cmpl   $0x3,-0x38(%rbp)
jne    133e <writeFile+0x19e>
movsbl -0x19(%rbp),%eax
cmp    $0x72,%eax
je     13c8 <writeFile+0x228>
cmpl   $0x4,-0x38(%rbp)
jne    1355 <writeFile+0x1b5>
movsbl -0x19(%rbp),%eax
cmp    $0x65,%eax
je     13c8 <writeFile+0x228>
cmpl   $0x5,-0x38(%rbp)
jne    136c <writeFile+0x1cc>
movsbl -0x19(%rbp),%eax
cmp    $0x71,%eax
je     13c8 <writeFile+0x228>
cmpl   $0x6,-0x38(%rbp)
jne    1383 <writeFile+0x1e3>
movsbl -0x19(%rbp),%eax
cmp    $0x75,%eax
je     13c8 <writeFile+0x228>
cmpl   $0x7,-0x38(%rbp)
jne    139a <writeFile+0x1fa>
movsbl -0x19(%rbp),%eax
cmp    $0x69,%eax
je     13c8 <writeFile+0x228>
cmpl   $0x8,-0x38(%rbp)
jne    13b1 <writeFile+0x211>
movsbl -0x19(%rbp),%eax
cmp    $0x72,%eax
je     13c8 <writeFile+0x228>
cmpl   $0x9,-0x38(%rbp)
jne    13d6 <writeFile+0x236>
movsbl -0x19(%rbp),%eax
cmp    $0x65,%eax
jne    13d6 <writeFile+0x236>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1236 <writeFile+0x96>
cmpl   $0x0,-0x38(%rbp)
jl     13f6 <writeFile+0x256>
cmpl   $0x9,-0x38(%rbp)
jg     13f6 <writeFile+0x256>
movl   $0x0,-0x40(%rbp)
jmp    1236 <writeFile+0x96>
cmpl   $0xa,-0x38(%rbp)
jne    1429 <writeFile+0x289>
movsbl -0x19(%rbp),%eax
cmp    $0x27,%eax
jne    1429 <writeFile+0x289>
movl   $0x1,-0x3c(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1236 <writeFile+0x96>
cmpl   $0xa,-0x38(%rbp)
jne    145c <writeFile+0x2bc>
movsbl -0x19(%rbp),%eax
cmp    $0x22,%eax
jne    145c <writeFile+0x2bc>
movl   $0x2,-0x3c(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1236 <writeFile+0x96>
cmpl   $0xa,-0x38(%rbp)
jne    1472 <writeFile+0x2d2>
movl   $0x0,-0x40(%rbp)
jmp    1236 <writeFile+0x96>
cmpl   $0xb,-0x38(%rbp)
jne    152a <writeFile+0x38a>
cmpl   $0x1,-0x3c(%rbp)
jne    1493 <writeFile+0x2f3>
movsbl -0x19(%rbp),%eax
cmp    $0x27,%eax
je     14aa <writeFile+0x30a>
cmpl   $0x2,-0x3c(%rbp)
jne    152a <writeFile+0x38a>
movsbl -0x19(%rbp),%eax
cmp    $0x22,%eax
jne    152a <writeFile+0x38a>
movl   $0x0,-0x40(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rdi
lea    0xb53(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x30(%rbp),%rdi
movslq -0x34(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%esi
call   10a0 <realloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <writeFile@plt>
mov    -0x8(%rbp),%rdi
lea    0xaf9(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    0x2aca(%rip),%rax
mov    (%rax),%edx
call   1090 <fseek@plt>
jmp    1236 <writeFile+0x96>
cmpl   $0xb,-0x38(%rbp)
jne    157d <writeFile+0x3dd>
mov    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
jle    1560 <writeFile+0x3c0>
mov    -0x24(%rbp),%eax
add    $0x40,%eax
mov    %eax,-0x24(%rbp)
mov    -0x30(%rbp),%rdi
movslq -0x24(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%esi
call   10a0 <realloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x19(%rbp),%dl
mov    -0x30(%rbp),%rax
mov    -0x34(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x34(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1236 <writeFile+0x96>
jmp    1236 <writeFile+0x96>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeFile>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,0x18(%rsp)
mov    %rdi,%rbx
lea    0xe33(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     149f <writeFile+0x2ef>
mov    %rax,%rbp
mov    $0x40,%edi
call   1090 <malloc@plt>
mov    %rax,0x10(%rsp)
mov    %rbp,%r15
mov    %rbp,%rdi
call   1050 <fgetc@plt>
mov    %eax,%r12d
mov    0x2dde(%rip),%rax
cmp    (%rax),%r12b
jne    1227 <writeFile+0x77>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    %r15,%rdi
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fclose@plt>
movl   $0x40,0xc(%rsp)
mov    %rbx,0x20(%rsp)
xor    %r13d,%r13d
mov    $0x1,%ebp
movl   $0x0,0x8(%rsp)
xor    %ebx,%ebx
movl   $0x0,0x4(%rsp)
jmp    1279 <writeFile+0xc9>
mov    %ebx,%r14d
mov    %r15,%rbx
mov    $0x1,%r13b
mov    %rbx,%r15
mov    %rbx,%rdi
call   1050 <fgetc@plt>
mov    %eax,%r12d
add    $0x1,%ebp
mov    %r14d,%ebx
mov    0x2d6c(%rip),%rax
cmp    (%rax),%r12b
je     1207 <writeFile+0x57>
movsbl %r12b,%r14d
mov    %r14d,%edi
mov    0x18(%rsp),%rsi
call   1060 <fputc@plt>
cmp    $0xa,%r14b
jne    12a0 <writeFile+0xf0>
xor    %r14d,%r14d
xor    %r13d,%r13d
jmp    1320 <writeFile+0x170>
nopl   0x0(%rax,%rax,1)
test   $0x1,%r13b
jne    1250 <writeFile+0xa0>
cmp    $0xa,%ebx
mov    $0x1,%r13b
ja     12cc <writeFile+0x11c>
mov    $0x409,%eax
bt     %ebx,%eax
jae    12cc <writeFile+0x11c>
cmp    $0x9,%r12b
je     12c4 <writeFile+0x114>
cmp    $0x20,%r12b
jne    12cc <writeFile+0x11c>
mov    %ebx,%r14d
xor    %r13d,%r13d
jmp    1320 <writeFile+0x170>
cmp    $0x1,%ebx
ja     12d7 <writeFile+0x127>
cmp    $0x2f,%r12b
je     130e <writeFile+0x15e>
cmp    $0x2,%ebx
jne    12e2 <writeFile+0x132>
cmp    $0x3d,%r12b
je     130e <writeFile+0x15e>
cmp    $0x3,%ebx
jne    12ed <writeFile+0x13d>
cmp    $0x72,%r12b
je     130e <writeFile+0x15e>
cmp    $0x4,%ebx
jne    12f8 <writeFile+0x148>
cmp    $0x65,%r12b
je     130e <writeFile+0x15e>
cmp    $0x5,%ebx
jne    1303 <writeFile+0x153>
cmp    $0x71,%r12b
je     130e <writeFile+0x15e>
cmp    $0x6,%ebx
jne    1328 <writeFile+0x178>
cmp    $0x75,%r12b
jne    1328 <writeFile+0x178>
add    $0x1,%ebx
xor    %r13d,%r13d
mov    %ebx,%r14d
nopw   0x0(%rax,%rax,1)
mov    %r15,%rbx
jmp    1259 <writeFile+0xa9>
cmp    $0x65,%r12b
sete   %sil
cmp    $0x72,%r12b
sete   %dil
cmp    $0x7,%ebx
sete   %r8b
cmp    $0x69,%r12b
sete   %cl
cmp    $0x8,%ebx
sete   %al
cmp    $0x9,%ebx
sete   %dl
test   %cl,%r8b
jne    130e <writeFile+0x15e>
and    %dil,%al
jne    130e <writeFile+0x15e>
and    %sil,%dl
jne    130e <writeFile+0x15e>
cmp    $0xa,%ebx
jb     1314 <writeFile+0x164>
mov    $0xb,%r14d
jne    1389 <writeFile+0x1d9>
cmp    $0x27,%r12b
jne    1389 <writeFile+0x1d9>
movl   $0x0,0x4(%rsp)
movl   $0x1,0x8(%rsp)
xor    %r13d,%r13d
jmp    1320 <writeFile+0x170>
cmp    $0xa,%ebx
jne    13ac <writeFile+0x1fc>
cmp    $0x22,%r12b
jne    13ac <writeFile+0x1fc>
movl   $0x0,0x4(%rsp)
movl   $0x2,0x8(%rsp)
xor    %r13d,%r13d
jmp    1320 <writeFile+0x170>
cmp    $0xa,%ebx
jne    13bc <writeFile+0x20c>
mov    $0xa,%r14d
jmp    1320 <writeFile+0x170>
cmp    $0xb,%ebx
jne    1311 <writeFile+0x161>
cmp    $0x22,%r12b
sete   %al
cmp    $0x27,%r12b
sete   %dl
mov    0x8(%rsp),%ecx
cmp    $0x1,%ecx
sete   %bl
cmp    $0x2,%ecx
sete   %cl
test   %dl,%bl
mov    0x10(%rsp),%rbx
jne    142c <writeFile+0x27c>
and    %al,%cl
jne    142c <writeFile+0x27c>
lea    -0x1(%rbp),%eax
mov    0xc(%rsp),%esi
cmp    %esi,%eax
jl     140d <writeFile+0x25d>
add    $0x40,%esi
mov    %rbx,%rdi
mov    %esi,0xc(%rsp)
call   10b0 <realloc@plt>
mov    %rax,%rbx
mov    0x4(%rsp),%ecx
movslq %ecx,%rax
add    $0x1,%ecx
mov    %ecx,0x4(%rsp)
mov    %rbx,0x10(%rsp)
mov    %r12b,(%rbx,%rax,1)
xor    %r13d,%r13d
jmp    1320 <writeFile+0x170>
mov    0x4(%rsp),%r13d
movslq %r13d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    $0xa,%edi
mov    0x18(%rsp),%r12
mov    %r12,%rsi
call   1060 <fputc@plt>
mov    %rbx,%rdi
mov    %r13d,%esi
mov    $0x1,%r13b
call   10b0 <realloc@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1040 <fclose@plt>
mov    %rbx,0x10(%rsp)
mov    %rbx,%rdi
mov    %r12,%rsi
call   1070 <writeFile@plt>
mov    0x20(%rsp),%rdi
lea    0xb81(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,%rbx
mov    0x2b5a(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
call   10a0 <fseek@plt>
jmp    1259 <writeFile+0xa9>
mov    0x2b2a(%rip),%rax
movslq (%rax),%rdi
lea    0xb52(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x2b07(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [27 x i8] c"Failed to open file at %s\0A\00"
@EXIT_FAILURE = global i32 0
@EOF = global i8 0
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [2 x i8] c"\0A\00"
@SEEK_CUR = global i32 0
define void @writeFile(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
%14 = load i8*, i8** %3
%15 = call i32* @fopen(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %15, i32** %5
%16 = load i32*, i32** %5
%17 = icmp eq i32* %16, null
br i1 %17, label %18, label %26
18: ; preds = %2
%19 = load i32, i32* @stderr
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
%22 = load i8*, i8** %3
%23 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %22)
%24 = load i32, i32* @EXIT_FAILURE
%25 = call i32 @exit(i32 %24)
unreachable
26: ; preds = %2
store i32 0, i32* %7
store i32 64, i32* %8
%27 = load i32, i32* %8
%28 = sext i32 %27 to i64
%29 = mul i64 1, %28
%30 = trunc i64 %29 to i32
%31 = call i8* @malloc(i32 %30)
store i8* %31, i8** %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
store i32 1, i32* %13
br label %32
32: ; preds = %239, %232, %193, %175, %169, %159, %151, %142, %71, %53, %49, %26
%33 = load i32*, i32** %5
%34 = call signext i8 @fgetc(i32* %33)
store i8 %34, i8* %6
%35 = sext i8 %34 to i32
%36 = load i8, i8* @EOF
%37 = sext i8 %36 to i32
%38 = icmp ne i32 %35, %37
br i1 %38, label %39, label %240
39: ; preds = %32
%40 = load i32, i32* %7
%41 = add nsw i32 %40, 1
store i32 %41, i32* %7
%42 = load i32*, i32** %4
%43 = load i8, i8* %6
%44 = sext i8 %43 to i32
%45 = call i32 (i32*, i8*, ...) @fprintf(i32* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %44)
%46 = load i8, i8* %6
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 10
br i1 %48, label %49, label %50
49: ; preds = %39
store i32 1, i32* %13
store i32 0, i32* %11
br label %32
50: ; preds = %39
%51 = load i32, i32* %13
%52 = icmp eq i32 %51, 0
br i1 %52, label %53, label %54
53: ; preds = %50
br label %32
54: ; preds = %50
%55 = load i32, i32* %11
%56 = icmp eq i32 %55, 0
br i1 %56, label %63, label %57
57: ; preds = %54
%58 = load i32, i32* %11
%59 = icmp eq i32 %58, 3
br i1 %59, label %63, label %60
60: ; preds = %57
%61 = load i32, i32* %11
%62 = icmp eq i32 %61, 10
br i1 %62, label %63, label %72
63: ; preds = %60, %57, %54
%64 = load i8, i8* %6
%65 = sext i8 %64 to i32
%66 = icmp eq i32 %65, 9
br i1 %66, label %71, label %67
67: ; preds = %63
%68 = load i8, i8* %6
%69 = sext i8 %68 to i32
%70 = icmp eq i32 %69, 32
br i1 %70, label %71, label %72
71: ; preds = %67, %63
br label %32
72: ; preds = %67, %60
%73 = load i32, i32* %11
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %79
75: ; preds = %72
%76 = load i8, i8* %6
%77 = sext i8 %76 to i32
%78 = icmp eq i32 %77, 47
br i1 %78, label %142, label %79
79: ; preds = %75, %72
%80 = load i32, i32* %11
%81 = icmp eq i32 %80, 1
br i1 %81, label %82, label %86
82: ; preds = %79
%83 = load i8, i8* %6
%84 = sext i8 %83 to i32
%85 = icmp eq i32 %84, 47
br i1 %85, label %142, label %86
86: ; preds = %82, %79
%87 = load i32, i32* %11
%88 = icmp eq i32 %87, 2
br i1 %88, label %89, label %93
89: ; preds = %86
%90 = load i8, i8* %6
%91 = sext i8 %90 to i32
%92 = icmp eq i32 %91, 61
br i1 %92, label %142, label %93
93: ; preds = %89, %86
%94 = load i32, i32* %11
%95 = icmp eq i32 %94, 3
br i1 %95, label %96, label %100
96: ; preds = %93
%97 = load i8, i8* %6
%98 = sext i8 %97 to i32
%99 = icmp eq i32 %98, 114
br i1 %99, label %142, label %100
100: ; preds = %96, %93
%101 = load i32, i32* %11
%102 = icmp eq i32 %101, 4
br i1 %102, label %103, label %107
103: ; preds = %100
%104 = load i8, i8* %6
%105 = sext i8 %104 to i32
%106 = icmp eq i32 %105, 101
br i1 %106, label %142, label %107
107: ; preds = %103, %100
%108 = load i32, i32* %11
%109 = icmp eq i32 %108, 5
br i1 %109, label %110, label %114
110: ; preds = %107
%111 = load i8, i8* %6
%112 = sext i8 %111 to i32
%113 = icmp eq i32 %112, 113
br i1 %113, label %142, label %114
114: ; preds = %110, %107
%115 = load i32, i32* %11
%116 = icmp eq i32 %115, 6
br i1 %116, label %117, label %121
117: ; preds = %114
%118 = load i8, i8* %6
%119 = sext i8 %118 to i32
%120 = icmp eq i32 %119, 117
br i1 %120, label %142, label %121
121: ; preds = %117, %114
%122 = load i32, i32* %11
%123 = icmp eq i32 %122, 7
br i1 %123, label %124, label %128
124: ; preds = %121
%125 = load i8, i8* %6
%126 = sext i8 %125 to i32
%127 = icmp eq i32 %126, 105
br i1 %127, label %142, label %128
128: ; preds = %124, %121
%129 = load i32, i32* %11
%130 = icmp eq i32 %129, 8
br i1 %130, label %131, label %135
131: ; preds = %128
%132 = load i8, i8* %6
%133 = sext i8 %132 to i32
%134 = icmp eq i32 %133, 114
br i1 %134, label %142, label %135
135: ; preds = %131, %128
%136 = load i32, i32* %11
%137 = icmp eq i32 %136, 9
br i1 %137, label %138, label %145
138: ; preds = %135
%139 = load i8, i8* %6
%140 = sext i8 %139 to i32
%141 = icmp eq i32 %140, 101
br i1 %141, label %142, label %145
142: ; preds = %138, %131, %124, %117, %110, %103, %96, %89, %82, %75
%143 = load i32, i32* %11
%144 = add nsw i32 %143, 1
store i32 %144, i32* %11
br label %32
145: ; preds = %138, %135
%146 = load i32, i32* %11
%147 = icmp sge i32 %146, 0
br i1 %147, label %148, label %152
148: ; preds = %145
%149 = load i32, i32* %11
%150 = icmp sle i32 %149, 9
br i1 %150, label %151, label %152
151: ; preds = %148
store i32 0, i32* %13
br label %32
152: ; preds = %148, %145
%153 = load i32, i32* %11
%154 = icmp eq i32 %153, 10
br i1 %154, label %155, label %162
155: ; preds = %152
%156 = load i8, i8* %6
%157 = sext i8 %156 to i32
%158 = icmp eq i32 %157, 39
br i1 %158, label %159, label %162
159: ; preds = %155
store i32 1, i32* %12
store i32 0, i32* %10
%160 = load i32, i32* %11
%161 = add nsw i32 %160, 1
store i32 %161, i32* %11
br label %32
162: ; preds = %155, %152
%163 = load i32, i32* %11
%164 = icmp eq i32 %163, 10
br i1 %164, label %165, label %172
165: ; preds = %162
%166 = load i8, i8* %6
%167 = sext i8 %166 to i32
%168 = icmp eq i32 %167, 34
br i1 %168, label %169, label %172
169: ; preds = %165
store i32 2, i32* %12
store i32 0, i32* %10
%170 = load i32, i32* %11
%171 = add nsw i32 %170, 1
store i32 %171, i32* %11
br label %32
172: ; preds = %165, %162
%173 = load i32, i32* %11
%174 = icmp eq i32 %173, 10
br i1 %174, label %175, label %176
175: ; preds = %172
store i32 0, i32* %13
br label %32
176: ; preds = %172
%177 = load i32, i32* %11
%178 = icmp eq i32 %177, 11
br i1 %178, label %179, label %216
179: ; preds = %176
%180 = load i32, i32* %12
%181 = icmp eq i32 %180, 1
br i1 %181, label %182, label %186
182: ; preds = %179
%183 = load i8, i8* %6
%184 = sext i8 %183 to i32
%185 = icmp eq i32 %184, 39
br i1 %185, label %193, label %186
186: ; preds = %182, %179
%187 = load i32, i32* %12
%188 = icmp eq i32 %187, 2
br i1 %188, label %189, label %216
189: ; preds = %186
%190 = load i8, i8* %6
%191 = sext i8 %190 to i32
%192 = icmp eq i32 %191, 34
br i1 %192, label %193, label %216
193: ; preds = %189, %182
store i32 0, i32* %13
%194 = load i8*, i8** %9
%195 = load i32, i32* %10
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds i8, i8* %194, i64 %196
store i8 0, i8* %197
%198 = load i32*, i32** %4
%199 = call i32 (i32*, i8*, ...) @fprintf(i32* %198, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%200 = load i8*, i8** %9
%201 = load i32, i32* %10
%202 = sext i32 %201 to i64
%203 = mul i64 1, %202
%204 = trunc i64 %203 to i32
%205 = call i8* @realloc(i8* %200, i32 %204)
store i8* %205, i8** %9
%206 = load i32*, i32** %5
%207 = call i32 @fclose(i32* %206)
%208 = load i8*, i8** %9
%209 = load i32*, i32** %4
%210 = load i8*, i8** %3
%211 = call i32* @fopen(i8* %210, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %211, i32** %5
%212 = load i32*, i32** %5
%213 = load i32, i32* %7
%214 = load i32, i32* @SEEK_CUR
%215 = call i32 @fseek(i32* %212, i32 %213, i32 %214)
br label %32
216: ; preds = %189, %186, %176
%217 = load i32, i32* %11
%218 = icmp eq i32 %217, 11
br i1 %218, label %219, label %239
219: ; preds = %216
%220 = load i32, i32* %7
%221 = load i32, i32* %8
%222 = icmp sgt i32 %220, %221
br i1 %222, label %223, label %232
223: ; preds = %219
%224 = load i32, i32* %8
%225 = add nsw i32 %224, 64
store i32 %225, i32* %8
%226 = load i8*, i8** %9
%227 = load i32, i32* %8
%228 = sext i32 %227 to i64
%229 = mul i64 1, %228
%230 = trunc i64 %229 to i32
%231 = call i8* @realloc(i8* %226, i32 %230)
store i8* %231, i8** %9
br label %232
232: ; preds = %223, %219
%233 = load i8, i8* %6
%234 = load i8*, i8** %9
%235 = load i32, i32* %10
%236 = add nsw i32 %235, 1
store i32 %236, i32* %10
%237 = sext i32 %235 to i64
%238 = getelementptr inbounds i8, i8* %234, i64 %237
store i8 %233, i8* %238
br label %32
239: ; preds = %216
br label %32
240: ; preds = %32
%241 = load i8*, i8** %9
%242 = call i32 @free(i8* %241)
%243 = load i32*, i32** %5
%244 = call i32 @fclose(i32* %243)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [27 x i8] c"Failed to open file at %s\0A\00"
@EXIT_FAILURE = global i32 0
@EOF = global i8 0
@SEEK_CUR = global i32 0
define void @writeFile(i8* %0, i32* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%10 = load i32, i32* @EXIT_FAILURE
%11 = tail call i32 @exit(i32 %10)
unreachable
12: ; preds = %2
%13 = tail call dereferenceable_or_null(64) i8* @malloc(i32 64)
%14 = tail call signext i8 @fgetc(i32* %3)
%15 = load i8, i8* @EOF
%16 = icmp eq i8 %14, %15
br i1 %16, label %119, label %17
17: ; preds = %12, %71
%18 = phi i8 [ %79, %71 ], [ %14, %12 ]
%19 = phi i1 [ %78, %71 ], [ false, %12 ]
%20 = phi i32 [ %77, %71 ], [ 0, %12 ]
%21 = phi i32 [ %76, %71 ], [ 0, %12 ]
%22 = phi i32 [ %75, %71 ], [ 0, %12 ]
%23 = phi i8* [ %74, %71 ], [ %13, %12 ]
%24 = phi i32 [ %73, %71 ], [ 64, %12 ]
%25 = phi i32 [ %28, %71 ], [ 0, %12 ]
%26 = phi i32* [ %72, %71 ], [ %3, %12 ]
%27 = sext i8 %18 to i32
%28 = add nuw nsw i32 %25, 1
%29 = tail call i32 @fputc(i32 %27, i32* %1)
%30 = icmp eq i8 %18, 10
br i1 %30, label %71, label %31
31: ; preds = %17
br i1 %19, label %71, label %32
32: ; preds = %31
%33 = icmp eq i32 %21, 3
%34 = icmp eq i32 %21, 10
switch i32 %21, label %36 [
i32 10, label %35
i32 3, label %35
i32 0, label %35
]
35: ; preds = %32, %32, %32
switch i8 %18, label %36 [
i8 32, label %71
i8 9, label %71
]
36: ; preds = %35, %32
%37 = icmp eq i8 %18, 47
%38 = icmp ult i32 %21, 2
%39 = and i1 %38, %37
br i1 %39, label %69, label %40
40: ; preds = %36
%41 = icmp eq i32 %21, 2
%42 = icmp eq i8 %18, 61
%43 = and i1 %41, %42
br i1 %43, label %69, label %44
44: ; preds = %40
%45 = icmp eq i8 %18, 114
%46 = and i1 %33, %45
br i1 %46, label %69, label %47
47: ; preds = %44
%48 = icmp eq i32 %21, 4
%49 = icmp eq i8 %18, 101
%50 = and i1 %48, %49
br i1 %50, label %69, label %51
51: ; preds = %47
%52 = icmp eq i32 %21, 5
%53 = icmp eq i8 %18, 113
%54 = and i1 %52, %53
br i1 %54, label %69, label %55
55: ; preds = %51
%56 = icmp eq i32 %21, 6
%57 = icmp eq i8 %18, 117
%58 = and i1 %56, %57
br i1 %58, label %69, label %59
59: ; preds = %55
%60 = icmp eq i32 %21, 7
%61 = icmp eq i8 %18, 105
%62 = and i1 %60, %61
%63 = icmp eq i32 %21, 8
%64 = and i1 %63, %45
%65 = or i1 %62, %64
%66 = icmp eq i32 %21, 9
%67 = and i1 %66, %49
%68 = select i1 %65, i1 true, i1 %67
br i1 %68, label %69, label %82
69: ; preds = %59, %55, %51, %47, %44, %40, %36
%70 = add nuw nsw i32 %21, 1
br label %71
71: ; preds = %69, %99, %113, %31, %17, %35, %35, %82, %84, %87, %90, %91
%72 = phi i32* [ %26, %31 ], [ %26, %35 ], [ %26, %69 ], [ %105, %99 ], [ %26, %113 ], [ %26, %17 ], [ %26, %35 ], [ %26, %82 ], [ %26, %84 ], [ %26, %87 ], [ %26, %90 ], [ %26, %91 ]
%73 = phi i32 [ %24, %31 ], [ %24, %35 ], [ %24, %69 ], [ %24, %99 ], [ %114, %113 ], [ %24, %17 ], [ %24, %35 ], [ %24, %82 ], [ %24, %84 ], [ %24, %87 ], [ %24, %90 ], [ %24, %91 ]
%74 = phi i8* [ %23, %31 ], [ %23, %35 ], [ %23, %69 ], [ %103, %99 ], [ %115, %113 ], [ %23, %17 ], [ %23, %35 ], [ %23, %82 ], [ %23, %84 ], [ %23, %87 ], [ %23, %90 ], [ %23, %91 ]
%75 = phi i32 [ %22, %31 ], [ %22, %35 ], [ %22, %69 ], [ %22, %99 ], [ %116, %113 ], [ %22, %17 ], [ %22, %35 ], [ %22, %82 ], [ 0, %84 ], [ 0, %87 ], [ %22, %90 ], [ %22, %91 ]
%76 = phi i32 [ %21, %31 ], [ %21, %35 ], [ %70, %69 ], [ 11, %99 ], [ 11, %113 ], [ 0, %17 ], [ %21, %35 ], [ %21, %82 ], [ 11, %84 ], [ 11, %87 ], [ 10, %90 ], [ %21, %91 ]
%77 = phi i32 [ %20, %31 ], [ %20, %35 ], [ %20, %69 ], [ %20, %99 ], [ %20, %113 ], [ %20, %17 ], [ %20, %35 ], [ %20, %82 ], [ 1, %84 ], [ 2, %87 ], [ %20, %90 ], [ %20, %91 ]
%78 = phi i1 [ true, %31 ], [ false, %35 ], [ false, %69 ], [ true, %99 ], [ false, %113 ], [ false, %17 ], [ false, %35 ], [ true, %82 ], [ false, %84 ], [ false, %87 ], [ true, %90 ], [ false, %91 ]
%79 = tail call signext i8 @fgetc(i32* %72)
%80 = load i8, i8* @EOF
%81 = icmp eq i8 %79, %80
br i1 %81, label %119, label %17
82: ; preds = %59
%83 = icmp ult i32 %21, 10
br i1 %83, label %71, label %84
84: ; preds = %82
%85 = icmp eq i8 %18, 39
%86 = and i1 %34, %85
br i1 %86, label %71, label %87
87: ; preds = %84
%88 = icmp eq i8 %18, 34
%89 = and i1 %34, %88
br i1 %89, label %71, label %90
90: ; preds = %87
br i1 %34, label %71, label %91
91: ; preds = %90
%92 = icmp eq i32 %21, 11
br i1 %92, label %93, label %71
93: ; preds = %91
%94 = icmp eq i32 %20, 1
%95 = and i1 %94, %85
%96 = icmp eq i32 %20, 2
%97 = and i1 %96, %88
%98 = or i1 %95, %97
br i1 %98, label %99, label %108
99: ; preds = %93
%100 = sext i32 %22 to i64
%101 = getelementptr inbounds i8, i8* %23, i64 %100
store i8 0, i8* %101
%102 = tail call i32 @fputc(i32 10, i32* %1)
%103 = tail call i8* @realloc(i8* %23, i32 %22)
%104 = tail call i32 @fclose(i32* %26)
tail call void @writeFile(i8* %103, i32* %1)
%105 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%106 = load i32, i32* @SEEK_CUR
%107 = tail call i32 @fseek(i32* %105, i32 %28, i32 %106)
br label %71
108: ; preds = %93
%109 = icmp slt i32 %25, %24
br i1 %109, label %113, label %110
110: ; preds = %108
%111 = add nsw i32 %24, 64
%112 = tail call i8* @realloc(i8* %23, i32 %111)
br label %113
113: ; preds = %110, %108
%114 = phi i32 [ %111, %110 ], [ %24, %108 ]
%115 = phi i8* [ %112, %110 ], [ %23, %108 ]
%116 = add nsw i32 %22, 1
%117 = sext i32 %22 to i64
%118 = getelementptr inbounds i8, i8* %115, i64 %117
store i8 %18, i8* %118
br label %71
119: ; preds = %71, %12
%120 = phi i32* [ %3, %12 ], [ %72, %71 ]
%121 = phi i8* [ %13, %12 ], [ %74, %71 ]
%122 = tail call i32 @free(i8* %121)
%123 = tail call i32 @fclose(i32* %120)
ret void
}