// File: /workspace/github_c_makefile_star2_O1/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 0xc9fd
leaq (,%r13,4), %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1100
movq 0x30(%r12), %rax
movq 0x30(%r15), %rcx
testq %rcx, %rcx
je 0xca6e
movq %rax, %rdx
cmpl $0x1, 0x8(%rcx)
jne 0xca51
movslq 0x4(%rcx), %rsi
cmpl $0x0, (%rbx,%rsi,4)
jne 0xca51
testq %rdx, %rdx
je 0xca51
movq %rdx, %rdi
cmpl %esi, 0x4(%rdi)
jl 0xca44
jg 0xca51
cmpl $0x1, 0xc(%rdi)
jne 0xca48
movl 0x4(%r12), %r8d
addl (%rdi), %r8d
subl (%rcx), %r8d
cmpl $0x64, %r8d
jge 0xca5c
movq 0x10(%rdi), %rdx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
jne 0xca26
movq 0x10(%rcx), %rcx
testq %rcx, %rcx
jne 0xca0e
jmp 0xca6e
cmpl $0xc8, %r8d
jg 0xca51
movl $0x1, (%rbx,%rsi,4)
jmp 0xca51
movq 0x30(%r15), %rcx
testq %rcx, %rcx
je 0xcacd
cmpl $0x1, 0xc(%rcx)
jne 0xcabe
movslq 0x4(%rcx), %rdx
cmpl $0x0, (%rbx,%rdx,4)
jne 0xcabe
testq %rax, %rax
je 0xcabe
movq %rax, %rsi
cmpl %edx, 0x4(%rsi)
jl 0xcab1
jg 0xcabe
cmpl $0x1, 0x8(%rsi)
jne 0xcab5
movl 0x4(%r15), %edi
addl (%rcx), %edi
subl (%rsi), %edi
cmpl $0x64, %edi
jl 0xcabe
cmpl $0xc8, %edi
jle 0xcac4
movq 0x10(%rsi), %rax
movq 0x10(%rsi), %rsi
testq %rsi, %rsi
jne 0xca8f
movq 0x10(%rcx), %rcx
jmp 0xca72
movl $0x1, (%rbx,%rdx,4)
jmp 0xcabe
testl %r14d, %r14d
jle 0xcae3
xorl %ecx, %ecx
xorl %eax, %eax
addl (%rbx,%rcx,4), %eax
incq %rcx
cmpq %rcx, %r13
jne 0xcad6
jmp 0xcae5
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq