// File: Laakeri[P]maxpre/src/preprocessor.cpp
// Function: maxPreprocessor::Preprocessor::doUP()
int Preprocessor::doUP() {
	rLog.startTechnique(Log::Technique::UP);
	int removed = 0;
	if (!rLog.requestTime(Log::Technique::UP)) {
		rLog.stopTechnique(Log::Technique::UP);
		return 0;
	}
	vector<int> checkLit = pi.tl.getTouchedLiterals("UP");
	if ((int)checkLit.size() > pi.vars) {
		removed = tryUPAll();
	}
	else {
		for (int lit : checkLit) {
			if (!rLog.requestTime(Log::Technique::UP)) break;
			removed += tryUP(lit);
		}
	}
	
	log(removed, " clauses removed by UP");
	rLog.stopTechnique(Log::Technique::UP);
	return removed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x90(%rbp)
addq $0x218, %rdi            # imm = 0x218
movl $0x2, %esi
callq 0x61320
movq -0x90(%rbp), %rdi
movl $0x0, -0x14(%rbp)
addq $0x218, %rdi            # imm = 0x218
movl $0x2, %esi
callq 0x62450
testb $0x1, %al
jne 0x12f02
movq -0x90(%rbp), %rdi
addq $0x218, %rdi            # imm = 0x218
movl $0x2, %esi
callq 0x61390
movl $0x0, -0x4(%rbp)
jmp 0x130d2
movq -0x90(%rbp), %rax
addq $0x68, %rax
movq %rax, -0xa0(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x4620
movq -0x98(%rbp), %rdx
leaq 0x7345e(%rip), %rsi     # 0x86390
leaq -0x50(%rbp), %rdi
callq 0xa430
jmp 0x12f3d
movq -0xa0(%rbp), %rsi
leaq -0x30(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x73500
jmp 0x12f53
leaq -0x50(%rbp), %rdi
callq 0x4240
leaq -0x51(%rbp), %rdi
callq 0x43f0
leaq -0x30(%rbp), %rdi
callq 0xf940
movq -0x90(%rbp), %rcx
cmpl 0x60(%rcx), %eax
jle 0x12fe7
movq -0x90(%rbp), %rdi
callq 0x12d00
movl %eax, -0xa4(%rbp)
jmp 0x12f8e
movl -0xa4(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x13091
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x12fbf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x4240
leaq -0x51(%rbp), %rdi
callq 0x43f0
jmp 0x130de
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xab00
jmp 0x130de
leaq -0x30(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0xa800
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rdi
callq 0xa830
movq %rax, -0x80(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0xa860
testb $0x1, %al
jne 0x1301c
jmp 0x1308f
leaq -0x78(%rbp), %rdi
callq 0xa8a0
movq -0x90(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x84(%rbp)
addq $0x218, %rdi            # imm = 0x218
movl $0x2, %esi
callq 0x62450
movb %al, -0xa5(%rbp)
jmp 0x1304d
movb -0xa5(%rbp), %al
testb $0x1, %al
jne 0x1305b
jmp 0x13059
jmp 0x1308f
movq -0x90(%rbp), %rdi
movl -0x84(%rbp), %esi
callq 0x12ba0
movl %eax, -0xac(%rbp)
jmp 0x13075
movl -0xac(%rbp), %eax
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
leaq -0x78(%rbp), %rdi
callq 0xa930
jmp 0x13009
jmp 0x13091
movq -0x90(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq 0x732da(%rip), %rdx     # 0x8637c
callq 0x3c620
jmp 0x130a9
movq -0x90(%rbp), %rdi
addq $0x218, %rdi            # imm = 0x218
movl $0x2, %esi
callq 0x61390
jmp 0x130c3
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xab00
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x4610
nopw (%rax,%rax)