// File: /workspace/github_c_makefile_star2_O0/ranbenbasat[P]RHHH/check1.cpp
// Function: conditionedcount(std::map<unsigned int, Counter, std::less<unsigned int>, std::allocator<std::pair<unsigned int const, Counter>>>*, std::vector<std::pair<int, unsigned int>, std::allocator<std::pair<int, unsigned int>>> const&, unsigned int, int)
int conditionedcount(map<Item, Counter> * m, const vector<Pair> &p, Item item, int mask) {
	vector<Pair> descendants; //the direct descendants of item,mask
	//int countcandidates=0;
	for (vector<Pair>::const_iterator it = p.begin(); it != p.end(); ++it) {
		if ((masks[it->first] & masks[mask]) == masks[mask] && (it->second & masks[mask]) == item) {
			//it is a descendant, now eliminate non-direct descendants
			vector<Pair> newdescendants;
			for (vector<Pair>::const_iterator iter = descendants.begin(); iter != descendants.end(); ++iter) {
				if ((masks[iter->first] & masks[it->first]) != masks[it->first] || (iter->second & masks[it->first]) != it->second) {
					newdescendants.push_back(*iter);
				}
			}
			descendants = newdescendants;
			descendants.push_back(*it);
		}
	}
	
	int s = m[mask][item].get();
	for (vector<Pair>::iterator iter = descendants.begin(); iter != descendants.end(); ++iter) {
		s -= m[iter->first][iter->second].get();
	}

	return s;
}

// Assembly:
subq $0x198, %rsp            # imm = 0x198
movq %rdi, 0x190(%rsp)
movq %rsi, 0x188(%rsp)
movl %edx, 0x184(%rsp)
movl %ecx, 0x180(%rsp)
leaq 0x168(%rsp), %rdi
callq 0x2f70
movq 0x188(%rsp), %rdi
callq 0x2f80
movq %rax, 0xf8(%rsp)
jmp 0x1349
movq 0xf8(%rsp), %rax
movq %rax, 0x160(%rsp)
movq 0x188(%rsp), %rdi
callq 0x2ff0
movq %rax, 0xf0(%rsp)
jmp 0x1370
movq 0xf0(%rsp), %rax
movq %rax, 0x148(%rsp)
leaq 0x160(%rsp), %rdi
leaq 0x148(%rsp), %rsi
callq 0x2fb0
movb %al, 0xef(%rsp)
jmp 0x139e
movb 0xef(%rsp), %al
testb $0x1, %al
jne 0x13ae
jmp 0x16fc
leaq 0x160(%rsp), %rdi
callq 0x3020
movq %rax, 0xe0(%rsp)
jmp 0x13c5
movq 0xe0(%rsp), %rax
movslq (%rax), %rcx
leaq 0xad09(%rip), %rax      # 0xc0e0
movl (%rax,%rcx,4), %eax
movslq 0x180(%rsp), %rdx
leaq 0xacf7(%rip), %rcx      # 0xc0e0
andl (%rcx,%rdx,4), %eax
movslq 0x180(%rsp), %rdx
leaq 0xace5(%rip), %rcx      # 0xc0e0
cmpl (%rcx,%rdx,4), %eax
jne 0x16e6
leaq 0x160(%rsp), %rdi
callq 0x3020
movq %rax, 0xd8(%rsp)
jmp 0x141b
movq 0xd8(%rsp), %rax
movl 0x4(%rax), %eax
movslq 0x180(%rsp), %rdx
leaq 0xacab(%rip), %rcx      # 0xc0e0
andl (%rcx,%rdx,4), %eax
cmpl 0x184(%rsp), %eax
jne 0x16e6
leaq 0x130(%rsp), %rdi
callq 0x2f70
jmp 0x1454
leaq 0x168(%rsp), %rdi
callq 0x3030
movq %rax, 0xd0(%rsp)
jmp 0x146b
movq 0xd0(%rsp), %rax
movq %rax, 0x120(%rsp)
leaq 0x128(%rsp), %rdi
leaq 0x120(%rsp), %rsi
callq 0x3060
jmp 0x1492
jmp 0x1494
leaq 0x168(%rsp), %rdi
callq 0x30e0
movq %rax, 0xc8(%rsp)
jmp 0x14ab
movq 0xc8(%rsp), %rax
movq %rax, 0x118(%rsp)
leaq 0x128(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x30a0
movb %al, 0xc7(%rsp)
jmp 0x14d9
movb 0xc7(%rsp), %al
testb $0x1, %al
jne 0x14e9
jmp 0x1691
leaq 0x128(%rsp), %rdi
callq 0x3020
movq %rax, 0xb8(%rsp)
jmp 0x1500
movq 0xb8(%rsp), %rax
movslq (%rax), %rcx
leaq 0xabce(%rip), %rax      # 0xc0e0
movl (%rax,%rcx,4), %eax
movl %eax, 0xac(%rsp)
leaq 0x160(%rsp), %rdi
callq 0x3020
movq %rax, 0xb0(%rsp)
jmp 0x1533
movl 0xac(%rsp), %eax
movq 0xb0(%rsp), %rcx
movslq (%rcx), %rdx
leaq 0xab94(%rip), %rcx      # 0xc0e0
movl (%rcx,%rdx,4), %ecx
andl %ecx, %eax
movl %eax, 0x9c(%rsp)
leaq 0x160(%rsp), %rdi
callq 0x3020
movq %rax, 0xa0(%rsp)
jmp 0x156f
movl 0x9c(%rsp), %eax
movq 0xa0(%rsp), %rcx
movslq (%rcx), %rdx
leaq 0xab58(%rip), %rcx      # 0xc0e0
cmpl (%rcx,%rdx,4), %eax
jne 0x1615
leaq 0x128(%rsp), %rdi
callq 0x3020
movq %rax, 0x90(%rsp)
jmp 0x15a8
movq 0x90(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x84(%rsp)
leaq 0x160(%rsp), %rdi
callq 0x3020
movq %rax, 0x88(%rsp)
jmp 0x15d1
movl 0x84(%rsp), %eax
movq 0x88(%rsp), %rcx
movslq (%rcx), %rdx
leaq 0xaaf6(%rip), %rcx      # 0xc0e0
movl (%rcx,%rdx,4), %ecx
andl %ecx, %eax
movl %eax, 0x74(%rsp)
leaq 0x160(%rsp), %rdi
callq 0x3020
movq %rax, 0x78(%rsp)
jmp 0x1607
movl 0x74(%rsp), %eax
movq 0x78(%rsp), %rcx
cmpl 0x4(%rcx), %eax
je 0x167b
leaq 0x128(%rsp), %rdi
callq 0x3180
movq %rax, 0x68(%rsp)
jmp 0x1629
movq 0x68(%rsp), %rsi
leaq 0x130(%rsp), %rdi
callq 0x3110
jmp 0x163d
jmp 0x167b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x158(%rsp)
movl %eax, 0x154(%rsp)
jmp 0x1878
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x158(%rsp)
movl %eax, 0x154(%rsp)
leaq 0x130(%rsp), %rdi
callq 0x3470
jmp 0x16e1
jmp 0x167d
leaq 0x128(%rsp), %rdi
callq 0x3190
jmp 0x168c
jmp 0x1494
leaq 0x168(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0x31b0
jmp 0x16a8
leaq 0x160(%rsp), %rdi
callq 0x3180
movq %rax, 0x60(%rsp)
jmp 0x16bc
movq 0x60(%rsp), %rsi
leaq 0x168(%rsp), %rdi
callq 0x3110
jmp 0x16d0
leaq 0x130(%rsp), %rdi
callq 0x3470
jmp 0x16df
jmp 0x16e6
jmp 0x1878
jmp 0x16e8
leaq 0x160(%rsp), %rdi
callq 0x3190
jmp 0x16f7
jmp 0x1359
movq 0x190(%rsp), %rdi
movslq 0x180(%rsp), %rax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
addq %rax, %rdi
leaq 0x184(%rsp), %rsi
callq 0x3500
movq %rax, 0x58(%rsp)
jmp 0x172b
movq 0x58(%rsp), %rdi
callq 0x3600
movl %eax, 0x54(%rsp)
jmp 0x173b
movl 0x54(%rsp), %eax
movl %eax, 0x114(%rsp)
leaq 0x168(%rsp), %rdi
callq 0x3030
movq %rax, 0x48(%rsp)
jmp 0x175a
movq 0x48(%rsp), %rax
movq %rax, 0x108(%rsp)
leaq 0x168(%rsp), %rdi
callq 0x30e0
movq %rax, 0x40(%rsp)
jmp 0x177b
movq 0x40(%rsp), %rax
movq %rax, 0x100(%rsp)
leaq 0x108(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x3610
movb %al, 0x3f(%rsp)
jmp 0x17a3
movb 0x3f(%rsp), %al
testb $0x1, %al
jne 0x17b0
jmp 0x1854
movq 0x190(%rsp), %rax
movq %rax, 0x28(%rsp)
leaq 0x108(%rsp), %rdi
callq 0x3650
movq %rax, 0x30(%rsp)
jmp 0x17d1
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rcx
movslq (%rcx), %rcx
leaq (%rcx,%rcx,2), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, 0x18(%rsp)
leaq 0x108(%rsp), %rdi
callq 0x3650
movq %rax, 0x20(%rsp)
jmp 0x1802
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
addq $0x4, %rsi
callq 0x3500
movq %rax, 0x10(%rsp)
jmp 0x181c
movq 0x10(%rsp), %rdi
callq 0x3600
movl %eax, 0xc(%rsp)
jmp 0x182c
movl 0xc(%rsp), %ecx
movl 0x114(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x114(%rsp)
leaq 0x108(%rsp), %rdi
callq 0x3660
jmp 0x184f
jmp 0x1767
movl 0x114(%rsp), %eax
movl %eax, 0x8(%rsp)
leaq 0x168(%rsp), %rdi
callq 0x3470
movl 0x8(%rsp), %eax
addq $0x198, %rsp            # imm = 0x198
retq
leaq 0x168(%rsp), %rdi
callq 0x3470
jmp 0x1887
jmp 0x1889
movq 0x158(%rsp), %rdi
callq 0x1180
movq %rax, %rdi
callq 0x34f0
nop