// File: /workspace/github_cpp_makefile_star2_O1/zakimjz[P]SLEUTH/treeminer.cpp
// Function: check_outs(idlist*, idlist*, Eqnode*, int, int, int, int, int, int)
void check_outs(idlist *l1, idlist *l2, Eqnode *outs,
                int st1, int st2, int en1, int en2,
                int n1depth, int n2depth){
   static idnode *n1, *n2;
   static ival_type cmpval;

   bool found_flg = false;
   bool induced, induced_flg = false;
   bool next2;
   int pos1 = st1;
   
   //for each n2 ival find if there is a sibling to the left
   int tpos = outs->tlist.size();
   while(st2 < en2){
      n1 = &(*l1)[pos1];
      n2 = &(*l2)[st2];

      //next2 = true;
      cmpval = ival::compare(n1->itscope, n2->itscope);
      switch (cmpval){
      case sup:
         //next2 = false;
         break;
      case before: 
//          //n1 is before n2. Check if n1.par is subset of or equal to n2.par
//          if (n1->path_equal(*n2)){
//             if (en1 - st1 > 1 || use_fullpath){
//                //outs->tlist.push_back(idnode(n2->cid, n1->parscope, 
//                //                            n1->itscope.lb, n2->itscope));
//                outs->add_list(n2->cid, n1->parscope, 
//                               n1->itscope.lb, n2->itscope, n2->depth);
//             }
//             else{
//                //outs->tlist.push_back(idnode(n2->cid,n2->itscope));
//                outs->add_list(n2->cid,n2->itscope, n2->depth);
//             }
//             if (!count_unique) outs->sup++;
//             found_flg = true;
//             if (n2->depth == rdepth) induced_flg = true;
//          }
//          //next2 = false;
//          break;
      case after:
         if (mine_ordered && cmpval == after) break;
         
         //n1 is before n2. Check if n1.par is subset of or equal to n2.par
         if (n1->path_equal(*n2)){
            //if (n1->depth == n1depth && n2->depth == n2depth &&
            if(n1->induced && n2->induced)
               induced = true;
            else induced = false;
            
            if (en1 - st1 > 1 || use_fullpath){
               //outs->tlist.push_back(idnode(n2->cid, n1->parscope, 
               //                            n1->itscope.lb, n2->itscope));
               outs->add_list(n2->cid, n1->parscope, 
                              n1->itscope.lb, n2->itscope, n2->depth, induced);
            }
            else{
               //outs->tlist.push_back(idnode(n2->cid,n2->itscope));
               outs->add_list(n2->cid,n2->itscope,n2->depth, induced);
            }
            if (!count_unique) outs->sup++;
            found_flg = true;
            if (induced) induced_flg = true;
         }
         //next2 = false;         
         break;
      case sub:
         break;
      }
      if (pos1+1 == en1){ //go to next n2 ival
         pos1 = st1;
         st2++;
      }
      else pos1++; //go to next n1 ival
   }
   if (found_flg && count_unique) outs->sup++;
   if (induced_flg) outs->isup++;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, 0x18(%rsp)
cmpl 0x60(%rsp), %r8d
jge 0x590a
movl %r9d, %ebp
movl %r8d, %r14d
movl %ecx, %ebx
movq %rsi, %r12
movq %rdi, %r13
movl %r9d, %eax
subl %ecx, %eax
movl %eax, 0x24(%rsp)
movl $0x0, 0x10(%rsp)
movl %ecx, %r15d
movl $0x0, 0x14(%rsp)
movslq %r15d, %rax
movq (%r13), %rcx
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
leaq (%rcx,%rax), %rdx
movq %rdx, 0x7c89(%rip)      # 0xd428
movslq %r14d, %rdx
movq (%r12), %rsi
leaq (%rdx,%rdx,2), %rdx
shlq $0x4, %rdx
leaq (%rsi,%rdx), %rdi
movq %rdi, 0x7c77(%rip)      # 0xd430
leaq (%rcx,%rax), %rdi
addq $0x4, %rdi
addq %rdx, %rsi
addq $0x4, %rsi
callq 0x3d8c
leal -0x3(%rax), %ecx
cmpl $0x1, %ecx
ja 0x58e3
cmpl $0x4, %eax
jne 0x57eb
cmpb $0x0, 0x7bff(%rip)      # 0xd3e4
jne 0x58e3
movq 0x7c36(%rip), %rdx      # 0xd428
movq 0x10(%rdx), %rcx
movq 0x18(%rdx), %rax
movq 0x7c2f(%rip), %rdi      # 0xd430
subq %rcx, %rax
sete %sil
je 0x584c
sarq $0x2, %rax
cmpq $0x1, %rax
movq %rax, %rsi
adcq $0x0, %rsi
movq 0x10(%rdi), %r8
movl (%rcx), %r9d
cmpl (%r8), %r9d
jne 0x58e3
movl $0x1, %r10d
movq %r10, %r9
cmpq %r10, %rsi
je 0x5845
movl (%rcx,%r9,4), %r11d
leaq 0x1(%r9), %r10
cmpl (%r8,%r9,4), %r11d
je 0x582f
cmpq %r9, %rax
setbe %sil
testb %sil, %sil
je 0x58e3
cmpb $0x1, 0x2c(%rdx)
jne 0x5863
movb $0x1, %al
cmpb $0x0, 0x2c(%rdi)
jne 0x5865
xorl %eax, %eax
movl %eax, 0x10(%rsp)
movzbl %al, %r8d
cmpl $0x1, 0x24(%rsp)
jg 0x587d
cmpb $0x1, 0x7b67(%rip)      # 0xd3e2
jne 0x58a1
movl 0x4(%rdx), %ecx
addq $0x10, %rdx
leaq 0x4(%rdi), %rax
movl (%rdi), %esi
movl 0x28(%rdi), %r9d
movl %r8d, (%rsp)
movq 0x18(%rsp), %rdi
movq %rax, %r8
callq 0x69e0
jmp 0x58b4
leaq 0x4(%rdi), %rdx
movl (%rdi), %esi
movl 0x28(%rdi), %ecx
movq 0x18(%rsp), %rdi
callq 0x6a50
cmpb $0x0, 0x7931(%rip)      # 0xd1ec
jne 0x58c5
movq 0x18(%rsp), %rax
incl 0x8(%rax)
movl 0x14(%rsp), %eax
movzbl %al, %eax
cmpb $0x0, 0x10(%rsp)
movl $0x1, %ecx
cmovnel %ecx, %eax
movl %eax, 0x14(%rsp)
movb $0x1, %al
movl %eax, 0x10(%rsp)
incl %r15d
xorl %eax, %eax
cmpl %ebp, %r15d
sete %al
cmovel %ebx, %r15d
addl %eax, %r14d
cmpl 0x60(%rsp), %r14d
jl 0x5785
movl 0x14(%rsp), %ecx
movl 0x10(%rsp), %eax
jmp 0x590e
xorl %ecx, %ecx
xorl %eax, %eax
testb $0x1, %al
je 0x5923
cmpb $0x1, 0x78d3(%rip)      # 0xd1ec
jne 0x5923
movq 0x18(%rsp), %rax
incl 0x8(%rax)
testb $0x1, %cl
je 0x5930
movq 0x18(%rsp), %rax
incl 0xc(%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq