// File: Laakeri[P]maxpre/src/./FLP.cpp
// Function: maxPreprocessor::Preprocessor::doFLP()
int Preprocessor::doFLP() {
	rLog.startTechnique(Log::Technique::FLP);
	if (!rLog.requestTime(Log::Technique::FLP)) {
		rLog.stopTechnique(Log::Technique::FLP);
		return 0;
	}
	int removed = 0;
	for (int c = 0; c < (int)pi.clauses.size(); c++) {
		if (!rLog.requestTime(Log::Technique::FLP)) break;
		if (pi.isClauseRemoved(c)) continue;
		if (!pi.clauses[c].isHard()) continue;
		vector<int> lbs;
		bool f = false;
		for (int lit : pi.clauses[c].lit) {
			if (pi.isLabel[litVariable(lit)]) lbs.push_back(lit);
			else f = true;
		}
		if (lbs.size() > 0 && f) removed += tryFLP(lbs, c);
	}
	log(removed, " cores found by FLP");
	rLog.stopTechnique(Log::Technique::FLP);
	return removed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x88(%rbp)
addq $0x218, %rdi            # imm = 0x218
movl $0xc, %esi
callq 0x61320
movq -0x88(%rbp), %rdi
addq $0x218, %rdi            # imm = 0x218
movl $0xc, %esi
callq 0x62450
testb $0x1, %al
jne 0x2c8cb
movq -0x88(%rbp), %rdi
addq $0x218, %rdi            # imm = 0x218
movl $0xc, %esi
callq 0x61390
movl $0x0, -0x4(%rbp)
jmp 0x2caf2
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x88(%rbp), %rdi
movl -0x18(%rbp), %eax
movl %eax, -0x8c(%rbp)
callq 0x3c4b0
movq %rax, %rcx
movl -0x8c(%rbp), %eax
cmpl %ecx, %eax
jge 0x2cabe
movq -0x88(%rbp), %rdi
addq $0x218, %rdi            # imm = 0x218
movl $0xc, %esi
callq 0x62450
testb $0x1, %al
jne 0x2c920
jmp 0x2cabe
movq -0x88(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x5eb70
testb $0x1, %al
jne 0x2c935
jmp 0x2c93a
jmp 0x2caa5
movq -0x88(%rbp), %rdi
movslq -0x18(%rbp), %rsi
callq 0x3c600
movq %rax, %rdi
callq 0x60e90
testb $0x1, %al
jne 0x2c95b
jmp 0x2caa5
leaq -0x30(%rbp), %rdi
callq 0xa7e0
movq -0x88(%rbp), %rdi
movb $0x0, -0x31(%rbp)
movslq -0x18(%rbp), %rsi
callq 0x3c600
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0xa800
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
callq 0xa830
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xa860
testb $0x1, %al
jne 0x2c9ac
jmp 0x2ca2f
leaq -0x48(%rbp), %rdi
callq 0xa8a0
movq %rax, %rcx
movq -0x88(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, -0x54(%rbp)
addq $0x48, %rax
movq %rax, -0x98(%rbp)
movl -0x54(%rbp), %edi
callq 0x3c880
movl %eax, -0x90(%rbp)
jmp 0x2c9df
movq -0x98(%rbp), %rdi
movl -0x90(%rbp), %eax
movslq %eax, %rsi
callq 0xa7c0
cmpl $0x0, (%rax)
je 0x2ca1b
leaq -0x30(%rbp), %rdi
leaq -0x54(%rbp), %rsi
callq 0xa8c0
jmp 0x2ca08
jmp 0x2ca1f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x2cab3
movb $0x1, -0x31(%rbp)
jmp 0x2ca21
leaq -0x48(%rbp), %rdi
callq 0xa930
jmp 0x2c996
leaq -0x30(%rbp), %rdi
callq 0xf940
cmpq $0x0, %rax
jbe 0x2ca9c
testb $0x1, -0x31(%rbp)
je 0x2ca9c
leaq -0x80(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3edb0
jmp 0x2ca53
movq -0x88(%rbp), %rdi
movl -0x18(%rbp), %edx
leaq -0x80(%rbp), %rsi
callq 0x2bd50
movl %eax, -0x9c(%rbp)
jmp 0x2ca6e
movl -0x9c(%rbp), %eax
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
leaq -0x80(%rbp), %rdi
callq 0xab00
jmp 0x2ca9c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x80(%rbp), %rdi
callq 0xab00
jmp 0x2cab3
leaq -0x30(%rbp), %rdi
callq 0xab00
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x2c8d9
leaq -0x30(%rbp), %rdi
callq 0xab00
jmp 0x2cafe
movq -0x88(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq 0x5a465(%rip), %rdx     # 0x86f34
callq 0x3c620
movq -0x88(%rbp), %rdi
addq $0x218, %rdi            # imm = 0x218
movl $0xc, %esi
callq 0x61390
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x4610
nopw (%rax,%rax)