// File: /workspace/github_c_makefile_star2_O3/jiqingxiaoxi[P]RPA/RPA.c
// Function: check_common
int check_common(struct Primer *F,struct Primer *R,int *result,int common)
{
        int dis,num,i;
	struct Node *c_F,*c_R,*b_R;

	for(i=0;i<common;i++)
		result[i]=0;
//plus
	b_R=R->common;
	for(c_F=F->common;c_F;c_F=c_F->next)
	{
		if(c_F->plus!=1)
			continue;
		if(result[c_F->gi])
			continue;
		for(c_R=b_R;c_R;c_R=c_R->next)
		{
			if(c_R->gi<c_F->gi)
			{
				b_R=c_R->next;
				continue;
			}
			if(c_R->gi>c_F->gi)
				break;
			if(c_R->minus!=1)
				continue;
			if(c_R->pos+R->len-c_F->pos<100)
			{
				b_R=c_R->next;
				continue;
			}
			if(c_R->pos+R->len-c_F->pos>200)
				break;
			result[c_F->gi]=1;
			break;
		}
	}
//minus
	b_R=R->common;
        for(c_F=F->common;c_F;c_F=c_F->next)
        {
                if(c_F->minus!=1)
                        continue;
                if(result[c_F->gi])
                        continue;  //this GI can common

                for(c_R=b_R;c_R;c_R=c_R->next)
                {
			if(c_R->gi<c_F->gi)
                        {
                                b_R=c_R->next;
                                continue;
                        }
                        if(c_R->gi>c_F->gi)
                                break;
                        if(c_R->plus!=1)
                                continue;
			if(c_F->pos+F->len-c_R->pos<100)
				break;
			if(c_F->pos+F->len-c_R->pos>200)
			{
				b_R=c_R->next;
				continue;
			}
			result[c_F->gi]=1;
			break;
                }
        }
	num=0;
	for(i=0;i<common;i++)
	{
		num=num+result[i];
	}
	return num;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r14d
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r15
movl %ecx, %r13d
testl %ecx, %ecx
jle 0xc84f
leaq (,%r13,4), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1100
movq 0x30(%r15), %rax
testq %rax, %rax
je 0xc92e
movq 0x30(%r12), %rcx
movq %rax, %rdx
movq %rcx, %rsi
cmpl $0x1, 0x8(%rdx)
jne 0xc8b1
movslq 0x4(%rdx), %rdi
cmpl $0x0, (%rbx,%rdi,4)
jne 0xc8b1
testq %rsi, %rsi
je 0xc8b1
movq %rsi, %r8
cmpl %edi, 0x4(%r8)
jl 0xc89f
jg 0xc8b1
cmpl $0x1, 0xc(%r8)
jne 0xc8a8
movl 0x4(%r12), %r9d
addl (%r8), %r9d
subl (%rdx), %r9d
cmpl $0x63, %r9d
jg 0xc8bc
movq 0x10(%r8), %r8
movq %r8, %rsi
jmp 0xc8ac
movq 0x10(%r8), %r8
testq %r8, %r8
jne 0xc87f
movq 0x10(%rdx), %rdx
testq %rdx, %rdx
jne 0xc867
jmp 0xc929
cmpl $0xc8, %r9d
ja 0xc8b1
movl $0x1, (%rbx,%rdi,4)
jmp 0xc8b1
cmpl $0x1, 0xc(%rax)
jne 0xc91a
movslq 0x4(%rax), %rdx
cmpl $0x0, (%rbx,%rdx,4)
jne 0xc91a
testq %rcx, %rcx
je 0xc91a
movq %rcx, %rsi
cmpl %edx, 0x4(%rsi)
jl 0xc908
jg 0xc91a
cmpl $0x1, 0x8(%rsi)
jne 0xc911
movl 0x4(%r15), %edi
addl (%rax), %edi
subl (%rsi), %edi
cmpl $0x64, %edi
jl 0xc91a
cmpl $0xc9, %edi
jb 0xc920
movq 0x10(%rsi), %rsi
movq %rsi, %rcx
jmp 0xc915
movq 0x10(%rsi), %rsi
testq %rsi, %rsi
jne 0xc8e6
movq 0x10(%rax), %rax
jmp 0xc929
movl $0x1, (%rbx,%rdx,4)
jmp 0xc91a
testq %rax, %rax
jne 0xc8ce
testl %r14d, %r14d
jle 0xc944
xorl %ecx, %ecx
xorl %eax, %eax
addl (%rbx,%rcx,4), %eax
incq %rcx
cmpq %rcx, %r13
jne 0xc937
jmp 0xc946
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq