#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*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
char *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ process_sequence(char *, char **, int *, char *, int);
scalar_t__ realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
void process_file(char *filename, int flags) {
  char *s;
  char *p;
  char *frm[6];
  static char buf[1024];
  static char title[1024];
  int sz = 8192;
  int seq_length;
  int lengths[6];
  int i;
  int n;
  FILE *f;
  s = (char *)malloc(sz);
  if (!s) {
    exit(EXIT_FAILURE);
  }
  for (i = 0; i < 6; i++) {
    frm[i] = (char *)malloc(sz);
    if (!frm[i]) {
      exit(EXIT_FAILURE);
    }
  }
  *s = '\0';
  seq_length = 0;
  f = fopen(filename, "r");
  if (f == NULL)
    exit(EXIT_FAILURE);
  while (!feof(f)) {
    p = fgets(buf, sizeof(buf), f);
    if (p) {
      if (*p == '>') {
        if (*s != '\0') {
          s[seq_length] = '\0';
          process_sequence(s, frm, lengths, title, flags);
          seq_length = 0;
        }
        buf[strlen(buf) - 1] = '\0';
        strcpy(title, buf);
      } else {
        n = strlen(p) - 1;
        if ((seq_length + n + 3) > sz) {
          sz <<= 1;
          s = (char *)realloc(s, sz);
          if (!s) {
            exit(EXIT_FAILURE);
          }
          for (i = 0; i < 6; i++) {
            frm[i] = (char *)realloc(frm[i], sz);
            if (!frm[i]) {
              exit(EXIT_FAILURE);
            }
          }
        }
        memcpy(&s[seq_length], buf, n);
        seq_length += n;
      }
    }
  }
  if (*s != '\0') {
    s[seq_length] = '\0';
    process_sequence(s, frm, lengths, title, flags);
    seq_length = 0;
  }
  if (filename)
    fclose(f);
  for (i = 0; i < 6; i++) {
    free(frm[i]);
  }
  free(s);
}


x86 assembly (clang, -O0):
<process_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x2000,-0x54(%rbp)
mov    -0x54(%rbp),%edi
call   10a0 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11fe <process_file+0x3e>
mov    0x2de9(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
movl   $0x0,-0x74(%rbp)
cmpl   $0x6,-0x74(%rbp)
jge    1254 <process_file+0x94>
mov    -0x54(%rbp),%edi
call   10a0 <malloc@plt>
mov    %rax,%rcx
movslq -0x74(%rbp),%rax
mov    %rcx,-0x50(%rbp,%rax,8)
movslq -0x74(%rbp),%rax
cmpq   $0x0,-0x50(%rbp,%rax,8)
jne    1241 <process_file+0x81>
mov    0x2da6(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
jmp    1246 <process_file+0x86>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1205 <process_file+0x45>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x58(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xd93(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x80(%rbp)
cmpq   $0x0,-0x80(%rbp)
jne    128f <process_file+0xcf>
mov    0x2d58(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
jmp    1294 <process_file+0xd4>
mov    -0x80(%rbp),%rdi
call   1080 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    12b2 <process_file+0xf2>
jmp    143e <process_file+0x27e>
mov    -0x80(%rbp),%rdx
lea    0x2dd3(%rip),%rdi
mov    $0x400,%esi
call   1070 <fgets@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1439 <process_file+0x279>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3e,%eax
jne    135a <process_file+0x19a>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1325 <process_file+0x165>
mov    -0x18(%rbp),%rax
movslq -0x58(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rdi
lea    -0x50(%rbp),%rsi
lea    -0x70(%rbp),%rdx
mov    -0xc(%rbp),%r8d
lea    0x3177(%rip),%rcx
call   10e0 <process_sequence@plt>
movl   $0x0,-0x58(%rbp)
lea    0x2d64(%rip),%rdi
call   1060 <strlen@plt>
sub    $0x1,%eax
movslq %eax,%rcx
lea    0x2d52(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
lea    0x3147(%rip),%rdi
lea    0x2d40(%rip),%rsi
call   1040 <strcpy@plt>
jmp    1434 <process_file+0x274>
mov    -0x20(%rbp),%rdi
call   1060 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x78(%rbp)
mov    -0x58(%rbp),%eax
add    -0x78(%rbp),%eax
add    $0x3,%eax
cmp    -0x54(%rbp),%eax
jle    1411 <process_file+0x251>
mov    -0x54(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x54(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x54(%rbp),%esi
call   10b0 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    13ad <process_file+0x1ed>
mov    0x2c3a(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
movl   $0x0,-0x74(%rbp)
cmpl   $0x6,-0x74(%rbp)
jge    140c <process_file+0x24c>
movslq -0x74(%rbp),%rax
mov    -0x50(%rbp,%rax,8),%rdi
mov    -0x54(%rbp),%esi
call   10b0 <realloc@plt>
mov    %rax,%rcx
movslq -0x74(%rbp),%rax
mov    %rcx,-0x50(%rbp,%rax,8)
movslq -0x74(%rbp),%rax
cmpq   $0x0,-0x50(%rbp,%rax,8)
jne    13f9 <process_file+0x239>
mov    0x2bee(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>
jmp    13fe <process_file+0x23e>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    13b4 <process_file+0x1f4>
jmp    1411 <process_file+0x251>
mov    -0x18(%rbp),%rdi
movslq -0x58(%rbp),%rax
add    %rax,%rdi
mov    -0x78(%rbp),%edx
lea    0x2c6a(%rip),%rsi
call   1090 <memcpy@plt>
mov    -0x78(%rbp),%eax
add    -0x58(%rbp),%eax
mov    %eax,-0x58(%rbp)
jmp    1439 <process_file+0x279>
jmp    1294 <process_file+0xd4>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     147d <process_file+0x2bd>
mov    -0x18(%rbp),%rax
movslq -0x58(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rdi
lea    -0x50(%rbp),%rsi
lea    -0x70(%rbp),%rdx
mov    -0xc(%rbp),%r8d
lea    0x301f(%rip),%rcx
call   10e0 <process_sequence@plt>
movl   $0x0,-0x58(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1491 <process_file+0x2d1>
mov    -0x80(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x74(%rbp)
cmpl   $0x6,-0x74(%rbp)
jge    14be <process_file+0x2fe>
movslq -0x74(%rbp),%rax
mov    -0x50(%rbp,%rax,8),%rdi
call   1030 <free@plt>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1498 <process_file+0x2d8>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_file>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %esi,0xc(%rsp)
mov    %rdi,%rbx
mov    $0x2000,%edi
call   10a0 <malloc@plt>
test   %rax,%rax
je     14cc <process_file+0x30c>
mov    %rax,%r15
mov    $0x2000,%edi
call   10a0 <malloc@plt>
mov    %rax,0x10(%rsp)
test   %rax,%rax
je     14cc <process_file+0x30c>
mov    $0x2000,%edi
call   10a0 <malloc@plt>
mov    %rax,0x18(%rsp)
test   %rax,%rax
je     14cc <process_file+0x30c>
mov    $0x2000,%edi
call   10a0 <malloc@plt>
mov    %rax,0x20(%rsp)
test   %rax,%rax
je     14cc <process_file+0x30c>
mov    $0x2000,%edi
call   10a0 <malloc@plt>
mov    %rax,0x28(%rsp)
test   %rax,%rax
je     14cc <process_file+0x30c>
mov    $0x2000,%edi
call   10a0 <malloc@plt>
mov    %rax,0x30(%rsp)
test   %rax,%rax
je     14cc <process_file+0x30c>
mov    $0x2000,%edi
call   10a0 <malloc@plt>
mov    %rax,0x38(%rsp)
test   %rax,%rax
je     14cc <process_file+0x30c>
movb   $0x0,(%r15)
lea    0xd7a(%rip),%rsi
mov    %rbx,%rdi
call   10c0 <fopen@plt>
test   %rax,%rax
je     14cc <process_file+0x30c>
mov    %rax,%r13
mov    %rbx,0x48(%rsp)
mov    %rax,%rdi
call   1080 <feof@plt>
xor    %r14d,%r14d
test   %eax,%eax
je     1341 <process_file+0x181>
cmpb   $0x0,(%r15)
je     12de <process_file+0x11e>
movslq %r14d,%rax
movb   $0x0,(%r15,%rax,1)
lea    0x31c9(%rip),%rcx
lea    0x10(%rsp),%rsi
lea    0x50(%rsp),%rdx
mov    %r15,%rdi
mov    0xc(%rsp),%r8d
call   10e0 <process_sequence@plt>
cmpq   $0x0,0x48(%rsp)
je     12ee <process_file+0x12e>
mov    %r13,%rdi
call   1050 <fclose@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    0x20(%rsp),%rdi
call   1030 <free@plt>
mov    0x28(%rsp),%rdi
call   1030 <free@plt>
mov    0x30(%rsp),%rdi
call   1030 <free@plt>
mov    0x38(%rsp),%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x2000,%r12d
lea    0x2d42(%rip),%rbx
lea    0x313b(%rip),%rbp
jmp    139f <process_file+0x1df>
nopw   0x0(%rax,%rax,1)
mov    %r15d,%edx
add    $0xffffffff,%edx
lea    (%r15,%rbx,1),%ebp
add    $0xffffffff,%ebp
movslq %ebx,%rdi
mov    %r14,%r15
add    %r14,%rdi
lea    0x2d13(%rip),%rbx
mov    %rbx,%rsi
call   1090 <memcpy@plt>
mov    %ebp,%r14d
lea    0x3101(%rip),%rbp
mov    %r13,%rdi
call   1080 <feof@plt>
test   %eax,%eax
jne    12b2 <process_file+0xf2>
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     138f <process_file+0x1cf>
cmpb   $0x3e,(%rax)
jne    1400 <process_file+0x240>
cmpb   $0x0,(%r15)
je     13e4 <process_file+0x224>
movslq %r14d,%rax
movb   $0x0,(%r15,%rax,1)
mov    %r15,%rdi
lea    0x10(%rsp),%rsi
lea    0x50(%rsp),%rdx
mov    %rbp,%rcx
mov    0xc(%rsp),%r8d
call   10e0 <process_sequence@plt>
xor    %r14d,%r14d
mov    %rbx,%rdi
call   1060 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
jmp    138f <process_file+0x1cf>
mov    %r14,%rbp
mov    %r15,%r14
mov    %rax,%rdi
call   1060 <strlen@plt>
mov    %eax,%r15d
mov    %rbp,%rbx
lea    (%r15,%rbp,1),%eax
add    $0x2,%eax
cmp    %r12d,%eax
jle    1360 <process_file+0x1a0>
add    %r12d,%r12d
mov    %r14,%rdi
mov    %r12d,%esi
call   10b0 <realloc@plt>
test   %rax,%rax
je     14cc <process_file+0x30c>
mov    %rax,%r14
mov    0x10(%rsp),%rdi
mov    %r12d,%esi
call   10b0 <realloc@plt>
mov    %rax,0x10(%rsp)
test   %rax,%rax
je     14cc <process_file+0x30c>
mov    0x18(%rsp),%rdi
mov    %r12d,%esi
call   10b0 <realloc@plt>
mov    %rax,0x18(%rsp)
test   %rax,%rax
je     14cc <process_file+0x30c>
mov    0x20(%rsp),%rdi
mov    %r12d,%esi
call   10b0 <realloc@plt>
mov    %rax,0x20(%rsp)
test   %rax,%rax
je     14cc <process_file+0x30c>
mov    0x28(%rsp),%rdi
mov    %r12d,%esi
call   10b0 <realloc@plt>
mov    %rax,0x28(%rsp)
test   %rax,%rax
je     14cc <process_file+0x30c>
mov    0x30(%rsp),%rdi
mov    %r12d,%esi
call   10b0 <realloc@plt>
mov    %rax,0x30(%rsp)
test   %rax,%rax
je     14cc <process_file+0x30c>
mov    0x38(%rsp),%rdi
mov    %r12d,%esi
call   10b0 <realloc@plt>
mov    %rax,0x38(%rsp)
test   %rax,%rax
jne    1360 <process_file+0x1a0>
mov    0x2b0d(%rip),%rax
mov    (%rax),%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@process_file.buf = internal global [1024 x i8] zeroinitializer
@process_file.title = internal global [1024 x i8] zeroinitializer
@EXIT_FAILURE = global i32 0
@.str = [2 x i8] c"r\00"
define void @process_file(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [6 x i8*]
%8 = alloca i32
%9 = alloca i32
%10 = alloca [6 x i32]
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 8192, i32* %8
%14 = load i32, i32* %8
%15 = call i64 @malloc(i32 %14)
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %5
%17 = load i8*, i8** %5
%18 = icmp ne i8* %17, null
br i1 %18, label %22, label %19
19: ; preds = %2
%20 = load i32, i32* @EXIT_FAILURE
%21 = call i32 @exit(i32 %20)
unreachable
22: ; preds = %2
store i32 0, i32* %11
br label %23
23: ; preds = %42, %22
%24 = load i32, i32* %11
%25 = icmp slt i32 %24, 6
br i1 %25, label %26, label %45
26: ; preds = %23
%27 = load i32, i32* %8
%28 = call i64 @malloc(i32 %27)
%29 = inttoptr i64 %28 to i8*
%30 = load i32, i32* %11
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i64 0, i64 %31
store i8* %29, i8** %32
%33 = load i32, i32* %11
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i64 0, i64 %34
%36 = load i8*, i8** %35
%37 = icmp ne i8* %36, null
br i1 %37, label %41, label %38
38: ; preds = %26
%39 = load i32, i32* @EXIT_FAILURE
%40 = call i32 @exit(i32 %39)
unreachable
41: ; preds = %26
br label %42
42: ; preds = %41
%43 = load i32, i32* %11
%44 = add nsw i32 %43, 1
store i32 %44, i32* %11
br label %23
45: ; preds = %23
%46 = load i8*, i8** %5
store i8 0, i8* %46
store i32 0, i32* %9
%47 = load i8*, i8** %3
%48 = call i32* @fopen(i8* %47, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %48, i32** %13
%49 = load i32*, i32** %13
%50 = icmp eq i32* %49, null
br i1 %50, label %51, label %54
51: ; preds = %45
%52 = load i32, i32* @EXIT_FAILURE
%53 = call i32 @exit(i32 %52)
unreachable
54: ; preds = %45
br label %55
55: ; preds = %152, %54
%56 = load i32*, i32** %13
%57 = call i32 @feof(i32* %56)
%58 = icmp ne i32 %57, 0
%59 = xor i1 %58, true
br i1 %59, label %60, label %153
60: ; preds = %55
%61 = load i32*, i32** %13
%62 = call i8* @fgets(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @process_file.buf, i64 0, i64 0), i32 1024, i32* %61)
store i8* %62, i8** %6
%63 = load i8*, i8** %6
%64 = icmp ne i8* %63, null
br i1 %64, label %65, label %152
65: ; preds = %60
%66 = load i8*, i8** %6
%67 = load i8, i8* %66
%68 = sext i8 %67 to i32
%69 = icmp eq i32 %68, 62
br i1 %69, label %70, label %91
70: ; preds = %65
%71 = load i8*, i8** %5
%72 = load i8, i8* %71
%73 = sext i8 %72 to i32
%74 = icmp ne i32 %73, 0
br i1 %74, label %75, label %85
75: ; preds = %70
%76 = load i8*, i8** %5
%77 = load i32, i32* %9
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i8, i8* %76, i64 %78
store i8 0, i8* %79
%80 = load i8*, i8** %5
%81 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i64 0, i64 0
%82 = getelementptr inbounds [6 x i32], [6 x i32]* %10, i64 0, i64 0
%83 = load i32, i32* %4
%84 = call i32 @process_sequence(i8* %80, i8** %81, i32* %82, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @process_file.title, i64 0, i64 0), i32 %83)
store i32 0, i32* %9
br label %85
85: ; preds = %75, %70
%86 = call i32 @strlen(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @process_file.buf, i64 0, i64 0))
%87 = sub nsw i32 %86, 1
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [1024 x i8], [1024 x i8]* @process_file.buf, i64 0, i64 %88
store i8 0, i8* %89
%90 = call i32 @strcpy(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @process_file.title, i64 0, i64 0), i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @process_file.buf, i64 0, i64 0))
br label %151
91: ; preds = %65
%92 = load i8*, i8** %6
%93 = call i32 @strlen(i8* %92)
%94 = sub nsw i32 %93, 1
store i32 %94, i32* %12
%95 = load i32, i32* %9
%96 = load i32, i32* %12
%97 = add nsw i32 %95, %96
%98 = add nsw i32 %97, 3
%99 = load i32, i32* %8
%100 = icmp sgt i32 %98, %99
br i1 %100, label %101, label %141
101: ; preds = %91
%102 = load i32, i32* %8
%103 = shl i32 %102, 1
store i32 %103, i32* %8
%104 = load i8*, i8** %5
%105 = load i32, i32* %8
%106 = call i64 @realloc(i8* %104, i32 %105)
%107 = inttoptr i64 %106 to i8*
store i8* %107, i8** %5
%108 = load i8*, i8** %5
%109 = icmp ne i8* %108, null
br i1 %109, label %113, label %110
110: ; preds = %101
%111 = load i32, i32* @EXIT_FAILURE
%112 = call i32 @exit(i32 %111)
unreachable
113: ; preds = %101
store i32 0, i32* %11
br label %114
114: ; preds = %137, %113
%115 = load i32, i32* %11
%116 = icmp slt i32 %115, 6
br i1 %116, label %117, label %140
117: ; preds = %114
%118 = load i32, i32* %11
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i64 0, i64 %119
%121 = load i8*, i8** %120
%122 = load i32, i32* %8
%123 = call i64 @realloc(i8* %121, i32 %122)
%124 = inttoptr i64 %123 to i8*
%125 = load i32, i32* %11
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i64 0, i64 %126
store i8* %124, i8** %127
%128 = load i32, i32* %11
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i64 0, i64 %129
%131 = load i8*, i8** %130
%132 = icmp ne i8* %131, null
br i1 %132, label %136, label %133
133: ; preds = %117
%134 = load i32, i32* @EXIT_FAILURE
%135 = call i32 @exit(i32 %134)
unreachable
136: ; preds = %117
br label %137
137: ; preds = %136
%138 = load i32, i32* %11
%139 = add nsw i32 %138, 1
store i32 %139, i32* %11
br label %114
140: ; preds = %114
br label %141
141: ; preds = %140, %91
%142 = load i8*, i8** %5
%143 = load i32, i32* %9
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds i8, i8* %142, i64 %144
%146 = load i32, i32* %12
%147 = call i32 @memcpy(i8* %145, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @process_file.buf, i64 0, i64 0), i32 %146)
%148 = load i32, i32* %12
%149 = load i32, i32* %9
%150 = add nsw i32 %149, %148
store i32 %150, i32* %9
br label %151
151: ; preds = %141, %85
br label %152
152: ; preds = %151, %60
br label %55
153: ; preds = %55
%154 = load i8*, i8** %5
%155 = load i8, i8* %154
%156 = sext i8 %155 to i32
%157 = icmp ne i32 %156, 0
br i1 %157, label %158, label %168
158: ; preds = %153
%159 = load i8*, i8** %5
%160 = load i32, i32* %9
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds i8, i8* %159, i64 %161
store i8 0, i8* %162
%163 = load i8*, i8** %5
%164 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i64 0, i64 0
%165 = getelementptr inbounds [6 x i32], [6 x i32]* %10, i64 0, i64 0
%166 = load i32, i32* %4
%167 = call i32 @process_sequence(i8* %163, i8** %164, i32* %165, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @process_file.title, i64 0, i64 0), i32 %166)
store i32 0, i32* %9
br label %168
168: ; preds = %158, %153
%169 = load i8*, i8** %3
%170 = icmp ne i8* %169, null
br i1 %170, label %171, label %174
171: ; preds = %168
%172 = load i32*, i32** %13
%173 = call i32 @fclose(i32* %172)
br label %174
174: ; preds = %171, %168
store i32 0, i32* %11
br label %175
175: ; preds = %184, %174
%176 = load i32, i32* %11
%177 = icmp slt i32 %176, 6
br i1 %177, label %178, label %187
178: ; preds = %175
%179 = load i32, i32* %11
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i64 0, i64 %180
%182 = load i8*, i8** %181
%183 = call i32 @free(i8* %182)
br label %184
184: ; preds = %178
%185 = load i32, i32* %11
%186 = add nsw i32 %185, 1
store i32 %186, i32* %11
br label %175
187: ; preds = %175
%188 = load i8*, i8** %5
%189 = call i32 @free(i8* %188)
ret void
}

LLVM IR (-O2):
@process_file.buf = internal global [1024 x i8] zeroinitializer
@process_file.title = internal global [1024 x i8] zeroinitializer
@EXIT_FAILURE = global i32 0
@.str = [2 x i8] c"r\00"
define void @process_file(i8* %0, i32 %1) {
%3 = alloca [6 x i8*]
%4 = alloca [6 x i32]
%5 = bitcast [6 x i8*]* %3 to i8*
%6 = bitcast [6 x i32]* %4 to i8*
%7 = tail call i64 @malloc(i32 8192)
%8 = inttoptr i64 %7 to i8*
%9 = icmp eq i64 %7, 0
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = tail call i64 @malloc(i32 8192)
%12 = inttoptr i64 %11 to i8*
%13 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 0
store i8* %12, i8** %13
%14 = icmp eq i64 %11, 0
br i1 %14, label %46, label %18
15: ; preds = %2
%16 = load i32, i32* @EXIT_FAILURE
%17 = tail call i32 @exit(i32 %16)
unreachable
18: ; preds = %10
%19 = tail call i64 @malloc(i32 8192)
%20 = inttoptr i64 %19 to i8*
%21 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 1
store i8* %20, i8** %21
%22 = icmp eq i64 %19, 0
br i1 %22, label %46, label %23
23: ; preds = %18
%24 = tail call i64 @malloc(i32 8192)
%25 = inttoptr i64 %24 to i8*
%26 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 2
store i8* %25, i8** %26
%27 = icmp eq i64 %24, 0
br i1 %27, label %46, label %28
28: ; preds = %23
%29 = tail call i64 @malloc(i32 8192)
%30 = inttoptr i64 %29 to i8*
%31 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 3
store i8* %30, i8** %31
%32 = icmp eq i64 %29, 0
br i1 %32, label %46, label %33
33: ; preds = %28
%34 = tail call i64 @malloc(i32 8192)
%35 = inttoptr i64 %34 to i8*
%36 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 4
store i8* %35, i8** %36
%37 = icmp eq i64 %34, 0
br i1 %37, label %46, label %38
38: ; preds = %33
%39 = tail call i64 @malloc(i32 8192)
%40 = inttoptr i64 %39 to i8*
%41 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 5
store i8* %40, i8** %41
%42 = icmp eq i64 %39, 0
br i1 %42, label %46, label %43
43: ; preds = %38
store i8 0, i8* %8
%44 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%45 = icmp eq i32* %44, null
br i1 %45, label %54, label %49
46: ; preds = %38, %33, %28, %23, %18, %10
%47 = load i32, i32* @EXIT_FAILURE
%48 = tail call i32 @exit(i32 %47)
unreachable
49: ; preds = %43
%50 = call i32 @feof(i32* %44)
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %139
52: ; preds = %49
%53 = getelementptr inbounds [6 x i32], [6 x i32]* %4, i64 0, i64 0
br label %57
54: ; preds = %43
%55 = load i32, i32* @EXIT_FAILURE
%56 = tail call i32 @exit(i32 %55)
unreachable
57: ; preds = %52, %133
%58 = phi i8* [ %8, %52 ], [ %136, %133 ]
%59 = phi i32 [ 8192, %52 ], [ %135, %133 ]
%60 = phi i32 [ 0, %52 ], [ %134, %133 ]
%61 = call i8* @fgets(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @process_file.buf, i64 0, i64 0), i32 1024, i32* %44)
%62 = icmp eq i8* %61, null
br i1 %62, label %133, label %63
63: ; preds = %57
%64 = load i8, i8* %61
%65 = icmp eq i8 %64, 62
br i1 %65, label %66, label %80
66: ; preds = %63
%67 = load i8, i8* %58
%68 = icmp eq i8 %67, 0
br i1 %68, label %73, label %69
69: ; preds = %66
%70 = sext i32 %60 to i64
%71 = getelementptr inbounds i8, i8* %58, i64 %70
store i8 0, i8* %71
%72 = call i32 @process_sequence(i8* %58, i8** %13, i32* %53, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @process_file.title, i64 0, i64 0), i32 %1)
br label %73
73: ; preds = %69, %66
%74 = phi i32 [ 0, %69 ], [ %60, %66 ]
%75 = call i32 @strlen(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @process_file.buf, i64 0, i64 0))
%76 = add nsw i32 %75, -1
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [1024 x i8], [1024 x i8]* @process_file.buf, i64 0, i64 %77
store i8 0, i8* %78
%79 = call i32 @strcpy(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @process_file.title, i64 0, i64 0), i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @process_file.buf, i64 0, i64 0))
br label %133
80: ; preds = %63
%81 = call i32 @strlen(i8* %61)
%82 = add nsw i32 %81, -1
%83 = add nsw i32 %82, %60
%84 = add nsw i32 %83, 3
%85 = icmp sgt i32 %84, %59
br i1 %85, label %86, label %127
86: ; preds = %80
%87 = shl i32 %59, 1
%88 = call i64 @realloc(i8* %58, i32 %87)
%89 = inttoptr i64 %88 to i8*
%90 = icmp eq i64 %88, 0
br i1 %90, label %96, label %91
91: ; preds = %86
%92 = load i8*, i8** %13
%93 = call i64 @realloc(i8* %92, i32 %87)
%94 = inttoptr i64 %93 to i8*
store i8* %94, i8** %13
%95 = icmp eq i64 %93, 0
br i1 %95, label %124, label %99
96: ; preds = %86
%97 = load i32, i32* @EXIT_FAILURE
%98 = call i32 @exit(i32 %97)
unreachable
99: ; preds = %91
%100 = load i8*, i8** %21
%101 = call i64 @realloc(i8* %100, i32 %87)
%102 = inttoptr i64 %101 to i8*
store i8* %102, i8** %21
%103 = icmp eq i64 %101, 0
br i1 %103, label %124, label %104
104: ; preds = %99
%105 = load i8*, i8** %26
%106 = call i64 @realloc(i8* %105, i32 %87)
%107 = inttoptr i64 %106 to i8*
store i8* %107, i8** %26
%108 = icmp eq i64 %106, 0
br i1 %108, label %124, label %109
109: ; preds = %104
%110 = load i8*, i8** %31
%111 = call i64 @realloc(i8* %110, i32 %87)
%112 = inttoptr i64 %111 to i8*
store i8* %112, i8** %31
%113 = icmp eq i64 %111, 0
br i1 %113, label %124, label %114
114: ; preds = %109
%115 = load i8*, i8** %36
%116 = call i64 @realloc(i8* %115, i32 %87)
%117 = inttoptr i64 %116 to i8*
store i8* %117, i8** %36
%118 = icmp eq i64 %116, 0
br i1 %118, label %124, label %119
119: ; preds = %114
%120 = load i8*, i8** %41
%121 = call i64 @realloc(i8* %120, i32 %87)
%122 = inttoptr i64 %121 to i8*
store i8* %122, i8** %41
%123 = icmp eq i64 %121, 0
br i1 %123, label %124, label %127
124: ; preds = %119, %114, %109, %104, %99, %91
%125 = load i32, i32* @EXIT_FAILURE
%126 = call i32 @exit(i32 %125)
unreachable
127: ; preds = %119, %80
%128 = phi i32 [ %59, %80 ], [ %87, %119 ]
%129 = phi i8* [ %58, %80 ], [ %89, %119 ]
%130 = sext i32 %60 to i64
%131 = getelementptr inbounds i8, i8* %129, i64 %130
%132 = call i32 @memcpy(i8* %131, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @process_file.buf, i64 0, i64 0), i32 %82)
br label %133
133: ; preds = %73, %127, %57
%134 = phi i32 [ %74, %73 ], [ %83, %127 ], [ %60, %57 ]
%135 = phi i32 [ %59, %73 ], [ %128, %127 ], [ %59, %57 ]
%136 = phi i8* [ %58, %73 ], [ %129, %127 ], [ %58, %57 ]
%137 = call i32 @feof(i32* %44)
%138 = icmp eq i32 %137, 0
br i1 %138, label %57, label %139
139: ; preds = %133, %49
%140 = phi i32 [ 0, %49 ], [ %134, %133 ]
%141 = phi i8* [ %8, %49 ], [ %136, %133 ]
%142 = load i8, i8* %141
%143 = icmp eq i8 %142, 0
br i1 %143, label %149, label %144
144: ; preds = %139
%145 = sext i32 %140 to i64
%146 = getelementptr inbounds i8, i8* %141, i64 %145
store i8 0, i8* %146
%147 = getelementptr inbounds [6 x i32], [6 x i32]* %4, i64 0, i64 0
%148 = call i32 @process_sequence(i8* %141, i8** %13, i32* %147, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @process_file.title, i64 0, i64 0), i32 %1)
br label %149
149: ; preds = %144, %139
%150 = icmp eq i8* %0, null
br i1 %150, label %153, label %151
151: ; preds = %149
%152 = call i32 @fclose(i32* %44)
br label %153
153: ; preds = %151, %149
%154 = load i8*, i8** %13
%155 = call i32 @free(i8* %154)
%156 = load i8*, i8** %21
%157 = call i32 @free(i8* %156)
%158 = load i8*, i8** %26
%159 = call i32 @free(i8* %158)
%160 = load i8*, i8** %31
%161 = call i32 @free(i8* %160)
%162 = load i8*, i8** %36
%163 = call i32 @free(i8* %162)
%164 = load i8*, i8** %41
%165 = call i32 @free(i8* %164)
%166 = call i32 @free(i8* %141)
ret void
}