// File: /workspace/github_cpp_makefile_star2_O1/Laakeri[P]maxpre/src/./LS.cpp
// Function: maxPreprocessor::Preprocessor::tryLS(int)
int Preprocessor::tryLS(int lbl) {
	assert(pi.isLabel[lbl]);
	vector<int> tc;
	if (pi.isLabel[lbl] == VAR_TRUE) {
		tc = pi.litClauses[negLit(lbl)];
	}
	else {
		tc = pi.litClauses[posLit(lbl)];
	}
	if (tc.size() == 0) return 0;
	vector<pair<int, int> > blockedClauses;
	unordered_set<int> touchedList;
	unordered_set<int> deletedClauses;
	for (int t : tc) {
		deletedClauses.insert(t);
		for(int l : pi.clauses[t].lit) {
			touchedList.insert(litVariable(l));
		}
	}
	while (touchedList.size() > 0) {
		int var = *touchedList.begin();
		touchedList.erase(var);
		if (pi.isLabel[var]) continue;
		tryLSBCE(posLit(var), deletedClauses, touchedList, blockedClauses);
		tryLSBCE(negLit(var), deletedClauses, touchedList, blockedClauses);
	}
	for (auto c : blockedClauses) {
		if (pi.isLabel[lbl] == VAR_TRUE) trace.LS(negLit(lbl), c.S, pi.clauses[c.F].lit);
		else trace.LS(posLit(lbl), c.S, pi.clauses[c.F].lit);
		
		if(pi.isLabel[lbl] == VAR_TRUE) pi.addLiteralToClause(negLit(lbl), c.F);
		else pi.addLiteralToClause(posLit(lbl), c.F);
	}
	rLog.removeLiteral(-(int)blockedClauses.size());
	return blockedClauses.size();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movslq %esi, %r14
movq 0x48(%rdi), %rax
cmpl $0x0, (%rax,%r14,4)
je 0x19eb6
movl %esi, %ebp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
xorl %ecx, %ecx
cmpl $0x1, (%rax,%r14,4)
sete %cl
leal (%rcx,%r14,2), %eax
cltq
leaq (%rax,%rax,2), %rsi
shlq $0x3, %rsi
addq 0x18(%rbx), %rsi
callq 0x1fb22
movq 0x50(%rsp), %r15
movq 0x58(%rsp), %rax
movq %rax, 0x40(%rsp)
cmpq %r15, %rax
je 0x19e89
movq %r14, 0x78(%rsp)
movl %ebp, 0xc(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
leaq 0xb8(%rsp), %rax
movq %rax, -0x30(%rax)
movl $0x1, %ecx
movq %rcx, -0x28(%rax)
movups %xmm0, -0x20(%rax)
movl $0x3f800000, %edx       # imm = 0x3F800000
movl %edx, -0x10(%rax)
movups %xmm0, -0x8(%rax)
leaq 0xf0(%rsp), %rax
movq %rax, -0x30(%rax)
movq %rcx, -0x28(%rax)
movups %xmm0, -0x20(%rax)
movl %edx, -0x10(%rax)
movups %xmm0, -0x8(%rax)
leaq 0x10(%rsp), %r12
leaq 0x88(%rsp), %r13
leaq 0x4c(%rsp), %rbp
movq %rbx, 0x80(%rsp)
movl (%r15), %eax
movl %eax, 0x1c(%rsp)
leaq 0xc0(%rsp), %rdi
movq %rdi, 0x10(%rsp)
leaq 0x1c(%rsp), %rsi
movq %r12, %rdx
callq 0x2451c
movslq 0x1c(%rsp), %rax
movq (%rbx), %rcx
leaq (%rax,%rax,4), %rax
movq (%rcx,%rax,8), %r14
movq 0x8(%rcx,%rax,8), %rbx
cmpq %rbx, %r14
je 0x19cf5
movl (%r14), %eax
sarl %eax
movl %eax, 0x4c(%rsp)
movq %r13, 0x10(%rsp)
movq %r13, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x2479a
addq $0x4, %r14
jmp 0x19cce
addq $0x4, %r15
cmpq 0x40(%rsp), %r15
movq 0x80(%rsp), %rbx
jne 0x19c98
cmpq $0x0, 0xa0(%rsp)
je 0x19d90
leaq 0x88(%rsp), %r14
leaq 0x10(%rsp), %r15
leaq 0xc0(%rsp), %r12
leaq 0x20(%rsp), %r13
movq 0x98(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0x10(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x2483e
movslq 0x10(%rsp), %rsi
movq 0x48(%rbx), %rax
cmpl $0x0, (%rax,%rsi,4)
jne 0x19d85
addl %esi, %esi
movq %rbx, %rdi
movq %r12, %rdx
movq %r14, %rcx
movq %r13, %r8
callq 0x1996e
movl 0x10(%rsp), %eax
leal 0x1(,%rax,2), %esi
movq %rbx, %rdi
movq %r12, %rdx
movq %r14, %rcx
movq %r13, %r8
callq 0x1996e
cmpq $0x0, 0xa0(%rsp)
jne 0x19d2d
movq 0x20(%rsp), %r12
movq 0x28(%rsp), %rax
movq %rax, 0x40(%rsp)
cmpq %rax, %r12
je 0x19e29
movl 0xc(%rsp), %ecx
movl %ecx, %eax
addl %ecx, %ecx
movl %ecx, 0xc(%rsp)
leal 0x1(,%rax,2), %ebp
leaq 0x2f0(%rbx), %rax
movq %rax, 0x70(%rsp)
movq 0x78(%rsp), %r14
movslq (%r12), %r15
movq 0x48(%rbx), %rax
leaq (%r15,%r15,4), %rcx
shlq $0x3, %rcx
addq (%rbx), %rcx
cmpl $0x1, (%rax,%r14,4)
movl 0x4(%r12), %edx
movl 0xc(%rsp), %r13d
movl %r13d, %esi
cmovel %ebp, %esi
movq 0x70(%rsp), %rdi
callq 0x27afe
movq 0x48(%rbx), %rax
cmpl $0x1, (%rax,%r14,4)
cmovel %ebp, %r13d
movq %rbx, %rdi
movl %r13d, %esi
movl %r15d, %edx
movl $0x1, %ecx
callq 0x28e70
addq $0x8, %r12
cmpq 0x40(%rsp), %r12
jne 0x19dcc
addq $0x218, %rbx            # imm = 0x218
movq 0x28(%rsp), %rsi
subq 0x20(%rsp), %rsi
shrq $0x3, %rsi
negl %esi
movq %rbx, %rdi
callq 0x299e8
movq 0x28(%rsp), %rbx
subq 0x20(%rsp), %rbx
shrq $0x3, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x206ca
leaq 0x88(%rsp), %rdi
callq 0x206ca
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x19e8b
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
jmp 0x19e8b
xorl %ebx, %ebx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x19ea2
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movl %ebx, %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x200fb(%rip), %rdi     # 0x39fb8
leaq 0x20104(%rip), %rsi     # 0x39fc8
leaq 0x20106(%rip), %rcx     # 0x39fd1
movl $0x23, %edx
callq 0x31b0
jmp 0x19ee2
movq %rax, %rbx
jmp 0x19f16
jmp 0x19ee2
jmp 0x19ee2
jmp 0x19ee2
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x206ca
leaq 0x88(%rsp), %rdi
callq 0x206ca
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x19f16
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x19f2d
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq %rbx, %rdi
callq 0x34a0
nop