// File: /workspace/github_cpp_makefile_star2_O2/Laakeri[P]maxpre/src/./SIE.cpp
// Function: maxPreprocessor::Preprocessor::trySIE(int)
int Preprocessor::trySIE(int lit) {
	if (pi.isVarRemoved(litVariable(lit))) return 0;
	if (pi.litClauses[lit].size() == 0) {
		int rm = setVariable(litVariable(lit), !litValue(lit));
		return rm;
	}
	if (pi.litClauses[lit].size() == 1){
		int c = pi.litClauses[lit][0];
		for (int l : pi.clauses[c].lit) {
			if (l != lit) {
				int rm = try2SIE(l, lit);
				if (rm > 0) {
					return rm;
				}
			}
		}
		return 0;
	}
	unsigned mi1 = 1e9;
	int mi1c = -1;
	unsigned mi2 = 1e9;
	int mi2c = -1;
	for (int c : pi.litClauses[lit]) {
		if (pi.clauses[c].lit.size() < mi1) {
			mi2 = mi1;
			mi2c = mi1c;
			mi1 = pi.clauses[c].lit.size();
			mi1c = c;
		}
		else if(pi.clauses[c].lit.size() < mi2) {
			mi2 = pi.clauses[c].lit.size();
			mi2c = c;
		}
	}
	assert(mi1c != mi2c);
	assert(mi1c >= 0 && mi2c >= 0);
	unsigned i1 = 0;
	unsigned i2 = 0;
	vector<int> cands;
	while (i1 < pi.clauses[mi1c].lit.size() && i2 < pi.clauses[mi2c].lit.size()) {
		if (pi.clauses[mi1c].lit[i1] == pi.clauses[mi2c].lit[i2]) {
			if (pi.clauses[mi1c].lit[i1] != lit) {
				cands.push_back(pi.clauses[mi1c].lit[i1]);
			}
			i1++;
			i2++;
		}
		else if(pi.clauses[mi1c].lit[i1] < pi.clauses[mi2c].lit[i2]) {
			i1++;
		}
		else {
			i2++;
		}
	}
	vector<int> newCands;
	for (int l : cands) {
		if (SIErndCheck(l, lit)) newCands.push_back(l);
	}
	cands = newCands;
	for (int c : pi.litClauses[lit]) {
		vector<int> nCands;
		nCands.reserve(cands.size());
		int ci = 0;
		for (int l : pi.clauses[c].lit) {
			while (ci < (int)cands.size() && cands[ci] < l) ci++;
			if (ci == (int)cands.size()) break;
			if (l == cands[ci]) nCands.push_back(l);
		}
		cands = nCands;
		if (cands.size() < 2) break;
	}
	for (int l : cands) {
		int rm = try2SIE(l, lit);
		if (rm > 0) {
			return rm;
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %esi, %ebx
movq %rdi, %r12
movl %esi, %r15d
sarl %r15d
movl %r15d, %esi
callq 0x20fae
xorl %ebp, %ebp
testb %al, %al
jne 0xf9ba
movl %ebx, 0xc(%rsp)
movslq %ebx, %rax
movq 0x18(%r12), %rcx
imulq $0x18, %rax, %r13
movq (%rcx,%r13), %rdx
movq 0x8(%rcx,%r13), %rsi
movq %rsi, %rax
subq %rdx, %rax
sarq $0x2, %rax
je 0xf6fc
cmpq $0x1, %rax
jne 0xf71c
movslq (%rdx), %rax
movq (%r12), %rcx
imulq $0x28, %rax, %rax
movq (%rcx,%rax), %rbx
movq 0x8(%rcx,%rax), %r14
movl 0xc(%rsp), %r15d
cmpq %r14, %rbx
je 0xf9ba
movl (%rbx), %esi
cmpl %r15d, %esi
je 0xf6f6
movq %r12, %rdi
movl %r15d, %edx
callq 0xf4e2
testl %eax, %eax
jg 0xf9b8
addq $0x4, %rbx
jmp 0xf6d3
movl 0xc(%rsp), %edx
andl $0x1, %edx
movq %r12, %rdi
movl %r15d, %esi
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7c98
movq (%r12), %rax
movl $0x3b9aca00, %r8d       # imm = 0x3B9ACA00
pushq $-0x1
popq %rcx
movl %ecx, %edi
movl $0x3b9aca00, %r9d       # imm = 0x3B9ACA00
cmpq %rsi, %rdx
je 0xf779
movslq (%rdx), %r10
imulq $0x28, %r10, %rbx
movq 0x8(%rax,%rbx), %r11
subq (%rax,%rbx), %r11
sarq $0x2, %r11
movl %r9d, %ebx
cmpq %rbx, %r11
jae 0xf75c
movl %edi, %ecx
movl %r9d, %r8d
movl %r11d, %r9d
jmp 0xf770
movl %r8d, %ebx
cmpq %rbx, %r11
cmovbl %r10d, %ecx
cmovael %r8d, %r11d
movl %r11d, %r8d
movl %edi, %r10d
addq $0x4, %rdx
movl %r10d, %edi
jmp 0xf731
cmpl %ecx, %edi
je 0xf9cb
movq %r12, 0x30(%rsp)
testl %edi, %edi
js 0xf9e4
testl %ecx, %ecx
js 0xf9e4
leaq 0x10(%rsp), %rbx
andq $0x0, 0x10(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rbx)
movl %edi, %edx
movl %ecx, %ecx
xorl %r12d, %r12d
imulq $0x28, %rdx, %rbp
imulq $0x28, %rcx, %r14
xorl %r15d, %r15d
movq (%rax,%rbp), %rcx
movq 0x8(%rax,%rbp), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
leaq (%rax,%r14), %rsi
movl %r12d, %r12d
movl %r15d, %edi
cmpq %rdi, %rdx
jbe 0xf823
movq (%rsi), %r8
movq 0x8(%rsi), %r9
subq %r8, %r9
sarq $0x2, %r9
cmpq %r12, %r9
jbe 0xf823
movl (%rcx,%rdi,4), %r9d
cmpl (%r8,%r12,4), %r9d
je 0xf800
jge 0xf7fb
incl %r15d
jmp 0xf7cf
incl %r12d
jmp 0xf7cc
cmpl 0xc(%rsp), %r9d
je 0xf81b
leaq (%rcx,%rdi,4), %rsi
movq %rbx, %rdi
callq 0x68a4
movq 0x30(%rsp), %rax
movq (%rax), %rax
incl %r15d
incl %r12d
jmp 0xf7b8
xorps %xmm0, %xmm0
leaq 0x60(%rsp), %r15
andq $0x0, 0x10(%r15)
movaps %xmm0, (%r15)
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r14
leaq 0x40(%rsp), %r12
cmpq %r14, %rbx
je 0xf871
movl (%rbx), %esi
movl %esi, 0x40(%rsp)
movq 0x30(%rsp), %rdi
movl 0xc(%rsp), %edx
callq 0xf46e
testb %al, %al
je 0xf86b
movq %r15, %rdi
movq %r12, %rsi
callq 0x68a4
addq $0x4, %rbx
jmp 0xf843
leaq 0x10(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x18ea4
movq 0x30(%rsp), %r12
movq 0x18(%r12), %rax
movq (%rax,%r13), %rbp
movq 0x8(%rax,%r13), %rax
movq %rax, 0x58(%rsp)
leaq 0x40(%rsp), %r15
leaq 0x3c(%rsp), %r13
cmpq 0x58(%rsp), %rbp
je 0xf973
movslq (%rbp), %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
andq $0x0, 0x50(%rsp)
movq 0x18(%rsp), %rsi
subq 0x10(%rsp), %rsi
sarq $0x2, %rsi
movq %r15, %rdi
callq 0x19034
movq (%r12), %rax
imulq $0x28, %rbx, %rcx
movq (%rax,%rcx), %r12
movq 0x8(%rax,%rcx), %r14
xorl %ebx, %ebx
cmpq %r14, %r12
je 0xf941
movl (%r12), %eax
movl %eax, 0x3c(%rsp)
movq 0x10(%rsp), %rcx
movq 0x18(%rsp), %rdx
subq %rcx, %rdx
shrq $0x2, %rdx
movslq %ebx, %rsi
movslq %edx, %rdi
cmpl %edi, %esi
movl %edx, %ebx
cmovgl %esi, %ebx
cmpq %rdi, %rsi
jge 0xf924
cmpl %eax, (%rcx,%rsi,4)
jge 0xf922
incq %rsi
jmp 0xf913
movl %esi, %ebx
cmpl %edx, %ebx
je 0xf941
movslq %ebx, %rdx
cmpl (%rcx,%rdx,4), %eax
jne 0xf93b
movq %r15, %rdi
movq %r13, %rsi
callq 0x68a4
addq $0x4, %r12
jmp 0xf8e8
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x18ea4
movq 0x18(%rsp), %rbx
subq 0x10(%rsp), %rbx
movq %r15, %rdi
callq 0x7512
addq $0x4, %rbp
cmpq $0x4, %rbx
movq 0x30(%rsp), %r12
ja 0xf8a2
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r14
movl 0xc(%rsp), %r15d
cmpq %r14, %rbx
je 0xf9a0
movl (%rbx), %esi
movq %r12, %rdi
movl %r15d, %edx
callq 0xf4e2
movl %eax, %ebp
addq $0x4, %rbx
testl %eax, %eax
jle 0xf982
jmp 0xf9a2
xorl %ebp, %ebp
leaq 0x60(%rsp), %rdi
callq 0x7512
leaq 0x10(%rsp), %rdi
callq 0x7512
jmp 0xf9ba
movl %eax, %ebp
movl %ebp, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x20182(%rip), %rdi     # 0x2fb54
leaq 0x20119(%rip), %rsi     # 0x2faf2
leaq 0x20181(%rip), %rcx     # 0x2fb61
pushq $0x5e
jmp 0xf9fb
leaq 0x201a5(%rip), %rdi     # 0x2fb90
leaq 0x20100(%rip), %rsi     # 0x2faf2
leaq 0x20168(%rip), %rcx     # 0x2fb61
pushq $0x5f
popq %rdx
callq 0x31c0
movq %rax, %rbx
jmp 0xfa2a
jmp 0xfa0e
jmp 0xfa0e
jmp 0xfa13
jmp 0xfa13
movq %rax, %rbx
jmp 0xfa20
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x7512
leaq 0x60(%rsp), %rdi
callq 0x7512
leaq 0x10(%rsp), %rdi
callq 0x7512
movq %rbx, %rdi
callq 0x3490