// File: /workspace/github_cpp_makefile_star2_O3/davinash[P]regex/src/regex.cpp
// Function: RegEx::EpsilonClosure(std::set<RegExState*, std::less<RegExState*>, std::allocator<RegExState*>>, std::set<RegExState*, std::less<RegExState*>, std::allocator<RegExState*>>&)
void RegEx::EpsilonClosure(std::set<RegExState*> startSet, std::set<RegExState*> &result) {
	std::stack<RegExState*> UnVisitedStates;	
	result.clear();	
	result = startSet; 
	StateIterator iter;
	for(iter = startSet.begin(); iter != startSet.end(); ++iter) {
		UnVisitedStates.push(*iter);
	}

	while(!UnVisitedStates.empty()) {
		RegExState* curState = UnVisitedStates.top();
		UnVisitedStates.pop();

		Table epsilonStates;
		curState->GetTransition(EPSILON, epsilonStates);

		TableIterator epsilonItr;

		for ( epsilonItr = epsilonStates.begin(); epsilonItr != epsilonStates.end(); ++epsilonItr ){
			if(result.find((*epsilonItr)) == result.end()) {
				result.insert((*epsilonItr));
				UnVisitedStates.push((*epsilonItr));
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %rbx
movq %rsi, %r14
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdi
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
xorl %esi, %esi
callq 0x8ddc
movq %rbx, %rdi
callq 0x8f52
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7d44
movq 0x18(%r14), %r15
addq $0x8, %r14
cmpq %r14, %r15
je 0x5c6a
leaq 0x20(%rsp), %r12
leaq 0x20(%r15), %rsi
movq 0x50(%rsp), %rax
movq 0x60(%rsp), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x5c52
movq (%rsi), %rcx
movq %rcx, (%rax)
addq $0x8, 0x50(%rsp)
jmp 0x5c5a
movq %r12, %rdi
callq 0x8f80
movq %r15, %rdi
callq 0x21c0
movq %rax, %r15
cmpq %r14, %rax
jne 0x5c2d
movq 0x50(%rsp), %rax
cmpq 0x30(%rsp), %rax
je 0x5dae
leaq 0x8(%rbx), %r13
movl $0x1f8, %ebp            # imm = 0x1F8
movq %rsp, %r14
leaq 0x20(%rsp), %r15
movq 0x58(%rsp), %rdi
cmpq %rdi, %rax
je 0x5c9f
movq -0x8(%rax), %r12
addq $-0x8, %rax
jmp 0x5cdf
movq 0x68(%rsp), %rax
movq -0x8(%rax), %rax
movq 0x1f8(%rax), %r12
movl $0x200, %esi            # imm = 0x200
callq 0x2160
movq 0x68(%rsp), %rax
leaq -0x8(%rax), %rcx
movq %rcx, 0x68(%rsp)
movq -0x8(%rax), %rax
movq %rax, 0x58(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0x60(%rsp)
addq %rbp, %rax
movq %rax, 0x50(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq $0x0, 0x10(%rsp)
movq %r12, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %r14, %rdx
callq 0x9552
movq (%rsp), %r12
cmpq 0x8(%rsp), %r12
je 0x5d89
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
je 0x5d42
movq (%r12), %rax
movq %r13, %rdx
xorl %esi, %esi
cmpq %rax, 0x20(%rcx)
setb %sil
cmovaeq %rcx, %rdx
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0x5d1f
cmpq %r13, %rdx
je 0x5d42
cmpq 0x20(%rdx), %rax
jae 0x5d7a
movq %rbx, %rdi
movq %r12, %rsi
callq 0x9194
movq 0x50(%rsp), %rax
movq 0x60(%rsp), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x5d6f
movq (%r12), %rcx
movq %rcx, (%rax)
addq $0x8, 0x50(%rsp)
jmp 0x5d7a
movq %r15, %rdi
movq %r12, %rsi
callq 0x8f80
addq $0x8, %r12
cmpq 0x8(%rsp), %r12
jne 0x5d0f
movq (%rsp), %r12
testq %r12, %r12
je 0x5d9e
movq 0x10(%rsp), %rsi
subq %r12, %rsi
movq %r12, %rdi
callq 0x2160
movq 0x50(%rsp), %rax
cmpq 0x30(%rsp), %rax
jne 0x5c8b
leaq 0x20(%rsp), %rdi
callq 0x8008
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5dc9
movq %rax, %rbx
jmp 0x5de9
jmp 0x5dd0
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x5de9
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2160
leaq 0x20(%rsp), %rdi
callq 0x8008
movq %rbx, %rdi
callq 0x2260
nop