#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 *cvector(int, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free_cvector(char *, int, int);
int /*<<< orphan*/ free_ivector(int *, int, int);
int *ivector(int, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ read_line_wstrand_v4(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/ *, int *, int *,
                                        char *, int, int, int, int, int, int **,
                                        int **, int, int, int, int, int, int,
                                        int);
int read_scan_file_v5(char *filename_positions, char *filename_strands,
                      int *transcripts, int *positions, char *strands,
                      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,
                      int *out, int data_format, int filteron, int verbose) {
  FILE *input_file_pos;
  FILE *input_file_strand;
  int t[5];
  int *m_p;
  char *m_s;
  int max_occur = 10000;
  int curr_tr;
  int curr_n;
  int running_n = 0;
  int running_np = 0;
  int running_nm = 0;
  int i;
  int togoon = 1;
  int n_orig;
  int n_after_filter;
  int cumul_filter_out = 0;
  int cumul_overlap_out = 0;
  input_file_pos = fopen(filename_positions, "r");
  if (!input_file_pos) {
    printf("error! i could not open %s\n", filename_positions);
    return running_n;
  }
  input_file_strand = fopen(filename_strands, "r");
  if (!input_file_strand) {
    printf("error! i could not open %s\n", filename_strands);
    return running_n;
  }
  m_p = ivector(1, max_occur);
  m_s = cvector(1, max_occur);
  while (togoon >= 0) {
    read_line_wstrand_v4(
        input_file_pos, input_file_strand, t, m_p, m_s, max_occur, sortpos,
        max_ul, max_el, max_il, transcript_lengths, transcript_map, max_overlap,
        seq_ul, seq_el, seq_il, data_format, filteron, verbose);
    curr_tr = t[0];
    curr_n = t[1];
    togoon = t[2];
    n_orig = t[3];
    n_after_filter = t[4];
    cumul_filter_out += (n_orig - n_after_filter);
    cumul_overlap_out += (n_orig - curr_n);
    if (curr_n > 0) {
      for (i = 1; i <= curr_n; i++) {
        running_n++;
        transcripts[running_n] = curr_tr;
        positions[running_n] = m_p[i];
        strands[running_n] = m_s[i];
        if (m_s[i] > 0)
          running_np++;
        if (m_s[i] == 0)
          running_nm++;
      }
    }
  }
  fclose(input_file_pos);
  fclose(input_file_strand);
  out[0] = cumul_filter_out;
  out[1] = cumul_overlap_out;
  out[2] = running_np;
  out[3] = running_nm;
  free_ivector(m_p, 1, max_occur);
  free_cvector(m_s, 1, max_occur);
  return running_n;
}


x86 assembly (clang, -O0):
<read_scan_file_v5>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x138,%rsp
mov    0x70(%rbp),%eax
mov    0x68(%rbp),%eax
mov    0x60(%rbp),%eax
mov    0x58(%rbp),%rax
mov    0x50(%rbp),%eax
mov    0x48(%rbp),%eax
mov    0x40(%rbp),%eax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%eax
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    %rcx,-0x50(%rbp)
mov    %r8,-0x58(%rbp)
mov    %r9d,-0x5c(%rbp)
movl   $0x2710,-0xa4(%rbp)
movl   $0x0,-0xb0(%rbp)
movl   $0x0,-0xb4(%rbp)
movl   $0x0,-0xb8(%rbp)
movl   $0x1,-0xc0(%rbp)
movl   $0x0,-0xcc(%rbp)
movl   $0x0,-0xd0(%rbp)
mov    -0x38(%rbp),%rdi
lea    0xdd9(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
jne    1259 <read_scan_file_v5+0xd9>
mov    -0x38(%rbp),%rsi
lea    0xdbc(%rip),%rdi
call   1040 <printf@plt>
mov    -0xb0(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    1592 <read_scan_file_v5+0x412>
mov    -0x40(%rbp),%rdi
lea    0xd9c(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x70(%rbp)
cmpq   $0x0,-0x70(%rbp)
jne    1296 <read_scan_file_v5+0x116>
mov    -0x40(%rbp),%rsi
lea    0xd7f(%rip),%rdi
call   1040 <printf@plt>
mov    -0xb0(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    1592 <read_scan_file_v5+0x412>
mov    -0xa4(%rbp),%esi
mov    $0x1,%edi
call   1090 <ivector@plt>
mov    %rax,-0x98(%rbp)
mov    -0xa4(%rbp),%esi
mov    $0x1,%edi
call   1050 <cvector@plt>
mov    %rax,-0xa0(%rbp)
cmpl   $0x0,-0xc0(%rbp)
jl     1516 <read_scan_file_v5+0x396>
mov    -0x68(%rbp),%rdi
mov    -0x70(%rbp),%rsi
lea    -0x90(%rbp),%rdx
mov    -0x98(%rbp),%rcx
mov    -0xa0(%rbp),%r8
mov    -0xa4(%rbp),%r9d
mov    -0x5c(%rbp),%eax
mov    %eax,-0xf0(%rbp)
mov    0x18(%rbp),%eax
mov    %eax,-0xec(%rbp)
mov    0x20(%rbp),%eax
mov    %eax,-0xe8(%rbp)
mov    0x28(%rbp),%eax
mov    %eax,-0xe4(%rbp)
mov    0x30(%rbp),%rax
mov    %rax,-0xe0(%rbp)
mov    0x38(%rbp),%r13
mov    0x10(%rbp),%r12d
mov    0x40(%rbp),%r15d
mov    0x48(%rbp),%r14d
mov    0x50(%rbp),%ebx
mov    0x60(%rbp),%r11d
mov    0x68(%rbp),%r10d
mov    0x70(%rbp),%eax
mov    %eax,-0xd4(%rbp)
mov    -0xf0(%rbp),%eax
mov    %eax,(%rsp)
mov    -0xec(%rbp),%eax
mov    %eax,0x8(%rsp)
mov    -0xe8(%rbp),%eax
mov    %eax,0x10(%rsp)
mov    -0xe4(%rbp),%eax
mov    %eax,0x18(%rsp)
mov    -0xe0(%rbp),%rax
mov    %rax,0x20(%rsp)
mov    -0xd4(%rbp),%eax
mov    %r13,0x28(%rsp)
mov    %r12d,0x30(%rsp)
mov    %r15d,0x38(%rsp)
mov    %r14d,0x40(%rsp)
mov    %ebx,0x48(%rsp)
mov    %r11d,0x50(%rsp)
mov    %r10d,0x58(%rsp)
mov    %eax,0x60(%rsp)
call   1070 <read_line_wstrand_v4@plt>
mov    -0x90(%rbp),%eax
mov    %eax,-0xa8(%rbp)
mov    -0x8c(%rbp),%eax
mov    %eax,-0xac(%rbp)
mov    -0x88(%rbp),%eax
mov    %eax,-0xc0(%rbp)
mov    -0x84(%rbp),%eax
mov    %eax,-0xc4(%rbp)
mov    -0x80(%rbp),%eax
mov    %eax,-0xc8(%rbp)
mov    -0xc4(%rbp),%eax
sub    -0xc8(%rbp),%eax
add    -0xcc(%rbp),%eax
mov    %eax,-0xcc(%rbp)
mov    -0xc4(%rbp),%eax
sub    -0xac(%rbp),%eax
add    -0xd0(%rbp),%eax
mov    %eax,-0xd0(%rbp)
cmpl   $0x0,-0xac(%rbp)
jle    1511 <read_scan_file_v5+0x391>
movl   $0x1,-0xbc(%rbp)
mov    -0xbc(%rbp),%eax
cmp    -0xac(%rbp),%eax
jg     150c <read_scan_file_v5+0x38c>
mov    -0xb0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb0(%rbp)
mov    -0xa8(%rbp),%edx
mov    -0x48(%rbp),%rax
movslq -0xb0(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x98(%rbp),%rax
movslq -0xbc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x50(%rbp),%rax
movslq -0xb0(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xa0(%rbp),%rax
movslq -0xbc(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x58(%rbp),%rax
movslq -0xb0(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xa0(%rbp),%rax
movslq -0xbc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jle    14c9 <read_scan_file_v5+0x349>
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
mov    -0xa0(%rbp),%rax
movslq -0xbc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    14f3 <read_scan_file_v5+0x373>
mov    -0xb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    14f8 <read_scan_file_v5+0x378>
mov    -0xbc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xbc(%rbp)
jmp    142c <read_scan_file_v5+0x2ac>
jmp    1511 <read_scan_file_v5+0x391>
jmp    12c4 <read_scan_file_v5+0x144>
mov    -0x68(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x70(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0xcc(%rbp),%ecx
mov    0x58(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xd0(%rbp),%ecx
mov    0x58(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xb4(%rbp),%ecx
mov    0x58(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xb8(%rbp),%ecx
mov    0x58(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x98(%rbp),%rdi
mov    -0xa4(%rbp),%edx
mov    $0x1,%esi
call   1080 <free_ivector@plt>
mov    -0xa0(%rbp),%rdi
mov    -0xa4(%rbp),%edx
mov    $0x1,%esi
call   1060 <free_cvector@plt>
mov    -0xb0(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x138,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_scan_file_v5>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r9,0x48(%rsp)
mov    %r8,0x18(%rsp)
mov    %rcx,0x10(%rsp)
mov    %rdx,0x8(%rsp)
mov    %rsi,%r14
mov    %rdi,%rbp
lea    0xe51(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,0x28(%rsp)
test   %rax,%rax
je     13b8 <read_scan_file_v5+0x238>
lea    0xe37(%rip),%rsi
mov    %r14,%rdi
call   10a0 <fopen@plt>
mov    %rax,0x20(%rsp)
test   %rax,%rax
je     13c4 <read_scan_file_v5+0x244>
mov    $0x1,%edi
mov    $0x2710,%esi
call   1090 <ivector@plt>
mov    %rax,%r15
mov    $0x1,%edi
mov    $0x2710,%esi
call   1050 <cvector@plt>
mov    %rax,%r12
addq   $0x4,0x8(%rsp)
addq   $0x4,0x10(%rsp)
addq   $0x1,0x18(%rsp)
xor    %ebx,%ebx
xor    %r13d,%r13d
movl   $0x0,0x4(%rsp)
xor    %ebp,%ebp
xor    %r14d,%r14d
jmp    1243 <read_scan_file_v5+0xc3>
nopl   0x0(%rax)
sub    0x40(%rsp),%r13d
add    %r8d,%ebx
cmpl   $0x0,0x38(%rsp)
js     1365 <read_scan_file_v5+0x1e5>
sub    $0x8,%rsp
mov    0x30(%rsp),%rdi
mov    0x28(%rsp),%rsi
lea    0x38(%rsp),%rdx
mov    %r15,%rcx
mov    %r12,%r8
mov    $0x2710,%r9d
mov    0xf8(%rsp),%eax
push   %rax
mov    0xf8(%rsp),%eax
push   %rax
mov    0xf8(%rsp),%eax
push   %rax
mov    0xf0(%rsp),%eax
push   %rax
mov    0xf0(%rsp),%eax
push   %rax
mov    0xf0(%rsp),%eax
push   %rax
mov    0xc8(%rsp),%eax
push   %rax
push   0xf8(%rsp)
push   0xf8(%rsp)
mov    0xf8(%rsp),%eax
push   %rax
mov    0xf8(%rsp),%eax
push   %rax
mov    0xf8(%rsp),%eax
push   %rax
push   0xb0(%rsp)
call   1070 <read_line_wstrand_v4@plt>
add    $0x70,%rsp
mov    0x34(%rsp),%r9d
mov    0x3c(%rsp),%r8d
add    %r8d,%r13d
sub    %r9d,%ebx
test   %r9d,%r9d
jle    1230 <read_scan_file_v5+0xb0>
mov    %rbx,0x50(%rsp)
mov    0x30(%rsp),%r10d
mov    0x4(%rsp),%eax
mov    %eax,%r11d
movslq %eax,%rsi
mov    0x8(%rsp),%rax
lea    (%rax,%rsi,4),%rdi
mov    0x10(%rsp),%rax
lea    (%rax,%rsi,4),%rax
add    0x18(%rsp),%rsi
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %r10d,(%rdi,%rbx,4)
mov    0x4(%r15,%rbx,4),%ecx
mov    %ecx,(%rax,%rbx,4)
movzbl 0x1(%r12,%rbx,1),%ecx
mov    %cl,(%rsi,%rbx,1)
xor    %ecx,%ecx
xor    %edx,%edx
cmpb   $0x0,0x1(%r12,%rbx,1)
setg   %cl
sete   %dl
add    %ecx,%r14d
add    %edx,%ebp
add    $0x1,%rbx
cmp    %rbx,%r9
jne    1320 <read_scan_file_v5+0x1a0>
add    %ebx,%r11d
mov    %r11d,0x4(%rsp)
mov    0x50(%rsp),%rbx
jmp    1230 <read_scan_file_v5+0xb0>
mov    0x28(%rsp),%rdi
call   1030 <fclose@plt>
mov    0x20(%rsp),%rdi
call   1030 <fclose@plt>
mov    0xd8(%rsp),%rax
mov    %r13d,(%rax)
mov    %ebx,0x4(%rax)
mov    %r14d,0x8(%rax)
mov    %ebp,0xc(%rax)
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x2710,%edx
call   1080 <free_ivector@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x2710,%edx
call   1060 <free_cvector@plt>
mov    0x4(%rsp),%eax
jmp    13d5 <read_scan_file_v5+0x255>
lea    0xc43(%rip),%rdi
mov    %rbp,%rsi
jmp    13ce <read_scan_file_v5+0x24e>
lea    0xc37(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x58,%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_v5(i8* %0, i8* %1, i32* %2, i32* %3, i8* %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32** %10, i32** %11, i32 %12, i32 %13, i32 %14, i32* %15, i32 %16, i32 %17, i32 %18) {
%20 = alloca i32
%21 = alloca i8*
%22 = alloca i8*
%23 = alloca i32*
%24 = alloca i32*
%25 = alloca i8*
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32**
%32 = alloca i32**
%33 = alloca i32
%34 = alloca i32
%35 = alloca i32
%36 = alloca i32*
%37 = alloca i32
%38 = alloca i32
%39 = alloca i32
%40 = alloca i32*
%41 = alloca i32*
%42 = alloca [5 x i32]
%43 = alloca i32*
%44 = alloca i8*
%45 = alloca i32
%46 = alloca i32
%47 = alloca i32
%48 = alloca i32
%49 = alloca i32
%50 = alloca i32
%51 = alloca i32
%52 = alloca i32
%53 = alloca i32
%54 = alloca i32
%55 = alloca i32
%56 = alloca i32
store i8* %0, i8** %21
store i8* %1, i8** %22
store i32* %2, i32** %23
store i32* %3, i32** %24
store i8* %4, i8** %25
store i32 %5, i32* %26
store i32 %6, i32* %27
store i32 %7, i32* %28
store i32 %8, i32* %29
store i32 %9, i32* %30
store i32** %10, i32*** %31
store i32** %11, i32*** %32
store i32 %12, i32* %33
store i32 %13, i32* %34
store i32 %14, i32* %35
store i32* %15, i32** %36
store i32 %16, i32* %37
store i32 %17, i32* %38
store i32 %18, i32* %39
store i32 10000, i32* %45
store i32 0, i32* %48
store i32 0, i32* %49
store i32 0, i32* %50
store i32 1, i32* %52
store i32 0, i32* %55
store i32 0, i32* %56
%57 = load i8*, i8** %21
%58 = call i32* @fopen(i8* %57, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %58, i32** %40
%59 = load i32*, i32** %40
%60 = icmp ne i32* %59, null
br i1 %60, label %65, label %61
61: ; preds = %19
%62 = load i8*, i8** %21
%63 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %62)
%64 = load i32, i32* %48
store i32 %64, i32* %20
br label %207
65: ; preds = %19
%66 = load i8*, i8** %22
%67 = call i32* @fopen(i8* %66, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %67, i32** %41
%68 = load i32*, i32** %41
%69 = icmp ne i32* %68, null
br i1 %69, label %74, label %70
70: ; preds = %65
%71 = load i8*, i8** %22
%72 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %71)
%73 = load i32, i32* %48
store i32 %73, i32* %20
br label %207
74: ; preds = %65
%75 = load i32, i32* %45
%76 = call i32* @ivector(i32 1, i32 %75)
store i32* %76, i32** %43
%77 = load i32, i32* %45
%78 = call i8* @cvector(i32 1, i32 %77)
store i8* %78, i8** %44
br label %79
79: ; preds = %182, %74
%80 = load i32, i32* %52
%81 = icmp sge i32 %80, 0
br i1 %81, label %82, label %183
82: ; preds = %79
%83 = load i32*, i32** %40
%84 = load i32*, i32** %41
%85 = getelementptr inbounds [5 x i32], [5 x i32]* %42, i64 0, i64 0
%86 = load i32*, i32** %43
%87 = load i8*, i8** %44
%88 = load i32, i32* %45
%89 = load i32, i32* %26
%90 = load i32, i32* %28
%91 = load i32, i32* %29
%92 = load i32, i32* %30
%93 = load i32**, i32*** %31
%94 = load i32**, i32*** %32
%95 = load i32, i32* %27
%96 = load i32, i32* %33
%97 = load i32, i32* %34
%98 = load i32, i32* %35
%99 = load i32, i32* %37
%100 = load i32, i32* %38
%101 = load i32, i32* %39
%102 = call i32 @read_line_wstrand_v4(i32* %83, i32* %84, i32* %85, i32* %86, i8* %87, i32 %88, i32 %89, i32 %90, i32 %91, i32 %92, i32** %93, i32** %94, i32 %95, i32 %96, i32 %97, i32 %98, i32 %99, i32 %100, i32 %101)
%103 = getelementptr inbounds [5 x i32], [5 x i32]* %42, i64 0, i64 0
%104 = load i32, i32* %103
store i32 %104, i32* %46
%105 = getelementptr inbounds [5 x i32], [5 x i32]* %42, i64 0, i64 1
%106 = load i32, i32* %105
store i32 %106, i32* %47
%107 = getelementptr inbounds [5 x i32], [5 x i32]* %42, i64 0, i64 2
%108 = load i32, i32* %107
store i32 %108, i32* %52
%109 = getelementptr inbounds [5 x i32], [5 x i32]* %42, i64 0, i64 3
%110 = load i32, i32* %109
store i32 %110, i32* %53
%111 = getelementptr inbounds [5 x i32], [5 x i32]* %42, i64 0, i64 4
%112 = load i32, i32* %111
store i32 %112, i32* %54
%113 = load i32, i32* %53
%114 = load i32, i32* %54
%115 = sub nsw i32 %113, %114
%116 = load i32, i32* %55
%117 = add nsw i32 %116, %115
store i32 %117, i32* %55
%118 = load i32, i32* %53
%119 = load i32, i32* %47
%120 = sub nsw i32 %118, %119
%121 = load i32, i32* %56
%122 = add nsw i32 %121, %120
store i32 %122, i32* %56
%123 = load i32, i32* %47
%124 = icmp sgt i32 %123, 0
br i1 %124, label %125, label %182
125: ; preds = %82
store i32 1, i32* %51
br label %126
126: ; preds = %178, %125
%127 = load i32, i32* %51
%128 = load i32, i32* %47
%129 = icmp sle i32 %127, %128
br i1 %129, label %130, label %181
130: ; preds = %126
%131 = load i32, i32* %48
%132 = add nsw i32 %131, 1
store i32 %132, i32* %48
%133 = load i32, i32* %46
%134 = load i32*, i32** %23
%135 = load i32, i32* %48
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds i32, i32* %134, i64 %136
store i32 %133, i32* %137
%138 = load i32*, i32** %43
%139 = load i32, i32* %51
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds i32, i32* %138, i64 %140
%142 = load i32, i32* %141
%143 = load i32*, i32** %24
%144 = load i32, i32* %48
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds i32, i32* %143, i64 %145
store i32 %142, i32* %146
%147 = load i8*, i8** %44
%148 = load i32, i32* %51
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds i8, i8* %147, i64 %149
%151 = load i8, i8* %150
%152 = load i8*, i8** %25
%153 = load i32, i32* %48
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds i8, i8* %152, i64 %154
store i8 %151, i8* %155
%156 = load i8*, i8** %44
%157 = load i32, i32* %51
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds i8, i8* %156, i64 %158
%160 = load i8, i8* %159
%161 = sext i8 %160 to i32
%162 = icmp sgt i32 %161, 0
br i1 %162, label %163, label %166
163: ; preds = %130
%164 = load i32, i32* %49
%165 = add nsw i32 %164, 1
store i32 %165, i32* %49
br label %166
166: ; preds = %163, %130
%167 = load i8*, i8** %44
%168 = load i32, i32* %51
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds i8, i8* %167, i64 %169
%171 = load i8, i8* %170
%172 = sext i8 %171 to i32
%173 = icmp eq i32 %172, 0
br i1 %173, label %174, label %177
174: ; preds = %166
%175 = load i32, i32* %50
%176 = add nsw i32 %175, 1
store i32 %176, i32* %50
br label %177
177: ; preds = %174, %166
br label %178
178: ; preds = %177
%179 = load i32, i32* %51
%180 = add nsw i32 %179, 1
store i32 %180, i32* %51
br label %126
181: ; preds = %126
br label %182
182: ; preds = %181, %82
br label %79
183: ; preds = %79
%184 = load i32*, i32** %40
%185 = call i32 @fclose(i32* %184)
%186 = load i32*, i32** %41
%187 = call i32 @fclose(i32* %186)
%188 = load i32, i32* %55
%189 = load i32*, i32** %36
%190 = getelementptr inbounds i32, i32* %189, i64 0
store i32 %188, i32* %190
%191 = load i32, i32* %56
%192 = load i32*, i32** %36
%193 = getelementptr inbounds i32, i32* %192, i64 1
store i32 %191, i32* %193
%194 = load i32, i32* %49
%195 = load i32*, i32** %36
%196 = getelementptr inbounds i32, i32* %195, i64 2
store i32 %194, i32* %196
%197 = load i32, i32* %50
%198 = load i32*, i32** %36
%199 = getelementptr inbounds i32, i32* %198, i64 3
store i32 %197, i32* %199
%200 = load i32*, i32** %43
%201 = load i32, i32* %45
%202 = call i32 @free_ivector(i32* %200, i32 1, i32 %201)
%203 = load i8*, i8** %44
%204 = load i32, i32* %45
%205 = call i32 @free_cvector(i8* %203, i32 1, i32 %204)
%206 = load i32, i32* %48
store i32 %206, i32* %20
br label %207
207: ; preds = %183, %70, %61
%208 = load i32, i32* %20
ret i32 %208
}

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_v5(i8* %0, i8* %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i8* nocapture writeonly %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32** %10, i32** %11, i32 %12, i32 %13, i32 %14, i32* nocapture writeonly %15, i32 %16, i32 %17, i32 %18) {
%20 = alloca [5 x i32]
%21 = bitcast [5 x i32]* %20 to i8*
%22 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %26
24: ; preds = %19
%25 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %97
26: ; preds = %19
%27 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%28 = icmp eq i32* %27, null
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %97
31: ; preds = %26
%32 = tail call i32* @ivector(i32 1, i32 10000)
%33 = tail call i8* @cvector(i32 1, i32 10000)
%34 = getelementptr inbounds [5 x i32], [5 x i32]* %20, i64 0, i64 0
%35 = getelementptr inbounds [5 x i32], [5 x i32]* %20, i64 0, i64 1
%36 = getelementptr inbounds [5 x i32], [5 x i32]* %20, i64 0, i64 2
%37 = getelementptr inbounds [5 x i32], [5 x i32]* %20, i64 0, i64 3
%38 = getelementptr inbounds [5 x i32], [5 x i32]* %20, i64 0, i64 4
br label %39
39: ; preds = %31, %84
%40 = phi i32 [ 0, %31 ], [ %54, %84 ]
%41 = phi i32 [ 0, %31 ], [ %52, %84 ]
%42 = phi i32 [ 0, %31 ], [ %87, %84 ]
%43 = phi i32 [ 0, %31 ], [ %86, %84 ]
%44 = phi i32 [ 0, %31 ], [ %85, %84 ]
%45 = call i32 @read_line_wstrand_v4(i32* %22, i32* %27, i32* %34, i32* %32, i8* %33, i32 10000, i32 %5, i32 %7, i32 %8, i32 %9, i32** %10, i32** %11, i32 %6, i32 %12, i32 %13, i32 %14, i32 %16, i32 %17, i32 %18)
%46 = load i32, i32* %34
%47 = load i32, i32* %35
%48 = load i32, i32* %36
%49 = load i32, i32* %37
%50 = load i32, i32* %38
%51 = add i32 %49, %41
%52 = sub i32 %51, %50
%53 = sub i32 %40, %47
%54 = add i32 %53, %49
%55 = icmp slt i32 %47, 1
br i1 %55, label %84, label %56
56: ; preds = %39
%57 = sext i32 %42 to i64
%58 = add nuw i32 %47, 1
%59 = zext i32 %58 to i64
br label %60
60: ; preds = %56, %60
%61 = phi i64 [ 1, %56 ], [ %80, %60 ]
%62 = phi i64 [ %57, %56 ], [ %65, %60 ]
%63 = phi i32 [ %43, %56 ], [ %79, %60 ]
%64 = phi i32 [ %44, %56 ], [ %76, %60 ]
%65 = add nsw i64 %62, 1
%66 = getelementptr inbounds i32, i32* %2, i64 %65
store i32 %46, i32* %66
%67 = getelementptr inbounds i32, i32* %32, i64 %61
%68 = load i32, i32* %67
%69 = getelementptr inbounds i32, i32* %3, i64 %65
store i32 %68, i32* %69
%70 = getelementptr inbounds i8, i8* %33, i64 %61
%71 = load i8, i8* %70
%72 = getelementptr inbounds i8, i8* %4, i64 %65
store i8 %71, i8* %72
%73 = load i8, i8* %70
%74 = icmp sgt i8 %73, 0
%75 = zext i1 %74 to i32
%76 = add nsw i32 %64, %75
%77 = icmp eq i8 %73, 0
%78 = zext i1 %77 to i32
%79 = add nsw i32 %63, %78
%80 = add nuw nsw i64 %61, 1
%81 = icmp eq i64 %80, %59
br i1 %81, label %82, label %60
82: ; preds = %60
%83 = trunc i64 %65 to i32
br label %84
84: ; preds = %82, %39
%85 = phi i32 [ %44, %39 ], [ %76, %82 ]
%86 = phi i32 [ %43, %39 ], [ %79, %82 ]
%87 = phi i32 [ %42, %39 ], [ %83, %82 ]
%88 = icmp sgt i32 %48, -1
br i1 %88, label %39, label %89
89: ; preds = %84
%90 = call i32 @fclose(i32* %22)
%91 = call i32 @fclose(i32* %27)
store i32 %52, i32* %15
%92 = getelementptr inbounds i32, i32* %15, i64 1
store i32 %54, i32* %92
%93 = getelementptr inbounds i32, i32* %15, i64 2
store i32 %85, i32* %93
%94 = getelementptr inbounds i32, i32* %15, i64 3
store i32 %86, i32* %94
%95 = call i32 @free_ivector(i32* %32, i32 1, i32 10000)
%96 = call i32 @free_cvector(i8* %33, i32 1, i32 10000)
br label %97
97: ; preds = %89, %29, %24
%98 = phi i32 [ %87, %89 ], [ 0, %29 ], [ 0, %24 ]
ret i32 %98
}