#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 */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free_imatrix(int **, int, int, int, int);
int **imatrix(int, int, int, int);
int /*<<< orphan*/ printf(char *, int, ...);
int remove_overlaps_v2(int **, int **, int *, int, int);
void dist_2v_ordered_v2(int *m1_p, int *m2_p, char *m1_s, char *m2_s, int n1,
                        int n2, int **ovdi, int *n, int min_dist, int max_dist,
                        int max_n_ovdi, int *ml, int get_positions,
                        int pos_format, int verbose) {
  int i, j;
  int p1;
  int p2;
  char s1;
  char s2;
  int d;
  int n_ovdi = 0;
  int **all_ovdi;
  int n_cooc;
  int max_p2;
  int init_j = 1;
  int firstnear;
  if ((pos_format != 1) & (pos_format != -1)) {
    printf("ERROR!\ncooc_single_lib.c\ndist_2v_ordered_v2\npos_format=%d\nd "
           "should be either +1 or -1\nexiting...\n",
           pos_format);
    exit(1);
  }
  if (verbose)
    printf("max_dist=%d\tmin_dist=%d\n", max_dist, min_dist);
  max_p2 = m2_p[n2] + max_dist;
  if (get_positions == 1)
    all_ovdi = imatrix(1, max_n_ovdi, 1, 6);
  i = 0;
  p1 = m1_p[1];
  while ((i < n1) & (n_ovdi < max_n_ovdi) & (p1 < max_p2)) {
    i++;
    j = init_j;
    p1 = m1_p[i];
    s1 = m1_s[i];
    d = 0;
    firstnear = 1;
    if (verbose)
      printf("i=%d\tp1=%d\ts1=%d\n", i, p1, s1);
    while ((j <= n2) & (n_ovdi < max_n_ovdi) & (d < max_dist)) {
      p2 = m2_p[j];
      s2 = m2_s[j];
      d = 0;
      if ((s1 == 1) & (s2 == 1))
        d = p2 - p1;
      if ((s1 == 0) & (s2 == 0))
        d = p1 - p2;
      d = d * pos_format;
      if (verbose)
        printf("\tj=%d\tp2=%d\ts2=%d\td=%d\n", j, p2, s2, d);
      if ((d < max_dist) & (d > 0)) {
        if (firstnear == 1) {
          init_j = j;
          firstnear = 0;
        }
        if (d > min_dist) {
          n_ovdi++;
          if (get_positions == 1) {
            all_ovdi[n_ovdi][1] = p1;
            all_ovdi[n_ovdi][2] = p2;
            all_ovdi[n_ovdi][3] = i;
            all_ovdi[n_ovdi][4] = j;
            all_ovdi[n_ovdi][5] = s1;
            all_ovdi[n_ovdi][6] = s2;
          }
        }
      }
      j++;
    }
    if (firstnear == 1) {
      if (p1 > m2_p[init_j])
        init_j++;
      if (init_j > n2)
        p1 = max_p2 + 1;
    }
  }
  if ((n_ovdi > 0) & (get_positions == 1)) {
    n_cooc = remove_overlaps_v2(all_ovdi, ovdi, ml, n_ovdi, 2);
  } else {
    n_cooc = n_ovdi;
  }
  if ((i < n1) & (p1 < max_p2)) {
    n[1] = -1;
  } else {
    n[1] = 0;
  }
  n[0] = n_cooc;
  if (get_positions == 1)
    free_imatrix(all_ovdi, 1, max_n_ovdi, 1, 6);
}


