// File: /workspace/github_cpp_makefile_star2_O2/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 $0x78, %rsp
movq %rdx, 0x18(%rsp)
movq %rdi, %r14
leaq 0x24(%rsp), %r15
movl %esi, (%r15)
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x1910c
movq %r12, %rdi
movq %r15, %rsi
callq 0x1cfd6
leaq 0x28(%rsp), %r15
leaq 0xc(%rsp), %r13
movq 0x38(%rsp), %rax
cmpq %rax, 0x58(%rsp)
je 0xfd85
movl (%rax), %eax
movl %eax, 0x8(%rsp)
movq %r15, %rdi
callq 0x1d20a
movslq 0x8(%rsp), %rax
movq 0x3b0(%r14), %rcx
movl 0x3ac(%r14), %edx
cmpl %edx, (%rcx,%rax,4)
je 0xfc1e
movl %edx, (%rcx,%rax,4)
movslq 0x8(%rsp), %rax
movq 0x3c8(%r14), %rcx
andl $0x0, (%rcx,%rax,4)
movl 0x8(%rsp), %eax
sarl %eax
cltq
andl $0x0, (%rcx,%rax,4)
movq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x68a4
movslq 0x8(%rsp), %rax
movq 0x18(%r14), %rcx
imulq $0x18, %rax, %rax
movq (%rcx,%rax), %rbp
movq 0x8(%rcx,%rax), %rax
movq %rax, 0x10(%rsp)
cmpq 0x10(%rsp), %rbp
je 0xfd00
movslq (%rbp), %rax
movq (%r14), %rcx
imulq $0x28, %rax, %rax
movq (%rcx,%rax), %rbx
movq 0x8(%rcx,%rax), %r12
movq %r12, %rax
subq %rbx, %rax
cmpq $0x8, %rax
jne 0xfcfa
cmpq %r12, %rbx
je 0xfcfa
movl (%rbx), %eax
cmpl 0x8(%rsp), %eax
je 0xfcf4
movl %eax, %ecx
sarl %ecx
movslq %ecx, %rcx
movq 0x48(%r14), %rdx
cmpl $0x0, (%rdx,%rcx,4)
jne 0xfcf4
xorl $0x1, %eax
movl %eax, 0xc(%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x1d260
addq $0x4, %rbx
jmp 0xfcc4
addq $0x4, %rbp
jmp 0xfc9d
movslq 0x8(%rsp), %rax
xorq $0x1, %rax
movq 0x18(%r14), %rcx
imulq $0x18, %rax, %rax
movq (%rcx,%rax), %rbp
movq 0x8(%rcx,%rax), %rax
movq %rax, 0x10(%rsp)
cmpq 0x10(%rsp), %rbp
je 0xfc1e
movslq (%rbp), %rax
movq (%r14), %rcx
imulq $0x28, %rax, %rax
movq (%rcx,%rax), %rbx
movq 0x8(%rcx,%rax), %r12
movq %r12, %rax
subq %rbx, %rax
cmpq $0x8, %rax
jne 0xfd7f
cmpq %r12, %rbx
je 0xfd7f
movl (%rbx), %eax
movl %eax, 0xc(%rsp)
movl 0x8(%rsp), %ecx
xorl %eax, %ecx
cmpl $0x1, %ecx
je 0xfd79
sarl %eax
cltq
movq 0x48(%r14), %rcx
cmpl $0x0, (%rcx,%rax,4)
jne 0xfd79
movq %r15, %rdi
movq %r13, %rsi
callq 0x1cfd6
addq $0x4, %rbx
jmp 0xfd4a
addq $0x4, %rbp
jmp 0xfd1f
leaq 0x28(%rsp), %rdi
callq 0x198d0
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xfda4
jmp 0xfda4
jmp 0xfda4
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x198d0
movq %rbx, %rdi
callq 0x3490
nop