#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 */

/* Variables and functions */
char *cvector(int, int);
int /*<<< orphan*/ dist_2v_ordered_v2(int *, int *, char *, char *, int, int,
                                      int **, int *, int, int, int, int *, int,
                                      int, int /*<<< orphan*/);
int /*<<< orphan*/ free_cvector(char *, int, int);
int /*<<< orphan*/ free_imatrix(int **, int, int, int, int);
int /*<<< orphan*/ free_ivector(int *, int, int);
int **imatrix(int, int, int, int);
int *ivector(int, int);
int remove_overlaps_v2(int **, int **, int *, int, int);
void dist_4v_ordered_v3(int **ovdi123_p, int *m4_p, char *m4_s, int n123,
                        int n4, int **ovdi, int *n, int min_dist, int max_dist,
                        int max_n_ovdi, int *ml, int get_positions,
                        int pos_format) {
  int *m123_p;
  char *m123_s;
  int n1234;
  int n_1234[2];
  int **ovdi1234;
  int i, j;
  int curr_index;
  int n_cooc;
  int **all_ovdi;
  m123_p = ivector(1, n123);
  m123_s = cvector(1, n123);
  ovdi1234 = imatrix(1, max_n_ovdi, 1, 6);
  all_ovdi = imatrix(1, max_n_ovdi, 1, 12);
  for (i = 1; i <= n123; i++) {
    m123_p[i] = ovdi123_p[i][3];
    m123_s[i] = ovdi123_p[i][9];
  }
  dist_2v_ordered_v2(m123_p, m4_p, m123_s, m4_s, n123, n4, ovdi1234, n_1234,
                     min_dist, max_dist, max_n_ovdi, ml, get_positions,
                     pos_format, 0);
  n1234 = n_1234[0];
  if (get_positions == 1) {
    for (i = 1; i <= n1234; i++) {
      curr_index = ovdi1234[i][3];
      all_ovdi[i][1] = ovdi123_p[curr_index][1];
      all_ovdi[i][2] = ovdi123_p[curr_index][2];
      all_ovdi[i][3] = ovdi123_p[curr_index][3];
      all_ovdi[i][4] = ovdi1234[i][2];
      all_ovdi[i][5] = ovdi123_p[curr_index][4];
      all_ovdi[i][6] = ovdi123_p[curr_index][5];
      all_ovdi[i][7] = ovdi123_p[curr_index][6];
      all_ovdi[i][8] = ovdi1234[i][4];
      all_ovdi[i][9] = ovdi123_p[curr_index][7];
      all_ovdi[i][10] = ovdi123_p[curr_index][8];
      all_ovdi[i][11] = ovdi123_p[curr_index][9];
      all_ovdi[i][12] = ovdi1234[i][6];
    }
  }
  if ((n1234 > 0) & (get_positions == 1)) {
    n_cooc = remove_overlaps_v2(all_ovdi, ovdi, ml, n1234, 4);
  } else {
    n_cooc = n1234;
  }
  n[0] = n_cooc;
  n[1] = n_1234[1];
  free_ivector(m123_p, 1, n123);
  free_cvector(m123_s, 1, n123);
  free_imatrix(ovdi1234, 1, max_n_ovdi, 1, 4);
  free_imatrix(all_ovdi, 1, max_n_ovdi, 1, 8);
}


