// File: /workspace/github_cpp_makefile_star2_O3/Laakeri[P]maxpre/src/./BIG.cpp
// Function: maxPreprocessor::Preprocessor::BIGdfs1(int, std::vector<int, std::allocator<int>>&)
void Preprocessor::BIGdfs1(int x, vector<int>& ns) {
	// we do actually bfs to avoid stack overflow
	queue<int> bfs;
	bfs.push(x);
	while (!bfs.empty()) {
		int v = bfs.front();
		bfs.pop();
		if (BIGu[v] == BIGIt) continue;
		BIGu[v] = BIGIt;
		BIGu2[v] = 0;
		BIGu2[litVariable(v)] = 0;
		ns.push_back(v);
		// backward edges
		for (int c : pi.litClauses[v]) {
			if (pi.clauses[c].lit.size() == 2) {
				for (int nx : pi.clauses[c].lit) {
					if (nx != v && pi.isLabel[litVariable(nx)] == VAR_UNDEFINED) {
						bfs.push(litNegation(nx));
					}
				}
			}
		}
		// forward edges
		for (int c : pi.litClauses[litNegation(v)]) {
			if (pi.clauses[c].lit.size() == 2) {
				for (int nx : pi.clauses[c].lit) {
					if (nx != litNegation(v) && pi.isLabel[litVariable(nx)] == VAR_UNDEFINED) {
						bfs.push(nx);
					}
				}
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, 0x60(%rsp)
movl %esi, %ebp
movq %rdi, %r14
movl %esi, 0xc(%rsp)
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r15
movaps %xmm0, 0x40(%r15)
movaps %xmm0, 0x30(%r15)
movaps %xmm0, 0x20(%r15)
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
movq %r15, %rdi
xorl %esi, %esi
callq 0x22890
movq 0x30(%r15), %rcx
movq 0x40(%r15), %rax
addq $-0x4, %rax
cmpq %rax, %rcx
je 0x13804
movl %ebp, (%rcx)
addq $0x4, %rcx
movq %rcx, 0x40(%rsp)
jmp 0x13818
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x22a06
movq 0x40(%rsp), %rcx
movq 0x20(%rsp), %rax
cmpq %rax, %rcx
je 0x13a1d
leaq 0x8(%rsp), %r13
movl (%rax), %ecx
movl %ecx, 0x4(%rsp)
movq 0x30(%rsp), %rdx
addq $-0x4, %rdx
cmpq %rdx, %rax
je 0x13845
addq $0x4, %rax
jmp 0x1387b
movq 0x28(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x32b0
movq 0x38(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x38(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x28(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0x30(%rsp)
movl 0x4(%rsp), %ecx
movq %rax, 0x20(%rsp)
movslq %ecx, %rax
movq 0x3b0(%r14), %rcx
movl 0x3ac(%r14), %edx
cmpl %edx, (%rcx,%rax,4)
jne 0x138a7
movq 0x20(%rsp), %rax
cmpq %rax, 0x40(%rsp)
jne 0x1382b
jmp 0x13a1d
movl %edx, (%rcx,%rax,4)
movslq 0x4(%rsp), %rax
movq 0x3c8(%r14), %rcx
xorl %edx, %edx
movl %edx, (%rcx,%rax,4)
movl 0x4(%rsp), %eax
sarl %eax
cltq
movl %edx, (%rcx,%rax,4)
movq 0x60(%rsp), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x138e5
movl 0x4(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x138f3
leaq 0x4(%rsp), %rdx
callq 0x98f8
movl 0x4(%rsp), %eax
movslq %eax, %rdx
movq 0x18(%r14), %rcx
leaq (%rdx,%rdx,2), %rdx
movq (%rcx,%rdx,8), %r15
movq 0x8(%rcx,%rdx,8), %rbp
cmpq %rbp, %r15
je 0x1397a
movslq (%r15), %rax
movq (%r14), %rcx
leaq (%rax,%rax,4), %rax
movq (%rcx,%rax,8), %rbx
movq 0x8(%rcx,%rax,8), %r12
movq %r12, %rax
subq %rbx, %rax
sete %cl
cmpq $0x8, %rax
setne %al
orb %cl, %al
jne 0x13969
movl (%rbx), %eax
cmpl 0x4(%rsp), %eax
je 0x13960
movl %eax, %ecx
sarl %ecx
movslq %ecx, %rcx
movq 0x48(%r14), %rdx
cmpl $0x0, (%rdx,%rcx,4)
jne 0x13960
xorl $0x1, %eax
movl %eax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x22c1a
addq $0x4, %rbx
cmpq %r12, %rbx
jne 0x13933
addq $0x4, %r15
cmpq %rbp, %r15
jne 0x1390c
movl 0x4(%rsp), %eax
movq 0x18(%r14), %rcx
xorl $0x1, %eax
cltq
leaq (%rax,%rax,2), %rax
movq (%rcx,%rax,8), %r15
movq 0x8(%rcx,%rax,8), %rbp
cmpq %rbp, %r15
je 0x13896
movslq (%r15), %rax
movq (%r14), %rcx
leaq (%rax,%rax,4), %rax
movq (%rcx,%rax,8), %rbx
movq 0x8(%rcx,%rax,8), %r12
movq %r12, %rax
subq %rbx, %rax
sete %cl
cmpq $0x8, %rax
setne %al
orb %cl, %al
jne 0x13a14
movl (%rbx), %eax
movl %eax, 0x8(%rsp)
movl 0x4(%rsp), %ecx
xorl %eax, %ecx
cmpl $0x1, %ecx
je 0x13a0b
movl %eax, %ecx
sarl %ecx
movslq %ecx, %rcx
movq 0x48(%r14), %rdx
cmpl $0x0, (%rdx,%rcx,4)
jne 0x13a0b
movq 0x40(%rsp), %rcx
movq 0x50(%rsp), %rdx
addq $-0x4, %rdx
cmpq %rdx, %rcx
je 0x139fe
movl %eax, (%rcx)
addq $0x4, %rcx
movq %rcx, 0x40(%rsp)
jmp 0x13a0b
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x22a06
addq $0x4, %rbx
cmpq %r12, %rbx
jne 0x139bc
addq $0x4, %r15
jmp 0x1398c
leaq 0x10(%rsp), %rdi
callq 0x1faa8
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x13a3c
jmp 0x13a3c
jmp 0x13a3c
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x1faa8
movq %rbx, %rdi
callq 0x34a0
nop