// File: Laakeri[P]maxpre/src/preprocessorinterface.cpp
// Function: maxPreprocessor::PreprocessorInterface::PreprocessorInterface(std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>> const&, std::vector<unsigned long, std::allocator<unsigned long>> const&, unsigned long, bool)
PreprocessorInterface::PreprocessorInterface(const vector<vector<int> >& clauses, const vector<uint64_t>& weights, uint64_t topWeight_, bool inProcessMode_) 
	: preprocessor(clauses, weights, topWeight_), topWeight(topWeight_), inProcessMode(inProcessMode_) {
		variables = 0;
		originalVariables = 0;
		for (auto& clause : clauses) {
			for (int lit : clause) {
				assert(lit != 0);
				variables = max(variables, abs(lit));
			}
		}
		originalVariables = variables;
		preprocessed = false;
		useBVEGateExtraction = false;
		useLabelMatching = false;
		skipTechnique = 0;
    BVEsortMaxFirst = false;
    BVElocalGrow = 0;
    BVEglobalGrow = 0;

		if (inProcessMode) {
			PPVarToSolverVar.resize(variables);
			solverVarToPPVar.resize(variables);
			for (auto& clause : clauses) {
				for (int lit : clause) {
					PPVarToSolverVar[abs(lit)-1] = abs(lit);
					solverVarToPPVar[abs(lit)-1] = abs(lit);
				}
			}
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movb %r8b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
andb $0x1, %al
movb %al, -0x21(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
addq $0x8, %rdi
movq %rdi, -0xe0(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x10770
movq -0xc0(%rbp), %rdi
addq $0x1800, %rdi           # imm = 0x1800
movq %rdi, -0xd8(%rbp)
callq 0x3f4f0
movq -0xc0(%rbp), %rdi
movq -0x20(%rbp), %rax
movq %rax, 0x1848(%rdi)
movb -0x21(%rbp), %al
andb $0x1, %al
movb %al, 0x1850(%rdi)
addq $0x1868, %rdi           # imm = 0x1868
movq %rdi, -0xd0(%rbp)
callq 0xa7e0
movq -0xc0(%rbp), %rdi
addq $0x1880, %rdi           # imm = 0x1880
movq %rdi, -0xc8(%rbp)
callq 0xa7e0
movq -0xc0(%rbp), %rax
movl $0x0, (%rax)
movl $0x0, 0x4(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x5e970
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
callq 0x5e9a0
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x5e9d0
testb $0x1, %al
jne 0x7762a
jmp 0x7773b
leaq -0x38(%rbp), %rdi
callq 0x5ea10
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
callq 0x3d080
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
callq 0x3d0b0
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x3d0e0
testb $0x1, %al
jne 0x7766f
jmp 0x7772b
leaq -0x58(%rbp), %rdi
callq 0x3d120
movl (%rax), %eax
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x64(%rbp)
je 0x77685
jmp 0x776a4
leaq 0x1058f(%rip), %rdi     # 0x87c1b
leaq 0x10591(%rip), %rsi     # 0x87c24
movl $0x17, %edx
leaq 0x1059f(%rip), %rcx     # 0x87c3e
callq 0x4260
movq -0xc0(%rbp), %rdi
movl -0x64(%rbp), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movl %eax, -0x68(%rbp)
leaq -0x68(%rbp), %rsi
callq 0x3e430
movq %rax, -0xe8(%rbp)
jmp 0x776ca
movq -0xc0(%rbp), %rax
movq -0xe8(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, (%rax)
leaq -0x58(%rbp), %rdi
callq 0x3d160
jmp 0x77659
movq -0xc8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
callq 0xab00
movq -0xd0(%rbp), %rdi
callq 0xab00
movq -0xd8(%rbp), %rdi
callq 0xb7c0
movq -0xe0(%rbp), %rdi
callq 0xb800
jmp 0x77930
jmp 0x7772d
leaq -0x38(%rbp), %rdi
callq 0x5ea30
jmp 0x77614
movq -0xc0(%rbp), %rax
movl (%rax), %ecx
movl %ecx, 0x4(%rax)
movb $0x0, 0x1851(%rax)
movb $0x0, 0x1852(%rax)
movb $0x0, 0x1853(%rax)
movl $0x0, 0x1854(%rax)
movb $0x0, 0x1858(%rax)
movl $0x0, 0x185c(%rax)
movl $0x0, 0x1860(%rax)
testb $0x1, 0x1850(%rax)
je 0x77927
movq -0xc0(%rbp), %rax
movq %rax, %rdi
addq $0x1880, %rdi           # imm = 0x1880
movslq (%rax), %rsi
callq 0xa990
jmp 0x777a9
movq -0xc0(%rbp), %rax
movq %rax, %rdi
addq $0x1868, %rdi           # imm = 0x1868
movslq (%rax), %rsi
callq 0xa990
jmp 0x777c4
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rdi
callq 0x5e970
movq %rax, -0x88(%rbp)
movq -0x80(%rbp), %rdi
callq 0x5e9a0
movq %rax, -0x90(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x5e9d0
testb $0x1, %al
jne 0x77808
jmp 0x77925
leaq -0x88(%rbp), %rdi
callq 0x5ea10
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rdi
callq 0x3d080
movq %rax, -0xa8(%rbp)
movq -0xa0(%rbp), %rdi
callq 0x3d0b0
movq %rax, -0xb0(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x3d0e0
testb $0x1, %al
jne 0x7786b
jmp 0x77912
leaq -0xa8(%rbp), %rdi
callq 0x3d120
movq -0xc0(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0xb4(%rbp)
movl -0xb4(%rbp), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movl %eax, -0xf0(%rbp)
addq $0x1880, %rdi           # imm = 0x1880
movl -0xb4(%rbp), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0xa7c0
movl -0xf0(%rbp), %ecx
movq -0xc0(%rbp), %rdi
movl %ecx, (%rax)
movl -0xb4(%rbp), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movl %eax, -0xec(%rbp)
addq $0x1868, %rdi           # imm = 0x1868
movl -0xb4(%rbp), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0xa7c0
movl -0xec(%rbp), %ecx
movl %ecx, (%rax)
leaq -0xa8(%rbp), %rdi
callq 0x3d160
jmp 0x7784f
jmp 0x77914
leaq -0x88(%rbp), %rdi
callq 0x5ea30
jmp 0x777ec
jmp 0x77927
addq $0xf0, %rsp
popq %rbp
retq
movq -0x70(%rbp), %rdi
callq 0x4610
nopl (%rax)