#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*/ dist_2v_allt_v4(int *, int *, int *, int *, char *, char *,
                                   int, int, int **, int *, int, int, int,
                                   int *, int, int, int, int, int, int **,
                                   int **, int *, char *, int *, char *,
                                   int /*<<< orphan*/);
int /*<<< orphan*/ dist_3v_allt_v4(int **, int *, int *, char *, int, int,
                                   int **, int *, int, int, int, int *, int,
                                   int, int, int, int, int **, int **, int **,
                                   int **, int **, int *, char *, int *, char *,
                                   int /*<<< orphan*/);
int /*<<< orphan*/ free_imatrix(int **, int, int, int, int);
int **imatrix(int, int, int, int);
int /*<<< orphan*/ printf(char *, ...);
void dist_3v_allt_from_m123_v2(
    int *m1_t, int *m2_t, int *m3_t, int *m1_p, int *m2_p, int *m3_p,
    char *m1_s, char *m2_s, char *m3_s, int n1, int n2, int n3, int **ovdi,
    int *n, int min_dist, int max_dist, int n_transcripts, int *ml,
    int get_positions, int order_constraint, int max_n_transcripts,
    int max_n_ovdi, int pos_format, int **ovdi_single_transcript6,
    int **temp_ovdi6, int **ovdi_single_transcript9, int **temp_ovdi9,
    int **all_ovdi6, int *m1p, char *m1s, int *m2p, char *m2s, int *m3p,
    char *m3s, int *m12_p, char *m12_s, int verbose) {
  int **ovdi12;
  int max_n_ovdi12 = 500000;
  int nout12[4];
  int nout123[4];
  int n12;
  int get_positions12 = 1;
  int max_n_transcripts12 = -1;
  int errorcode = 0;
  int i, j;
  ovdi12 = imatrix(1, max_n_ovdi12, 1, 7);
  if (verbose) {
    printf("motif 1 (%d): ", n1);
    for (i = 1; i <= n1; i++)
      printf("%d %d %d,", m1_t[i], m1_p[i], m1_s[i]);
    printf("\n");
    printf("motif 2 (%d): ", n2);
    for (i = 1; i <= n2; i++)
      printf("%d %d %d,", m2_t[i], m2_p[i], m2_s[i]);
    printf("\n");
    printf("motif 3 (%d): ", n3);
    for (i = 1; i <= n3; i++)
      printf("%d %d %d,", m3_t[i], m3_p[i], m3_s[i]);
    printf("\n");
  }
  dist_2v_allt_v4(m1_t, m2_t, m1_p, m2_p, m1_s, m2_s, n1, n2, ovdi12, nout12,
                  min_dist, max_dist, n_transcripts, ml, get_positions12,
                  order_constraint, max_n_transcripts12, max_n_ovdi12,
                  pos_format, ovdi_single_transcript6, temp_ovdi6, m1p, m1s,
                  m2p, m2s, 0);
  errorcode += nout12[2];
  if (errorcode < 0) {
    n12 = nout12[3];
  } else {
    n12 = nout12[0];
  }
  if (verbose) {
    printf("ovdi12 (%d)\n", n12);
    for (i = 1; i <= n12; i++)
      printf("%d %d %d %d %d\n", ovdi12[i][1], ovdi12[i][2], ovdi12[i][3],
             ovdi12[i][6], ovdi12[i][7]);
  }
  dist_3v_allt_v4(ovdi12, m3_t, m3_p, m3_s, n12, n3, ovdi, nout123, min_dist,
                  max_dist, n_transcripts, ml, get_positions, order_constraint,
                  max_n_transcripts, max_n_ovdi, pos_format,
                  ovdi_single_transcript9, temp_ovdi9, ovdi_single_transcript6,
                  temp_ovdi6, all_ovdi6, m3p, m3s, m12_p, m12_s, 0);
  n[0] = nout123[0];
  n[1] = nout123[1];
  errorcode += nout123[2];
  n[2] = errorcode;
  n[3] = nout123[3];
  if (verbose) {
    printf("ovdi123 (%d)\n", n[0]);
    for (i = 1; i <= n[0]; i++)
      printf("%d %d %d %d %d %d %d\n", ovdi[i][1], ovdi[i][2], ovdi[i][3],
             ovdi[i][4], ovdi[i][8], ovdi[i][9], ovdi[i][10]);
  }
  free_imatrix(ovdi12, 1, max_n_ovdi12, 1, 7);
}


x86 assembly (clang, -O0):
<dist_3v_allt_from_m123_v2>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1c8,%rsp
mov    0x100(%rbp),%eax
mov    0xf8(%rbp),%rax
mov    0xf0(%rbp),%rax
mov    0xe8(%rbp),%rax
mov    0xe0(%rbp),%rax
mov    0xd8(%rbp),%rax
mov    0xd0(%rbp),%rax
mov    0xc8(%rbp),%rax
mov    0xc0(%rbp),%rax
mov    0xb8(%rbp),%rax
mov    0xb0(%rbp),%rax
mov    0xa8(%rbp),%rax
mov    0xa0(%rbp),%rax
mov    0x98(%rbp),%rax
mov    0x90(%rbp),%eax
mov    0x88(%rbp),%eax
mov    0x80(%rbp),%eax
mov    0x78(%rbp),%eax
mov    0x70(%rbp),%eax
mov    0x68(%rbp),%rax
mov    0x60(%rbp),%eax
mov    0x58(%rbp),%eax
mov    0x50(%rbp),%eax
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x48(%rbp)
mov    %r8,-0x50(%rbp)
mov    %r9,-0x58(%rbp)
movl   $0x7a120,-0x64(%rbp)
movl   $0x1,-0x98(%rbp)
movl   $0xffffffff,-0x9c(%rbp)
ff ff ff
movl   $0x0,-0xa0(%rbp)
mov    -0x64(%rbp),%esi
mov    $0x1,%edx
mov    $0x7,%ecx
mov    %edx,%edi
call   1040 <imatrix@plt>
mov    %rax,-0x60(%rbp)
cmpl   $0x0,0x100(%rbp)
je     13f8 <dist_3v_allt_from_m123_v2+0x2a8>
mov    0x28(%rbp),%esi
lea    0xd8d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    0x28(%rbp),%eax
jg     12e0 <dist_3v_allt_from_m123_v2+0x190>
mov    -0x30(%rbp),%rax
movslq -0xa4(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x48(%rbp),%rax
movslq -0xa4(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    0x10(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
lea    0xd4a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1284 <dist_3v_allt_from_m123_v2+0x134>
lea    0xd5b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x30(%rbp),%esi
lea    0xd21(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    0x30(%rbp),%eax
jg     1365 <dist_3v_allt_from_m123_v2+0x215>
mov    -0x38(%rbp),%rax
movslq -0xa4(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x50(%rbp),%rax
movslq -0xa4(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    0x18(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
lea    0xcc5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1309 <dist_3v_allt_from_m123_v2+0x1b9>
lea    0xcd6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x38(%rbp),%esi
lea    0xcab(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    0x38(%rbp),%eax
jg     13ea <dist_3v_allt_from_m123_v2+0x29a>
mov    -0x40(%rbp),%rax
movslq -0xa4(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x58(%rbp),%rax
movslq -0xa4(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    0x20(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
lea    0xc40(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    138e <dist_3v_allt_from_m123_v2+0x23e>
lea    0xc51(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    -0x50(%rbp),%rcx
mov    0x10(%rbp),%r8
mov    0x18(%rbp),%r9
mov    0x28(%rbp),%eax
mov    %eax,-0xf0(%rbp)
mov    0x30(%rbp),%eax
mov    %eax,-0xec(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0xe8(%rbp)
lea    -0x80(%rbp),%rax
mov    %rax,-0xe0(%rbp)
mov    0x50(%rbp),%eax
mov    %eax,-0xd4(%rbp)
mov    0x58(%rbp),%eax
mov    %eax,-0xd0(%rbp)
mov    0x60(%rbp),%eax
mov    %eax,-0xcc(%rbp)
mov    0x68(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    -0x98(%rbp),%eax
mov    %eax,-0xbc(%rbp)
mov    0x78(%rbp),%eax
mov    %eax,-0xb8(%rbp)
mov    -0x9c(%rbp),%eax
mov    %eax,-0xb4(%rbp)
mov    -0x64(%rbp),%r13d
mov    0x90(%rbp),%r12d
mov    0x98(%rbp),%r15
mov    0xa0(%rbp),%r14
mov    0xc0(%rbp),%rbx
mov    0xc8(%rbp),%r11
mov    0xd0(%rbp),%r10
mov    0xd8(%rbp),%rax
mov    %rax,-0xb0(%rbp)
xor    %eax,%eax
mov    -0xf0(%rbp),%eax
mov    %eax,(%rsp)
mov    -0xec(%rbp),%eax
mov    %eax,0x8(%rsp)
mov    -0xe8(%rbp),%rax
mov    %rax,0x10(%rsp)
mov    -0xe0(%rbp),%rax
mov    %rax,0x18(%rsp)
mov    -0xd4(%rbp),%eax
mov    %eax,0x20(%rsp)
mov    -0xd0(%rbp),%eax
mov    %eax,0x28(%rsp)
mov    -0xcc(%rbp),%eax
mov    %eax,0x30(%rsp)
mov    -0xc8(%rbp),%rax
mov    %rax,0x38(%rsp)
mov    -0xbc(%rbp),%eax
mov    %eax,0x40(%rsp)
mov    -0xb8(%rbp),%eax
mov    %eax,0x48(%rsp)
mov    -0xb4(%rbp),%eax
mov    %eax,0x50(%rsp)
mov    -0xb0(%rbp),%rax
mov    %r13d,0x58(%rsp)
mov    %r12d,0x60(%rsp)
mov    %r15,0x68(%rsp)
mov    %r14,0x70(%rsp)
mov    %rbx,0x78(%rsp)
mov    %r11,0x80(%rsp)
mov    %r10,0x88(%rsp)
mov    %rax,0x90(%rsp)
movl   $0x0,0x98(%rsp)
call   1050 <dist_2v_allt_v4@plt>
mov    -0x78(%rbp),%eax
add    -0xa0(%rbp),%eax
mov    %eax,-0xa0(%rbp)
cmpl   $0x0,-0xa0(%rbp)
jge    15a2 <dist_3v_allt_from_m123_v2+0x452>
mov    -0x74(%rbp),%eax
mov    %eax,-0x94(%rbp)
jmp    15ab <dist_3v_allt_from_m123_v2+0x45b>
mov    -0x80(%rbp),%eax
mov    %eax,-0x94(%rbp)
cmpl   $0x0,0x100(%rbp)
je     166b <dist_3v_allt_from_m123_v2+0x51b>
mov    -0x94(%rbp),%esi
lea    0xa72(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0x94(%rbp),%eax
jg     1666 <dist_3v_allt_from_m123_v2+0x516>
mov    -0x60(%rbp),%rax
movslq -0xa4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x4(%rax),%esi
mov    -0x60(%rbp),%rax
movslq -0xa4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x8(%rax),%edx
mov    -0x60(%rbp),%rax
movslq -0xa4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0xc(%rax),%ecx
mov    -0x60(%rbp),%rax
movslq -0xa4(%rbp),%rdi
mov    (%rax,%rdi,8),%rax
mov    0x18(%rax),%r8d
mov    -0x60(%rbp),%rax
movslq -0xa4(%rbp),%rdi
mov    (%rax,%rdi,8),%rax
mov    0x1c(%rax),%r9d
lea    0xa0d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    15d6 <dist_3v_allt_from_m123_v2+0x486>
jmp    166b <dist_3v_allt_from_m123_v2+0x51b>
mov    -0x60(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x58(%rbp),%rdx
mov    0x20(%rbp),%rcx
mov    -0x94(%rbp),%r8d
mov    0x38(%rbp),%r9d
mov    0x40(%rbp),%rax
mov    %rax,-0x140(%rbp)
lea    -0x90(%rbp),%rax
mov    %rax,-0x138(%rbp)
mov    0x50(%rbp),%eax
mov    %eax,-0x12c(%rbp)
mov    0x58(%rbp),%eax
mov    %eax,-0x128(%rbp)
mov    0x60(%rbp),%eax
mov    %eax,-0x124(%rbp)
mov    0x68(%rbp),%rax
mov    %rax,-0x120(%rbp)
mov    0x70(%rbp),%eax
mov    %eax,-0x114(%rbp)
mov    0x78(%rbp),%eax
mov    %eax,-0x110(%rbp)
mov    0x80(%rbp),%eax
mov    %eax,-0x10c(%rbp)
mov    0x88(%rbp),%eax
mov    %eax,-0x108(%rbp)
mov    0x90(%rbp),%eax
mov    %eax,-0x104(%rbp)
mov    0xa8(%rbp),%rax
mov    %rax,-0x100(%rbp)
mov    0xb0(%rbp),%r13
mov    0x98(%rbp),%r12
mov    0xa0(%rbp),%r15
mov    0xb8(%rbp),%r14
mov    0xe0(%rbp),%rbx
mov    0xe8(%rbp),%r11
mov    0xf0(%rbp),%r10
mov    0xf8(%rbp),%rax
mov    %rax,-0xf8(%rbp)
xor    %eax,%eax
mov    -0x140(%rbp),%rax
mov    %rax,(%rsp)
mov    -0x138(%rbp),%rax
mov    %rax,0x8(%rsp)
mov    -0x12c(%rbp),%eax
mov    %eax,0x10(%rsp)
mov    -0x128(%rbp),%eax
mov    %eax,0x18(%rsp)
mov    -0x124(%rbp),%eax
mov    %eax,0x20(%rsp)
mov    -0x120(%rbp),%rax
mov    %rax,0x28(%rsp)
mov    -0x114(%rbp),%eax
mov    %eax,0x30(%rsp)
mov    -0x110(%rbp),%eax
mov    %eax,0x38(%rsp)
mov    -0x10c(%rbp),%eax
mov    %eax,0x40(%rsp)
mov    -0x108(%rbp),%eax
mov    %eax,0x48(%rsp)
mov    -0x104(%rbp),%eax
mov    %eax,0x50(%rsp)
mov    -0x100(%rbp),%rax
mov    %rax,0x58(%rsp)
mov    -0xf8(%rbp),%rax
mov    %r13,0x60(%rsp)
mov    %r12,0x68(%rsp)
mov    %r15,0x70(%rsp)
mov    %r14,0x78(%rsp)
mov    %rbx,0x80(%rsp)
mov    %r11,0x88(%rsp)
mov    %r10,0x90(%rsp)
mov    %rax,0x98(%rsp)
movl   $0x0,0xa0(%rsp)
call   1030 <dist_3v_allt_v4@plt>
mov    -0x90(%rbp),%ecx
mov    0x48(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8c(%rbp),%ecx
mov    0x48(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x88(%rbp),%eax
add    -0xa0(%rbp),%eax
mov    %eax,-0xa0(%rbp)
mov    -0xa0(%rbp),%ecx
mov    0x48(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x84(%rbp),%ecx
mov    0x48(%rbp),%rax
mov    %ecx,0xc(%rax)
cmpl   $0x0,0x100(%rbp)
je     1946 <dist_3v_allt_from_m123_v2+0x7f6>
mov    0x48(%rbp),%rax
mov    (%rax),%esi
lea    0x7d1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
mov    0x48(%rbp),%rcx
cmp    (%rcx),%eax
jg     1941 <dist_3v_allt_from_m123_v2+0x7f1>
mov    0x40(%rbp),%rax
movslq -0xa4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x4(%rax),%esi
mov    0x40(%rbp),%rax
movslq -0xa4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x8(%rax),%edx
mov    0x40(%rbp),%rax
movslq -0xa4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0xc(%rax),%ecx
mov    0x40(%rbp),%rax
movslq -0xa4(%rbp),%rdi
mov    (%rax,%rdi,8),%rax
mov    0x10(%rax),%r8d
mov    0x40(%rbp),%rax
movslq -0xa4(%rbp),%rdi
mov    (%rax,%rdi,8),%rax
mov    0x20(%rax),%r9d
mov    0x40(%rbp),%rax
movslq -0xa4(%rbp),%rdi
mov    (%rax,%rdi,8),%rax
mov    0x24(%rax),%r10d
mov    0x40(%rbp),%rax
movslq -0xa4(%rbp),%rdi
mov    (%rax,%rdi,8),%rax
mov    0x28(%rax),%eax
lea    0x734(%rip),%rdi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1884 <dist_3v_allt_from_m123_v2+0x734>
jmp    1946 <dist_3v_allt_from_m123_v2+0x7f6>
mov    -0x60(%rbp),%rdi
mov    -0x64(%rbp),%edx
mov    $0x1,%ecx
mov    $0x7,%r8d
mov    %ecx,%esi
call   1070 <free_imatrix@plt>
add    $0x1c8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist_3v_allt_from_m123_v2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r9,0x28(%rsp)
mov    %r8,%r12
mov    %rcx,(%rsp)
mov    %rdx,0x20(%rsp)
mov    %rsi,0x18(%rsp)
mov    %rdi,0x10(%rsp)
mov    0x158(%rsp),%r14
mov    0x150(%rsp),%r15
mov    0xc0(%rsp),%r13d
mov    0xb8(%rsp),%ebx
mov    0xa8(%rsp),%rbp
mov    $0x1,%edi
mov    $0x7a120,%esi
mov    $0x1,%edx
mov    $0x7,%ecx
call   1050 <imatrix@plt>
mov    %rax,0x48(%rsp)
mov    %r15,%rax
cmpl   $0x0,0x190(%rsp)
je     135a <dist_3v_allt_from_m123_v2+0x1fa>
mov    %r12,0x8(%rsp)
lea    0xe15(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1070 <printf@plt>
test   %ebx,%ebx
mov    (%rsp),%r12
mov    0x10(%rsp),%r14
mov    0xa0(%rsp),%r13
jle    1241 <dist_3v_allt_from_m123_v2+0xe1>
add    $0x1,%ebx
mov    $0x1,%ebp
lea    0xdf7(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbp,4),%esi
mov    (%r12,%rbp,4),%edx
movsbl 0x0(%r13,%rbp,1),%ecx
mov    %r15,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1220 <dist_3v_allt_from_m123_v2+0xc0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdc7(%rip),%rdi
mov    0xc0(%rsp),%ebx
mov    %ebx,%esi
xor    %eax,%eax
call   1070 <printf@plt>
test   %ebx,%ebx
mov    0x18(%rsp),%r12
mov    0xa8(%rsp),%r14
mov    0x8(%rsp),%r13
jle    12b1 <dist_3v_allt_from_m123_v2+0x151>
lea    0x1(%rbx),%ebp
mov    $0x1,%ebx
lea    0xd88(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    (%r12,%rbx,4),%esi
mov    0x0(%r13,%rbx,4),%edx
movsbl (%r14,%rbx,1),%ecx
mov    %r15,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1290 <dist_3v_allt_from_m123_v2+0x130>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd66(%rip),%rdi
mov    0xc8(%rsp),%ebx
mov    %ebx,%esi
xor    %eax,%eax
call   1070 <printf@plt>
test   %ebx,%ebx
mov    0x28(%rsp),%r12
mov    0x20(%rsp),%r13
mov    0xb0(%rsp),%r14
jle    1321 <dist_3v_allt_from_m123_v2+0x1c1>
mov    0xc8(%rsp),%eax
lea    0x1(%rax),%ebp
mov    $0x1,%ebx
lea    0xd11(%rip),%r15
xchg   %ax,%ax
mov    0x0(%r13,%rbx,4),%esi
mov    (%r12,%rbx,4),%edx
movsbl (%r14,%rbx,1),%ecx
mov    %r15,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1300 <dist_3v_allt_from_m123_v2+0x1a0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xb8(%rsp),%ebx
mov    0xc0(%rsp),%r14d
mov    %r14,%r13
mov    0x150(%rsp),%rax
mov    0x158(%rsp),%r14
mov    0x8(%rsp),%r12
mov    0xa8(%rsp),%rbp
mov    0xd8(%rsp),%r15
lea    0x50(%rsp),%r10
mov    0x10(%rsp),%rdi
mov    0x18(%rsp),%rsi
mov    (%rsp),%rdx
mov    %r12,%rcx
mov    0xa0(%rsp),%r8
mov    %rbp,%r9
push   $0x0
push   0x170(%rsp)
push   0x170(%rsp)
push   %r14
push   %rax
push   0x158(%rsp)
push   0x158(%rsp)
mov    0x158(%rsp),%eax
push   %rax
push   $0x7a120
push   $0xffffffffffffffff
mov    0x158(%rsp),%eax
push   %rax
push   $0x1
push   0x158(%rsp)
mov    0x158(%rsp),%eax
push   %rax
mov    0x158(%rsp),%eax
push   %rax
mov    0x158(%rsp),%eax
push   %rax
mov    %r10,%rbp
push   %r10
mov    0xd0(%rsp),%r12
push   %r12
push   %r13
push   %rbx
call   1060 <dist_2v_allt_v4@plt>
add    $0xa0,%rsp
mov    0x58(%rsp),%eax
mov    %eax,(%rsp)
test   %eax,%eax
lea    0x5c(%rsp),%rax
cmovns %rbp,%rax
mov    (%rax),%r14d
cmpl   $0x0,0x190(%rsp)
je     1468 <dist_3v_allt_from_m123_v2+0x308>
lea    0xc17(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
test   %r14d,%r14d
jle    1468 <dist_3v_allt_from_m123_v2+0x308>
lea    0x1(%r14),%ebx
mov    $0x1,%ebp
lea    0xc19(%rip),%r13
nop
mov    (%r12,%rbp,8),%rax
mov    0x4(%rax),%esi
mov    0x8(%rax),%edx
mov    0xc(%rax),%ecx
mov    0x18(%rax),%r8d
mov    0x1c(%rax),%r9d
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1440 <dist_3v_allt_from_m123_v2+0x2e0>
sub    $0x8,%rsp
lea    0x38(%rsp),%rax
mov    %r12,%rdi
mov    0x28(%rsp),%rsi
mov    0x30(%rsp),%rdx
mov    0xb8(%rsp),%rcx
mov    %r14d,%r8d
mov    0xd0(%rsp),%r9d
push   $0x0
push   0x198(%rsp)
push   0x198(%rsp)
push   0x198(%rsp)
push   0x198(%rsp)
push   0x178(%rsp)
push   0x168(%rsp)
push   0x168(%rsp)
push   0x188(%rsp)
push   0x188(%rsp)
mov    0x178(%rsp),%ebp
push   %rbp
mov    0x178(%rsp),%ebp
push   %rbp
mov    0x178(%rsp),%ebp
push   %rbp
mov    0x178(%rsp),%ebp
push   %rbp
mov    0x178(%rsp),%ebp
push   %rbp
push   0x178(%rsp)
mov    0x178(%rsp),%ebp
push   %rbp
mov    0x178(%rsp),%ebp
push   %rbp
mov    0x178(%rsp),%ebp
push   %rbp
push   %rax
mov    0x178(%rsp),%r13
push   %r13
call   1040 <dist_3v_allt_v4@plt>
add    $0xb0,%rsp
mov    0x30(%rsp),%esi
mov    %esi,(%r15)
mov    0x34(%rsp),%eax
mov    %eax,0x4(%r15)
mov    (%rsp),%eax
add    0x38(%rsp),%eax
mov    %eax,0x8(%r15)
mov    0x3c(%rsp),%eax
mov    %eax,0xc(%r15)
cmpl   $0x0,0x190(%rsp)
je     15ba <dist_3v_allt_from_m123_v2+0x45a>
lea    0xae1(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
cmpl   $0x0,(%r15)
jle    15ba <dist_3v_allt_from_m123_v2+0x45a>
lea    0xadb(%rip),%r14
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    0x8(%r13,%rbp,8),%rax
mov    0x4(%rax),%esi
mov    0x8(%rax),%edx
mov    0xc(%rax),%ecx
mov    0x10(%rax),%r8d
mov    0x20(%rax),%r9d
mov    0x24(%rax),%r10d
mov    0x28(%rax),%ebx
mov    %r14,%rdi
xor    %eax,%eax
push   %rbx
push   %r10
call   1070 <printf@plt>
add    $0x10,%rsp
movslq (%r15),%rax
add    $0x1,%rbp
cmp    %rax,%rbp
jl     1580 <dist_3v_allt_from_m123_v2+0x420>
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x7a120,%edx
mov    $0x1,%ecx
mov    $0x7,%r8d
call   1080 <free_imatrix@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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