// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %edx, 0xc(%rsp)
movl %esi, %r14d
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
andq $0x0, 0x40(%rsp)
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
movslq %esi, %r15
movq 0x48(%rdi), %rax
leal (%r15,%r15), %ebp
cmpl $0x1, (%rax,%r15,4)
jne 0xe1c4
movl %ebp, %eax
orl $0x1, %eax
cltq
imulq $0x18, %rax, %rsi
addq 0x18(%rbx), %rsi
leaq 0x30(%rsp), %rdi
callq 0x18ea4
jmp 0xe1dc
movslq %ebp, %rax
imulq $0x18, %rax, %rsi
addq 0x18(%rbx), %rsi
leaq 0x30(%rsp), %rdi
callq 0x18ea4
orl $0x1, %ebp
movslq %ebp, %rax
movq (%rbx), %rcx
movq 0x18(%rbx), %rsi
imulq $0x18, %rax, %rax
movq (%rsi,%rax), %rax
movslq (%rax), %rax
imulq $0x28, %rax, %rax
movq 0x18(%rcx,%rax), %r13
movslq 0xc(%rsp), %r12
movq 0x48(%rbx), %rax
leal (%r12,%r12), %ebp
cmpl $0x2, (%rax,%r12,4)
jne 0xe227
movslq %ebp, %rax
imulq $0x18, %rax, %rax
addq %rax, %rsi
leaq 0x10(%rsp), %rdi
callq 0x18ea4
orl $0x1, %ebp
jmp 0xe23f
movl %ebp, %eax
orl $0x1, %eax
cltq
imulq $0x18, %rax, %rax
addq %rax, %rsi
leaq 0x10(%rsp), %rdi
callq 0x18ea4
testq %r13, %r13
js 0xe35a
movslq %ebp, %rax
movq (%rbx), %rcx
movq 0x18(%rbx), %rdx
imulq $0x18, %rax, %rax
movq (%rdx,%rax), %rax
movslq (%rax), %rax
imulq $0x28, %rax, %rax
movq 0x18(%rcx,%rax), %rbp
testq %rbp, %rbp
js 0xe373
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0xe130
testb %al, %al
je 0xe2c8
cmpq %r13, %rbp
ja 0xe2c8
movq 0x48(%rbx), %rax
xorl %edx, %edx
cmpl $0x1, (%rax,%r15,4)
sete %dl
movq %rbx, %rdi
movl %r15d, %esi
callq 0x7c98
movl %eax, %ebp
movq %rbx, %rdi
movl %r14d, %esi
callq 0x20fae
testb %al, %al
je 0xe38c
addq $0x218, %rbx            # imm = 0x218
movq %rbx, %rdi
movl %ebp, %esi
callq 0x21e84
jmp 0xe325
leaq 0x10(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0xe130
xorl %r14d, %r14d
testb %al, %al
je 0xe334
cmpq %rbp, %r13
ja 0xe334
movq 0x48(%rbx), %rax
xorl %edx, %edx
cmpl $0x1, (%rax,%r12,4)
sete %dl
movq %rbx, %rdi
movl %r12d, %esi
callq 0x7c98
movl %eax, %r14d
movq %rbx, %rdi
movl 0xc(%rsp), %esi
callq 0x20fae
testb %al, %al
je 0xe3a5
addq $0x218, %rbx            # imm = 0x218
movq %rbx, %rdi
movl %r14d, %esi
callq 0x21e84
pushq $0x1
popq %r14
movq %rbx, %rdi
movl %r14d, %esi
callq 0x21f32
leaq 0x10(%rsp), %rdi
callq 0x7512
leaq 0x30(%rsp), %rdi
callq 0x7512
movl %r14d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x21512(%rip), %rdi     # 0x2f873
leaq 0x2151b(%rip), %rsi     # 0x2f883
leaq 0x2151e(%rip), %rcx     # 0x2f88d
pushq $0x26
jmp 0xe3bc
leaq 0x2154b(%rip), %rdi     # 0x2f8c5
leaq 0x21502(%rip), %rsi     # 0x2f883
leaq 0x21505(%rip), %rcx     # 0x2f88d
pushq $0x27
jmp 0xe3bc
leaq 0x21542(%rip), %rdi     # 0x2f8d5
leaq 0x214e9(%rip), %rsi     # 0x2f883
leaq 0x214ec(%rip), %rcx     # 0x2f88d
pushq $0x35
jmp 0xe3bc
leaq 0x2153e(%rip), %rdi     # 0x2f8ea
leaq 0x214d0(%rip), %rsi     # 0x2f883
leaq 0x214d3(%rip), %rcx     # 0x2f88d
pushq $0x41
popq %rdx
callq 0x31c0
jmp 0xe3c4
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x7512
leaq 0x30(%rsp), %rdi
callq 0x7512
movq %rbx, %rdi
callq 0x3490
nop