// File: Laakeri[P]maxpre/src/./SLE.cpp
// Function: maxPreprocessor::Preprocessor::trySLESlow(int, int)
int Preprocessor::trySLESlow(int lb1, int lb2) {
	vector<int> cs1;
	vector<int> cs2;
	uint64_t w1, w2;
	if (pi.isLabel[lb1] == VAR_TRUE) {
		cs1 = pi.litClauses[negLit(lb1)];
		w1 = pi.clauses[pi.litClauses[posLit(lb1)][0]].weight;
	}
	else {
		cs1 = pi.litClauses[posLit(lb1)];
		w1 = pi.clauses[pi.litClauses[negLit(lb1)][0]].weight;
	}
	if (pi.isLabel[lb2] == VAR_FALSE) {
		cs2 = pi.litClauses[posLit(lb2)];
		w2 = pi.clauses[pi.litClauses[negLit(lb2)][0]].weight;
	}
	else {
		cs2 = pi.litClauses[negLit(lb2)];
		w2 = pi.clauses[pi.litClauses[posLit(lb2)][0]].weight;
	}
	assert(w1 < HARDWEIGHT);
	assert(w2 < HARDWEIGHT);
	
	bool s1 = vSubsumed(cs1, cs2);
	bool s2 = vSubsumed(cs2, cs1);
	
	int rmClauses = 0;
	
	if (s1 && w2 <= w1) {
		if (pi.isLabel[lb1] == VAR_TRUE) {
			rmClauses = setVariable(lb1, true);
		}
		else {
			rmClauses = setVariable(lb1, false);
		}
		assert(pi.isVarRemoved(lb1));
		rLog.removeClause(rmClauses);
		rLog.removeLabel(1);
		return 1;
	}
	else if(s2 && w1 <= w2) {
		if (pi.isLabel[lb2] == VAR_TRUE) {
			rmClauses = setVariable(lb2, true);
		}
		else {
			rmClauses = setVariable(lb2, false);
		}
		assert(pi.isVarRemoved(lb2));
		rLog.removeClause(rmClauses);
		rLog.removeLabel(1);
		return 1;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xa7e0
leaq -0x48(%rbp), %rdi
callq 0xa7e0
movq -0x78(%rbp), %rdi
addq $0x48, %rdi
movslq -0x14(%rbp), %rsi
callq 0xa7c0
cmpl $0x1, (%rax)
jne 0x1ef6e
movq -0x78(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x88(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5e0
movl %eax, -0x7c(%rbp)
jmp 0x1eec5
movq -0x88(%rbp), %rdi
movl -0x7c(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq %rax, %rsi
leaq -0x30(%rbp), %rdi
callq 0x3de50
jmp 0x1eee5
movq -0x78(%rbp), %rax
movq %rax, %rcx
movq %rcx, -0xa0(%rbp)
addq $0x18, %rax
movq %rax, -0x98(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5d0
movl %eax, -0x8c(%rbp)
jmp 0x1ef0e
movq -0x98(%rbp), %rdi
movl -0x8c(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa7c0
movq -0xa0(%rbp), %rdi
movslq (%rax), %rsi
callq 0x3c600
movq 0x18(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x1f011
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xab00
leaq -0x30(%rbp), %rdi
callq 0xab00
jmp 0x1f418
movq -0x78(%rbp), %rax
addq $0x18, %rax
movq %rax, -0xb0(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5d0
movl %eax, -0xa4(%rbp)
jmp 0x1ef8d
movq -0xb0(%rbp), %rdi
movl -0xa4(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq %rax, %rsi
leaq -0x30(%rbp), %rdi
callq 0x3de50
jmp 0x1efb0
movq -0x78(%rbp), %rax
movq %rax, %rcx
movq %rcx, -0xc8(%rbp)
addq $0x18, %rax
movq %rax, -0xc0(%rbp)
movl -0x14(%rbp), %edi
callq 0x3c5e0
movl %eax, -0xb4(%rbp)
jmp 0x1efd9
movq -0xc0(%rbp), %rdi
movl -0xb4(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa7c0
movq -0xc8(%rbp), %rdi
movslq (%rax), %rsi
callq 0x3c600
movq 0x18(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x78(%rbp), %rdi
addq $0x48, %rdi
movslq -0x18(%rbp), %rsi
callq 0xa7c0
cmpl $0x2, (%rax)
jne 0x1f0d3
movq -0x78(%rbp), %rax
addq $0x18, %rax
movq %rax, -0xd8(%rbp)
movl -0x18(%rbp), %edi
callq 0x3c5d0
movl %eax, -0xcc(%rbp)
jmp 0x1f04a
movq -0xd8(%rbp), %rdi
movl -0xcc(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq %rax, %rsi
leaq -0x48(%rbp), %rdi
callq 0x3de50
jmp 0x1f06d
movq -0x78(%rbp), %rax
movq %rax, %rcx
movq %rcx, -0xf0(%rbp)
addq $0x18, %rax
movq %rax, -0xe8(%rbp)
movl -0x18(%rbp), %edi
callq 0x3c5e0
movl %eax, -0xdc(%rbp)
jmp 0x1f096
movq -0xe8(%rbp), %rdi
movl -0xdc(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa7c0
movq -0xf0(%rbp), %rdi
movslq (%rax), %rsi
callq 0x3c600
movq 0x18(%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0x1f176
movq -0x78(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x100(%rbp)
movl -0x18(%rbp), %edi
callq 0x3c5e0
movl %eax, -0xf4(%rbp)
jmp 0x1f0f2
movq -0x100(%rbp), %rdi
movl -0xf4(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq %rax, %rsi
leaq -0x48(%rbp), %rdi
callq 0x3de50
jmp 0x1f115
movq -0x78(%rbp), %rax
movq %rax, %rcx
movq %rcx, -0x118(%rbp)
addq $0x18, %rax
movq %rax, -0x110(%rbp)
movl -0x18(%rbp), %edi
callq 0x3c5d0
movl %eax, -0x104(%rbp)
jmp 0x1f13e
movq -0x110(%rbp), %rdi
movl -0x104(%rbp), %eax
movslq %eax, %rsi
callq 0xaab0
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa7c0
movq -0x118(%rbp), %rdi
movslq (%rax), %rsi
callq 0x3c600
movq 0x18(%rax), %rax
movq %rax, -0x58(%rbp)
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
cmpq %rax, -0x50(%rbp)
jae 0x1f188
jmp 0x1f1a7
leaq 0x67644(%rip), %rdi     # 0x867d3
leaq 0x6764d(%rip), %rsi     # 0x867e3
movl $0x26, %edx
leaq 0x6764b(%rip), %rcx     # 0x867ed
callq 0x4260
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
cmpq %rax, -0x58(%rbp)
jae 0x1f1b9
jmp 0x1f1d8
leaq 0x67665(%rip), %rdi     # 0x86825
leaq 0x6761c(%rip), %rsi     # 0x867e3
movl $0x27, %edx
leaq 0x6761a(%rip), %rcx     # 0x867ed
callq 0x4260
movq -0x78(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x1ed70
movq -0x78(%rbp), %rdi
andb $0x1, %al
movb %al, -0x65(%rbp)
leaq -0x48(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x1ed70
andb $0x1, %al
movb %al, -0x66(%rbp)
movl $0x0, -0x6c(%rbp)
testb $0x1, -0x65(%rbp)
je 0x1f2fc
movq -0x58(%rbp), %rax
cmpq -0x50(%rbp), %rax
ja 0x1f2fc
movq -0x78(%rbp), %rdi
addq $0x48, %rdi
movslq -0x14(%rbp), %rsi
callq 0xa7c0
cmpl $0x1, (%rax)
jne 0x1f25d
movq -0x78(%rbp), %rdi
movl -0x14(%rbp), %esi
movl $0x1, %edx
callq 0x10a60
movl %eax, -0x11c(%rbp)
jmp 0x1f252
movl -0x11c(%rbp), %eax
movl %eax, -0x6c(%rbp)
jmp 0x1f27c
movq -0x78(%rbp), %rdi
movl -0x14(%rbp), %esi
xorl %edx, %edx
callq 0x10a60
movl %eax, -0x120(%rbp)
jmp 0x1f273
movl -0x120(%rbp), %eax
movl %eax, -0x6c(%rbp)
movq -0x78(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x5ecc0
movb %al, -0x121(%rbp)
jmp 0x1f290
movb -0x121(%rbp), %al
testb $0x1, %al
jne 0x1f29c
jmp 0x1f29e
jmp 0x1f2bd
leaq 0x67590(%rip), %rdi     # 0x86835
leaq 0x67537(%rip), %rsi     # 0x867e3
movl $0x35, %edx
leaq 0x67535(%rip), %rcx     # 0x867ed
callq 0x4260
movq -0x78(%rbp), %rdi
addq $0x218, %rdi            # imm = 0x218
movl -0x6c(%rbp), %esi
callq 0x61410
jmp 0x1f2d2
movq -0x78(%rbp), %rdi
addq $0x218, %rdi            # imm = 0x218
movl $0x1, %esi
callq 0x61590
jmp 0x1f2e9
movl $0x1, -0x4(%rbp)
movl $0x1, -0x70(%rbp)
jmp 0x1f3fa
testb $0x1, -0x66(%rbp)
je 0x1f3ea
movq -0x50(%rbp), %rax
cmpq -0x58(%rbp), %rax
ja 0x1f3ea
movq -0x78(%rbp), %rdi
addq $0x48, %rdi
movslq -0x18(%rbp), %rsi
callq 0xa7c0
cmpl $0x1, (%rax)
jne 0x1f34e
movq -0x78(%rbp), %rdi
movl -0x18(%rbp), %esi
movl $0x1, %edx
callq 0x10a60
movl %eax, -0x128(%rbp)
jmp 0x1f343
movl -0x128(%rbp), %eax
movl %eax, -0x6c(%rbp)
jmp 0x1f36d
movq -0x78(%rbp), %rdi
movl -0x18(%rbp), %esi
xorl %edx, %edx
callq 0x10a60
movl %eax, -0x12c(%rbp)
jmp 0x1f364
movl -0x12c(%rbp), %eax
movl %eax, -0x6c(%rbp)
movq -0x78(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x5ecc0
movb %al, -0x12d(%rbp)
jmp 0x1f381
movb -0x12d(%rbp), %al
testb $0x1, %al
jne 0x1f38d
jmp 0x1f38f
jmp 0x1f3ae
leaq 0x674b4(%rip), %rdi     # 0x8684a
leaq 0x67446(%rip), %rsi     # 0x867e3
movl $0x41, %edx
leaq 0x67444(%rip), %rcx     # 0x867ed
callq 0x4260
movq -0x78(%rbp), %rdi
addq $0x218, %rdi            # imm = 0x218
movl -0x6c(%rbp), %esi
callq 0x61410
jmp 0x1f3c3
movq -0x78(%rbp), %rdi
addq $0x218, %rdi            # imm = 0x218
movl $0x1, %esi
callq 0x61590
jmp 0x1f3da
movl $0x1, -0x4(%rbp)
movl $0x1, -0x70(%rbp)
jmp 0x1f3fa
jmp 0x1f3ec
movl $0x0, -0x4(%rbp)
movl $0x1, -0x70(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xab00
leaq -0x30(%rbp), %rdi
callq 0xab00
movl -0x4(%rbp), %eax
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x4610
nopw %cs:(%rax,%rax)