x86 assembly (clang, -O0):
<dist_2v_ordered_v2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x50(%rbp),%eax
mov    0x48(%rbp),%eax
mov    0x40(%rbp),%eax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x1,-0x5c(%rbp)
cmpl   $0x1,0x48(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0xffffffff,0x48(%rbp)
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     11db <dist_2v_ordered_v2+0x8b>
mov    0x48(%rbp),%esi
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
cmpl   $0x0,0x50(%rbp)
je     11f9 <dist_2v_ordered_v2+0xa9>
mov    0x28(%rbp),%esi
mov    0x20(%rbp),%edx
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    0x28(%rbp),%eax
mov    %eax,-0x58(%rbp)
cmpl   $0x1,0x40(%rbp)
jne    122c <dist_2v_ordered_v2+0xdc>
mov    0x30(%rbp),%esi
mov    $0x1,%edx
mov    $0x6,%ecx
mov    %edx,%edi
call   1030 <imatrix@plt>
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x44(%rbp),%ecx
cmp    0x30(%rbp),%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
mov    -0x34(%rbp),%ecx
cmp    -0x58(%rbp),%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     14f0 <dist_2v_ordered_v2+0x3a0>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x39(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x1,-0x60(%rbp)
cmpl   $0x0,0x50(%rbp)
je     12d1 <dist_2v_ordered_v2+0x181>
mov    -0x2c(%rbp),%esi
mov    -0x34(%rbp),%edx
movsbl -0x39(%rbp),%ecx
lea    0xdb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12d6 <dist_2v_ordered_v2+0x186>
mov    -0x30(%rbp),%eax
cmp    -0x28(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x44(%rbp),%ecx
cmp    0x30(%rbp),%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
mov    -0x40(%rbp),%ecx
cmp    0x28(%rbp),%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     14aa <dist_2v_ordered_v2+0x35a>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x3a(%rbp)
movl   $0x0,-0x40(%rbp)
movsbl -0x39(%rbp),%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
movsbl -0x3a(%rbp),%ecx
cmp    $0x1,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1365 <dist_2v_ordered_v2+0x215>
mov    -0x38(%rbp),%eax
sub    -0x34(%rbp),%eax
mov    %eax,-0x40(%rbp)
movsbl -0x39(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
movsbl -0x3a(%rbp),%ecx
cmp    $0x0,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1398 <dist_2v_ordered_v2+0x248>
mov    -0x34(%rbp),%eax
sub    -0x38(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
imul   0x48(%rbp),%eax
mov    %eax,-0x40(%rbp)
cmpl   $0x0,0x50(%rbp)
je     13c8 <dist_2v_ordered_v2+0x278>
mov    -0x30(%rbp),%esi
mov    -0x38(%rbp),%edx
movsbl -0x3a(%rbp),%ecx
mov    -0x40(%rbp),%r8d
lea    0xccc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x40(%rbp),%eax
cmp    0x28(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x0,-0x40(%rbp)
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     149c <dist_2v_ordered_v2+0x34c>
cmpl   $0x1,-0x60(%rbp)
jne    1405 <dist_2v_ordered_v2+0x2b5>
mov    -0x30(%rbp),%eax
mov    %eax,-0x5c(%rbp)
movl   $0x0,-0x60(%rbp)
mov    -0x40(%rbp),%eax
cmp    0x20(%rbp),%eax
jle    1497 <dist_2v_ordered_v2+0x347>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
cmpl   $0x1,0x40(%rbp)
jne    1492 <dist_2v_ordered_v2+0x342>
mov    -0x34(%rbp),%ecx
mov    -0x50(%rbp),%rax
movslq -0x44(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    %ecx,0x4(%rax)
mov    -0x38(%rbp),%ecx
mov    -0x50(%rbp),%rax
movslq -0x44(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    %ecx,0x8(%rax)
mov    -0x2c(%rbp),%ecx
mov    -0x50(%rbp),%rax
movslq -0x44(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    %ecx,0xc(%rax)
mov    -0x30(%rbp),%ecx
mov    -0x50(%rbp),%rax
movslq -0x44(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    %ecx,0x10(%rax)
movsbl -0x39(%rbp),%ecx
mov    -0x50(%rbp),%rax
movslq -0x44(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    %ecx,0x14(%rax)
movsbl -0x3a(%rbp),%ecx
mov    -0x50(%rbp),%rax
movslq -0x44(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    %ecx,0x18(%rax)
jmp    1497 <dist_2v_ordered_v2+0x347>
jmp    149c <dist_2v_ordered_v2+0x34c>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    12d6 <dist_2v_ordered_v2+0x186>
cmpl   $0x1,-0x60(%rbp)
jne    14eb <dist_2v_ordered_v2+0x39b>
mov    -0x34(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x5c(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jle    14d1 <dist_2v_ordered_v2+0x381>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jle    14e6 <dist_2v_ordered_v2+0x396>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    14eb <dist_2v_ordered_v2+0x39b>
jmp    123d <dist_2v_ordered_v2+0xed>
cmpl   $0x0,-0x44(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x1,0x40(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1536 <dist_2v_ordered_v2+0x3e6>
mov    -0x50(%rbp),%rdi
mov    0x10(%rbp),%rsi
mov    0x38(%rbp),%rdx
mov    -0x44(%rbp),%ecx
mov    $0x2,%r8d
call   1060 <remove_overlaps_v2@plt>
mov    %eax,-0x54(%rbp)
jmp    153c <dist_2v_ordered_v2+0x3ec>
mov    -0x44(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x34(%rbp),%ecx
cmp    -0x58(%rbp),%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1574 <dist_2v_ordered_v2+0x424>
mov    0x18(%rbp),%rax
movl   $0xffffffff,0x4(%rax)
jmp    157f <dist_2v_ordered_v2+0x42f>
mov    0x18(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x54(%rbp),%ecx
mov    0x18(%rbp),%rax
mov    %ecx,(%rax)
cmpl   $0x1,0x40(%rbp)
jne    15ab <dist_2v_ordered_v2+0x45b>
mov    -0x50(%rbp),%rdi
mov    0x30(%rbp),%edx
mov    $0x1,%ecx
mov    $0x6,%r8d
mov    %ecx,%esi
call   1050 <free_imatrix@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist_2v_ordered_v2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %r9d,%r15d
mov    %r8d,%r12d
mov    %rcx,0x90(%rsp)
mov    %rdx,%r13
mov    %rsi,0x38(%rsp)
mov    %rdi,0x58(%rsp)
mov    0x110(%rsp),%eax
mov    %eax,0x18(%rsp)
mov    0x108(%rsp),%ecx
mov    0x100(%rsp),%eax
mov    %eax,0xc(%rsp)
mov    0xf8(%rsp),%r14
mov    0xf0(%rsp),%eax
mov    %eax,0x4(%rsp)
mov    0xe8(%rsp),%edi
mov    0xe0(%rsp),%eax
mov    %eax,0x20(%rsp)
mov    0xd8(%rsp),%rbp
mov    0xd0(%rsp),%rbx
mov    %ecx,0x10(%rsp)
cmp    $0xffffffff,%ecx
je     11e2 <dist_2v_ordered_v2+0x92>
cmpl   $0x1,0x10(%rsp)
jne    152a <dist_2v_ordered_v2+0x3da>
cmpl   $0x0,0x18(%rsp)
mov    %edi,0x8(%rsp)
je     1207 <dist_2v_ordered_v2+0xb7>
lea    0xe6e(%rip),%rdi
mov    0x8(%rsp),%esi
mov    0x20(%rsp),%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%edi
mov    %rbx,0x68(%rsp)
mov    %r14,0x70(%rsp)
movslq %r15d,%rcx
mov    0x38(%rsp),%rax
mov    %rcx,0x88(%rsp)
mov    (%rax,%rcx,4),%eax
add    %edi,%eax
mov    %rax,0x28(%rsp)
cmpl   $0x1,0xc(%rsp)
jne    1253 <dist_2v_ordered_v2+0x103>
mov    $0x1,%edi
mov    0x4(%rsp),%esi
mov    $0x1,%edx
mov    $0x6,%ecx
call   1030 <imatrix@plt>
mov    0x8(%rsp),%edi
mov    %rax,0x30(%rsp)
test   %r12d,%r12d
setg   %r14b
xor    %r8d,%r8d
mov    0x58(%rsp),%rax
mov    0x28(%rsp),%rcx
cmp    %ecx,0x4(%rax)
setl   %bl
jge    14d3 <dist_2v_ordered_v2+0x383>
cmpl   $0x0,0x4(%rsp)
jle    14d3 <dist_2v_ordered_v2+0x383>
test   %r12d,%r12d
jle    14d3 <dist_2v_ordered_v2+0x383>
mov    %rbp,0x50(%rsp)
mov    0x28(%rsp),%rax
add    $0x1,%eax
mov    %eax,0x4c(%rsp)
mov    %r12d,%r12d
mov    $0x1,%ebp
xor    %esi,%esi
xor    %r8d,%r8d
mov    %r15d,0x1c(%rsp)
mov    %r13,0x80(%rsp)
mov    %r12,0x78(%rsp)
nopw   0x0(%rax,%rax,1)
mov    %rsi,%rax
mov    0x58(%rsp),%rcx
mov    0x4(%rcx,%rsi,4),%edx
movsbl 0x1(%r13,%rsi,1),%ebx
add    $0x1,%rsi
cmpl   $0x0,0x18(%rsp)
mov    %edx,0x24(%rsp)
je     1316 <dist_2v_ordered_v2+0x1c6>
lea    0xd93(%rip),%rdi
mov    %ebx,%ecx
xor    %eax,%eax
mov    %r13,%r15
mov    %rsi,%r13
mov    %rbp,%r14
mov    %r8d,%ebp
call   1040 <printf@plt>
mov    0x24(%rsp),%edx
mov    %ebp,%r8d
mov    %r14,%rbp
mov    %r13,%rsi
mov    %r15,%r13
mov    0x1c(%rsp),%r15d
mov    0x8(%rsp),%edi
test   %edi,%edi
jle    1461 <dist_2v_ordered_v2+0x311>
cmp    %r15d,%ebp
jg     1461 <dist_2v_ordered_v2+0x311>
cmp    0x4(%rsp),%r8d
jge    1461 <dist_2v_ordered_v2+0x311>
mov    %rsi,0x60(%rsp)
mov    %rbp,0x40(%rsp)
movslq %ebp,%rbp
movl   $0x1,0x14(%rsp)
nopw   0x0(%rax,%rax,1)
mov    %ebx,%eax
xor    $0x1,%al
mov    0x38(%rsp),%rcx
mov    (%rcx,%rbp,4),%r12d
mov    0x90(%rsp),%rcx
movsbl (%rcx,%rbp,1),%r14d
mov    %r14d,%ecx
xor    $0x1,%cl
mov    %r12d,%esi
sub    %edx,%esi
or     %al,%cl
mov    $0x0,%eax
cmovne %eax,%esi
mov    %edx,%r13d
sub    %r12d,%r13d
mov    %ebx,%eax
or     %r14b,%al
cmovne %esi,%r13d
imul   0x10(%rsp),%r13d
cmpl   $0x0,0x18(%rsp)
je     13c2 <dist_2v_ordered_v2+0x272>
lea    0xceb(%rip),%rdi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r14d,%ecx
mov    %r8d,%r15d
mov    %r13d,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rsp),%edx
mov    %r15d,%r8d
mov    0x8(%rsp),%edi
cmp    %edi,%r13d
jge    1420 <dist_2v_ordered_v2+0x2d0>
test   %r13d,%r13d
jle    1420 <dist_2v_ordered_v2+0x2d0>
cmpl   $0x1,0x14(%rsp)
mov    0x40(%rsp),%rax
cmove  %ebp,%eax
mov    %rax,0x40(%rsp)
movl   $0x0,0x14(%rsp)
cmp    0x20(%rsp),%r13d
jle    1420 <dist_2v_ordered_v2+0x2d0>
add    $0x1,%r8d
cmpl   $0x1,0xc(%rsp)
jne    1420 <dist_2v_ordered_v2+0x2d0>
movslq %r8d,%rax
mov    0x30(%rsp),%rcx
mov    (%rcx,%rax,8),%rax
mov    %edx,0x4(%rax)
mov    %r12d,0x8(%rax)
mov    0x60(%rsp),%rcx
mov    %ecx,0xc(%rax)
mov    %ebp,0x10(%rax)
mov    %ebx,0x14(%rax)
mov    %r14d,0x18(%rax)
nopl   (%rax)
cmp    %edi,%r13d
jge    143e <dist_2v_ordered_v2+0x2ee>
cmp    0x88(%rsp),%rbp
jge    143e <dist_2v_ordered_v2+0x2ee>
add    $0x1,%rbp
cmp    0x4(%rsp),%r8d
jl     1350 <dist_2v_ordered_v2+0x200>
cmpl   $0x1,0x14(%rsp)
mov    0x1c(%rsp),%r15d
mov    0x80(%rsp),%r13
mov    0x78(%rsp),%r12
mov    0x40(%rsp),%rbp
mov    0x60(%rsp),%rsi
jne    147b <dist_2v_ordered_v2+0x32b>
movslq %ebp,%rbp
xor    %eax,%eax
mov    0x38(%rsp),%rcx
cmp    (%rcx,%rbp,4),%edx
setg   %al
add    %eax,%ebp
cmp    %r15d,%ebp
cmovg  0x4c(%rsp),%edx
cmp    %r12,%rsi
setb   %r14b
cmp    0x28(%rsp),%edx
setl   %bl
jge    149b <dist_2v_ordered_v2+0x34b>
cmp    0x4(%rsp),%r8d
jge    149b <dist_2v_ordered_v2+0x34b>
cmp    %r12,%rsi
jb     12c0 <dist_2v_ordered_v2+0x170>
cmpl   $0x1,0xc(%rsp)
jne    14ce <dist_2v_ordered_v2+0x37e>
test   %r8d,%r8d
mov    0x50(%rsp),%rbp
jle    14d3 <dist_2v_ordered_v2+0x383>
mov    0x30(%rsp),%rdi
mov    0x68(%rsp),%rsi
mov    0x70(%rsp),%rdx
mov    %r8d,%ecx
mov    $0x2,%r8d
call   1060 <remove_overlaps_v2@plt>
mov    %eax,%r8d
jmp    14d3 <dist_2v_ordered_v2+0x383>
mov    0x50(%rsp),%rbp
and    %r14b,%bl
movzbl %bl,%eax
neg    %eax
mov    %eax,0x4(%rbp)
mov    %r8d,0x0(%rbp)
cmpl   $0x1,0xc(%rsp)
jne    1518 <dist_2v_ordered_v2+0x3c8>
mov    0x30(%rsp),%rdi
mov    $0x1,%esi
mov    0x4(%rsp),%edx
mov    $0x1,%ecx
mov    $0x6,%r8d
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <free_imatrix@plt>
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xacf(%rip),%rdi
mov    0x10(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

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

LLVM IR (-O2):
@.str = [98 x i8] c"ERROR!\0Acooc_single_lib.c\0Adist_2v_ordered_v2\0Apos_format=%d\0Ad should be either +1 or -1\0Aexiting...\0A\00"
@.str.1 = [25 x i8] c"max_dist=%d\09min_dist=%d\0A\00"
@.str.2 = [18 x i8] c"i=%d\09p1=%d\09s1=%d\0A\00"
@.str.3 = [24 x i8] c"\09j=%d\09p2=%d\09s2=%d\09d=%d\0A\00"
define void @dist_2v_ordered_v2(i32* nocapture %0, i32* nocapture %1, i8* nocapture %2, i8* nocapture %3, i32 %4, i32 %5, i32** %6, i32* nocapture writeonly %7, i32 %8, i32 %9, i32 %10, i32* %11, i32 %12, i32 %13, i32 %14) {
switch i32 %13, label %16 [
i32 -1, label %19
i32 1, label %19
]
16: ; preds = %15
%17 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0), i32 %13)
%18 = tail call i32 @exit(i32 1)
unreachable
19: ; preds = %15, %15
%20 = icmp eq i32 %14, 0
br i1 %20, label %23, label %21
21: ; preds = %19
%22 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %8)
br label %23
23: ; preds = %21, %19
%24 = sext i32 %5 to i64
%25 = getelementptr inbounds i32, i32* %1, i64 %24
%26 = load i32, i32* %25
%27 = add nsw i32 %26, %9
%28 = icmp eq i32 %12, 1
br i1 %28, label %29, label %31
29: ; preds = %23
%30 = tail call i32** @imatrix(i32 1, i32 %10, i32 1, i32 6)
br label %31
31: ; preds = %29, %23
%32 = phi i32** [ %30, %29 ], [ undef, %23 ]
%33 = getelementptr inbounds i32, i32* %0, i64 1
%34 = load i32, i32* %33
%35 = icmp sgt i32 %4, 0
%36 = icmp sgt i32 %10, 0
%37 = and i1 %36, %35
%38 = icmp slt i32 %34, %27
%39 = and i1 %38, %37
br i1 %39, label %40, label %146
40: ; preds = %31
%41 = icmp sgt i32 %9, 0
%42 = add nsw i32 %27, 1
%43 = zext i32 %4 to i64
br label %44
44: ; preds = %132, %40
%45 = phi i64 [ 0, %40 ], [ %48, %132 ]
%46 = phi i32 [ 1, %40 ], [ %135, %132 ]
%47 = phi i32 [ 0, %40 ], [ %133, %132 ]
%48 = add nuw nsw i64 %45, 1
%49 = getelementptr inbounds i32, i32* %0, i64 %48
%50 = load i32, i32* %49
%51 = getelementptr inbounds i8, i8* %2, i64 %48
%52 = load i8, i8* %51
br i1 %20, label %57, label %53
53: ; preds = %44
%54 = sext i8 %52 to i32
%55 = trunc i64 %48 to i32
%56 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %55, i32 %50, i32 %54)
br label %57
57: ; preds = %53, %44
%58 = icmp sle i32 %46, %5
%59 = icmp slt i32 %47, %10
%60 = and i1 %58, %59
%61 = and i1 %41, %60
br i1 %61, label %62, label %121
62: ; preds = %57
%63 = sext i8 %52 to i32
%64 = icmp eq i8 %52, 1
%65 = sext i32 %46 to i64
%66 = trunc i64 %48 to i32
br label %67
67: ; preds = %62, %110
%68 = phi i64 [ %65, %62 ], [ %114, %110 ]
%69 = phi i32 [ 1, %62 ], [ %113, %110 ]
%70 = phi i32 [ %46, %62 ], [ %112, %110 ]
%71 = phi i32 [ %47, %62 ], [ %111, %110 ]
%72 = getelementptr inbounds i32, i32* %1, i64 %68
%73 = load i32, i32* %72
%74 = getelementptr inbounds i8, i8* %3, i64 %68
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
%77 = icmp eq i8 %75, 1
%78 = and i1 %64, %77
%79 = sub nsw i32 %73, %50
%80 = select i1 %78, i32 %79, i32 0
%81 = or i8 %75, %52
%82 = icmp eq i8 %81, 0
%83 = sub nsw i32 %50, %73
%84 = select i1 %82, i32 %83, i32 %80
%85 = mul nsw i32 %84, %13
br i1 %20, label %89, label %86
86: ; preds = %67
%87 = trunc i64 %68 to i32
%88 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %87, i32 %73, i32 %76, i32 %85)
br label %89
89: ; preds = %86, %67
%90 = icmp slt i32 %85, %9
%91 = icmp sgt i32 %85, 0
%92 = and i1 %90, %91
br i1 %92, label %93, label %110
93: ; preds = %89
%94 = icmp eq i32 %69, 1
%95 = trunc i64 %68 to i32
%96 = select i1 %94, i32 %95, i32 %70
%97 = icmp sgt i32 %85, %8
br i1 %97, label %98, label %110
98: ; preds = %93
%99 = add nsw i32 %71, 1
br i1 %28, label %100, label %110
100: ; preds = %98
%101 = sext i32 %99 to i64
%102 = getelementptr inbounds i32*, i32** %32, i64 %101
%103 = load i32*, i32** %102
%104 = getelementptr inbounds i32, i32* %103, i64 1
store i32 %50, i32* %104
%105 = getelementptr inbounds i32, i32* %103, i64 2
store i32 %73, i32* %105
%106 = getelementptr inbounds i32, i32* %103, i64 3
store i32 %66, i32* %106
%107 = getelementptr inbounds i32, i32* %103, i64 4
store i32 %95, i32* %107
%108 = getelementptr inbounds i32, i32* %103, i64 5
store i32 %63, i32* %108
%109 = getelementptr inbounds i32, i32* %103, i64 6
store i32 %76, i32* %109
br label %110
110: ; preds = %93, %100, %98, %89
%111 = phi i32 [ %99, %100 ], [ %99, %98 ], [ %71, %93 ], [ %71, %89 ]
%112 = phi i32 [ %96, %100 ], [ %96, %98 ], [ %96, %93 ], [ %70, %89 ]
%113 = phi i32 [ 0, %100 ], [ 0, %98 ], [ 0, %93 ], [ %69, %89 ]
%114 = add nsw i64 %68, 1
%115 = icmp slt i64 %68, %24
%116 = icmp slt i32 %111, %10
%117 = and i1 %115, %116
%118 = and i1 %90, %117
br i1 %118, label %67, label %119
119: ; preds = %110
%120 = icmp eq i32 %113, 1
br i1 %120, label %121, label %132
121: ; preds = %57, %119
%122 = phi i32 [ %112, %119 ], [ %46, %57 ]
%123 = phi i32 [ %111, %119 ], [ %47, %57 ]
%124 = sext i32 %122 to i64
%125 = getelementptr inbounds i32, i32* %1, i64 %124
%126 = load i32, i32* %125
%127 = icmp sgt i32 %50, %126
%128 = zext i1 %127 to i32
%129 = add nsw i32 %122, %128
%130 = icmp sgt i32 %129, %5
%131 = select i1 %130, i32 %42, i32 %50
br label %132
132: ; preds = %121, %119
%133 = phi i32 [ %111, %119 ], [ %123, %121 ]
%134 = phi i32 [ %50, %119 ], [ %131, %121 ]
%135 = phi i32 [ %112, %119 ], [ %129, %121 ]
%136 = icmp ult i64 %48, %43
%137 = icmp slt i32 %133, %10
%138 = and i1 %137, %136
%139 = icmp slt i32 %134, %27
%140 = and i1 %139, %138
br i1 %140, label %44, label %141
141: ; preds = %132
%142 = icmp sgt i32 %133, 0
%143 = and i1 %28, %142
br i1 %143, label %144, label %146
144: ; preds = %141
%145 = tail call i32 @remove_overlaps_v2(i32** %32, i32** %6, i32* %11, i32 %133, i32 2)
br label %146
146: ; preds = %31, %141, %144
%147 = phi i1 [ %139, %144 ], [ %139, %141 ], [ %38, %31 ]
%148 = phi i1 [ %136, %144 ], [ %136, %141 ], [ %35, %31 ]
%149 = phi i32 [ %145, %144 ], [ %133, %141 ], [ 0, %31 ]
%150 = and i1 %147, %148
%151 = sext i1 %150 to i32
%152 = getelementptr inbounds i32, i32* %7, i64 1
store i32 %151, i32* %152
store i32 %149, i32* %7
br i1 %28, label %153, label %155
153: ; preds = %146
%154 = tail call i32 @free_imatrix(i32** %32, i32 1, i32 %10, i32 1, i32 6)
br label %155
155: ; preds = %153, %146
ret void
}