// File: /workspace/github_cpp_makefile_star2_O1/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 0x8e1a
movq %rbx, %rdi
callq 0x8f90
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7d54
movq 0x18(%r14), %r15
addq $0x8, %r14
cmpq %r14, %r15
je 0x5c4e
leaq 0x20(%rsp), %r12
leaq 0x20(%r15), %rsi
movq 0x50(%rsp), %rax
movq 0x60(%rsp), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x5c36
movq (%rsi), %rcx
movq %rcx, (%rax)
addq $0x8, 0x50(%rsp)
jmp 0x5c3e
movq %r12, %rdi
callq 0x8fbe
movq %r15, %rdi
callq 0x21c0
movq %rax, %r15
cmpq %r14, %rax
jne 0x5c11
movq 0x50(%rsp), %rax
cmpq 0x30(%rsp), %rax
je 0x5dac
leaq 0x8(%rbx), %r13
movl $0x200, %ebp            # imm = 0x200
movq %rsp, %r14
leaq 0x20(%rsp), %r15
movq 0x58(%rsp), %rdi
movq %rax, %rcx
cmpq %rdi, %rax
jne 0x5c88
movq 0x68(%rsp), %rcx
movq -0x8(%rcx), %rcx
addq %rbp, %rcx
movq -0x8(%rcx), %r12
cmpq %rdi, %rax
je 0x5c97
addq $-0x8, %rax
jmp 0x5cca
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 $0x1f8, %rax            # imm = 0x1F8
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 0x959a
movq (%rsp), %r12
cmpq 0x8(%rsp), %r12
je 0x5d86
movq 0x10(%rbx), %rcx
movq %r13, %rax
testq %rcx, %rcx
je 0x5d29
movq (%r12), %rdx
movq %r13, %rax
xorl %esi, %esi
cmpq %rdx, 0x20(%rcx)
setb %sil
cmovaeq %rcx, %rax
movq 0x10(%rcx,%rsi,8), %rcx
testq %rcx, %rcx
jne 0x5d11
movq %r13, %rcx
cmpq %r13, %rax
je 0x5d40
movq (%r12), %rcx
cmpq 0x20(%rax), %rcx
cmovbq %r13, %rax
movq %rax, %rcx
cmpq %r13, %rcx
jne 0x5d7d
movq %rbx, %rdi
movq %r12, %rsi
callq 0x91d2
movq 0x50(%rsp), %rax
movq 0x60(%rsp), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x5d72
movq (%r12), %rcx
movq %rcx, (%rax)
addq $0x8, 0x50(%rsp)
jmp 0x5d7d
movq %r15, %rdi
movq %r12, %rsi
callq 0x8fbe
addq $0x8, %r12
jmp 0x5cf3
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x5d9c
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2160
movq 0x50(%rsp), %rax
cmpq 0x30(%rsp), %rax
jne 0x5c6f
leaq 0x20(%rsp), %rdi
callq 0x801a
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5dc7
movq %rax, %rbx
jmp 0x5de7
jmp 0x5dce
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x5de7
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2160
leaq 0x20(%rsp), %rdi
callq 0x801a
movq %rbx, %rdi
callq 0x2260
nop