// File: gersteinlab[P]MUSIC/src/ms_annot_region_tools.cpp
// Function: exclude_annot_regions(std::vector<t_annot_region*, std::allocator<t_annot_region*>>*, std::vector<t_annot_region*, std::allocator<t_annot_region*>>*, bool)
vector<t_annot_region*>* exclude_annot_regions(vector<t_annot_region*>* annot_regions1,
													vector<t_annot_region*>* annot_regions2, 
													bool strand_specific)
{
	if(strand_specific)
	{
		vector<t_annot_region*>* excluded_regions = new vector<t_annot_region*>();

		vector<t_annot_region*>* reg1_pos_regs = get_regions_per_strand(annot_regions1, '+');
		vector<t_annot_region*>* reg1_neg_regs = get_regions_per_strand(annot_regions1, '-');

		vector<t_annot_region*>* reg2_pos_regs = get_regions_per_strand(annot_regions2, '+');
		vector<t_annot_region*>* reg2_neg_regs = get_regions_per_strand(annot_regions2, '-');

		// Do strand specific exclusion.
		vector<t_annot_region*>* reg1_min_reg2_pos = exclude_annot_regions(reg1_pos_regs, reg2_pos_regs);
		vector<t_annot_region*>* reg1_min_reg2_neg = exclude_annot_regions(reg1_neg_regs, reg2_neg_regs);

		// Add the excluded regions.
		excluded_regions->insert(excluded_regions->end(), reg1_min_reg2_pos->begin(), reg1_min_reg2_pos->end());
		excluded_regions->insert(excluded_regions->end(), reg1_min_reg2_neg->begin(), reg1_min_reg2_neg->end());

		return(excluded_regions);
	}
	else
	{
		vector<t_annot_region*>* excluded_regions = exclude_annot_regions(annot_regions1, annot_regions2);
		return(excluded_regions);
	}
}

// Assembly:
subq $0xc8, %rsp
movb %dl, %al
movq %rdi, 0xb8(%rsp)
movq %rsi, 0xb0(%rsp)
andb $0x1, %al
movb %al, 0xaf(%rsp)
testb $0x1, 0xaf(%rsp)
je 0x2ecd4
movl $0x18, %edi
callq 0x2190
movq %rax, %rdi
movq %rdi, (%rsp)
xorl %esi, %esi
movl $0x18, %edx
callq 0x2110
movq (%rsp), %rdi
callq 0xc670
movq (%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0xb8(%rsp), %rdi
movl $0x2b, %esi
callq 0x2ed10
movq %rax, 0x98(%rsp)
movq 0xb8(%rsp), %rdi
movl $0x2d, %esi
callq 0x2ed10
movq %rax, 0x90(%rsp)
movq 0xb0(%rsp), %rdi
movl $0x2b, %esi
callq 0x2ed10
movq %rax, 0x88(%rsp)
movq 0xb0(%rsp), %rdi
movl $0x2d, %esi
callq 0x2ed10
movq %rax, 0x80(%rsp)
movq 0x98(%rsp), %rdi
movq 0x88(%rsp), %rsi
callq 0x2ede0
movq %rax, 0x78(%rsp)
movq 0x90(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0x2ede0
movq %rax, 0x70(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0xa0(%rsp), %rdi
callq 0xc760
movq %rax, 0x60(%rsp)
leaq 0x68(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0xc790
movq 0x78(%rsp), %rdi
callq 0xc7d0
movq %rax, 0x58(%rsp)
movq 0x78(%rsp), %rdi
callq 0xc760
movq 0x8(%rsp), %rdi
movq %rax, 0x50(%rsp)
movq 0x68(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq 0x50(%rsp), %rcx
callq 0xc6a0
movq %rax, 0x48(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xa0(%rsp), %rdi
callq 0xc760
movq %rax, 0x38(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0xc790
movq 0x70(%rsp), %rdi
callq 0xc7d0
movq %rax, 0x30(%rsp)
movq 0x70(%rsp), %rdi
callq 0xc760
movq 0x10(%rsp), %rdi
movq %rax, 0x28(%rsp)
movq 0x40(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x28(%rsp), %rcx
callq 0xc6a0
movq %rax, 0x20(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0xc0(%rsp)
jmp 0x2ecfb
movq 0xb8(%rsp), %rdi
movq 0xb0(%rsp), %rsi
callq 0x2ede0
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0xc0(%rsp), %rax
addq $0xc8, %rsp
retq
nopl (%rax,%rax)