#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*/ crm_1motifs(int *, int, int, int, int, int, int, 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);
void crm_1motifs_allt(int *m1_t, int *m1_p, int n1, int max_n_transcripts,
                      int max_crm_positions, int N, int dw, int bin_size,
                      int n_transcripts, int report_all, int *n,
                      int **crm_positions) {
  int **crm_positions_transcript;
  int *m1p;
  int curr_n1;
  int curr_tr1;
  int ec = 0;
  int errorcode;
  int i, j;
  int i1;
  int max_crm_positions_transcript = 1000;
  int max_transcript_occurrences = 1000;
  int n1_tr = 0;
  int n_crms;
  int n_crms_reported;
  int output[2];
  int running_entries = 0;
  int running_entries_reported;
  int transcript = 0;
  i1 = 1;
  curr_tr1 = m1_t[i1];
  m1p = ivector(1, max_transcript_occurrences);
  if (report_all == 1)
    crm_positions_transcript = imatrix(1, max_crm_positions_transcript, 1, 2);
  if (max_n_transcripts < 0)
    max_n_transcripts = n_transcripts + 1;
  while ((transcript < n_transcripts) & (n1_tr <= max_n_transcripts)) {
    transcript++;
    if (curr_tr1 < 0)
      transcript = n_transcripts + 1;
    while ((curr_tr1 < transcript) & (curr_tr1 >= 0) & (i1 < n1)) {
      i1++;
      curr_tr1 = m1_t[i1];
    }
    curr_n1 = 0;
    if (curr_tr1 == transcript) {
      while ((curr_tr1 == transcript) & (i1 <= n1)) {
        curr_n1++;
        m1p[curr_n1] = m1_p[i1];
        i1++;
        if (i1 <= n1)
          curr_tr1 = m1_t[i1];
      }
      i1--;
      curr_tr1 = transcript;
    }
    if (curr_n1 >= N) {
      crm_1motifs(m1p, curr_n1, N, dw, max_crm_positions_transcript, bin_size,
                  report_all, output, crm_positions_transcript);
      n_crms = output[0];
      errorcode = output[1];
      n_crms_reported = n_crms - errorcode;
    } else {
      n_crms = 0;
      n_crms_reported = 0;
    }
    if (n_crms > 0)
      n1_tr++;
    if (report_all == 1) {
      if ((running_entries + n_crms) > max_crm_positions) {
        ec--;
        running_entries_reported = running_entries;
        printf("running_entries=%d\n", running_entries);
        printf("running_entries_reported=%d\n", running_entries_reported);
      } else {
        for (i = 1; i <= n_crms_reported; i++) {
          running_entries++;
          crm_positions[running_entries][1] = transcript;
          crm_positions[running_entries][2] = crm_positions_transcript[i][1];
          crm_positions[running_entries][3] = crm_positions_transcript[i][2];
        }
      }
    }
  }
  n[0] = running_entries;
  n[1] = n1_tr;
  n[2] = ec;
  if (ec < 0) {
    n[3] = running_entries_reported;
  } else {
    n[3] = running_entries;
  }
  free_ivector(m1p, 1, max_transcript_occurrences);
  if (report_all == 1)
    free_imatrix(crm_positions_transcript, 1, max_crm_positions_transcript, 1,
                 2);
}


x86 assembly (clang, -O0):
<crm_1motifs_allt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x3e8,-0x50(%rbp)
movl   $0x3e8,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
movl   $0x0,-0x6c(%rbp)
movl   $0x0,-0x74(%rbp)
movl   $0x1,-0x4c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x38(%rbp)
mov    -0x54(%rbp),%esi
mov    $0x1,%edi
call   1080 <ivector@plt>
mov    %rax,-0x30(%rbp)
cmpl   $0x1,0x28(%rbp)
jne    1207 <crm_1motifs_allt+0xa7>
mov    -0x50(%rbp),%esi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    %edx,%edi
call   1030 <imatrix@plt>
mov    %rax,-0x28(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    121a <crm_1motifs_allt+0xba>
mov    0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    121f <crm_1motifs_allt+0xbf>
mov    -0x74(%rbp),%eax
cmp    0x20(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x58(%rbp),%ecx
cmp    -0x18(%rbp),%ecx
setle  %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     149e <crm_1motifs_allt+0x33e>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
cmpl   $0x0,-0x38(%rbp)
jge    1263 <crm_1motifs_allt+0x103>
mov    0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1268 <crm_1motifs_allt+0x108>
mov    -0x38(%rbp),%eax
cmp    -0x74(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x0,-0x38(%rbp)
setge  %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
mov    -0x4c(%rbp),%ecx
cmp    -0x14(%rbp),%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     12bb <crm_1motifs_allt+0x15b>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x38(%rbp)
jmp    1268 <crm_1motifs_allt+0x108>
movl   $0x0,-0x34(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x74(%rbp),%eax
jne    1351 <crm_1motifs_allt+0x1f1>
jmp    12d3 <crm_1motifs_allt+0x173>
mov    -0x38(%rbp),%eax
cmp    -0x74(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x4c(%rbp),%ecx
cmp    -0x14(%rbp),%ecx
setle  %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1342 <crm_1motifs_allt+0x1e2>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x30(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     133d <crm_1motifs_allt+0x1dd>
mov    -0x8(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x38(%rbp)
jmp    12d3 <crm_1motifs_allt+0x173>
mov    -0x4c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x74(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x20(%rbp),%eax
jl     13ab <crm_1motifs_allt+0x24b>
mov    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    0x10(%rbp),%ecx
mov    -0x50(%rbp),%r8d
mov    0x18(%rbp),%r9d
mov    0x28(%rbp),%r11d
lea    -0x68(%rbp),%r10
mov    -0x28(%rbp),%rax
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1040 <crm_1motifs@plt>
mov    -0x68(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x64(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x5c(%rbp),%eax
sub    -0x40(%rbp),%eax
mov    %eax,-0x60(%rbp)
jmp    13b9 <crm_1motifs_allt+0x259>
movl   $0x0,-0x5c(%rbp)
movl   $0x0,-0x60(%rbp)
cmpl   $0x0,-0x5c(%rbp)
jle    13cc <crm_1motifs_allt+0x26c>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
cmpl   $0x1,0x28(%rbp)
jne    1499 <crm_1motifs_allt+0x339>
mov    -0x6c(%rbp),%eax
add    -0x5c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    1417 <crm_1motifs_allt+0x2b7>
mov    -0x3c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x6c(%rbp),%esi
lea    0xc02(%rip),%rdi
call   1050 <printf@plt>
mov    -0x70(%rbp),%esi
lea    0xc07(%rip),%rdi
call   1050 <printf@plt>
jmp    1494 <crm_1motifs_allt+0x334>
movl   $0x1,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x60(%rbp),%eax
jg     148f <crm_1motifs_allt+0x32f>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x74(%rbp),%ecx
mov    0x38(%rbp),%rax
movslq -0x6c(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    %ecx,0x4(%rax)
mov    -0x28(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x4(%rax),%ecx
mov    0x38(%rbp),%rax
movslq -0x6c(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    %ecx,0x8(%rax)
mov    -0x28(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x8(%rax),%ecx
mov    0x38(%rbp),%rax
movslq -0x6c(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    %ecx,0xc(%rax)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    141e <crm_1motifs_allt+0x2be>
jmp    1494 <crm_1motifs_allt+0x334>
jmp    1499 <crm_1motifs_allt+0x339>
jmp    121f <crm_1motifs_allt+0xbf>
mov    -0x6c(%rbp),%ecx
mov    0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x58(%rbp),%ecx
mov    0x30(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x3c(%rbp),%ecx
mov    0x30(%rbp),%rax
mov    %ecx,0x8(%rax)
cmpl   $0x0,-0x3c(%rbp)
jge    14d4 <crm_1motifs_allt+0x374>
mov    -0x70(%rbp),%ecx
mov    0x30(%rbp),%rax
mov    %ecx,0xc(%rax)
jmp    14de <crm_1motifs_allt+0x37e>
mov    -0x6c(%rbp),%ecx
mov    0x30(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x30(%rbp),%rdi
mov    -0x54(%rbp),%edx
mov    $0x1,%esi
call   1070 <free_ivector@plt>
cmpl   $0x1,0x28(%rbp)
jne    1512 <crm_1motifs_allt+0x3b2>
mov    -0x28(%rbp),%rdi
mov    -0x50(%rbp),%edx
mov    $0x1,%ecx
mov    $0x2,%r8d
mov    %ecx,%esi
call   1060 <free_imatrix@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crm_1motifs_allt>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r9d,(%rsp)
mov    %r8d,0x30(%rsp)
mov    %ecx,%r15d
mov    %edx,0x4(%rsp)
mov    %rsi,0x50(%rsp)
mov    %rdi,%r13
mov    0xa8(%rsp),%ebx
mov    0x4(%rdi),%r14d
mov    $0x1,%edi
mov    $0x3e8,%esi
call   1080 <ivector@plt>
mov    %rax,0x18(%rsp)
cmp    $0x1,%ebx
jne    11c3 <crm_1motifs_allt+0x63>
mov    $0x1,%edi
mov    $0x3e8,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
call   1030 <imatrix@plt>
mov    0xb0(%rsp),%rdx
mov    0xa0(%rsp),%ecx
lea    0x1(%rcx),%esi
test   %r15d,%r15d
cmovns %r15d,%esi
mov    %esi,0x34(%rsp)
test   %esi,%esi
mov    %rax,0x8(%rsp)
js     1511 <crm_1motifs_allt+0x3b1>
test   %ecx,%ecx
jle    1511 <crm_1motifs_allt+0x3b1>
mov    0xb8(%rsp),%rdx
movslq 0x4(%rsp),%r12
lea    0x4(%r13),%rsi
mov    %rsi,0x48(%rsp)
add    $0x10,%rdx
mov    %rdx,0x40(%rsp)
mov    $0x1,%ebp
xor    %r15d,%r15d
xor    %r11d,%r11d
xor    %r10d,%r10d
movl   $0x0,0x14(%rsp)
nopw   0x0(%rax,%rax,1)
test   %r14d,%r14d
mov    %r15d,%edi
cmovs  %ecx,%edi
lea    0x1(%rdi),%r15d
xor    %ecx,%ecx
cmp    %edi,%r14d
setle  %cl
mov    %r14d,%edx
not    %edx
shr    $0x1f,%edx
and    %ecx,%edx
xor    %ecx,%ecx
cmp    0x4(%rsp),%ebp
setl   %cl
test   %ecx,%edx
je     129a <crm_1motifs_allt+0x13a>
movslq %ebp,%rcx
add    $0x1,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x0(%r13,%rcx,4),%r14d
xor    %edx,%edx
cmp    %edi,%r14d
setle  %dl
mov    %r14d,%esi
not    %esi
shr    $0x1f,%esi
and    %edx,%esi
xor    %edx,%edx
cmp    %r12,%rcx
setl   %dl
add    $0x1,%ebp
add    $0x1,%rcx
test   %edx,%esi
jne    1270 <crm_1motifs_allt+0x110>
xor    %r8d,%r8d
xor    %esi,%esi
cmp    %r15d,%r14d
jne    12c0 <crm_1motifs_allt+0x160>
cmp    0x4(%rsp),%ebp
jle    1340 <crm_1motifs_allt+0x1e0>
mov    (%rsp),%edx
jmp    139a <crm_1motifs_allt+0x23a>
cs nopw 0x0(%rax,%rax,1)
mov    (%rsp),%edx
cmp    %edx,%esi
jl     13a8 <crm_1motifs_allt+0x248>
sub    $0x8,%rsp
mov    0x20(%rsp),%rdi
mov    0x98(%rsp),%ecx
mov    $0x3e8,%r8d
mov    0xa0(%rsp),%r9d
push   %rax
lea    0x48(%rsp),%rax
push   %rax
push   %rbx
mov    %r11,0x40(%rsp)
mov    %r10d,%ebx
call   1040 <crm_1motifs@plt>
mov    %ebx,%r10d
mov    0x40(%rsp),%r11
mov    0xc8(%rsp),%ebx
add    $0x20,%rsp
mov    0x38(%rsp),%ecx
mov    %ecx,%r8d
sub    0x3c(%rsp),%r8d
xor    %eax,%eax
test   %ecx,%ecx
setg   %al
add    %eax,%r10d
cmp    $0x1,%ebx
je     13b3 <crm_1motifs_allt+0x253>
jmp    14d0 <crm_1motifs_allt+0x370>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r10d,%r14d
movslq %ebp,%rdx
mov    0x50(%rsp),%rcx
lea    (%rcx,%rdx,4),%r10
mov    0x48(%rsp),%rcx
lea    (%rcx,%rdx,4),%r9
xor    %esi,%esi
mov    0x18(%rsp),%rdi
nop
mov    %rsi,%rcx
lea    (%rdx,%rsi,1),%rbx
mov    (%r10,%rsi,4),%esi
mov    %esi,0x4(%rdi,%rcx,4)
cmp    %r12,%rbx
jge    1383 <crm_1motifs_allt+0x223>
cmp    %r15d,(%r9,%rcx,4)
jne    1383 <crm_1motifs_allt+0x223>
lea    0x1(%rcx),%rsi
cmp    %r12,%rbx
jl     1360 <crm_1motifs_allt+0x200>
mov    %ecx,%esi
add    $0x1,%esi
add    %ecx,%ebp
add    $0x1,%ebp
mov    0xa8(%rsp),%ebx
mov    (%rsp),%edx
mov    %r14d,%r10d
add    $0xffffffff,%ebp
mov    %r15d,%r14d
cmp    %edx,%esi
jge    12cb <crm_1motifs_allt+0x16b>
xor    %ecx,%ecx
cmp    $0x1,%ebx
jne    14d0 <crm_1motifs_allt+0x370>
add    %r11d,%ecx
cmp    0x30(%rsp),%ecx
jle    1410 <crm_1motifs_allt+0x2b0>
addl   $0xffffffff,0x14(%rsp)
lea    0xc38(%rip),%rdi
mov    %r11d,%esi
mov    %r11,%rbx
mov    %r10d,0x20(%rsp)
call   1050 <printf@plt>
lea    0xc35(%rip),%rdi
mov    %ebx,%esi
call   1050 <printf@plt>
mov    0x20(%rsp),%r10d
mov    %rbx,%r11
mov    0xa8(%rsp),%ebx
mov    %r11d,%eax
mov    %r11d,0x2c(%rsp)
jmp    14d0 <crm_1motifs_allt+0x370>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %r8d,%r8d
jle    14d0 <crm_1motifs_allt+0x370>
movslq %r11d,%r11
mov    %r8d,%r9d
mov    $0x1,%edx
cmp    $0x1,%r8d
mov    0x8(%rsp),%rax
je     149a <crm_1motifs_allt+0x33a>
mov    %r9d,%r8d
and    $0xfffffffe,%r8d
mov    0x40(%rsp),%rcx
lea    (%rcx,%r11,8),%rsi
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    -0x8(%rsi,%rdx,8),%rdi
mov    %r15d,0x4(%rdi)
mov    0x8(%rax,%rdx,8),%rbx
mov    0x4(%rbx),%ecx
mov    %ecx,0x8(%rdi)
mov    0x8(%rbx),%ecx
mov    %ecx,0xc(%rdi)
mov    (%rsi,%rdx,8),%rcx
mov    %r15d,0x4(%rcx)
mov    0x10(%rax,%rdx,8),%rdi
mov    0x4(%rdi),%ebx
mov    %ebx,0x8(%rcx)
mov    0x8(%rdi),%edi
mov    %edi,0xc(%rcx)
add    $0x2,%rdx
cmp    %rdx,%r8
jne    1450 <crm_1motifs_allt+0x2f0>
add    %rdx,%r11
add    $0x1,%rdx
mov    0xa8(%rsp),%ebx
test   $0x1,%r9b
je     14d5 <crm_1motifs_allt+0x375>
mov    0xb8(%rsp),%rcx
mov    0x8(%rcx,%r11,8),%rsi
add    $0x1,%r11
mov    %r15d,0x4(%rsi)
mov    (%rax,%rdx,8),%rcx
mov    0x4(%rcx),%edx
mov    %edx,0x8(%rsi)
mov    0x8(%rcx),%ecx
mov    %ecx,0xc(%rsi)
jmp    14d5 <crm_1motifs_allt+0x375>
nopw   0x0(%rax,%rax,1)
mov    0x8(%rsp),%rax
mov    0xa0(%rsp),%ecx
cmp    0x34(%rsp),%r10d
jg     14ec <crm_1motifs_allt+0x38c>
cmp    %ecx,%r15d
jl     1230 <crm_1motifs_allt+0xd0>
mov    0xb0(%rsp),%rdx
mov    %r11d,(%rdx)
mov    %r10d,0x4(%rdx)
mov    0x14(%rsp),%eax
mov    %eax,0x8(%rdx)
test   %eax,%eax
mov    0x18(%rsp),%rdi
mov    0x2c(%rsp),%eax
jns    1527 <crm_1motifs_allt+0x3c7>
jmp    152a <crm_1motifs_allt+0x3ca>
movq   $0x0,(%rdx)
movl   $0x0,0x8(%rdx)
xor    %r11d,%r11d
mov    0x18(%rsp),%rdi
mov    %r11d,%eax
mov    %eax,0xc(%rdx)
mov    $0x1,%esi
mov    $0x3e8,%edx
call   1070 <free_ivector@plt>
cmp    $0x1,%ebx
jne    1560 <crm_1motifs_allt+0x400>
mov    0x8(%rsp),%rdi
mov    $0x1,%esi
mov    $0x3e8,%edx
mov    $0x1,%ecx
mov    $0x2,%r8d
call   1060 <free_imatrix@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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