// File: Laakeri[P]maxpre/src/./SIE.cpp
// Function: maxPreprocessor::Preprocessor::try2SIE(int, int)
int Preprocessor::try2SIE(int litX, int litY) {
	for (int c : pi.litClauses[litNegation(litX)]) {
		if (pi.clauses[c].lit.size() > 10) { // magic constant
			if (!binary_search(pi.clauses[c].lit.begin(), pi.clauses[c].lit.end(), litNegation(litY))) {
				return 0;
			}
		}
		else {
			bool f = false;
			for (int l : pi.clauses[c].lit) {
				if (l == litNegation(litY)) {
					f = true;
					break;
				}
			}
			if (!f) {
				return 0;
			}
		}
	}
	for (int c : pi.litClauses[litY]) {
		if (!binary_search(pi.clauses[c].lit.begin(), pi.clauses[c].lit.end(), litX)) {
			return 0;
		}
	}
	int rmC = 0;
	rmC += setVariable(litVariable(litX), litValue(litX));
	rmC += setVariable(litVariable(litY), !litValue(litY));
	rLog.removeClause(rmC);
	rLog.removeVariable(2);
	assert(pi.isVarRemoved(litVariable(litX)));
	assert(pi.isVarRemoved(litVariable(litY)));
	return rmC;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
addq $0x18, %rax
movq %rax, -0xb0(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5a0
movq -0xb0(%rbp), %rdi
movslq %eax, %rsi
callq 0xaab0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xa800
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0xa830
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xa860
testb $0x1, %al
jne 0x21b16
jmp 0x21c56
leaq -0x28(%rbp), %rdi
callq 0xa8a0
movq -0xb8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x34(%rbp)
movslq -0x34(%rbp), %rsi
callq 0x3c600
movq %rax, %rdi
callq 0xf940
cmpq $0xa, %rax
jbe 0x21baf
movq -0xb8(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x3c600
movq %rax, %rdi
callq 0xa800
movq -0xb8(%rbp), %rdi
movq %rax, -0x40(%rbp)
movslq -0x34(%rbp), %rsi
callq 0x3c600
movq %rax, %rdi
callq 0xa830
movq %rax, -0x48(%rbp)
movl -0x18(%rbp), %edi
callq 0x3c5a0
movl %eax, -0x4c(%rbp)
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
leaq -0x4c(%rbp), %rdx
callq 0x3e170
xorb $-0x1, %al
testb $0x1, %al
jne 0x21b9e
jmp 0x21baa
movl $0x0, -0x4(%rbp)
jmp 0x21e70
jmp 0x21c46
movq -0xb8(%rbp), %rdi
movb $0x0, -0x4d(%rbp)
movslq -0x34(%rbp), %rsi
callq 0x3c600
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
callq 0xa800
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rdi
callq 0xa830
movq %rax, -0x68(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0xa860
testb $0x1, %al
jne 0x21bf4
jmp 0x21c32
leaq -0x60(%rbp), %rdi
callq 0xa8a0
movl (%rax), %eax
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movl %eax, -0xbc(%rbp)
movl -0x18(%rbp), %edi
callq 0x3c5a0
movl %eax, %ecx
movl -0xbc(%rbp), %eax
cmpl %ecx, %eax
jne 0x21c25
movb $0x1, -0x4d(%rbp)
jmp 0x21c32
jmp 0x21c27
leaq -0x60(%rbp), %rdi
callq 0xa930
jmp 0x21be1
testb $0x1, -0x4d(%rbp)
jne 0x21c44
movl $0x0, -0x4(%rbp)
jmp 0x21e70
jmp 0x21c46
jmp 0x21c48
leaq -0x28(%rbp), %rdi
callq 0xa930
jmp 0x21b00
movq -0xb8(%rbp), %rdi
addq $0x18, %rdi
movslq -0x18(%rbp), %rsi
callq 0xaab0
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdi
callq 0xa800
movq %rax, -0x80(%rbp)
movq -0x78(%rbp), %rdi
callq 0xa830
movq %rax, -0x88(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xa860
testb $0x1, %al
jne 0x21ca4
jmp 0x21d30
leaq -0x80(%rbp), %rdi
callq 0xa8a0
movq -0xb8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x8c(%rbp)
movslq -0x8c(%rbp), %rsi
callq 0x3c600
movq %rax, %rdi
callq 0xa800
movq -0xb8(%rbp), %rdi
movq %rax, -0x98(%rbp)
movslq -0x8c(%rbp), %rsi
callq 0x3c600
movq %rax, %rdi
callq 0xa830
movq %rax, -0xa0(%rbp)
movq -0x98(%rbp), %rdi
movq -0xa0(%rbp), %rsi
leaq -0x14(%rbp), %rdx
callq 0x3e170
testb $0x1, %al
jne 0x21d20
movl $0x0, -0x4(%rbp)
jmp 0x21e70
jmp 0x21d22
leaq -0x80(%rbp), %rdi
callq 0xa930
jmp 0x21c8b
movl $0x0, -0xa4(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c880
movl %eax, -0xc4(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c890
movl -0xc4(%rbp), %esi
movq -0xb8(%rbp), %rdi
cmpl $0x0, %eax
setne %al
movzbl %al, %edx
andl $0x1, %edx
callq 0x10a60
addl -0xa4(%rbp), %eax
movl %eax, -0xa4(%rbp)
movl -0x18(%rbp), %edi
callq 0x3c880
movl %eax, -0xc0(%rbp)
movl -0x18(%rbp), %edi
callq 0x3c890
movl -0xc0(%rbp), %esi
movq -0xb8(%rbp), %rdi
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movzbl %al, %edx
andl $0x1, %edx
callq 0x10a60
movq -0xb8(%rbp), %rdi
addl -0xa4(%rbp), %eax
movl %eax, -0xa4(%rbp)
addq $0x218, %rdi            # imm = 0x218
movl -0xa4(%rbp), %esi
callq 0x61410
movq -0xb8(%rbp), %rdi
addq $0x218, %rdi            # imm = 0x218
movl $0x2, %esi
callq 0x61490
movl -0x14(%rbp), %edi
callq 0x3c880
movq -0xb8(%rbp), %rdi
movl %eax, %esi
callq 0x5ecc0
testb $0x1, %al
jne 0x21e09
jmp 0x21e0b
jmp 0x21e2a
leaq 0x64c1d(%rip), %rdi     # 0x86a2f
leaq 0x64c39(%rip), %rsi     # 0x86a52
movl $0x36, %edx
leaq 0x64c37(%rip), %rcx     # 0x86a5c
callq 0x4260
movl -0x18(%rbp), %edi
callq 0x3c880
movq -0xb8(%rbp), %rdi
movl %eax, %esi
callq 0x5ecc0
testb $0x1, %al
jne 0x21e46
jmp 0x21e48
jmp 0x21e67
leaq 0x64c42(%rip), %rdi     # 0x86a91
leaq 0x64bfc(%rip), %rsi     # 0x86a52
movl $0x37, %edx
leaq 0x64bfa(%rip), %rcx     # 0x86a5c
callq 0x4260
movl -0xa4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xd0, %rsp
popq %rbp
retq
nopl (%rax)