#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);
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 /*<<< orphan*/ printf(char *, ...);
int remove_overlaps_v2(int **, int **, int *, int, int);
void dist_3v_ordered_v3(int **ovdi12_p, int *m3_p, char *m3_s, int n12, int n3,
                        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 *m12_p;
  char *m12_s;
  int n123;
  int n_123[2];
  int **ovdi123;
  int i;
  int curr_index;
  int n_cooc;
  int **all_ovdi;
  m12_p = ivector(1, n12);
  m12_s = cvector(1, n12);
  ovdi123 = imatrix(1, max_n_ovdi, 1, 6);
  all_ovdi = imatrix(1, max_n_ovdi, 1, 9);
  for (i = 1; i <= n12; i++) {
    m12_p[i] = ovdi12_p[i][2];
    m12_s[i] = ovdi12_p[i][6];
  }
  if (verbose) {
    printf("dist_3v_ordered_v3: motif 2 (%d): ", n12);
    for (i = 1; i <= n12; i++)
      printf("%d %d,", m12_p[i], m12_s[i]);
    printf("\n");
    printf("dist_3v_ordered_v3: motif 3 (%d): ", n3);
    for (i = 1; i <= n3; i++)
      printf("%d %d,", m3_p[i], m3_s[i]);
    printf("\n");
  }
  dist_2v_ordered_v2(m12_p, m3_p, m12_s, m3_s, n12, n3, ovdi123, n_123,
                     min_dist, max_dist, max_n_ovdi, ml, get_positions,
                     pos_format, verbose);
  n123 = n_123[0];
  if (verbose)
    printf("\tn123=%d\n", n123);
  if (get_positions == 1) {
    for (i = 1; i <= n123; i++) {
      curr_index = ovdi123[i][3];
      all_ovdi[i][1] = ovdi12_p[curr_index][1];
      all_ovdi[i][2] = ovdi123[i][1];
      all_ovdi[i][3] = ovdi123[i][2];
      all_ovdi[i][4] = ovdi12_p[curr_index][3];
      all_ovdi[i][5] = ovdi12_p[curr_index][4];
      all_ovdi[i][6] = ovdi123[i][4];
      all_ovdi[i][7] = ovdi12_p[curr_index][5];
      all_ovdi[i][8] = ovdi123[i][5];
      all_ovdi[i][9] = ovdi123[i][6];
    }
  }
  if ((n123 > 0) & (get_positions == 1)) {
    n_cooc = remove_overlaps_v2(all_ovdi, ovdi, ml, n123, 3);
  } else {
    n_cooc = n123;
  }
  n[0] = n_cooc;
  n[1] = n_123[1];
  free_ivector(m12_p, 1, n12);
  free_cvector(m12_s, 1, n12);
  free_imatrix(ovdi123, 1, max_n_ovdi, 1, 6);
  free_imatrix(all_ovdi, 1, max_n_ovdi, 1, 9);
}


x86 assembly (clang, -O0):
<dist_3v_ordered_v3>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    0x48(%rbp),%eax
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   1090 <ivector@plt>
mov    %rax,-0x58(%rbp)
mov    -0x44(%rbp),%esi
mov    $0x1,%edi
call   1050 <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    $0x9,%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     1281 <dist_3v_ordered_v3+0xf1>
mov    -0x30(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x8(%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    0x18(%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    1231 <dist_3v_ordered_v3+0xa1>
cmpl   $0x0,0x48(%rbp)
je     1355 <dist_3v_ordered_v3+0x1c5>
mov    -0x44(%rbp),%esi
lea    0xd6b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x44(%rbp),%eax
jg     12e2 <dist_3v_ordered_v3+0x152>
mov    -0x58(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x60(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
lea    0xd56(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    12a3 <dist_3v_ordered_v3+0x113>
lea    0xd6c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x48(%rbp),%esi
lea    0xd30(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x48(%rbp),%eax
jg     1347 <dist_3v_ordered_v3+0x1b7>
mov    -0x38(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x40(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
lea    0xcf1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    1308 <dist_3v_ordered_v3+0x178>
lea    0xd07(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
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),%rax
mov    %rax,-0xa0(%rbp)
lea    -0x6c(%rbp),%r13
mov    0x18(%rbp),%r12d
mov    0x20(%rbp),%r15d
mov    0x28(%rbp),%r14d
mov    0x30(%rbp),%rbx
mov    0x38(%rbp),%r11d
mov    0x40(%rbp),%r10d
mov    0x48(%rbp),%eax
mov    %eax,-0x94(%rbp)
mov    -0xa0(%rbp),%rax
mov    %rax,(%rsp)
mov    -0x94(%rbp),%eax
mov    %r13,0x8(%rsp)
mov    %r12d,0x10(%rsp)
mov    %r15d,0x18(%rsp)
mov    %r14d,0x20(%rsp)
mov    %rbx,0x28(%rsp)
mov    %r11d,0x30(%rsp)
mov    %r10d,0x38(%rsp)
mov    %eax,0x40(%rsp)
call   10a0 <dist_2v_ordered_v2@plt>
mov    -0x6c(%rbp),%eax
mov    %eax,-0x64(%rbp)
cmpl   $0x0,0x48(%rbp)
je     13fb <dist_3v_ordered_v3+0x26b>
mov    -0x64(%rbp),%esi
lea    0xc59(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x1,0x38(%rbp)
jne    1566 <dist_3v_ordered_v3+0x3d6>
movl   $0x1,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x64(%rbp),%eax
jg     1561 <dist_3v_ordered_v3+0x3d1>
mov    -0x78(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x80(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x80(%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    -0x78(%rbp),%rax
movslq -0x7c(%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,0x8(%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,0xc(%rax)
mov    -0x30(%rbp),%rax
movslq -0x80(%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,0x10(%rax)
mov    -0x30(%rbp),%rax
movslq -0x80(%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    -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,0x18(%rax)
mov    -0x30(%rbp),%rax
movslq -0x80(%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,0x1c(%rax)
mov    -0x78(%rbp),%rax
movslq -0x7c(%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,0x20(%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,0x24(%rax)
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    140c <dist_3v_ordered_v3+0x27c>
jmp    1566 <dist_3v_ordered_v3+0x3d6>
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     15b2 <dist_3v_ordered_v3+0x422>
mov    -0x90(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    0x30(%rbp),%rdx
mov    -0x64(%rbp),%ecx
mov    $0x3,%r8d
call   10b0 <remove_overlaps_v2@plt>
mov    %eax,-0x84(%rbp)
jmp    15bb <dist_3v_ordered_v3+0x42b>
mov    -0x64(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x84(%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   1080 <free_ivector@plt>
mov    -0x60(%rbp),%rdi
mov    -0x44(%rbp),%edx
mov    $0x1,%esi
call   1070 <free_cvector@plt>
mov    -0x78(%rbp),%rdi
mov    0x28(%rbp),%edx
mov    $0x1,%ecx
mov    $0x6,%r8d
mov    %ecx,%esi
call   1060 <free_imatrix@plt>
mov    -0x90(%rbp),%rdi
mov    0x28(%rbp),%edx
mov    $0x1,%ecx
mov    $0x9,%r8d
mov    %ecx,%esi
call   1060 <free_imatrix@plt>
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist_3v_ordered_v3>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r9,0x50(%rsp)
mov    %r8,0x8(%rsp)
mov    %ecx,%ebp
mov    %rdx,0x30(%rsp)
mov    %rsi,0x28(%rsp)
mov    %rdi,%r14
mov    0xc8(%rsp),%r13d
mov    0xa8(%rsp),%ebx
mov    $0x1,%edi
mov    %ecx,%esi
call   10a0 <ivector@plt>
mov    %rax,%r12
mov    $0x1,%edi
mov    %ebp,%esi
call   1060 <cvector@plt>
mov    %rax,%r15
mov    $0x1,%edi
mov    %ebx,%esi
mov    $0x1,%edx
mov    $0x6,%ecx
call   1040 <imatrix@plt>
mov    %rax,0x10(%rsp)
mov    $0x1,%edi
mov    %ebx,%esi
mov    $0x1,%edx
mov    $0x9,%ecx
call   1040 <imatrix@plt>
mov    %rax,0x38(%rsp)
test   %ebp,%ebp
mov    %rbp,0x20(%rsp)
jle    12fe <dist_3v_ordered_v3+0x15e>
mov    %ebp,%eax
mov    $0x1,%ecx
cmp    $0x1,%ebp
je     128b <dist_3v_ordered_v3+0xeb>
mov    %eax,%edx
and    $0xfffffffe,%edx
neg    %rdx
mov    $0x1,%ecx
mov    (%r14,%rcx,8),%rsi
mov    0x8(%rsi),%edi
mov    %edi,(%r12,%rcx,4)
movzbl 0x18(%rsi),%ebx
mov    %bl,(%r15,%rcx,1)
mov    0x8(%r14,%rcx,8),%rsi
mov    0x8(%rsi),%edi
mov    %edi,0x4(%r12,%rcx,4)
movzbl 0x18(%rsi),%ebx
mov    %bl,0x1(%r15,%rcx,1)
lea    (%rdx,%rcx,1),%rsi
add    $0x2,%rsi
add    $0x2,%rcx
cmp    $0x1,%rsi
jne    1250 <dist_3v_ordered_v3+0xb0>
test   $0x1,%al
je     12a1 <dist_3v_ordered_v3+0x101>
mov    (%r14,%rcx,8),%rax
mov    0x8(%rax),%edx
mov    %edx,(%r12,%rcx,4)
mov    0x18(%rax),%al
mov    %al,(%r15,%rcx,1)
mov    0xc8(%rsp),%eax
test   %eax,%eax
je     141c <dist_3v_ordered_v3+0x27c>
lea    0xd49(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebp,%ebp
jle    1317 <dist_3v_ordered_v3+0x177>
mov    0x20(%rsp),%rax
lea    0x1(%rax),%ebp
mov    $0x1,%ebx
lea    0xd4b(%rip),%r13
nopl   0x0(%rax,%rax,1)
mov    (%r12,%rbx,4),%esi
movsbl (%r15,%rbx,1),%edx
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    12e0 <dist_3v_ordered_v3+0x140>
jmp    1317 <dist_3v_ordered_v3+0x177>
test   %r13d,%r13d
je     141c <dist_3v_ordered_v3+0x27c>
lea    0xcf2(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,0x40(%rsp)
mov    %r12,0x48(%rsp)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xcf8(%rip),%rdi
mov    0x8(%rsp),%rbx
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebx,%ebx
mov    0x30(%rsp),%r12
mov    0x28(%rsp),%r15
jle    138c <dist_3v_ordered_v3+0x1ec>
mov    0x8(%rsp),%rax
lea    0x1(%rax),%ebx
mov    $0x1,%ebp
lea    0xcc1(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15,%rbp,4),%esi
movsbl (%r12,%rbp,1),%edx
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1370 <dist_3v_ordered_v3+0x1d0>
mov    $0xa,%edi
call   1030 <putchar@plt>
sub    $0x8,%rsp
lea    0x20(%rsp),%rax
mov    0x50(%rsp),%rdi
mov    %r15,%rsi
mov    0x48(%rsp),%r15
mov    %r15,%rdx
mov    %r12,%rcx
mov    %rdi,%r12
mov    0x28(%rsp),%r8
mov    0x10(%rsp),%r9
mov    0xd0(%rsp),%ebp
push   %rbp
mov    0xd0(%rsp),%ebp
push   %rbp
mov    0xd0(%rsp),%ebx
push   %rbx
push   0xd0(%rsp)
mov    0xd0(%rsp),%ebp
push   %rbp
mov    0xd0(%rsp),%ebp
push   %rbp
mov    0xd0(%rsp),%ebp
push   %rbp
push   %rax
push   0x58(%rsp)
call   10b0 <dist_2v_ordered_v2@plt>
add    $0x50,%rsp
mov    0x18(%rsp),%r13d
lea    0xc3d(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1481 <dist_3v_ordered_v3+0x2e1>
sub    $0x8,%rsp
lea    0x20(%rsp),%rax
mov    %r12,%rdi
mov    0x30(%rsp),%rsi
mov    %r15,%rdx
mov    0x38(%rsp),%rcx
mov    %ebp,%r8d
mov    0x10(%rsp),%r9
push   $0x0
mov    0xd0(%rsp),%ebp
push   %rbp
mov    0xd0(%rsp),%ebx
push   %rbx
push   0xd0(%rsp)
mov    0xd0(%rsp),%ebp
push   %rbp
mov    0xd0(%rsp),%ebp
push   %rbp
mov    0xd0(%rsp),%ebp
push   %rbp
push   %rax
push   0x58(%rsp)
call   10b0 <dist_2v_ordered_v2@plt>
add    $0x50,%rsp
mov    0x18(%rsp),%r13d
mov    0x90(%rsp),%r9
cmp    $0x1,%ebx
jne    1529 <dist_3v_ordered_v3+0x389>
test   %r13d,%r13d
jle    1529 <dist_3v_ordered_v3+0x389>
lea    0x1(%r13),%r8d
mov    $0x1,%ecx
mov    0x10(%rsp),%rbp
mov    0x38(%rsp),%rdi
xchg   %ax,%ax
mov    0x0(%rbp,%rcx,8),%rdx
movslq 0xc(%rdx),%rsi
mov    (%r14,%rsi,8),%rsi
mov    0x4(%rsi),%eax
mov    (%rdi,%rcx,8),%rbx
mov    %eax,0x4(%rbx)
mov    0x4(%rdx),%eax
mov    %eax,0x8(%rbx)
mov    0x8(%rdx),%eax
mov    %eax,0xc(%rbx)
mov    0xc(%rsi),%eax
mov    %eax,0x10(%rbx)
mov    0x10(%rsi),%eax
mov    %eax,0x14(%rbx)
mov    0x10(%rdx),%eax
mov    %eax,0x18(%rbx)
mov    0x14(%rsi),%esi
mov    %esi,0x1c(%rbx)
mov    0x14(%rdx),%esi
mov    %esi,0x20(%rbx)
mov    0x18(%rdx),%edx
mov    %edx,0x24(%rbx)
add    $0x1,%rcx
cmp    %rcx,%r8
jne    14b0 <dist_3v_ordered_v3+0x310>
test   %r13d,%r13d
jle    1529 <dist_3v_ordered_v3+0x389>
mov    0x50(%rsp),%rsi
mov    0xb0(%rsp),%rdx
mov    %r13d,%ecx
mov    $0x3,%r8d
mov    %r9,%rbx
call   10c0 <remove_overlaps_v2@plt>
mov    %rbx,%r9
mov    %eax,%r13d
mov    %r13d,(%r9)
mov    0x1c(%rsp),%eax
mov    %eax,0x4(%r9)
mov    %r12,%rdi
mov    $0x1,%esi
mov    0x20(%rsp),%rbx
mov    %ebx,%edx
call   1090 <free_ivector@plt>
mov    %r15,%rdi
mov    $0x1,%esi
mov    %ebx,%edx
call   1080 <free_cvector@plt>
mov    0x10(%rsp),%rdi
mov    $0x1,%esi
mov    0xa8(%rsp),%ebx
mov    %ebx,%edx
mov    $0x1,%ecx
mov    $0x6,%r8d
call   1070 <free_imatrix@plt>
mov    0x38(%rsp),%rdi
mov    $0x1,%esi
mov    %ebx,%edx
mov    $0x1,%ecx
mov    $0x9,%r8d
call   1070 <free_imatrix@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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