x86 assembly (clang, -O0):
<dist_4v_ordered_v3>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
mov    0x40(%rbp),%eax
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
mov    %rdx,-0x40(%rbp)
mov    %ecx,-0x44(%rbp)
mov    %r8d,-0x48(%rbp)
mov    %r9,-0x50(%rbp)
mov    -0x44(%rbp),%esi
mov    $0x1,%edi
call   1080 <ivector@plt>
mov    %rax,-0x58(%rbp)
mov    -0x44(%rbp),%esi
mov    $0x1,%edi
call   1040 <cvector@plt>
mov    %rax,-0x60(%rbp)
mov    0x28(%rbp),%esi
mov    $0x1,%edx
mov    $0x6,%ecx
mov    %edx,%edi
call   1030 <imatrix@plt>
mov    %rax,-0x78(%rbp)
mov    0x28(%rbp),%esi
mov    $0x1,%edx
mov    $0xc,%ecx
mov    %edx,%edi
call   1030 <imatrix@plt>
mov    %rax,-0x90(%rbp)
movl   $0x1,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x44(%rbp),%eax
jg     126e <dist_4v_ordered_v3+0xee>
mov    -0x30(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0xc(%rax),%edx
mov    -0x58(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x30(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x24(%rax),%eax
mov    %al,%dl
mov    -0x60(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    121e <dist_4v_ordered_v3+0x9e>
mov    -0x58(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x60(%rbp),%rdx
mov    -0x40(%rbp),%rcx
mov    -0x44(%rbp),%r8d
mov    -0x48(%rbp),%r9d
mov    -0x78(%rbp),%r13
lea    -0x6c(%rbp),%r12
mov    0x18(%rbp),%r15d
mov    0x20(%rbp),%r14d
mov    0x28(%rbp),%ebx
mov    0x30(%rbp),%r11
mov    0x38(%rbp),%r10d
mov    0x40(%rbp),%eax
mov    %eax,-0x94(%rbp)
xor    %eax,%eax
mov    -0x94(%rbp),%eax
mov    %r13,(%rsp)
mov    %r12,0x8(%rsp)
mov    %r15d,0x10(%rsp)
mov    %r14d,0x18(%rsp)
mov    %ebx,0x20(%rsp)
mov    %r11,0x28(%rsp)
mov    %r10d,0x30(%rsp)
mov    %eax,0x38(%rsp)
movl   $0x0,0x40(%rsp)
call   1090 <dist_2v_ordered_v2@plt>
mov    -0x6c(%rbp),%eax
mov    %eax,-0x64(%rbp)
cmpl   $0x1,0x38(%rbp)
jne    14d6 <dist_4v_ordered_v3+0x356>
movl   $0x1,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x64(%rbp),%eax
jg     14d1 <dist_4v_ordered_v3+0x351>
mov    -0x78(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x84(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x4(%rax),%ecx
mov    -0x90(%rbp),%rax
movslq -0x7c(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    %ecx,0x4(%rax)
mov    -0x30(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x8(%rax),%ecx
mov    -0x90(%rbp),%rax
movslq -0x7c(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    %ecx,0x8(%rax)
mov    -0x30(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0xc(%rax),%ecx
mov    -0x90(%rbp),%rax
movslq -0x7c(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    %ecx,0xc(%rax)
mov    -0x78(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x8(%rax),%ecx
mov    -0x90(%rbp),%rax
movslq -0x7c(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    %ecx,0x10(%rax)
mov    -0x30(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x10(%rax),%ecx
mov    -0x90(%rbp),%rax
movslq -0x7c(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    %ecx,0x14(%rax)
mov    -0x30(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x14(%rax),%ecx
mov    -0x90(%rbp),%rax
movslq -0x7c(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    %ecx,0x18(%rax)
mov    -0x30(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x18(%rax),%ecx
mov    -0x90(%rbp),%rax
movslq -0x7c(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    %ecx,0x1c(%rax)
mov    -0x78(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x10(%rax),%ecx
mov    -0x90(%rbp),%rax
movslq -0x7c(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    %ecx,0x20(%rax)
mov    -0x30(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x1c(%rax),%ecx
mov    -0x90(%rbp),%rax
movslq -0x7c(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    %ecx,0x24(%rax)
mov    -0x30(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x20(%rax),%ecx
mov    -0x90(%rbp),%rax
movslq -0x7c(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    %ecx,0x28(%rax)
mov    -0x30(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x24(%rax),%ecx
mov    -0x90(%rbp),%rax
movslq -0x7c(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    %ecx,0x2c(%rax)
mov    -0x78(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x18(%rax),%ecx
mov    -0x90(%rbp),%rax
movslq -0x7c(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    %ecx,0x30(%rax)
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    12fb <dist_4v_ordered_v3+0x17b>
jmp    14d6 <dist_4v_ordered_v3+0x356>
cmpl   $0x0,-0x64(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x1,0x38(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1522 <dist_4v_ordered_v3+0x3a2>
mov    -0x90(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    0x30(%rbp),%rdx
mov    -0x64(%rbp),%ecx
mov    $0x4,%r8d
call   10a0 <remove_overlaps_v2@plt>
mov    %eax,-0x88(%rbp)
jmp    152b <dist_4v_ordered_v3+0x3ab>
mov    -0x64(%rbp),%eax
mov    %eax,-0x88(%rbp)
mov    -0x88(%rbp),%ecx
mov    0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x68(%rbp),%ecx
mov    0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x58(%rbp),%rdi
mov    -0x44(%rbp),%edx
mov    $0x1,%esi
call   1070 <free_ivector@plt>
mov    -0x60(%rbp),%rdi
mov    -0x44(%rbp),%edx
mov    $0x1,%esi
call   1060 <free_cvector@plt>
mov    -0x78(%rbp),%rdi
mov    0x28(%rbp),%edx
mov    $0x1,%ecx
mov    $0x4,%r8d
mov    %ecx,%esi
call   1050 <free_imatrix@plt>
mov    -0x90(%rbp),%rdi
mov    0x28(%rbp),%edx
mov    $0x1,%ecx
mov    $0x8,%r8d
mov    %ecx,%esi
call   1050 <free_imatrix@plt>
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist_4v_ordered_v3>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r9,0x20(%rsp)
mov    %r8d,0xc(%rsp)
mov    %ecx,%ebp
mov    %rdx,0x30(%rsp)
mov    %rsi,0x28(%rsp)
mov    %rdi,%r14
mov    0x88(%rsp),%ebx
mov    $0x1,%edi
mov    %ecx,%esi
call   1080 <ivector@plt>
mov    %rax,%r15
mov    $0x1,%edi
mov    %ebp,%esi
call   1040 <cvector@plt>
mov    %rax,%r13
mov    $0x1,%edi
mov    %ebx,%esi
mov    $0x1,%edx
mov    $0x6,%ecx
call   1030 <imatrix@plt>
mov    %rax,%r12
mov    $0x1,%edi
mov    %ebx,%esi
mov    $0x1,%edx
mov    $0xc,%ecx
call   1030 <imatrix@plt>
mov    %rax,0x10(%rsp)
test   %ebp,%ebp
jle    1275 <dist_4v_ordered_v3+0xf5>
mov    %ebp,%r8d
mov    $0x1,%ecx
cmp    $0x1,%ebp
je     125c <dist_4v_ordered_v3+0xdc>
mov    %r8d,%edx
and    $0xfffffffe,%edx
neg    %rdx
mov    $0x1,%ecx
nop
mov    (%r14,%rcx,8),%rsi
mov    0xc(%rsi),%edi
mov    %edi,(%r15,%rcx,4)
movzbl 0x24(%rsi),%eax
mov    %al,0x0(%r13,%rcx,1)
mov    0x8(%r14,%rcx,8),%rax
mov    0xc(%rax),%esi
mov    %esi,0x4(%r15,%rcx,4)
movzbl 0x24(%rax),%eax
mov    %al,0x1(%r13,%rcx,1)
lea    (%rdx,%rcx,1),%rax
add    $0x2,%rax
add    $0x2,%rcx
cmp    $0x1,%rax
jne    1220 <dist_4v_ordered_v3+0xa0>
test   $0x1,%r8b
je     1275 <dist_4v_ordered_v3+0xf5>
mov    (%r14,%rcx,8),%rax
mov    0xc(%rax),%edx
mov    %edx,(%r15,%rcx,4)
mov    0x24(%rax),%al
mov    %al,0x0(%r13,%rcx,1)
sub    $0x8,%rsp
lea    0x20(%rsp),%r10
mov    %r15,%rdi
mov    0x30(%rsp),%rsi
mov    %r13,%rdx
mov    0x38(%rsp),%rcx
mov    %ebp,%r8d
mov    0x14(%rsp),%r9d
push   $0x0
mov    0xb0(%rsp),%eax
push   %rax
mov    0xb0(%rsp),%eax
push   %rax
push   0xb0(%rsp)
push   %rbx
mov    0xb0(%rsp),%eax
push   %rax
mov    0xb0(%rsp),%eax
push   %rax
push   %r10
push   %r12
call   1090 <dist_2v_ordered_v2@plt>
add    $0x50,%rsp
mov    0x18(%rsp),%eax
mov    0x98(%rsp),%ecx
cmp    $0x1,%ecx
jne    138a <dist_4v_ordered_v3+0x20a>
test   %eax,%eax
jle    138a <dist_4v_ordered_v3+0x20a>
mov    %ebp,0xc(%rsp)
lea    0x1(%rax),%r8
mov    $0x1,%edx
mov    0x10(%rsp),%rdi
nopl   0x0(%rax,%rax,1)
mov    (%r12,%rdx,8),%rsi
movslq 0xc(%rsi),%rbp
mov    (%r14,%rbp,8),%rcx
mov    0x4(%rcx),%ebx
mov    (%rdi,%rdx,8),%rbp
mov    %ebx,0x4(%rbp)
mov    0x8(%rcx),%ebx
mov    %ebx,0x8(%rbp)
mov    0xc(%rcx),%ebx
mov    %ebx,0xc(%rbp)
mov    0x8(%rsi),%ebx
mov    %ebx,0x10(%rbp)
mov    0x10(%rcx),%ebx
mov    %ebx,0x14(%rbp)
mov    0x14(%rcx),%ebx
mov    %ebx,0x18(%rbp)
mov    0x18(%rcx),%ebx
mov    %ebx,0x1c(%rbp)
mov    0x10(%rsi),%ebx
mov    %ebx,0x20(%rbp)
mov    0x1c(%rcx),%ebx
mov    %ebx,0x24(%rbp)
mov    0x20(%rcx),%ebx
mov    %ebx,0x28(%rbp)
mov    0x24(%rcx),%ecx
mov    %ecx,0x2c(%rbp)
mov    0x18(%rsi),%esi
mov    %esi,0x30(%rbp)
add    $0x1,%rdx
cmp    %rdx,%r8
jne    1300 <dist_4v_ordered_v3+0x180>
test   %eax,%eax
jle    137f <dist_4v_ordered_v3+0x1ff>
mov    0x20(%rsp),%rsi
mov    0x90(%rsp),%rdx
mov    %eax,%ecx
mov    $0x4,%r8d
call   10a0 <remove_overlaps_v2@plt>
mov    0x88(%rsp),%ebx
mov    0xc(%rsp),%ebp
mov    0x70(%rsp),%rcx
mov    %eax,(%rcx)
mov    0x1c(%rsp),%eax
mov    %eax,0x4(%rcx)
mov    %r15,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
call   1070 <free_ivector@plt>
mov    %r13,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
call   1060 <free_cvector@plt>
mov    %r12,%rdi
mov    $0x1,%esi
mov    %ebx,%edx
mov    $0x1,%ecx
mov    $0x4,%r8d
call   1050 <free_imatrix@plt>
mov    0x10(%rsp),%rdi
mov    $0x1,%esi
mov    %ebx,%edx
mov    $0x1,%ecx
mov    $0x8,%r8d
call   1050 <free_imatrix@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @dist_4v_ordered_v3(i32** %0, i32* %1, i8* %2, i32 %3, i32 %4, i32** %5, i32* %6, i32 %7, i32 %8, i32 %9, i32* %10, i32 %11, i32 %12) {
%14 = alloca i32**
%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 i8*
%29 = alloca i32
%30 = alloca [2 x i32]
%31 = alloca i32**
%32 = alloca i32
%33 = alloca i32
%34 = alloca i32
%35 = alloca i32
%36 = alloca i32**
store i32** %0, i32*** %14
store i32* %1, i32** %15
store i8* %2, i8** %16
store i32 %3, i32* %17
store i32 %4, i32* %18
store i32** %5, i32*** %19
store i32* %6, i32** %20
store i32 %7, i32* %21
store i32 %8, i32* %22
store i32 %9, i32* %23
store i32* %10, i32** %24
store i32 %11, i32* %25
store i32 %12, i32* %26
%37 = load i32, i32* %17
%38 = call i32* @ivector(i32 1, i32 %37)
store i32* %38, i32** %27
%39 = load i32, i32* %17
%40 = call i8* @cvector(i32 1, i32 %39)
store i8* %40, i8** %28
%41 = load i32, i32* %23
%42 = call i32** @imatrix(i32 1, i32 %41, i32 1, i32 6)
store i32** %42, i32*** %31
%43 = load i32, i32* %23
%44 = call i32** @imatrix(i32 1, i32 %43, i32 1, i32 12)
store i32** %44, i32*** %36
store i32 1, i32* %32
br label %45
45: ; preds = %73, %13
%46 = load i32, i32* %32
%47 = load i32, i32* %17
%48 = icmp sle i32 %46, %47
br i1 %48, label %49, label %76
49: ; preds = %45
%50 = load i32**, i32*** %14
%51 = load i32, i32* %32
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i32*, i32** %50, i64 %52
%54 = load i32*, i32** %53
%55 = getelementptr inbounds i32, i32* %54, i64 3
%56 = load i32, i32* %55
%57 = load i32*, i32** %27
%58 = load i32, i32* %32
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i32, i32* %57, i64 %59
store i32 %56, i32* %60
%61 = load i32**, i32*** %14
%62 = load i32, i32* %32
%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 9
%67 = load i32, i32* %66
%68 = trunc i32 %67 to i8
%69 = load i8*, i8** %28
%70 = load i32, i32* %32
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i8, i8* %69, i64 %71
store i8 %68, i8* %72
br label %73
73: ; preds = %49
%74 = load i32, i32* %32
%75 = add nsw i32 %74, 1
store i32 %75, i32* %32
br label %45
76: ; preds = %45
%77 = load i32*, i32** %27
%78 = load i32*, i32** %15
%79 = load i8*, i8** %28
%80 = load i8*, i8** %16
%81 = load i32, i32* %17
%82 = load i32, i32* %18
%83 = load i32**, i32*** %31
%84 = getelementptr inbounds [2 x i32], [2 x i32]* %30, i64 0, i64 0
%85 = load i32, i32* %21
%86 = load i32, i32* %22
%87 = load i32, i32* %23
%88 = load i32*, i32** %24
%89 = load i32, i32* %25
%90 = load i32, i32* %26
%91 = call i32 @dist_2v_ordered_v2(i32* %77, i32* %78, i8* %79, i8* %80, i32 %81, i32 %82, i32** %83, i32* %84, i32 %85, i32 %86, i32 %87, i32* %88, i32 %89, i32 %90, i32 0)
%92 = getelementptr inbounds [2 x i32], [2 x i32]* %30, i64 0, i64 0
%93 = load i32, i32* %92
store i32 %93, i32* %29
%94 = load i32, i32* %25
%95 = icmp eq i32 %94, 1
br i1 %95, label %96, label %269
96: ; preds = %76
store i32 1, i32* %32
br label %97
97: ; preds = %265, %96
%98 = load i32, i32* %32
%99 = load i32, i32* %29
%100 = icmp sle i32 %98, %99
br i1 %100, label %101, label %268
101: ; preds = %97
%102 = load i32**, i32*** %31
%103 = load i32, i32* %32
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds i32*, i32** %102, i64 %104
%106 = load i32*, i32** %105
%107 = getelementptr inbounds i32, i32* %106, i64 3
%108 = load i32, i32* %107
store i32 %108, i32* %34
%109 = load i32**, i32*** %14
%110 = load i32, i32* %34
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds i32*, i32** %109, i64 %111
%113 = load i32*, i32** %112
%114 = getelementptr inbounds i32, i32* %113, i64 1
%115 = load i32, i32* %114
%116 = load i32**, i32*** %36
%117 = load i32, i32* %32
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds i32*, i32** %116, i64 %118
%120 = load i32*, i32** %119
%121 = getelementptr inbounds i32, i32* %120, i64 1
store i32 %115, i32* %121
%122 = load i32**, i32*** %14
%123 = load i32, i32* %34
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds i32*, i32** %122, i64 %124
%126 = load i32*, i32** %125
%127 = getelementptr inbounds i32, i32* %126, i64 2
%128 = load i32, i32* %127
%129 = load i32**, i32*** %36
%130 = load i32, i32* %32
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds i32*, i32** %129, i64 %131
%133 = load i32*, i32** %132
%134 = getelementptr inbounds i32, i32* %133, i64 2
store i32 %128, i32* %134
%135 = load i32**, i32*** %14
%136 = load i32, i32* %34
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds i32*, i32** %135, i64 %137
%139 = load i32*, i32** %138
%140 = getelementptr inbounds i32, i32* %139, i64 3
%141 = load i32, i32* %140
%142 = load i32**, i32*** %36
%143 = load i32, i32* %32
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds i32*, i32** %142, i64 %144
%146 = load i32*, i32** %145
%147 = getelementptr inbounds i32, i32* %146, i64 3
store i32 %141, i32* %147
%148 = load i32**, i32*** %31
%149 = load i32, i32* %32
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds i32*, i32** %148, i64 %150
%152 = load i32*, i32** %151
%153 = getelementptr inbounds i32, i32* %152, i64 2
%154 = load i32, i32* %153
%155 = load i32**, i32*** %36
%156 = load i32, i32* %32
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds i32*, i32** %155, i64 %157
%159 = load i32*, i32** %158
%160 = getelementptr inbounds i32, i32* %159, i64 4
store i32 %154, i32* %160
%161 = load i32**, i32*** %14
%162 = load i32, i32* %34
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds i32*, i32** %161, i64 %163
%165 = load i32*, i32** %164
%166 = getelementptr inbounds i32, i32* %165, i64 4
%167 = load i32, i32* %166
%168 = load i32**, i32*** %36
%169 = load i32, i32* %32
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds i32*, i32** %168, i64 %170
%172 = load i32*, i32** %171
%173 = getelementptr inbounds i32, i32* %172, i64 5
store i32 %167, i32* %173
%174 = load i32**, i32*** %14
%175 = load i32, i32* %34
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds i32*, i32** %174, i64 %176
%178 = load i32*, i32** %177
%179 = getelementptr inbounds i32, i32* %178, i64 5
%180 = load i32, i32* %179
%181 = load i32**, i32*** %36
%182 = load i32, i32* %32
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds i32*, i32** %181, i64 %183
%185 = load i32*, i32** %184
%186 = getelementptr inbounds i32, i32* %185, i64 6
store i32 %180, i32* %186
%187 = load i32**, i32*** %14
%188 = load i32, i32* %34
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds i32*, i32** %187, i64 %189
%191 = load i32*, i32** %190
%192 = getelementptr inbounds i32, i32* %191, i64 6
%193 = load i32, i32* %192
%194 = load i32**, i32*** %36
%195 = load i32, i32* %32
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds i32*, i32** %194, i64 %196
%198 = load i32*, i32** %197
%199 = getelementptr inbounds i32, i32* %198, i64 7
store i32 %193, i32* %199
%200 = load i32**, i32*** %31
%201 = load i32, i32* %32
%202 = sext i32 %201 to i64
%203 = getelementptr inbounds i32*, i32** %200, i64 %202
%204 = load i32*, i32** %203
%205 = getelementptr inbounds i32, i32* %204, i64 4
%206 = load i32, i32* %205
%207 = load i32**, i32*** %36
%208 = load i32, i32* %32
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds i32*, i32** %207, i64 %209
%211 = load i32*, i32** %210
%212 = getelementptr inbounds i32, i32* %211, i64 8
store i32 %206, i32* %212
%213 = load i32**, i32*** %14
%214 = load i32, i32* %34
%215 = sext i32 %214 to i64
%216 = getelementptr inbounds i32*, i32** %213, i64 %215
%217 = load i32*, i32** %216
%218 = getelementptr inbounds i32, i32* %217, i64 7
%219 = load i32, i32* %218
%220 = load i32**, i32*** %36
%221 = load i32, i32* %32
%222 = sext i32 %221 to i64
%223 = getelementptr inbounds i32*, i32** %220, i64 %222
%224 = load i32*, i32** %223
%225 = getelementptr inbounds i32, i32* %224, i64 9
store i32 %219, i32* %225
%226 = load i32**, i32*** %14
%227 = load i32, i32* %34
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds i32*, i32** %226, i64 %228
%230 = load i32*, i32** %229
%231 = getelementptr inbounds i32, i32* %230, i64 8
%232 = load i32, i32* %231
%233 = load i32**, i32*** %36
%234 = load i32, i32* %32
%235 = sext i32 %234 to i64
%236 = getelementptr inbounds i32*, i32** %233, i64 %235
%237 = load i32*, i32** %236
%238 = getelementptr inbounds i32, i32* %237, i64 10
store i32 %232, i32* %238
%239 = load i32**, i32*** %14
%240 = load i32, i32* %34
%241 = sext i32 %240 to i64
%242 = getelementptr inbounds i32*, i32** %239, i64 %241
%243 = load i32*, i32** %242
%244 = getelementptr inbounds i32, i32* %243, i64 9
%245 = load i32, i32* %244
%246 = load i32**, i32*** %36
%247 = load i32, i32* %32
%248 = sext i32 %247 to i64
%249 = getelementptr inbounds i32*, i32** %246, i64 %248
%250 = load i32*, i32** %249
%251 = getelementptr inbounds i32, i32* %250, i64 11
store i32 %245, i32* %251
%252 = load i32**, i32*** %31
%253 = load i32, i32* %32
%254 = sext i32 %253 to i64
%255 = getelementptr inbounds i32*, i32** %252, i64 %254
%256 = load i32*, i32** %255
%257 = getelementptr inbounds i32, i32* %256, i64 6
%258 = load i32, i32* %257
%259 = load i32**, i32*** %36
%260 = load i32, i32* %32
%261 = sext i32 %260 to i64
%262 = getelementptr inbounds i32*, i32** %259, i64 %261
%263 = load i32*, i32** %262
%264 = getelementptr inbounds i32, i32* %263, i64 12
store i32 %258, i32* %264
br label %265
265: ; preds = %101
%266 = load i32, i32* %32
%267 = add nsw i32 %266, 1
store i32 %267, i32* %32
br label %97
268: ; preds = %97
br label %269
269: ; preds = %268, %76
%270 = load i32, i32* %29
%271 = icmp sgt i32 %270, 0
%272 = zext i1 %271 to i32
%273 = load i32, i32* %25
%274 = icmp eq i32 %273, 1
%275 = zext i1 %274 to i32
%276 = and i32 %272, %275
%277 = icmp ne i32 %276, 0
br i1 %277, label %278, label %284
278: ; preds = %269
%279 = load i32**, i32*** %36
%280 = load i32**, i32*** %19
%281 = load i32*, i32** %24
%282 = load i32, i32* %29
%283 = call i32 @remove_overlaps_v2(i32** %279, i32** %280, i32* %281, i32 %282, i32 4)
store i32 %283, i32* %35
br label %286
284: ; preds = %269
%285 = load i32, i32* %29
store i32 %285, i32* %35
br label %286
286: ; preds = %284, %278
%287 = load i32, i32* %35
%288 = load i32*, i32** %20
%289 = getelementptr inbounds i32, i32* %288, i64 0
store i32 %287, i32* %289
%290 = getelementptr inbounds [2 x i32], [2 x i32]* %30, i64 0, i64 1
%291 = load i32, i32* %290
%292 = load i32*, i32** %20
%293 = getelementptr inbounds i32, i32* %292, i64 1
store i32 %291, i32* %293
%294 = load i32*, i32** %27
%295 = load i32, i32* %17
%296 = call i32 @free_ivector(i32* %294, i32 1, i32 %295)
%297 = load i8*, i8** %28
%298 = load i32, i32* %17
%299 = call i32 @free_cvector(i8* %297, i32 1, i32 %298)
%300 = load i32**, i32*** %31
%301 = load i32, i32* %23
%302 = call i32 @free_imatrix(i32** %300, i32 1, i32 %301, i32 1, i32 4)
%303 = load i32**, i32*** %36
%304 = load i32, i32* %23
%305 = call i32 @free_imatrix(i32** %303, i32 1, i32 %304, i32 1, i32 8)
ret void
}

LLVM IR (-O2):
define void @dist_4v_ordered_v3(i32** nocapture %0, i32* %1, i8* %2, i32 %3, i32 %4, i32** %5, i32* nocapture writeonly %6, i32 %7, i32 %8, i32 %9, i32* %10, i32 %11, i32 %12) {
%14 = alloca [2 x i32]
%15 = bitcast [2 x i32]* %14 to i8*
%16 = tail call i32* @ivector(i32 1, i32 %3)
%17 = tail call i8* @cvector(i32 1, i32 %3)
%18 = tail call i32** @imatrix(i32 1, i32 %9, i32 1, i32 6)
%19 = tail call i32** @imatrix(i32 1, i32 %9, i32 1, i32 12)
%20 = icmp slt i32 %3, 1
br i1 %20, label %65, label %21
21: ; preds = %13
%22 = zext i32 %3 to i64
%23 = and i64 %22, 1
%24 = icmp eq i32 %3, 1
br i1 %24, label %52, label %25
25: ; preds = %21
%26 = and i64 %22, 4294967294
br label %27
27: ; preds = %27, %25
%28 = phi i64 [ 1, %25 ], [ %49, %27 ]
%29 = phi i64 [ 0, %25 ], [ %50, %27 ]
%30 = getelementptr inbounds i32*, i32** %0, i64 %28
%31 = load i32*, i32** %30
%32 = getelementptr inbounds i32, i32* %31, i64 3
%33 = load i32, i32* %32
%34 = getelementptr inbounds i32, i32* %16, i64 %28
store i32 %33, i32* %34
%35 = getelementptr inbounds i32, i32* %31, i64 9
%36 = load i32, i32* %35
%37 = trunc i32 %36 to i8
%38 = getelementptr inbounds i8, i8* %17, i64 %28
store i8 %37, i8* %38
%39 = add nuw nsw i64 %28, 1
%40 = getelementptr inbounds i32*, i32** %0, i64 %39
%41 = load i32*, i32** %40
%42 = getelementptr inbounds i32, i32* %41, i64 3
%43 = load i32, i32* %42
%44 = getelementptr inbounds i32, i32* %16, i64 %39
store i32 %43, i32* %44
%45 = getelementptr inbounds i32, i32* %41, i64 9
%46 = load i32, i32* %45
%47 = trunc i32 %46 to i8
%48 = getelementptr inbounds i8, i8* %17, i64 %39
store i8 %47, i8* %48
%49 = add nuw nsw i64 %28, 2
%50 = add i64 %29, 2
%51 = icmp eq i64 %50, %26
br i1 %51, label %52, label %27
52: ; preds = %27, %21
%53 = phi i64 [ 1, %21 ], [ %49, %27 ]
%54 = icmp eq i64 %23, 0
br i1 %54, label %65, label %55
55: ; preds = %52
%56 = getelementptr inbounds i32*, i32** %0, i64 %53
%57 = load i32*, i32** %56
%58 = getelementptr inbounds i32, i32* %57, i64 3
%59 = load i32, i32* %58
%60 = getelementptr inbounds i32, i32* %16, i64 %53
store i32 %59, i32* %60
%61 = getelementptr inbounds i32, i32* %57, i64 9
%62 = load i32, i32* %61
%63 = trunc i32 %62 to i8
%64 = getelementptr inbounds i8, i8* %17, i64 %53
store i8 %63, i8* %64
br label %65
65: ; preds = %55, %52, %13
%66 = getelementptr inbounds [2 x i32], [2 x i32]* %14, i64 0, i64 0
%67 = call i32 @dist_2v_ordered_v2(i32* %16, i32* %1, i8* %17, i8* %2, i32 %3, i32 %4, i32** %18, i32* %66, i32 %7, i32 %8, i32 %9, i32* %10, i32 %11, i32 %12, i32 0)
%68 = load i32, i32* %66
%69 = icmp ne i32 %11, 1
%70 = icmp slt i32 %68, 1
%71 = select i1 %69, i1 true, i1 %70
br i1 %71, label %128, label %72
72: ; preds = %65
%73 = add nuw i32 %68, 1
%74 = zext i32 %73 to i64
br label %75
75: ; preds = %72, %75
%76 = phi i64 [ 1, %72 ], [ %122, %75 ]
%77 = getelementptr inbounds i32*, i32** %18, i64 %76
%78 = load i32*, i32** %77
%79 = getelementptr inbounds i32, i32* %78, i64 3
%80 = load i32, i32* %79
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i32*, i32** %0, i64 %81
%83 = load i32*, i32** %82
%84 = getelementptr inbounds i32, i32* %83, i64 1
%85 = load i32, i32* %84
%86 = getelementptr inbounds i32*, i32** %19, i64 %76
%87 = load i32*, i32** %86
%88 = getelementptr inbounds i32, i32* %87, i64 1
store i32 %85, i32* %88
%89 = getelementptr inbounds i32, i32* %83, i64 2
%90 = load i32, i32* %89
%91 = getelementptr inbounds i32, i32* %87, i64 2
store i32 %90, i32* %91
%92 = getelementptr inbounds i32, i32* %83, i64 3
%93 = load i32, i32* %92
%94 = getelementptr inbounds i32, i32* %87, i64 3
store i32 %93, i32* %94
%95 = getelementptr inbounds i32, i32* %78, i64 2
%96 = load i32, i32* %95
%97 = getelementptr inbounds i32, i32* %87, i64 4
store i32 %96, i32* %97
%98 = getelementptr inbounds i32, i32* %83, i64 4
%99 = load i32, i32* %98
%100 = getelementptr inbounds i32, i32* %87, i64 5
store i32 %99, i32* %100
%101 = getelementptr inbounds i32, i32* %83, i64 5
%102 = load i32, i32* %101
%103 = getelementptr inbounds i32, i32* %87, i64 6
store i32 %102, i32* %103
%104 = getelementptr inbounds i32, i32* %83, i64 6
%105 = load i32, i32* %104
%106 = getelementptr inbounds i32, i32* %87, i64 7
store i32 %105, i32* %106
%107 = getelementptr inbounds i32, i32* %78, i64 4
%108 = load i32, i32* %107
%109 = getelementptr inbounds i32, i32* %87, i64 8
store i32 %108, i32* %109
%110 = getelementptr inbounds i32, i32* %83, i64 7
%111 = load i32, i32* %110
%112 = getelementptr inbounds i32, i32* %87, i64 9
store i32 %111, i32* %112
%113 = getelementptr inbounds i32, i32* %83, i64 8
%114 = load i32, i32* %113
%115 = getelementptr inbounds i32, i32* %87, i64 10
store i32 %114, i32* %115
%116 = getelementptr inbounds i32, i32* %83, i64 9
%117 = load i32, i32* %116
%118 = getelementptr inbounds i32, i32* %87, i64 11
store i32 %117, i32* %118
%119 = getelementptr inbounds i32, i32* %78, i64 6
%120 = load i32, i32* %119
%121 = getelementptr inbounds i32, i32* %87, i64 12
store i32 %120, i32* %121
%122 = add nuw nsw i64 %76, 1
%123 = icmp eq i64 %122, %74
br i1 %123, label %124, label %75
124: ; preds = %75
%125 = icmp sgt i32 %68, 0
br i1 %125, label %126, label %128
126: ; preds = %124
%127 = call i32 @remove_overlaps_v2(i32** %19, i32** %5, i32* %10, i32 %68, i32 4)
br label %128
128: ; preds = %65, %124, %126
%129 = phi i32 [ %127, %126 ], [ %68, %124 ], [ %68, %65 ]
store i32 %129, i32* %6
%130 = getelementptr inbounds [2 x i32], [2 x i32]* %14, i64 0, i64 1
%131 = load i32, i32* %130
%132 = getelementptr inbounds i32, i32* %6, i64 1
store i32 %131, i32* %132
%133 = call i32 @free_ivector(i32* %16, i32 1, i32 %3)
%134 = call i32 @free_cvector(i8* %17, i32 1, i32 %3)
%135 = call i32 @free_imatrix(i32** %18, i32 1, i32 %9, i32 1, i32 4)
%136 = call i32 @free_imatrix(i32** %19, i32 1, i32 %9, i32 1, i32 8)
ret void
}