// File: /workspace/github_cpp_makefile_star2_O3/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 $0xe8, %rsp
movslq %esi, %r14
movq 0x48(%rdi), %rax
movl (%rax,%r14,4), %eax
testl %eax, %eax
je 0x19624
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
xorl %ecx, %ecx
cmpl $0x1, %eax
sete %cl
movq %rsi, 0x58(%rsp)
leal (%rcx,%rsi,2), %eax
cltq
leaq (%rax,%rax,2), %rsi
shlq $0x3, %rsi
addq 0x18(%rbx), %rsi
callq 0x1ef50
movq 0x40(%rsp), %r15
movq 0x48(%rsp), %rax
movq %rax, 0x30(%rsp)
cmpq %r15, %rax
je 0x1959b
movq %r14, 0x68(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
leaq 0xa8(%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 0xe0(%rsp), %rax
movq %rax, -0x30(%rax)
movq %rcx, -0x28(%rax)
movups %xmm0, -0x20(%rax)
movl %edx, -0x10(%rax)
movups %xmm0, -0x8(%rax)
movq %rsp, %rbp
leaq 0x78(%rsp), %r14
leaq 0x3c(%rsp), %r13
movq %rbx, 0x70(%rsp)
movl (%r15), %eax
movl %eax, 0xc(%rsp)
leaq 0xb0(%rsp), %rdi
movq %rdi, (%rsp)
leaq 0xc(%rsp), %rsi
movq %rbp, %rdx
callq 0x237be
movslq 0xc(%rsp), %rax
movq (%rbx), %rcx
leaq (%rax,%rax,4), %rax
movq (%rcx,%rax,8), %r12
movq 0x8(%rcx,%rax,8), %rbx
cmpq %rbx, %r12
je 0x1946d
movl (%r12), %eax
sarl %eax
movl %eax, 0x3c(%rsp)
movq %r14, (%rsp)
movq %r14, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x23a4a
addq $0x4, %r12
jmp 0x19446
addq $0x4, %r15
cmpq 0x30(%rsp), %r15
movq 0x70(%rsp), %rbx
jne 0x19411
cmpq $0x0, 0x90(%rsp)
je 0x194fd
leaq 0x78(%rsp), %r14
movq %rsp, %r15
leaq 0xb0(%rsp), %r12
leaq 0x10(%rsp), %r13
movq 0x88(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, (%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x23afc
movslq (%rsp), %rsi
movq 0x48(%rbx), %rax
cmpl $0x0, (%rax,%rsi,4)
jne 0x194f2
addl %esi, %esi
movq %rbx, %rdi
movq %r12, %rdx
movq %r14, %rcx
movq %r13, %r8
callq 0x19176
movl (%rsp), %eax
leal 0x1(,%rax,2), %esi
movq %rbx, %rdi
movq %r12, %rdx
movq %r14, %rcx
movq %r13, %r8
callq 0x19176
cmpq $0x0, 0x90(%rsp)
jne 0x1949d
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %rax
movq %rax, 0x30(%rsp)
cmpq %rax, %r12
je 0x1959f
leaq 0x2f0(%rbx), %rax
movq %rax, 0x60(%rsp)
movq 0x58(%rsp), %r14
movl %r14d, %eax
addl %r14d, %r14d
leal 0x1(,%rax,2), %ebp
movq 0x68(%rsp), %r13
movslq (%r12), %r15
movq 0x48(%rbx), %rax
leaq (%r15,%r15,4), %rcx
shlq $0x3, %rcx
addq (%rbx), %rcx
cmpl $0x1, (%rax,%r13,4)
movl 0x4(%r12), %edx
movl %r14d, %esi
cmovel %ebp, %esi
movq 0x60(%rsp), %rdi
callq 0x26e22
movq 0x48(%rbx), %rax
cmpl $0x1, (%rax,%r13,4)
movl %r14d, %esi
cmovel %ebp, %esi
movq %rbx, %rdi
movl %r15d, %edx
movl $0x1, %ecx
callq 0x28164
addq $0x8, %r12
cmpq 0x30(%rsp), %r12
jne 0x19538
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %rsi
jmp 0x195a2
xorl %ebx, %ebx
jmp 0x195fb
movq %r12, %rsi
subq %r12, %rsi
addq $0x218, %rbx            # imm = 0x218
shrq $0x3, %rsi
negl %esi
movq %rbx, %rdi
callq 0x28ca0
movq 0x18(%rsp), %rbx
subq 0x10(%rsp), %rbx
shrq $0x3, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x1fb00
leaq 0x78(%rsp), %rdi
callq 0x1fb00
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x195f6
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x40(%rsp), %r15
testq %r15, %r15
je 0x19610
movq 0x50(%rsp), %rsi
subq %r15, %rsi
movq %r15, %rdi
callq 0x32b0
movl %ebx, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1fa3d(%rip), %rdi     # 0x39068
leaq 0x1fa46(%rip), %rsi     # 0x39078
leaq 0x1fa48(%rip), %rcx     # 0x39081
movl $0x23, %edx
callq 0x31b0
jmp 0x19650
movq %rax, %rbx
jmp 0x19681
jmp 0x19650
jmp 0x19650
jmp 0x19650
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0x1fb00
leaq 0x78(%rsp), %rdi
callq 0x1fb00
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x19681
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x19698
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq %rbx, %rdi
callq 0x34a0