#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free_ivector(int *, int, int);
int *ivector(int, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ read_line_v2(int /*<<< orphan*/ *, int *, int *, int, int,
                                int, int, int, int, int **, int, int, int, int);
int /*<<< orphan*/ read_line_v3(int /*<<< orphan*/ *, int *, int *, int, int,
                                int, int, int, int, int **, int **, int, int,
                                int, int);
int read_scan_file_v3(char *filename, int *transcripts, int *positions,
                      int neg2pos, int sortpos, int max_overlap, int max_ul,
                      int max_el, int max_il, int **transcript_lengths,
                      int **transcript_map, int seq_ul, int seq_el,
                      int seq_il) {
  FILE *input_file;
  int t[5];
  int *m_p;
  int max_occur = 10000;
  int curr_tr;
  int curr_n;
  int running_n = 0;
  int i;
  int togoon = 1;
  float *d;
  int call2or3 = 2;
  i = 1;
  while ((i < 10000) & (call2or3 == 2)) {
    if (transcript_map[i][1] > 0)
      call2or3 = 3;
    if (transcript_map[i][2] > 0)
      call2or3 = 3;
    i++;
  }
  input_file = fopen(filename, "r");
  if (!input_file) {
    printf("error! i could not open %s\n", filename);
    return running_n;
  }
  m_p = ivector(1, max_occur);
  while (togoon >= 0) {
    if (call2or3 == 3) {
      read_line_v3(input_file, t, m_p, max_occur, neg2pos, sortpos, max_ul,
                   max_el, max_il, transcript_lengths, transcript_map,
                   max_overlap, seq_ul, seq_el, seq_il);
    } else {
      read_line_v2(input_file, t, m_p, max_occur, neg2pos, sortpos, max_ul,
                   max_el, max_il, transcript_lengths, max_overlap, seq_ul,
                   seq_el, seq_il);
    }
    curr_tr = t[0];
    curr_n = t[1];
    togoon = t[2];
    if (curr_n > 0) {
      for (i = 1; i <= curr_n; i++) {
        running_n++;
        transcripts[running_n] = curr_tr;
        positions[running_n] = m_p[i];
      }
    }
  }
  fclose(input_file);
  free_ivector(m_p, 1, max_occur);
  return running_n;
}


x86 assembly (clang, -O0):
<read_scan_file_v3>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
mov    0x48(%rbp),%eax
mov    0x40(%rbp),%eax
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x38(%rbp)
mov    %rsi,-0x40(%rbp)
mov    %rdx,-0x48(%rbp)
mov    %ecx,-0x4c(%rbp)
mov    %r8d,-0x50(%rbp)
mov    %r9d,-0x54(%rbp)
movl   $0x2710,-0x8c(%rbp)
movl   $0x0,-0x98(%rbp)
movl   $0x1,-0xa0(%rbp)
movl   $0x2,-0xac(%rbp)
movl   $0x1,-0x9c(%rbp)
cmpl   $0x2710,-0x9c(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x2,-0xac(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     126e <read_scan_file_v3+0xfe>
mov    0x30(%rbp),%rax
movslq -0x9c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmpl   $0x0,0x4(%rax)
jle    1237 <read_scan_file_v3+0xc7>
movl   $0x3,-0xac(%rbp)
mov    0x30(%rbp),%rax
movslq -0x9c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmpl   $0x0,0x8(%rax)
jle    125a <read_scan_file_v3+0xea>
movl   $0x3,-0xac(%rbp)
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    11e7 <read_scan_file_v3+0x77>
mov    -0x38(%rbp),%rdi
lea    0xd87(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x60(%rbp)
cmpq   $0x0,-0x60(%rbp)
jne    12ab <read_scan_file_v3+0x13b>
mov    -0x38(%rbp),%rsi
lea    0xd6a(%rip),%rdi
call   1050 <printf@plt>
mov    -0x98(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    1497 <read_scan_file_v3+0x327>
mov    -0x8c(%rbp),%esi
mov    $0x1,%edi
call   1080 <ivector@plt>
mov    %rax,-0x88(%rbp)
cmpl   $0x0,-0xa0(%rbp)
jl     146e <read_scan_file_v3+0x2fe>
cmpl   $0x3,-0xac(%rbp)
jne    1365 <read_scan_file_v3+0x1f5>
mov    -0x60(%rbp),%rdi
lea    -0x80(%rbp),%rsi
mov    -0x88(%rbp),%rdx
mov    -0x8c(%rbp),%ecx
mov    -0x4c(%rbp),%r8d
mov    -0x50(%rbp),%r9d
mov    0x10(%rbp),%eax
mov    %eax,-0xb4(%rbp)
mov    0x18(%rbp),%r13d
mov    0x20(%rbp),%r12d
mov    0x28(%rbp),%r15
mov    0x30(%rbp),%r14
mov    -0x54(%rbp),%ebx
mov    0x38(%rbp),%r11d
mov    0x40(%rbp),%r10d
mov    0x48(%rbp),%eax
mov    %eax,-0xb0(%rbp)
mov    -0xb4(%rbp),%eax
mov    %eax,(%rsp)
mov    -0xb0(%rbp),%eax
mov    %r13d,0x8(%rsp)
mov    %r12d,0x10(%rsp)
mov    %r15,0x18(%rsp)
mov    %r14,0x20(%rsp)
mov    %ebx,0x28(%rsp)
mov    %r11d,0x30(%rsp)
mov    %r10d,0x38(%rsp)
mov    %eax,0x40(%rsp)
call   1060 <read_line_v3@plt>
jmp    13ca <read_scan_file_v3+0x25a>
mov    -0x60(%rbp),%rdi
lea    -0x80(%rbp),%rsi
mov    -0x88(%rbp),%rdx
mov    -0x8c(%rbp),%ecx
mov    -0x4c(%rbp),%r8d
mov    -0x50(%rbp),%r9d
mov    0x10(%rbp),%r13d
mov    0x18(%rbp),%r12d
mov    0x20(%rbp),%r15d
mov    0x28(%rbp),%r14
mov    -0x54(%rbp),%ebx
mov    0x38(%rbp),%r11d
mov    0x40(%rbp),%r10d
mov    0x48(%rbp),%eax
mov    %r13d,(%rsp)
mov    %r12d,0x8(%rsp)
mov    %r15d,0x10(%rsp)
mov    %r14,0x18(%rsp)
mov    %ebx,0x20(%rsp)
mov    %r11d,0x28(%rsp)
mov    %r10d,0x30(%rsp)
mov    %eax,0x38(%rsp)
call   1030 <read_line_v2@plt>
mov    -0x80(%rbp),%eax
mov    %eax,-0x90(%rbp)
mov    -0x7c(%rbp),%eax
mov    %eax,-0x94(%rbp)
mov    -0x78(%rbp),%eax
mov    %eax,-0xa0(%rbp)
cmpl   $0x0,-0x94(%rbp)
jle    1469 <read_scan_file_v3+0x2f9>
movl   $0x1,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
cmp    -0x94(%rbp),%eax
jg     1464 <read_scan_file_v3+0x2f4>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
mov    -0x90(%rbp),%edx
mov    -0x40(%rbp),%rax
movslq -0x98(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x88(%rbp),%rax
movslq -0x9c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x48(%rbp),%rax
movslq -0x98(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    13fc <read_scan_file_v3+0x28c>
jmp    1469 <read_scan_file_v3+0x2f9>
jmp    12c2 <read_scan_file_v3+0x152>
mov    -0x60(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x88(%rbp),%rdi
mov    -0x8c(%rbp),%edx
mov    $0x1,%esi
call   1070 <free_ivector@plt>
mov    -0x98(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_scan_file_v3>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %r9d,%r14d
mov    %r8d,0x14(%rsp)
mov    %ecx,0x10(%rsp)
mov    %rdx,0x20(%rsp)
mov    %rsi,0x18(%rsp)
mov    %rdi,%r15
mov    0xe0(%rsp),%rsi
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
mov    (%rsi,%rax,8),%rcx
cmpl   $0x0,0x4(%rcx)
setg   %dl
cmpl   $0x0,0x8(%rcx)
setg   %r13b
or     %dl,%r13b
jne    11d7 <read_scan_file_v3+0x67>
lea    0x1(%rax),%rcx
cmp    $0x270f,%rax
mov    %rcx,%rax
jb     11b0 <read_scan_file_v3+0x40>
lea    0xe22(%rip),%rsi
mov    %r15,%rdi
call   1090 <fopen@plt>
mov    %rax,0x30(%rsp)
test   %rax,%rax
je     15b6 <read_scan_file_v3+0x446>
mov    $0x1,%edi
mov    $0x2710,%esi
call   1080 <ivector@plt>
mov    %rax,%r15
mov    0x18(%rsp),%rcx
lea    0x4(%rcx),%rax
mov    %rax,0x80(%rsp)
mov    0x20(%rsp),%rax
lea    0x4(%rax),%rdx
mov    %rdx,0x78(%rsp)
lea    0x4(%r15),%rdx
mov    %rdx,0x38(%rsp)
lea    0x34(%rax),%rdx
mov    %rdx,0x60(%rsp)
lea    0x34(%rcx),%rdx
mov    %rdx,0x58(%rsp)
add    $0x8,%rax
mov    %rax,0x70(%rsp)
lea    0x8(%rcx),%rax
mov    %rax,0x68(%rsp)
xor    %r12d,%r12d
mov    %r14,0x28(%rsp)
jmp    126c <read_scan_file_v3+0xfc>
nopl   0x0(%rax)
mov    %r10,%r12
test   %r8d,%r8d
js     1598 <read_scan_file_v3+0x428>
test   %r13b,%r13b
je     12e0 <read_scan_file_v3+0x170>
sub    $0x8,%rsp
mov    0x38(%rsp),%rdi
lea    0x48(%rsp),%rsi
mov    %r15,%rdx
mov    $0x2710,%ecx
mov    0x18(%rsp),%r8d
mov    0x1c(%rsp),%r9d
mov    0x100(%rsp),%eax
push   %rax
mov    0x100(%rsp),%eax
push   %rax
mov    0x100(%rsp),%eax
push   %rax
push   %r14
push   0x108(%rsp)
push   0x108(%rsp)
mov    0x108(%rsp),%eax
push   %rax
mov    0x108(%rsp),%eax
push   %rax
mov    0x108(%rsp),%eax
push   %rax
call   1060 <read_line_v3@plt>
add    $0x50,%rsp
jmp    133e <read_scan_file_v3+0x1ce>
nopl   0x0(%rax)
mov    0x30(%rsp),%rdi
lea    0x40(%rsp),%rsi
mov    %r15,%rdx
mov    $0x2710,%ecx
mov    0x10(%rsp),%r8d
mov    0x14(%rsp),%r9d
mov    0xf8(%rsp),%eax
push   %rax
mov    0xf8(%rsp),%eax
push   %rax
mov    0xf8(%rsp),%eax
push   %rax
push   %r14
push   0xf8(%rsp)
mov    0xf8(%rsp),%eax
push   %rax
mov    0xf8(%rsp),%eax
push   %rax
mov    0xf8(%rsp),%eax
push   %rax
call   1030 <read_line_v2@plt>
add    $0x40,%rsp
mov    0x44(%rsp),%r11d
mov    0x48(%rsp),%r8d
test   %r11d,%r11d
jle    1263 <read_scan_file_v3+0xf3>
mov    0x40(%rsp),%edx
movslq %r12d,%r10
lea    0x1(%r11),%rsi
mov    $0x1,%edi
cmp    $0x8,%r11
jb     14f0 <read_scan_file_v3+0x380>
mov    %r8d,0xc(%rsp)
mov    0x80(%rsp),%rax
lea    (%rax,%r10,4),%rax
lea    (%r10,%rsi,1),%rcx
mov    0x18(%rsp),%rbp
lea    0x0(%rbp,%rcx,4),%rbp
mov    0x78(%rsp),%rbx
lea    (%rbx,%r10,4),%r8
mov    0x20(%rsp),%rbx
lea    (%rbx,%rcx,4),%r9
lea    (%r15,%rsi,4),%rcx
cmp    %r9,%rax
setb   %r12b
cmp    %rbp,%r8
setb   %r14b
cmp    %rcx,%rax
setb   %al
mov    0x38(%rsp),%rbx
cmp    %rbp,%rbx
setb   %bpl
cmp    %rcx,%r8
setb   %cl
cmp    %r9,%rbx
setb   %r9b
test   %r14b,%r12b
jne    14d8 <read_scan_file_v3+0x368>
and    %bpl,%al
jne    14d8 <read_scan_file_v3+0x368>
and    %r9b,%cl
mov    0x28(%rsp),%r14
jne    151b <read_scan_file_v3+0x3ab>
mov    %r11d,%edi
and    $0xfffffff8,%edi
movd   %edx,%xmm0
pshufd $0x0,%xmm0,%xmm0
lea    -0x8(%rdi),%rax
mov    %rax,%r9
shr    $0x3,%r9
add    $0x1,%r9
test   %rax,%rax
je     1587 <read_scan_file_v3+0x417>
mov    %r9,%rbp
and    $0xfffffffffffffffe,%rbp
mov    0x60(%rsp),%rax
lea    (%rax,%r10,4),%rcx
mov    0x58(%rsp),%rax
lea    (%rax,%r10,4),%rbx
xor    %eax,%eax
nop
movdqu %xmm0,-0x30(%rbx,%rax,4)
movdqu %xmm0,-0x20(%rbx,%rax,4)
movups 0x4(%r15,%rax,4),%xmm1
movups 0x14(%r15,%rax,4),%xmm2
movups %xmm1,-0x30(%rcx,%rax,4)
movups %xmm2,-0x20(%rcx,%rax,4)
movdqu %xmm0,-0x10(%rbx,%rax,4)
movdqu %xmm0,(%rbx,%rax,4)
movups 0x24(%r15,%rax,4),%xmm1
movups 0x34(%r15,%rax,4),%xmm2
movups %xmm1,-0x10(%rcx,%rax,4)
movups %xmm2,(%rcx,%rax,4)
add    $0x10,%rax
add    $0xfffffffffffffffe,%rbp
jne    1430 <read_scan_file_v3+0x2c0>
test   $0x1,%r9b
je     14bb <read_scan_file_v3+0x34b>
lea    (%rax,%r10,1),%rcx
shl    $0x2,%rax
mov    0x18(%rsp),%rbp
movdqu %xmm0,0x4(%rbp,%rcx,4)
movdqu %xmm0,0x14(%rbp,%rcx,4)
or     $0x4,%rax
movdqu (%r15,%rax,1),%xmm0
movups 0x10(%r15,%rax,1),%xmm1
mov    0x20(%rsp),%rax
movdqu %xmm0,0x4(%rax,%rcx,4)
movups %xmm1,0x14(%rax,%rcx,4)
add    %rdi,%r10
cmp    %rdi,%r11
mov    0xc(%rsp),%r8d
je     1260 <read_scan_file_v3+0xf0>
or     $0x1,%rdi
test   $0x1,%sil
je     14f6 <read_scan_file_v3+0x386>
jmp    1530 <read_scan_file_v3+0x3c0>
mov    0x28(%rsp),%r14
mov    0xc(%rsp),%r8d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   $0x1,%sil
jne    1530 <read_scan_file_v3+0x3c0>
lea    0x1(%r10),%r12
mov    0x18(%rsp),%rax
mov    %edx,0x4(%rax,%r10,4)
mov    (%r15,%rdi,4),%eax
mov    0x20(%rsp),%rcx
mov    %eax,0x4(%rcx,%r10,4)
lea    0x1(%rdi),%rax
mov    %r12,%r10
jmp    1533 <read_scan_file_v3+0x3c3>
mov    0xc(%rsp),%r8d
test   $0x1,%sil
je     14f6 <read_scan_file_v3+0x386>
cs nopw 0x0(%rax,%rax,1)
mov    %rdi,%rax
not    %rdi
add    %rsi,%rdi
je     1263 <read_scan_file_v3+0xf3>
mov    0x70(%rsp),%rcx
lea    (%rcx,%r10,4),%rcx
mov    0x68(%rsp),%rdi
lea    (%rdi,%r10,4),%rdi
sub    %rax,%rsi
mov    0x38(%rsp),%rbp
lea    0x0(%rbp,%rax,4),%rbp
xor    %eax,%eax
mov    %edx,-0x4(%rdi,%rax,4)
mov    -0x4(%rbp,%rax,4),%ebx
mov    %ebx,-0x4(%rcx,%rax,4)
mov    %edx,(%rdi,%rax,4)
mov    0x0(%rbp,%rax,4),%ebx
mov    %ebx,(%rcx,%rax,4)
add    $0x2,%rax
cmp    %rax,%rsi
jne    1560 <read_scan_file_v3+0x3f0>
add    %rax,%r10
jmp    1260 <read_scan_file_v3+0xf0>
xor    %eax,%eax
test   $0x1,%r9b
jne    1482 <read_scan_file_v3+0x312>
jmp    14bb <read_scan_file_v3+0x34b>
mov    0x30(%rsp),%rdi
call   1040 <fclose@plt>
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x2710,%edx
call   1070 <free_ivector@plt>
jmp    15c8 <read_scan_file_v3+0x458>
lea    0xa45(%rip),%rdi
mov    %r15,%rsi
call   1050 <printf@plt>
xor    %r12d,%r12d
mov    %r12d,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [28 x i8] c"error! i could not open %s\0A\00"
define i32 @read_scan_file_v3(i8* %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32** %9, i32** %10, i32 %11, i32 %12, i32 %13) {
%15 = alloca [5 x i32]
%16 = bitcast [5 x i32]* %15 to i8*
br label %17
17: ; preds = %14, %17
%18 = phi i64 [ 1, %14 ], [ %28, %17 ]
%19 = getelementptr inbounds i32*, i32** %10, i64 %18
%20 = load i32*, i32** %19
%21 = getelementptr inbounds i32, i32* %20, i64 1
%22 = load i32, i32* %21
%23 = icmp sgt i32 %22, 0
%24 = getelementptr inbounds i32, i32* %20, i64 2
%25 = load i32, i32* %24
%26 = icmp sgt i32 %25, 0
%27 = select i1 %26, i1 true, i1 %23
%28 = add nuw nsw i64 %18, 1
%29 = icmp ugt i64 %18, 9998
%30 = or i1 %27, %29
br i1 %30, label %31, label %17
31: ; preds = %17
%32 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%33 = icmp eq i32* %32, null
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %202
36: ; preds = %31
%37 = tail call i32* @ivector(i32 1, i32 10000)
%38 = getelementptr inbounds [5 x i32], [5 x i32]* %15, i64 0, i64 0
%39 = getelementptr inbounds [5 x i32], [5 x i32]* %15, i64 0, i64 1
%40 = getelementptr inbounds [5 x i32], [5 x i32]* %15, i64 0, i64 2
%41 = getelementptr i32, i32* %1, i64 1
%42 = getelementptr i32, i32* %2, i64 1
%43 = getelementptr i32, i32* %37, i64 1
br label %44
44: ; preds = %36, %196
%45 = phi i32 [ 0, %36 ], [ %197, %196 ]
br i1 %27, label %46, label %48
46: ; preds = %44
%47 = call i32 @read_line_v3(i32* %32, i32* %38, i32* %37, i32 10000, i32 %3, i32 %4, i32 %6, i32 %7, i32 %8, i32** %9, i32** %10, i32 %5, i32 %11, i32 %12, i32 %13)
br label %50
48: ; preds = %44
%49 = call i32 @read_line_v2(i32* %32, i32* %38, i32* %37, i32 10000, i32 %3, i32 %4, i32 %6, i32 %7, i32 %8, i32** %9, i32 %5, i32 %11, i32 %12, i32 %13)
br label %50
50: ; preds = %48, %46
%51 = load i32, i32* %38
%52 = load i32, i32* %39
%53 = load i32, i32* %40
%54 = icmp slt i32 %52, 1
br i1 %54, label %196, label %55
55: ; preds = %50
%56 = sext i32 %45 to i64
%57 = add nuw i32 %52, 1
%58 = zext i32 %57 to i64
%59 = add nsw i64 %58, -1
%60 = icmp ult i64 %59, 8
br i1 %60, label %158, label %61
61: ; preds = %55
%62 = getelementptr i32, i32* %41, i64 %56
%63 = add nsw i64 %56, %58
%64 = getelementptr i32, i32* %1, i64 %63
%65 = getelementptr i32, i32* %42, i64 %56
%66 = getelementptr i32, i32* %2, i64 %63
%67 = getelementptr i32, i32* %37, i64 %58
%68 = icmp ult i32* %62, %66
%69 = icmp ult i32* %65, %64
%70 = and i1 %68, %69
%71 = icmp ult i32* %62, %67
%72 = icmp ult i32* %43, %64
%73 = and i1 %71, %72
%74 = or i1 %70, %73
%75 = icmp ult i32* %65, %67
%76 = icmp ult i32* %43, %66
%77 = and i1 %75, %76
%78 = or i1 %74, %77
br i1 %78, label %158, label %79
79: ; preds = %61
%80 = and i64 %59, -8
%81 = add nsw i64 %80, %56
%82 = or i64 %80, 1
%83 = insertelement <4 x i32> poison, i32 %51, i64 0
%84 = shufflevector <4 x i32> %83, <4 x i32> poison, <4 x i32> zeroinitializer
%85 = insertelement <4 x i32> poison, i32 %51, i64 0
%86 = shufflevector <4 x i32> %85, <4 x i32> poison, <4 x i32> zeroinitializer
%87 = add nsw i64 %80, -8
%88 = lshr exact i64 %87, 3
%89 = add nuw nsw i64 %88, 1
%90 = and i64 %89, 1
%91 = icmp eq i64 %87, 0
br i1 %91, label %135, label %92
92: ; preds = %79
%93 = and i64 %89, 4611686018427387902
br label %94
94: ; preds = %94, %92
%95 = phi i64 [ 0, %92 ], [ %132, %94 ]
%96 = phi i64 [ 0, %92 ], [ %133, %94 ]
%97 = add i64 %95, %56
%98 = or i64 %95, 1
%99 = add nsw i64 %97, 1
%100 = getelementptr inbounds i32, i32* %1, i64 %99
%101 = bitcast i32* %100 to <4 x i32>*
store <4 x i32> %84, <4 x i32>* %101
%102 = getelementptr inbounds i32, i32* %100, i64 4
%103 = bitcast i32* %102 to <4 x i32>*
store <4 x i32> %86, <4 x i32>* %103
%104 = getelementptr inbounds i32, i32* %37, i64 %98
%105 = bitcast i32* %104 to <4 x i32>*
%106 = load <4 x i32>, <4 x i32>* %105
%107 = getelementptr inbounds i32, i32* %104, i64 4
%108 = bitcast i32* %107 to <4 x i32>*
%109 = load <4 x i32>, <4 x i32>* %108
%110 = getelementptr inbounds i32, i32* %2, i64 %99
%111 = bitcast i32* %110 to <4 x i32>*
store <4 x i32> %106, <4 x i32>* %111
%112 = getelementptr inbounds i32, i32* %110, i64 4
%113 = bitcast i32* %112 to <4 x i32>*
store <4 x i32> %109, <4 x i32>* %113
%114 = or i64 %95, 8
%115 = add i64 %114, %56
%116 = or i64 %95, 9
%117 = add nsw i64 %115, 1
%118 = getelementptr inbounds i32, i32* %1, i64 %117
%119 = bitcast i32* %118 to <4 x i32>*
store <4 x i32> %84, <4 x i32>* %119
%120 = getelementptr inbounds i32, i32* %118, i64 4
%121 = bitcast i32* %120 to <4 x i32>*
store <4 x i32> %86, <4 x i32>* %121
%122 = getelementptr inbounds i32, i32* %37, i64 %116
%123 = bitcast i32* %122 to <4 x i32>*
%124 = load <4 x i32>, <4 x i32>* %123
%125 = getelementptr inbounds i32, i32* %122, i64 4
%126 = bitcast i32* %125 to <4 x i32>*
%127 = load <4 x i32>, <4 x i32>* %126
%128 = getelementptr inbounds i32, i32* %2, i64 %117
%129 = bitcast i32* %128 to <4 x i32>*
store <4 x i32> %124, <4 x i32>* %129
%130 = getelementptr inbounds i32, i32* %128, i64 4
%131 = bitcast i32* %130 to <4 x i32>*
store <4 x i32> %127, <4 x i32>* %131
%132 = add nuw i64 %95, 16
%133 = add i64 %96, 2
%134 = icmp eq i64 %133, %93
br i1 %134, label %135, label %94
135: ; preds = %94, %79
%136 = phi i64 [ 0, %79 ], [ %132, %94 ]
%137 = icmp eq i64 %90, 0
br i1 %137, label %156, label %138
138: ; preds = %135
%139 = add i64 %136, %56
%140 = or i64 %136, 1
%141 = add nsw i64 %139, 1
%142 = getelementptr inbounds i32, i32* %1, i64 %141
%143 = bitcast i32* %142 to <4 x i32>*
store <4 x i32> %84, <4 x i32>* %143
%144 = getelementptr inbounds i32, i32* %142, i64 4
%145 = bitcast i32* %144 to <4 x i32>*
store <4 x i32> %86, <4 x i32>* %145
%146 = getelementptr inbounds i32, i32* %37, i64 %140
%147 = bitcast i32* %146 to <4 x i32>*
%148 = load <4 x i32>, <4 x i32>* %147
%149 = getelementptr inbounds i32, i32* %146, i64 4
%150 = bitcast i32* %149 to <4 x i32>*
%151 = load <4 x i32>, <4 x i32>* %150
%152 = getelementptr inbounds i32, i32* %2, i64 %141
%153 = bitcast i32* %152 to <4 x i32>*
store <4 x i32> %148, <4 x i32>* %153
%154 = getelementptr inbounds i32, i32* %152, i64 4
%155 = bitcast i32* %154 to <4 x i32>*
store <4 x i32> %151, <4 x i32>* %155
br label %156
156: ; preds = %135, %138
%157 = icmp eq i64 %59, %80
br i1 %157, label %193, label %158
158: ; preds = %61, %55, %156
%159 = phi i64 [ %56, %61 ], [ %56, %55 ], [ %81, %156 ]
%160 = phi i64 [ 1, %61 ], [ 1, %55 ], [ %82, %156 ]
%161 = xor i64 %160, -1
%162 = and i64 %58, 1
%163 = icmp eq i64 %162, 0
br i1 %163, label %164, label %171
164: ; preds = %158
%165 = add nsw i64 %159, 1
%166 = getelementptr inbounds i32, i32* %1, i64 %165
store i32 %51, i32* %166
%167 = getelementptr inbounds i32, i32* %37, i64 %160
%168 = load i32, i32* %167
%169 = getelementptr inbounds i32, i32* %2, i64 %165
store i32 %168, i32* %169
%170 = add nuw nsw i64 %160, 1
br label %171
171: ; preds = %164, %158
%172 = phi i64 [ undef, %158 ], [ %165, %164 ]
%173 = phi i64 [ %159, %158 ], [ %165, %164 ]
%174 = phi i64 [ %160, %158 ], [ %170, %164 ]
%175 = sub nsw i64 0, %58
%176 = icmp eq i64 %161, %175
br i1 %176, label %193, label %177
177: ; preds = %171, %177
%178 = phi i64 [ %186, %177 ], [ %173, %171 ]
%179 = phi i64 [ %191, %177 ], [ %174, %171 ]
%180 = add nsw i64 %178, 1
%181 = getelementptr inbounds i32, i32* %1, i64 %180
store i32 %51, i32* %181
%182 = getelementptr inbounds i32, i32* %37, i64 %179
%183 = load i32, i32* %182
%184 = getelementptr inbounds i32, i32* %2, i64 %180
store i32 %183, i32* %184
%185 = add nuw nsw i64 %179, 1
%186 = add nsw i64 %178, 2
%187 = getelementptr inbounds i32, i32* %1, i64 %186
store i32 %51, i32* %187
%188 = getelementptr inbounds i32, i32* %37, i64 %185
%189 = load i32, i32* %188
%190 = getelementptr inbounds i32, i32* %2, i64 %186
store i32 %189, i32* %190
%191 = add nuw nsw i64 %179, 2
%192 = icmp eq i64 %191, %58
br i1 %192, label %193, label %177
193: ; preds = %171, %177, %156
%194 = phi i64 [ %81, %156 ], [ %172, %171 ], [ %186, %177 ]
%195 = trunc i64 %194 to i32
br label %196
196: ; preds = %193, %50
%197 = phi i32 [ %45, %50 ], [ %195, %193 ]
%198 = icmp sgt i32 %53, -1
br i1 %198, label %44, label %199
199: ; preds = %196
%200 = call i32 @fclose(i32* %32)
%201 = call i32 @free_ivector(i32* %37, i32 1, i32 10000)
br label %202
202: ; preds = %199, %34
%203 = phi i32 [ %197, %199 ], [ 0, %34 ]
ret i32 %203
}