// File: /workspace/github_cpp_makefile_star2_O1/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)
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 0x23582
movq 0x30(%r15), %rax
movq 0x40(%r15), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x14028
movl 0xc(%rsp), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x40(%rsp)
jmp 0x14037
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x236f8
movq 0x20(%rsp), %rax
cmpq %rax, 0x40(%rsp)
je 0x14237
leaq 0x8(%rsp), %r13
movl (%rax), %ecx
movl %ecx, 0x4(%rsp)
movq 0x30(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x14066
addq $0x4, %rax
jmp 0x14098
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)
movq %rax, 0x20(%rsp)
movslq 0x4(%rsp), %rax
movq 0x3b0(%r14), %rcx
movl 0x3ac(%r14), %edx
cmpl %edx, (%rcx,%rax,4)
jne 0x140c6
movq 0x20(%rsp), %rax
cmpq %rax, 0x40(%rsp)
jne 0x1404c
jmp 0x14237
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 0x14104
movl 0x4(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x1410e
leaq 0x4(%rsp), %rdx
callq 0x98e8
movslq 0x4(%rsp), %rax
movq 0x18(%r14), %rcx
leaq (%rax,%rax,2), %rax
movq (%rcx,%rax,8), %r15
movq 0x8(%rcx,%rax,8), %rbp
cmpq %rbp, %r15
je 0x1418c
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 0x14186
movl (%rbx), %eax
cmpl 0x4(%rsp), %eax
je 0x1417d
movl %eax, %ecx
sarl %ecx
movslq %ecx, %rcx
movq 0x48(%r14), %rdx
cmpl $0x0, (%rdx,%rcx,4)
jne 0x1417d
xorl $0x1, %eax
movl %eax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x2390c
addq $0x4, %rbx
cmpq %r12, %rbx
jne 0x14150
addq $0x4, %r15
jmp 0x14124
movslq 0x4(%rsp), %rax
xorq $0x1, %rax
movq 0x18(%r14), %rcx
leaq (%rax,%rax,2), %rax
movq (%rcx,%rax,8), %r15
movq 0x8(%rcx,%rax,8), %rbp
cmpq %rbp, %r15
je 0x140b5
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 0x1422e
movl (%rbx), %eax
movl %eax, 0x8(%rsp)
movl 0x4(%rsp), %ecx
xorl %eax, %ecx
cmpl $0x1, %ecx
je 0x14225
movl %eax, %ecx
sarl %ecx
movslq %ecx, %rcx
movq 0x48(%r14), %rdx
cmpl $0x0, (%rdx,%rcx,4)
jne 0x14225
movq 0x40(%rsp), %rcx
movq 0x50(%rsp), %rdx
addq $-0x4, %rdx
cmpq %rdx, %rcx
je 0x14218
movl %eax, (%rcx)
addq $0x4, %rcx
movq %rcx, 0x40(%rsp)
jmp 0x14225
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x236f8
addq $0x4, %rbx
cmpq %r12, %rbx
jne 0x141d6
addq $0x4, %r15
jmp 0x141a6
leaq 0x10(%rsp), %rdi
callq 0x2067a
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x14256
jmp 0x14256
jmp 0x14256
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2067a
movq %rbx, %rdi
callq 0x34a0
nop