#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 /*<<< orphan*/ free_vector(float *, int, int);
int *ivector(int, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ quicksorti(int, int *, float *);
int /*<<< orphan*/ read_header(int /*<<< orphan*/ *, int *, int *, int);
int /*<<< orphan*/ read_line(int /*<<< orphan*/ *, int *, int *, int, int, int);
float *vector(int, int);
int read_scan_file(char *filename, int *transcripts, int *positions,
                   int neg2pos, int sortpos) {
  FILE *input_file;
  int t[3];
  int *m_p;
  int max_occur = 10000;
  int curr_tr;
  int curr_n;
  int running_n = 0;
  int i;
  int togoon = 1;
  float *d;
  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);
  read_header(input_file, t, m_p, max_occur);
  curr_tr = t[0];
  curr_n = t[1];
  if (curr_n > 0) {
    if (neg2pos == 1) {
      for (i = 1; i <= curr_n; i++) {
        if (m_p[i] < 0)
          m_p[i] = -m_p[i];
      }
    }
    if (sortpos > 0) {
      d = vector(1, curr_n);
      quicksorti(curr_n, m_p, d);
      free_vector(d, 1, curr_n);
    }
  }
  for (i = 1; i <= curr_n; i++) {
    running_n++;
    transcripts[running_n] = curr_tr;
    positions[running_n] = m_p[i];
  }
  while (togoon >= 1) {
    read_line(input_file, t, m_p, max_occur, neg2pos, sortpos);
    curr_tr = t[0];
    curr_n = t[1];
    togoon = t[2];
    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>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8d,-0x28(%rbp)
movl   $0x2710,-0x4c(%rbp)
movl   $0x0,-0x58(%rbp)
movl   $0x1,-0x60(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe25(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    120a <read_scan_file+0x6a>
mov    -0x10(%rbp),%rsi
lea    0xe08(%rip),%rdi
call   1050 <printf@plt>
mov    -0x58(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    13e3 <read_scan_file+0x243>
mov    -0x4c(%rbp),%esi
mov    $0x1,%edi
call   10a0 <ivector@plt>
mov    %rax,-0x48(%rbp)
mov    -0x30(%rbp),%rdi
lea    -0x3c(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    -0x4c(%rbp),%ecx
call   10c0 <read_header@plt>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x54(%rbp)
cmpl   $0x0,-0x54(%rbp)
jle    12e5 <read_scan_file+0x145>
cmpl   $0x1,-0x24(%rbp)
jne    12a4 <read_scan_file+0x104>
movl   $0x1,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x54(%rbp),%eax
jg     129f <read_scan_file+0xff>
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jge    128c <read_scan_file+0xec>
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
xor    %edx,%edx
sub    (%rax,%rcx,4),%edx
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    1291 <read_scan_file+0xf1>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1256 <read_scan_file+0xb6>
jmp    12a4 <read_scan_file+0x104>
cmpl   $0x0,-0x28(%rbp)
jle    12e0 <read_scan_file+0x140>
mov    -0x54(%rbp),%esi
mov    $0x1,%edi
call   1070 <vector@plt>
mov    %rax,-0x68(%rbp)
mov    -0x54(%rbp),%edi
mov    -0x48(%rbp),%rsi
mov    -0x68(%rbp),%rdx
call   1030 <quicksorti@plt>
mov    -0x68(%rbp),%rdi
mov    -0x54(%rbp),%edx
mov    $0x1,%esi
call   1060 <free_vector@plt>
jmp    12e5 <read_scan_file+0x145>
movl   $0x1,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x54(%rbp),%eax
jg     1333 <read_scan_file+0x193>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
mov    -0x50(%rbp),%edx
mov    -0x18(%rbp),%rax
movslq -0x58(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x20(%rbp),%rax
movslq -0x58(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    12ec <read_scan_file+0x14c>
jmp    1338 <read_scan_file+0x198>
cmpl   $0x1,-0x60(%rbp)
jl     13c3 <read_scan_file+0x223>
mov    -0x30(%rbp),%rdi
lea    -0x3c(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    -0x4c(%rbp),%ecx
mov    -0x24(%rbp),%r8d
mov    -0x28(%rbp),%r9d
call   1090 <read_line@plt>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x60(%rbp)
movl   $0x1,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x54(%rbp),%eax
jg     13be <read_scan_file+0x21e>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
mov    -0x50(%rbp),%edx
mov    -0x18(%rbp),%rax
movslq -0x58(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x20(%rbp),%rax
movslq -0x58(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1377 <read_scan_file+0x1d7>
jmp    1338 <read_scan_file+0x198>
mov    -0x30(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x48(%rbp),%rdi
mov    -0x4c(%rbp),%edx
mov    $0x1,%esi
call   1080 <free_ivector@plt>
mov    -0x58(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_scan_file>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %r8d,0x30(%rsp)
mov    %ecx,%r15d
mov    %rdx,%r13
mov    %rsi,%r12
mov    %rdi,%rbx
lea    0xe3a(%rip),%rsi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1350 <read_scan_file+0x1b0>
mov    %rax,%rbp
mov    %r13,0x10(%rsp)
mov    $0x1,%edi
mov    $0x2710,%esi
call   10a0 <ivector@plt>
mov    %rax,%r13
lea    0x34(%rsp),%rsi
mov    %rbp,%rdi
mov    %rax,%rdx
mov    $0x2710,%ecx
call   10c0 <read_header@plt>
mov    0x38(%rsp),%r11d
xor    %r14d,%r14d
test   %r11d,%r11d
mov    %rbp,0x18(%rsp)
jle    1606 <read_scan_file+0x466>
mov    0x34(%rsp),%edi
cmp    $0x1,%r15d
jne    136c <read_scan_file+0x1cc>
mov    $0x1,%eax
cmp    $0x8,%r11
jb     13dc <read_scan_file+0x23c>
mov    %r11d,%ecx
and    $0xfffffff8,%ecx
lea    0x1(%rcx),%rax
xor    %edx,%edx
jmp    125d <read_scan_file+0xbd>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x8,%rdx
cmp    %rdx,%rcx
je     1367 <read_scan_file+0x1c7>
movdqu 0x4(%r13,%rdx,4),%xmm0
pxor   %xmm1,%xmm1
pcmpgtd %xmm0,%xmm1
movd   %xmm1,%esi
test   $0x1,%sil
je     1281 <read_scan_file+0xe1>
movd   %xmm0,%esi
neg    %esi
mov    %esi,0x4(%r13,%rdx,4)
pextrw $0x2,%xmm1,%esi
test   $0x1,%sil
je     129c <read_scan_file+0xfc>
pshufd $0x55,%xmm0,%xmm2
movd   %xmm2,%esi
neg    %esi
mov    %esi,0x8(%r13,%rdx,4)
pextrw $0x4,%xmm1,%esi
test   $0x1,%sil
je     12b7 <read_scan_file+0x117>
pshufd $0xee,%xmm0,%xmm2
movd   %xmm2,%esi
neg    %esi
mov    %esi,0xc(%r13,%rdx,4)
pextrw $0x6,%xmm1,%esi
test   $0x1,%sil
je     12d2 <read_scan_file+0x132>
pshufd $0xff,%xmm0,%xmm0
movd   %xmm0,%esi
neg    %esi
mov    %esi,0x10(%r13,%rdx,4)
movdqu 0x14(%r13,%rdx,4),%xmm0
pxor   %xmm1,%xmm1
pcmpgtd %xmm0,%xmm1
movd   %xmm1,%esi
test   $0x1,%sil
je     12f6 <read_scan_file+0x156>
movd   %xmm0,%esi
neg    %esi
mov    %esi,0x14(%r13,%rdx,4)
pextrw $0x2,%xmm1,%esi
test   $0x1,%sil
je     1311 <read_scan_file+0x171>
pshufd $0x55,%xmm0,%xmm2
movd   %xmm2,%esi
neg    %esi
mov    %esi,0x18(%r13,%rdx,4)
pextrw $0x4,%xmm1,%esi
test   $0x1,%sil
je     132c <read_scan_file+0x18c>
pshufd $0xee,%xmm0,%xmm2
movd   %xmm2,%esi
neg    %esi
mov    %esi,0x1c(%r13,%rdx,4)
pextrw $0x6,%xmm1,%esi
test   $0x1,%sil
je     1250 <read_scan_file+0xb0>
pshufd $0xff,%xmm0,%xmm0
movd   %xmm0,%esi
neg    %esi
mov    %esi,0x20(%r13,%rdx,4)
jmp    1250 <read_scan_file+0xb0>
lea    0xcab(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
xor    %r14d,%r14d
jmp    1938 <read_scan_file+0x798>
cmp    %rcx,%r11
jne    13dc <read_scan_file+0x23c>
mov    %edi,0x20(%rsp)
cmpl   $0x0,0x30(%rsp)
jle    13bc <read_scan_file+0x21c>
mov    $0x1,%edi
mov    %r11d,%esi
mov    %r11,0x8(%rsp)
call   1070 <vector@plt>
mov    %r15d,%ebx
mov    %rax,%r15
mov    0x8(%rsp),%rdi
mov    %r13,%rsi
mov    %rax,%rdx
call   1030 <quicksorti@plt>
mov    %r15,%rdi
mov    %ebx,%r15d
xor    %r14d,%r14d
mov    $0x1,%esi
mov    0x8(%rsp),%rdx
call   1060 <free_vector@plt>
mov    0x8(%rsp),%r11
test   %r11d,%r11d
jle    1606 <read_scan_file+0x466>
mov    $0x1,%r8d
cmp    $0x8,%r11d
jae    140f <read_scan_file+0x26f>
xor    %eax,%eax
mov    0x20(%rsp),%ebx
jmp    157b <read_scan_file+0x3db>
lea    0x1(%r11),%rcx
jmp    13fd <read_scan_file+0x25d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rax
cmp    %rax,%rcx
je     136c <read_scan_file+0x1cc>
mov    0x0(%r13,%rax,4),%edx
test   %edx,%edx
jns    13f0 <read_scan_file+0x250>
neg    %edx
mov    %edx,0x0(%r13,%rax,4)
jmp    13f0 <read_scan_file+0x250>
lea    0x4(%r12),%rax
lea    (%r12,%r11,4),%rcx
add    $0x4,%rcx
mov    0x10(%rsp),%rdx
lea    0x4(%rdx),%rsi
lea    (%rdx,%r11,4),%rbp
add    $0x4,%rbp
lea    0x4(%r13),%rdi
lea    0x4(,%r11,4),%rbx
add    %r13,%rbx
cmp    %rbp,%rax
setb   %r9b
cmp    %rcx,%rsi
setb   %r10b
cmp    %rbx,%rax
setb   %dl
cmp    %rcx,%rdi
setb   %cl
cmp    %rbx,%rsi
setb   %sil
cmp    %rbp,%rdi
setb   %dil
xor    %eax,%eax
test   %r10b,%r9b
jne    156b <read_scan_file+0x3cb>
and    %cl,%dl
mov    0x20(%rsp),%ebx
jne    1576 <read_scan_file+0x3d6>
and    %dil,%sil
mov    0x18(%rsp),%rbp
jne    157b <read_scan_file+0x3db>
mov    %r11d,%eax
and    $0xfffffff8,%eax
movd   %ebx,%xmm0
pshufd $0x0,%xmm0,%xmm0
lea    -0x8(%rax),%rdx
mov    %rdx,%rcx
shr    $0x3,%rcx
add    $0x1,%rcx
test   %rdx,%rdx
je     155f <read_scan_file+0x3bf>
mov    %rcx,%rsi
movabs $0x3ffffffffffffffe,%rdx
ff ff 3f
and    %rdx,%rsi
mov    $0x1,%edx
mov    0x10(%rsp),%rdi
nopw   0x0(%rax,%rax,1)
movdqu %xmm0,(%r12,%rdx,4)
movdqu %xmm0,0x10(%r12,%rdx,4)
movups 0x0(%r13,%rdx,4),%xmm1
movups 0x10(%r13,%rdx,4),%xmm2
movups %xmm1,(%rdi,%rdx,4)
movups %xmm2,0x10(%rdi,%rdx,4)
movdqu %xmm0,0x20(%r12,%rdx,4)
movdqu %xmm0,0x30(%r12,%rdx,4)
movdqu 0x20(%r13,%rdx,4),%xmm1
movdqu 0x30(%r13,%rdx,4),%xmm2
movdqu %xmm1,0x20(%rdi,%rdx,4)
movdqu %xmm2,0x30(%rdi,%rdx,4)
add    $0x10,%rdx
add    $0xfffffffffffffffe,%rsi
jne    14d0 <read_scan_file+0x330>
test   $0x1,%cl
je     1554 <read_scan_file+0x3b4>
movdqu %xmm0,(%r12,%rdx,4)
movdqu %xmm0,0x10(%r12,%rdx,4)
movdqu 0x0(%r13,%rdx,4),%xmm0
movdqu 0x10(%r13,%rdx,4),%xmm1
mov    0x10(%rsp),%rcx
movdqu %xmm0,(%rcx,%rdx,4)
movdqu %xmm1,0x10(%rcx,%rdx,4)
cmp    %r11,%rax
je     15a5 <read_scan_file+0x405>
lea    0x1(%rax),%r8
jmp    157b <read_scan_file+0x3db>
mov    $0x1,%edx
test   $0x1,%cl
jne    1529 <read_scan_file+0x389>
jmp    1554 <read_scan_file+0x3b4>
mov    0x18(%rsp),%rbp
mov    0x20(%rsp),%ebx
jmp    157b <read_scan_file+0x3db>
mov    0x18(%rsp),%rbp
mov    %rax,%rdx
not    %rdx
test   $0x1,%r11b
je     15a0 <read_scan_file+0x400>
or     $0x1,%rax
mov    %ebx,(%r12,%rax,4)
mov    0x0(%r13,%r8,4),%ecx
mov    0x10(%rsp),%rsi
mov    %ecx,(%rsi,%rax,4)
add    $0x1,%r8
add    %r11,%rdx
jne    15aa <read_scan_file+0x40a>
mov    %r11d,%r14d
jmp    1606 <read_scan_file+0x466>
mov    %r11,%rdx
sub    %rax,%rdx
mov    0x10(%rsp),%rcx
lea    (%rcx,%rax,4),%rsi
add    $0x8,%rsi
lea    (%r12,%rax,4),%rax
add    $0x8,%rax
lea    0x4(,%r8,4),%rcx
add    %r13,%rcx
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,-0x4(%rax,%rdi,4)
mov    -0x4(%rcx,%rdi,4),%ebp
mov    %ebp,-0x4(%rsi,%rdi,4)
mov    %ebx,(%rax,%rdi,4)
mov    (%rcx,%rdi,4),%ebp
mov    %ebp,(%rsi,%rdi,4)
add    $0x2,%rdi
cmp    %rdi,%rdx
jne    15e0 <read_scan_file+0x440>
mov    %r11d,%r14d
mov    0x18(%rsp),%rbp
lea    0x4(%r12),%rax
mov    %rax,0x70(%rsp)
mov    0x10(%rsp),%rax
lea    0x4(%rax),%rcx
mov    %rcx,0x68(%rsp)
lea    0x4(%r13),%rcx
mov    %rcx,0x40(%rsp)
lea    0x34(%rax),%rcx
mov    %rcx,0x50(%rsp)
lea    0x34(%r12),%rcx
mov    %rcx,0x48(%rsp)
add    $0x8,%rax
mov    %rax,0x60(%rsp)
lea    0x8(%r12),%rax
mov    %rax,0x58(%rsp)
mov    %r12,0x20(%rsp)
mov    %r15d,0x2c(%rsp)
jmp    166b <read_scan_file+0x4cb>
nopl   0x0(%rax)
cmpl   $0x0,0x3c(%rsp)
jle    191e <read_scan_file+0x77e>
mov    %rbp,%rdi
lea    0x34(%rsp),%rsi
mov    %r13,%rdx
mov    $0x2710,%ecx
mov    %r15d,%r8d
mov    0x30(%rsp),%r9d
call   1090 <read_line@plt>
mov    0x38(%rsp),%r9d
test   %r9d,%r9d
jle    1660 <read_scan_file+0x4c0>
mov    0x34(%rsp),%eax
movslq %r14d,%r14
lea    0x1(%r9),%rcx
mov    $0x1,%edx
cmp    $0x8,%r9
jae    16e0 <read_scan_file+0x540>
test   $0x1,%cl
jne    1821 <read_scan_file+0x681>
mov    %eax,0x4(%r12,%r14,4)
mov    0x0(%r13,%rdx,4),%esi
mov    0x10(%rsp),%rdi
mov    %esi,0x4(%rdi,%r14,4)
add    $0x1,%r14
lea    0x1(%rdx),%rsi
mov    0x20(%rsp),%r12
jmp    1824 <read_scan_file+0x684>
nopw   0x0(%rax,%rax,1)
mov    0x70(%rsp),%rsi
lea    (%rsi,%r14,4),%rsi
lea    (%r14,%rcx,1),%rdi
lea    (%r12,%rdi,4),%rbp
mov    %r14,0x8(%rsp)
mov    0x68(%rsp),%rbx
lea    (%rbx,%r14,4),%r14
mov    0x10(%rsp),%rbx
lea    (%rbx,%rdi,4),%r8
lea    0x0(,%rcx,4),%rdi
add    %r13,%rdi
cmp    %r8,%rsi
setb   %r15b
cmp    %rbp,%r14
setb   %r12b
cmp    %rdi,%rsi
setb   %r10b
mov    0x40(%rsp),%rbx
cmp    %rbp,%rbx
setb   %r11b
cmp    %rdi,%r14
setb   %sil
cmp    %r8,%rbx
setb   %r8b
test   %r12b,%r15b
jne    18fc <read_scan_file+0x75c>
and    %r11b,%r10b
mov    0x2c(%rsp),%r15d
mov    0x20(%rsp),%r12
mov    0x18(%rsp),%rbp
jne    1813 <read_scan_file+0x673>
and    %r8b,%sil
jne    1813 <read_scan_file+0x673>
mov    %r9d,%edx
and    $0xfffffff8,%edx
movd   %eax,%xmm0
pshufd $0x0,%xmm0,%xmm0
lea    -0x8(%rdx),%rsi
mov    %rsi,%r8
shr    $0x3,%r8
add    $0x1,%r8
test   %rsi,%rsi
mov    0x8(%rsp),%rbx
je     188f <read_scan_file+0x6ef>
mov    %r8,%rdi
movabs $0x3ffffffffffffffe,%rsi
ff ff 3f
and    %rsi,%rdi
mov    0x50(%rsp),%rsi
lea    (%rsi,%rbx,4),%rbp
mov    0x48(%rsp),%rsi
lea    (%rsi,%rbx,4),%rsi
xor    %ebx,%ebx
nopl   0x0(%rax)
movdqu %xmm0,-0x30(%rsi,%rbx,4)
movdqu %xmm0,-0x20(%rsi,%rbx,4)
movups 0x4(%r13,%rbx,4),%xmm1
movups 0x14(%r13,%rbx,4),%xmm2
movups %xmm1,-0x30(%rbp,%rbx,4)
movups %xmm2,-0x20(%rbp,%rbx,4)
movdqu %xmm0,-0x10(%rsi,%rbx,4)
movdqu %xmm0,(%rsi,%rbx,4)
movdqu 0x24(%r13,%rbx,4),%xmm1
movdqu 0x34(%r13,%rbx,4),%xmm2
movdqu %xmm1,-0x10(%rbp,%rbx,4)
movdqu %xmm2,0x0(%rbp,%rbx,4)
add    $0x10,%rbx
add    $0xfffffffffffffffe,%rdi
jne    17c0 <read_scan_file+0x620>
jmp    1891 <read_scan_file+0x6f1>
mov    0x8(%rsp),%r14
test   $0x1,%cl
je     16b1 <read_scan_file+0x511>
mov    %rdx,%rsi
not    %rdx
add    %rcx,%rdx
je     1660 <read_scan_file+0x4c0>
mov    0x60(%rsp),%rdx
lea    (%rdx,%r14,4),%rdx
mov    %r14,%r8
mov    0x58(%rsp),%rdi
lea    (%rdi,%r14,4),%rdi
sub    %rsi,%rcx
mov    0x40(%rsp),%rbp
lea    0x0(%rbp,%rsi,4),%rbp
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %eax,-0x4(%rdi,%rsi,4)
mov    -0x4(%rbp,%rsi,4),%ebx
mov    %ebx,-0x4(%rdx,%rsi,4)
mov    %eax,(%rdi,%rsi,4)
mov    0x0(%rbp,%rsi,4),%ebx
mov    %ebx,(%rdx,%rsi,4)
add    $0x2,%rsi
cmp    %rsi,%rcx
jne    1860 <read_scan_file+0x6c0>
mov    %r8,%r14
add    %rsi,%r14
mov    0x18(%rsp),%rbp
jmp    1660 <read_scan_file+0x4c0>
xor    %ebx,%ebx
test   $0x1,%r8b
mov    0x18(%rsp),%rbp
je     18d9 <read_scan_file+0x739>
mov    0x8(%rsp),%rsi
add    %rbx,%rsi
shl    $0x2,%rbx
movdqu %xmm0,0x4(%r12,%rsi,4)
movdqu %xmm0,0x14(%r12,%rsi,4)
or     $0x4,%rbx
movdqu 0x0(%r13,%rbx,1),%xmm0
movdqu 0x10(%r13,%rbx,1),%xmm1
mov    0x10(%rsp),%rdi
movdqu %xmm0,0x4(%rdi,%rsi,4)
movdqu %xmm1,0x14(%rdi,%rsi,4)
mov    0x8(%rsp),%r14
add    %rdx,%r14
cmp    %rdx,%r9
je     1660 <read_scan_file+0x4c0>
or     $0x1,%rdx
test   $0x1,%cl
je     16b1 <read_scan_file+0x511>
jmp    1821 <read_scan_file+0x681>
mov    0x2c(%rsp),%r15d
mov    0x20(%rsp),%r12
mov    0x18(%rsp),%rbp
mov    0x8(%rsp),%r14
test   $0x1,%cl
jne    1821 <read_scan_file+0x681>
jmp    16b1 <read_scan_file+0x511>
mov    %rbp,%rdi
call   1040 <fclose@plt>
mov    %r13,%rdi
mov    $0x1,%esi
mov    $0x2710,%edx
call   1080 <free_ivector@plt>
mov    %r14d,%eax
add    $0x78,%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(i8* %0, i32* %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca [3 x i32]
%14 = alloca i32*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca float*
store i8* %0, i8** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 10000, i32* %15
store i32 0, i32* %18
store i32 1, i32* %20
%22 = load i8*, i8** %7
%23 = call i32* @fopen(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %23, i32** %12
%24 = load i32*, i32** %12
%25 = icmp ne i32* %24, null
br i1 %25, label %30, label %26
26: ; preds = %5
%27 = load i8*, i8** %7
%28 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %27)
%29 = load i32, i32* %18
store i32 %29, i32* %6
br label %164
30: ; preds = %5
%31 = load i32, i32* %15
%32 = call i32* @ivector(i32 1, i32 %31)
store i32* %32, i32** %14
%33 = load i32*, i32** %12
%34 = getelementptr inbounds [3 x i32], [3 x i32]* %13, i64 0, i64 0
%35 = load i32*, i32** %14
%36 = load i32, i32* %15
%37 = call i32 @read_header(i32* %33, i32* %34, i32* %35, i32 %36)
%38 = getelementptr inbounds [3 x i32], [3 x i32]* %13, i64 0, i64 0
%39 = load i32, i32* %38
store i32 %39, i32* %16
%40 = getelementptr inbounds [3 x i32], [3 x i32]* %13, i64 0, i64 1
%41 = load i32, i32* %40
store i32 %41, i32* %17
%42 = load i32, i32* %17
%43 = icmp sgt i32 %42, 0
br i1 %43, label %44, label %89
44: ; preds = %30
%45 = load i32, i32* %10
%46 = icmp eq i32 %45, 1
br i1 %46, label %47, label %75
47: ; preds = %44
store i32 1, i32* %19
br label %48
48: ; preds = %71, %47
%49 = load i32, i32* %19
%50 = load i32, i32* %17
%51 = icmp sle i32 %49, %50
br i1 %51, label %52, label %74
52: ; preds = %48
%53 = load i32*, i32** %14
%54 = load i32, i32* %19
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i32, i32* %53, i64 %55
%57 = load i32, i32* %56
%58 = icmp slt i32 %57, 0
br i1 %58, label %59, label %70
59: ; preds = %52
%60 = load i32*, i32** %14
%61 = load i32, i32* %19
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i32, i32* %60, i64 %62
%64 = load i32, i32* %63
%65 = sub nsw i32 0, %64
%66 = load i32*, i32** %14
%67 = load i32, i32* %19
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i32, i32* %66, i64 %68
store i32 %65, i32* %69
br label %70
70: ; preds = %59, %52
br label %71
71: ; preds = %70
%72 = load i32, i32* %19
%73 = add nsw i32 %72, 1
store i32 %73, i32* %19
br label %48
74: ; preds = %48
br label %75
75: ; preds = %74, %44
%76 = load i32, i32* %11
%77 = icmp sgt i32 %76, 0
br i1 %77, label %78, label %88
78: ; preds = %75
%79 = load i32, i32* %17
%80 = call float* @vector(i32 1, i32 %79)
store float* %80, float** %21
%81 = load i32, i32* %17
%82 = load i32*, i32** %14
%83 = load float*, float** %21
%84 = call i32 @quicksorti(i32 %81, i32* %82, float* %83)
%85 = load float*, float** %21
%86 = load i32, i32* %17
%87 = call i32 @free_vector(float* %85, i32 1, i32 %86)
br label %88
88: ; preds = %78, %75
br label %89
89: ; preds = %88, %30
store i32 1, i32* %19
br label %90
90: ; preds = %111, %89
%91 = load i32, i32* %19
%92 = load i32, i32* %17
%93 = icmp sle i32 %91, %92
br i1 %93, label %94, label %114
94: ; preds = %90
%95 = load i32, i32* %18
%96 = add nsw i32 %95, 1
store i32 %96, i32* %18
%97 = load i32, i32* %16
%98 = load i32*, i32** %8
%99 = load i32, i32* %18
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds i32, i32* %98, i64 %100
store i32 %97, i32* %101
%102 = load i32*, i32** %14
%103 = load i32, i32* %19
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds i32, i32* %102, i64 %104
%106 = load i32, i32* %105
%107 = load i32*, i32** %9
%108 = load i32, i32* %18
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i32, i32* %107, i64 %109
store i32 %106, i32* %110
br label %111
111: ; preds = %94
%112 = load i32, i32* %19
%113 = add nsw i32 %112, 1
store i32 %113, i32* %19
br label %90
114: ; preds = %90
br label %115
115: ; preds = %156, %114
%116 = load i32, i32* %20
%117 = icmp sge i32 %116, 1
br i1 %117, label %118, label %157
118: ; preds = %115
%119 = load i32*, i32** %12
%120 = getelementptr inbounds [3 x i32], [3 x i32]* %13, i64 0, i64 0
%121 = load i32*, i32** %14
%122 = load i32, i32* %15
%123 = load i32, i32* %10
%124 = load i32, i32* %11
%125 = call i32 @read_line(i32* %119, i32* %120, i32* %121, i32 %122, i32 %123, i32 %124)
%126 = getelementptr inbounds [3 x i32], [3 x i32]* %13, i64 0, i64 0
%127 = load i32, i32* %126
store i32 %127, i32* %16
%128 = getelementptr inbounds [3 x i32], [3 x i32]* %13, i64 0, i64 1
%129 = load i32, i32* %128
store i32 %129, i32* %17
%130 = getelementptr inbounds [3 x i32], [3 x i32]* %13, i64 0, i64 2
%131 = load i32, i32* %130
store i32 %131, i32* %20
store i32 1, i32* %19
br label %132
132: ; preds = %153, %118
%133 = load i32, i32* %19
%134 = load i32, i32* %17
%135 = icmp sle i32 %133, %134
br i1 %135, label %136, label %156
136: ; preds = %132
%137 = load i32, i32* %18
%138 = add nsw i32 %137, 1
store i32 %138, i32* %18
%139 = load i32, i32* %16
%140 = load i32*, i32** %8
%141 = load i32, i32* %18
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds i32, i32* %140, i64 %142
store i32 %139, i32* %143
%144 = load i32*, i32** %14
%145 = load i32, i32* %19
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds i32, i32* %144, i64 %146
%148 = load i32, i32* %147
%149 = load i32*, i32** %9
%150 = load i32, i32* %18
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds i32, i32* %149, i64 %151
store i32 %148, i32* %152
br label %153
153: ; preds = %136
%154 = load i32, i32* %19
%155 = add nsw i32 %154, 1
store i32 %155, i32* %19
br label %132
156: ; preds = %132
br label %115
157: ; preds = %115
%158 = load i32*, i32** %12
%159 = call i32 @fclose(i32* %158)
%160 = load i32*, i32** %14
%161 = load i32, i32* %15
%162 = call i32 @free_ivector(i32* %160, i32 1, i32 %161)
%163 = load i32, i32* %18
store i32 %163, i32* %6
br label %164
164: ; preds = %157, %26
%165 = load i32, i32* %6
ret i32 %165
}

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(i8* %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32 %3, i32 %4) {
%6 = alloca [3 x i32]
%7 = bitcast [3 x i32]* %6 to i8*
%8 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %410
12: ; preds = %5
%13 = tail call i32* @ivector(i32 1, i32 10000)
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%15 = call i32 @read_header(i32* %8, i32* %14, i32* %13, i32 10000)
%16 = load i32, i32* %14
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 1
%18 = load i32, i32* %17
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %234
20: ; preds = %12
%21 = icmp eq i32 %3, 1
br i1 %21, label %22, label %112
22: ; preds = %20
%23 = add nuw i32 %18, 1
%24 = zext i32 %23 to i64
%25 = add nsw i64 %24, -1
%26 = icmp ult i64 %25, 8
br i1 %26, label %100, label %27
27: ; preds = %22
%28 = and i64 %25, -8
%29 = or i64 %28, 1
br label %30
30: ; preds = %95, %27
%31 = phi i64 [ 0, %27 ], [ %96, %95 ]
%32 = or i64 %31, 1
%33 = or i64 %31, 5
%34 = getelementptr inbounds i32, i32* %13, i64 %32
%35 = bitcast i32* %34 to <4 x i32>*
%36 = load <4 x i32>, <4 x i32>* %35
%37 = getelementptr inbounds i32, i32* %34, i64 4
%38 = bitcast i32* %37 to <4 x i32>*
%39 = load <4 x i32>, <4 x i32>* %38
%40 = icmp slt <4 x i32> %36, zeroinitializer
%41 = icmp slt <4 x i32> %39, zeroinitializer
%42 = extractelement <4 x i1> %40, i64 0
br i1 %42, label %43, label %47
43: ; preds = %30
%44 = extractelement <4 x i32> %36, i64 0
%45 = sub nsw i32 0, %44
%46 = getelementptr inbounds i32, i32* %13, i64 %32
store i32 %45, i32* %46
br label %47
47: ; preds = %43, %30
%48 = extractelement <4 x i1> %40, i64 1
br i1 %48, label %49, label %54
49: ; preds = %47
%50 = or i64 %31, 2
%51 = extractelement <4 x i32> %36, i64 1
%52 = sub nsw i32 0, %51
%53 = getelementptr inbounds i32, i32* %13, i64 %50
store i32 %52, i32* %53
br label %54
54: ; preds = %49, %47
%55 = extractelement <4 x i1> %40, i64 2
br i1 %55, label %56, label %61
56: ; preds = %54
%57 = or i64 %31, 3
%58 = extractelement <4 x i32> %36, i64 2
%59 = sub nsw i32 0, %58
%60 = getelementptr inbounds i32, i32* %13, i64 %57
store i32 %59, i32* %60
br label %61
61: ; preds = %56, %54
%62 = extractelement <4 x i1> %40, i64 3
br i1 %62, label %63, label %68
63: ; preds = %61
%64 = or i64 %31, 4
%65 = extractelement <4 x i32> %36, i64 3
%66 = sub nsw i32 0, %65
%67 = getelementptr inbounds i32, i32* %13, i64 %64
store i32 %66, i32* %67
br label %68
68: ; preds = %63, %61
%69 = extractelement <4 x i1> %41, i64 0
br i1 %69, label %70, label %74
70: ; preds = %68
%71 = extractelement <4 x i32> %39, i64 0
%72 = sub nsw i32 0, %71
%73 = getelementptr inbounds i32, i32* %13, i64 %33
store i32 %72, i32* %73
br label %74
74: ; preds = %70, %68
%75 = extractelement <4 x i1> %41, i64 1
br i1 %75, label %76, label %81
76: ; preds = %74
%77 = or i64 %31, 6
%78 = extractelement <4 x i32> %39, i64 1
%79 = sub nsw i32 0, %78
%80 = getelementptr inbounds i32, i32* %13, i64 %77
store i32 %79, i32* %80
br label %81
81: ; preds = %76, %74
%82 = extractelement <4 x i1> %41, i64 2
br i1 %82, label %83, label %88
83: ; preds = %81
%84 = or i64 %31, 7
%85 = extractelement <4 x i32> %39, i64 2
%86 = sub nsw i32 0, %85
%87 = getelementptr inbounds i32, i32* %13, i64 %84
store i32 %86, i32* %87
br label %88
88: ; preds = %83, %81
%89 = extractelement <4 x i1> %41, i64 3
br i1 %89, label %90, label %95
90: ; preds = %88
%91 = add i64 %31, 8
%92 = extractelement <4 x i32> %39, i64 3
%93 = sub nsw i32 0, %92
%94 = getelementptr inbounds i32, i32* %13, i64 %91
store i32 %93, i32* %94
br label %95
95: ; preds = %90, %88
%96 = add nuw i64 %31, 8
%97 = icmp eq i64 %96, %28
br i1 %97, label %98, label %30
98: ; preds = %95
%99 = icmp eq i64 %25, %28
br i1 %99, label %112, label %100
100: ; preds = %22, %98
%101 = phi i64 [ 1, %22 ], [ %29, %98 ]
br label %102
102: ; preds = %100, %109
%103 = phi i64 [ %110, %109 ], [ %101, %100 ]
%104 = getelementptr inbounds i32, i32* %13, i64 %103
%105 = load i32, i32* %104
%106 = icmp slt i32 %105, 0
br i1 %106, label %107, label %109
107: ; preds = %102
%108 = sub nsw i32 0, %105
store i32 %108, i32* %104
br label %109
109: ; preds = %102, %107
%110 = add nuw nsw i64 %103, 1
%111 = icmp eq i64 %110, %24
br i1 %111, label %112, label %102
112: ; preds = %109, %98, %20
%113 = icmp sgt i32 %4, 0
br i1 %113, label %114, label %118
114: ; preds = %112
%115 = call float* @vector(i32 1, i32 %18)
%116 = call i32 @quicksorti(i32 %18, i32* %13, float* %115)
%117 = call i32 @free_vector(float* %115, i32 1, i32 %18)
br label %118
118: ; preds = %112, %114
%119 = icmp slt i32 %18, 1
br i1 %119, label %234, label %120
120: ; preds = %118
%121 = zext i32 %18 to i64
%122 = icmp ult i32 %18, 8
br i1 %122, label %216, label %123
123: ; preds = %120
%124 = getelementptr i32, i32* %1, i64 1
%125 = add nuw nsw i64 %121, 1
%126 = getelementptr i32, i32* %1, i64 %125
%127 = getelementptr i32, i32* %2, i64 1
%128 = getelementptr i32, i32* %2, i64 %125
%129 = getelementptr i32, i32* %13, i64 1
%130 = getelementptr i32, i32* %13, i64 %125
%131 = icmp ult i32* %124, %128
%132 = icmp ult i32* %127, %126
%133 = and i1 %131, %132
%134 = icmp ult i32* %124, %130
%135 = icmp ult i32* %129, %126
%136 = and i1 %134, %135
%137 = or i1 %133, %136
%138 = icmp ult i32* %127, %130
%139 = icmp ult i32* %129, %128
%140 = and i1 %138, %139
%141 = or i1 %137, %140
br i1 %141, label %216, label %142
142: ; preds = %123
%143 = and i64 %121, 4294967288
%144 = or i64 %143, 1
%145 = insertelement <4 x i32> poison, i32 %16, i64 0
%146 = shufflevector <4 x i32> %145, <4 x i32> poison, <4 x i32> zeroinitializer
%147 = insertelement <4 x i32> poison, i32 %16, i64 0
%148 = shufflevector <4 x i32> %147, <4 x i32> poison, <4 x i32> zeroinitializer
%149 = add nsw i64 %143, -8
%150 = lshr exact i64 %149, 3
%151 = add nuw nsw i64 %150, 1
%152 = and i64 %151, 1
%153 = icmp eq i64 %149, 0
br i1 %153, label %196, label %154
154: ; preds = %142
%155 = and i64 %151, 4611686018427387902
br label %156
156: ; preds = %156, %154
%157 = phi i64 [ 0, %154 ], [ %191, %156 ]
%158 = phi i64 [ 0, %154 ], [ %192, %156 ]
%159 = or i64 %157, 1
%160 = or i64 %157, 1
%161 = getelementptr inbounds i32, i32* %1, i64 %160
%162 = bitcast i32* %161 to <4 x i32>*
store <4 x i32> %146, <4 x i32>* %162
%163 = getelementptr inbounds i32, i32* %161, i64 4
%164 = bitcast i32* %163 to <4 x i32>*
store <4 x i32> %148, <4 x i32>* %164
%165 = getelementptr inbounds i32, i32* %13, i64 %159
%166 = bitcast i32* %165 to <4 x i32>*
%167 = load <4 x i32>, <4 x i32>* %166
%168 = getelementptr inbounds i32, i32* %165, i64 4
%169 = bitcast i32* %168 to <4 x i32>*
%170 = load <4 x i32>, <4 x i32>* %169
%171 = getelementptr inbounds i32, i32* %2, i64 %160
%172 = bitcast i32* %171 to <4 x i32>*
store <4 x i32> %167, <4 x i32>* %172
%173 = getelementptr inbounds i32, i32* %171, i64 4
%174 = bitcast i32* %173 to <4 x i32>*
store <4 x i32> %170, <4 x i32>* %174
%175 = or i64 %157, 9
%176 = or i64 %157, 9
%177 = getelementptr inbounds i32, i32* %1, i64 %176
%178 = bitcast i32* %177 to <4 x i32>*
store <4 x i32> %146, <4 x i32>* %178
%179 = getelementptr inbounds i32, i32* %177, i64 4
%180 = bitcast i32* %179 to <4 x i32>*
store <4 x i32> %148, <4 x i32>* %180
%181 = getelementptr inbounds i32, i32* %13, i64 %175
%182 = bitcast i32* %181 to <4 x i32>*
%183 = load <4 x i32>, <4 x i32>* %182
%184 = getelementptr inbounds i32, i32* %181, i64 4
%185 = bitcast i32* %184 to <4 x i32>*
%186 = load <4 x i32>, <4 x i32>* %185
%187 = getelementptr inbounds i32, i32* %2, i64 %176
%188 = bitcast i32* %187 to <4 x i32>*
store <4 x i32> %183, <4 x i32>* %188
%189 = getelementptr inbounds i32, i32* %187, i64 4
%190 = bitcast i32* %189 to <4 x i32>*
store <4 x i32> %186, <4 x i32>* %190
%191 = add nuw i64 %157, 16
%192 = add i64 %158, 2
%193 = icmp eq i64 %192, %155
br i1 %193, label %194, label %156
194: ; preds = %156
%195 = or i64 %191, 1
br label %196
196: ; preds = %194, %142
%197 = phi i64 [ 1, %142 ], [ %195, %194 ]
%198 = icmp eq i64 %152, 0
br i1 %198, label %214, label %199
199: ; preds = %196
%200 = getelementptr inbounds i32, i32* %1, i64 %197
%201 = bitcast i32* %200 to <4 x i32>*
store <4 x i32> %146, <4 x i32>* %201
%202 = getelementptr inbounds i32, i32* %200, i64 4
%203 = bitcast i32* %202 to <4 x i32>*
store <4 x i32> %148, <4 x i32>* %203
%204 = getelementptr inbounds i32, i32* %13, i64 %197
%205 = bitcast i32* %204 to <4 x i32>*
%206 = load <4 x i32>, <4 x i32>* %205
%207 = getelementptr inbounds i32, i32* %204, i64 4
%208 = bitcast i32* %207 to <4 x i32>*
%209 = load <4 x i32>, <4 x i32>* %208
%210 = getelementptr inbounds i32, i32* %2, i64 %197
%211 = bitcast i32* %210 to <4 x i32>*
store <4 x i32> %206, <4 x i32>* %211
%212 = getelementptr inbounds i32, i32* %210, i64 4
%213 = bitcast i32* %212 to <4 x i32>*
store <4 x i32> %209, <4 x i32>* %213
br label %214
214: ; preds = %196, %199
%215 = icmp eq i64 %143, %121
br i1 %215, label %234, label %216
216: ; preds = %123, %120, %214
%217 = phi i64 [ 0, %123 ], [ 0, %120 ], [ %143, %214 ]
%218 = phi i64 [ 1, %123 ], [ 1, %120 ], [ %144, %214 ]
%219 = xor i64 %217, -1
%220 = and i64 %121, 1
%221 = icmp eq i64 %220, 0
br i1 %221, label %229, label %222
222: ; preds = %216
%223 = or i64 %217, 1
%224 = getelementptr inbounds i32, i32* %1, i64 %223
store i32 %16, i32* %224
%225 = getelementptr inbounds i32, i32* %13, i64 %218
%226 = load i32, i32* %225
%227 = getelementptr inbounds i32, i32* %2, i64 %223
store i32 %226, i32* %227
%228 = add nuw nsw i64 %218, 1
br label %229
229: ; preds = %222, %216
%230 = phi i64 [ %217, %216 ], [ %223, %222 ]
%231 = phi i64 [ %218, %216 ], [ %228, %222 ]
%232 = sub nsw i64 0, %121
%233 = icmp eq i64 %219, %232
br i1 %233, label %234, label %240
234: ; preds = %229, %240, %214, %12, %118
%235 = phi i32 [ 0, %118 ], [ 0, %12 ], [ %18, %214 ], [ %18, %240 ], [ %18, %229 ]
%236 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 2
%237 = getelementptr i32, i32* %1, i64 1
%238 = getelementptr i32, i32* %2, i64 1
%239 = getelementptr i32, i32* %13, i64 1
br label %262
240: ; preds = %229, %240
%241 = phi i64 [ %249, %240 ], [ %230, %229 ]
%242 = phi i64 [ %254, %240 ], [ %231, %229 ]
%243 = add nuw nsw i64 %241, 1
%244 = getelementptr inbounds i32, i32* %1, i64 %243
store i32 %16, i32* %244
%245 = getelementptr inbounds i32, i32* %13, i64 %242
%246 = load i32, i32* %245
%247 = getelementptr inbounds i32, i32* %2, i64 %243
store i32 %246, i32* %247
%248 = add nuw nsw i64 %242, 1
%249 = add nuw nsw i64 %241, 2
%250 = getelementptr inbounds i32, i32* %1, i64 %249
store i32 %16, i32* %250
%251 = getelementptr inbounds i32, i32* %13, i64 %248
%252 = load i32, i32* %251
%253 = getelementptr inbounds i32, i32* %2, i64 %249
store i32 %252, i32* %253
%254 = add nuw nsw i64 %242, 2
%255 = icmp eq i64 %249, %121
br i1 %255, label %234, label %240
256: ; preds = %385, %391, %370
%257 = phi i64 [ %295, %370 ], [ %386, %385 ], [ %400, %391 ]
%258 = trunc i64 %257 to i32
br label %259
259: ; preds = %256, %262
%260 = phi i32 [ %263, %262 ], [ %258, %256 ]
%261 = icmp sgt i32 %267, 0
br i1 %261, label %262, label %407
262: ; preds = %234, %259
%263 = phi i32 [ %235, %234 ], [ %260, %259 ]
%264 = call i32 @read_line(i32* %8, i32* %14, i32* %13, i32 10000, i32 %3, i32 %4)
%265 = load i32, i32* %14
%266 = load i32, i32* %17
%267 = load i32, i32* %236
%268 = icmp slt i32 %266, 1
br i1 %268, label %259, label %269
269: ; preds = %262
%270 = sext i32 %263 to i64
%271 = add nuw i32 %266, 1
%272 = zext i32 %271 to i64
%273 = add nsw i64 %272, -1
%274 = icmp ult i64 %273, 8
br i1 %274, label %372, label %275
275: ; preds = %269
%276 = getelementptr i32, i32* %237, i64 %270
%277 = add nsw i64 %270, %272
%278 = getelementptr i32, i32* %1, i64 %277
%279 = getelementptr i32, i32* %238, i64 %270
%280 = getelementptr i32, i32* %2, i64 %277
%281 = getelementptr i32, i32* %13, i64 %272
%282 = icmp ult i32* %276, %280
%283 = icmp ult i32* %279, %278
%284 = and i1 %282, %283
%285 = icmp ult i32* %276, %281
%286 = icmp ult i32* %239, %278
%287 = and i1 %285, %286
%288 = or i1 %284, %287
%289 = icmp ult i32* %279, %281
%290 = icmp ult i32* %239, %280
%291 = and i1 %289, %290
%292 = or i1 %288, %291
br i1 %292, label %372, label %293
293: ; preds = %275
%294 = and i64 %273, -8
%295 = add nsw i64 %294, %270
%296 = or i64 %294, 1
%297 = insertelement <4 x i32> poison, i32 %265, i64 0
%298 = shufflevector <4 x i32> %297, <4 x i32> poison, <4 x i32> zeroinitializer
%299 = insertelement <4 x i32> poison, i32 %265, i64 0
%300 = shufflevector <4 x i32> %299, <4 x i32> poison, <4 x i32> zeroinitializer
%301 = add nsw i64 %294, -8
%302 = lshr exact i64 %301, 3
%303 = add nuw nsw i64 %302, 1
%304 = and i64 %303, 1
%305 = icmp eq i64 %301, 0
br i1 %305, label %349, label %306
306: ; preds = %293
%307 = and i64 %303, 4611686018427387902
br label %308
308: ; preds = %308, %306
%309 = phi i64 [ 0, %306 ], [ %346, %308 ]
%310 = phi i64 [ 0, %306 ], [ %347, %308 ]
%311 = add i64 %309, %270
%312 = or i64 %309, 1
%313 = add nsw i64 %311, 1
%314 = getelementptr inbounds i32, i32* %1, i64 %313
%315 = bitcast i32* %314 to <4 x i32>*
store <4 x i32> %298, <4 x i32>* %315
%316 = getelementptr inbounds i32, i32* %314, i64 4
%317 = bitcast i32* %316 to <4 x i32>*
store <4 x i32> %300, <4 x i32>* %317
%318 = getelementptr inbounds i32, i32* %13, i64 %312
%319 = bitcast i32* %318 to <4 x i32>*
%320 = load <4 x i32>, <4 x i32>* %319
%321 = getelementptr inbounds i32, i32* %318, i64 4
%322 = bitcast i32* %321 to <4 x i32>*
%323 = load <4 x i32>, <4 x i32>* %322
%324 = getelementptr inbounds i32, i32* %2, i64 %313
%325 = bitcast i32* %324 to <4 x i32>*
store <4 x i32> %320, <4 x i32>* %325
%326 = getelementptr inbounds i32, i32* %324, i64 4
%327 = bitcast i32* %326 to <4 x i32>*
store <4 x i32> %323, <4 x i32>* %327
%328 = or i64 %309, 8
%329 = add i64 %328, %270
%330 = or i64 %309, 9
%331 = add nsw i64 %329, 1
%332 = getelementptr inbounds i32, i32* %1, i64 %331
%333 = bitcast i32* %332 to <4 x i32>*
store <4 x i32> %298, <4 x i32>* %333
%334 = getelementptr inbounds i32, i32* %332, i64 4
%335 = bitcast i32* %334 to <4 x i32>*
store <4 x i32> %300, <4 x i32>* %335
%336 = getelementptr inbounds i32, i32* %13, i64 %330
%337 = bitcast i32* %336 to <4 x i32>*
%338 = load <4 x i32>, <4 x i32>* %337
%339 = getelementptr inbounds i32, i32* %336, i64 4
%340 = bitcast i32* %339 to <4 x i32>*
%341 = load <4 x i32>, <4 x i32>* %340
%342 = getelementptr inbounds i32, i32* %2, i64 %331
%343 = bitcast i32* %342 to <4 x i32>*
store <4 x i32> %338, <4 x i32>* %343
%344 = getelementptr inbounds i32, i32* %342, i64 4
%345 = bitcast i32* %344 to <4 x i32>*
store <4 x i32> %341, <4 x i32>* %345
%346 = add nuw i64 %309, 16
%347 = add i64 %310, 2
%348 = icmp eq i64 %347, %307
br i1 %348, label %349, label %308
349: ; preds = %308, %293
%350 = phi i64 [ 0, %293 ], [ %346, %308 ]
%351 = icmp eq i64 %304, 0
br i1 %351, label %370, label %352
352: ; preds = %349
%353 = add i64 %350, %270
%354 = or i64 %350, 1
%355 = add nsw i64 %353, 1
%356 = getelementptr inbounds i32, i32* %1, i64 %355
%357 = bitcast i32* %356 to <4 x i32>*
store <4 x i32> %298, <4 x i32>* %357
%358 = getelementptr inbounds i32, i32* %356, i64 4
%359 = bitcast i32* %358 to <4 x i32>*
store <4 x i32> %300, <4 x i32>* %359
%360 = getelementptr inbounds i32, i32* %13, i64 %354
%361 = bitcast i32* %360 to <4 x i32>*
%362 = load <4 x i32>, <4 x i32>* %361
%363 = getelementptr inbounds i32, i32* %360, i64 4
%364 = bitcast i32* %363 to <4 x i32>*
%365 = load <4 x i32>, <4 x i32>* %364
%366 = getelementptr inbounds i32, i32* %2, i64 %355
%367 = bitcast i32* %366 to <4 x i32>*
store <4 x i32> %362, <4 x i32>* %367
%368 = getelementptr inbounds i32, i32* %366, i64 4
%369 = bitcast i32* %368 to <4 x i32>*
store <4 x i32> %365, <4 x i32>* %369
br label %370
370: ; preds = %349, %352
%371 = icmp eq i64 %273, %294
br i1 %371, label %256, label %372
372: ; preds = %275, %269, %370
%373 = phi i64 [ %270, %275 ], [ %270, %269 ], [ %295, %370 ]
%374 = phi i64 [ 1, %275 ], [ 1, %269 ], [ %296, %370 ]
%375 = xor i64 %374, -1
%376 = and i64 %272, 1
%377 = icmp eq i64 %376, 0
br i1 %377, label %378, label %385
378: ; preds = %372
%379 = add nsw i64 %373, 1
%380 = getelementptr inbounds i32, i32* %1, i64 %379
store i32 %265, i32* %380
%381 = getelementptr inbounds i32, i32* %13, i64 %374
%382 = load i32, i32* %381
%383 = getelementptr inbounds i32, i32* %2, i64 %379
store i32 %382, i32* %383
%384 = add nuw nsw i64 %374, 1
br label %385
385: ; preds = %378, %372
%386 = phi i64 [ undef, %372 ], [ %379, %378 ]
%387 = phi i64 [ %373, %372 ], [ %379, %378 ]
%388 = phi i64 [ %374, %372 ], [ %384, %378 ]
%389 = sub nsw i64 0, %272
%390 = icmp eq i64 %375, %389
br i1 %390, label %256, label %391
391: ; preds = %385, %391
%392 = phi i64 [ %400, %391 ], [ %387, %385 ]
%393 = phi i64 [ %405, %391 ], [ %388, %385 ]
%394 = add nsw i64 %392, 1
%395 = getelementptr inbounds i32, i32* %1, i64 %394
store i32 %265, i32* %395
%396 = getelementptr inbounds i32, i32* %13, i64 %393
%397 = load i32, i32* %396
%398 = getelementptr inbounds i32, i32* %2, i64 %394
store i32 %397, i32* %398
%399 = add nuw nsw i64 %393, 1
%400 = add nsw i64 %392, 2
%401 = getelementptr inbounds i32, i32* %1, i64 %400
store i32 %265, i32* %401
%402 = getelementptr inbounds i32, i32* %13, i64 %399
%403 = load i32, i32* %402
%404 = getelementptr inbounds i32, i32* %2, i64 %400
store i32 %403, i32* %404
%405 = add nuw nsw i64 %393, 2
%406 = icmp eq i64 %405, %272
br i1 %406, label %256, label %391
407: ; preds = %259
%408 = call i32 @fclose(i32* %8)
%409 = call i32 @free_ivector(i32* %13, i32 1, i32 10000)
br label %410
410: ; preds = %407, %10
%411 = phi i32 [ %260, %407 ], [ 0, %10 ]
ret i32 %411
}