// File: Laakeri[P]maxpre/src/preprocessorinterface.cpp
// Function: maxPreprocessor::PreprocessorInterface::getInstance(std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>&, std::vector<unsigned long, std::allocator<unsigned long>>&, std::vector<int, std::allocator<int>>&)
void PreprocessorInterface::getInstance(std::vector<std::vector<int> >& retClauses, std::vector<uint64_t>& retWeights, std::vector<int>& retLabels) {
		preprocessedInstance = preprocessor.getPreprocessedInstance();
		
		retClauses = preprocessedInstance.clauses;
		retWeights = preprocessedInstance.weights;
		
		for (unsigned i = 0; i < preprocessedInstance.labels.size(); i++) {
			retLabels.push_back(litToSolver(litToDimacs(preprocessedInstance.labels[i].F)));
		}
		for (auto& clause : retClauses) {
			for (int& lit : clause) {
				lit = litToDimacs(lit);
				variables = max(variables, abs(lit));
				lit = litToSolver(lit);
			}
		}
		
		for (uint64_t& w : retWeights) {
			if (w == HARDWEIGHT) {
				w = topWeight;
			}
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0xe0(%rbp)
addq $0x8, %rsi
leaq -0x68(%rbp), %rdi
callq 0x2d7c0
movq -0xe0(%rbp), %rdi
addq $0x1800, %rdi           # imm = 0x1800
leaq -0x68(%rbp), %rsi
callq 0x798a0
leaq -0x68(%rbp), %rdi
callq 0xb7c0
movq -0xe0(%rbp), %rsi
addq $0x1800, %rsi           # imm = 0x1800
movq -0x10(%rbp), %rdi
callq 0x79900
movq -0xe0(%rbp), %rsi
addq $0x1800, %rsi           # imm = 0x1800
addq $0x18, %rsi
movq -0x18(%rbp), %rdi
callq 0x79b50
movl $0x0, -0x6c(%rbp)
movq -0xe0(%rbp), %rdi
movl -0x6c(%rbp), %eax
movq %rax, -0xe8(%rbp)
addq $0x1800, %rdi           # imm = 0x1800
addq $0x30, %rdi
callq 0x3f5d0
movq %rax, %rcx
movq -0xe8(%rbp), %rax
cmpq %rcx, %rax
jae 0x77b69
movq -0xe0(%rbp), %rdi
movq -0x20(%rbp), %rax
movq %rax, -0xf0(%rbp)
addq $0x1800, %rdi           # imm = 0x1800
addq $0x30, %rdi
movl -0x6c(%rbp), %eax
movl %eax, %esi
callq 0x3f5f0
movl (%rax), %edi
callq 0x5eb20
movq -0xe0(%rbp), %rdi
movl %eax, %esi
callq 0x77d50
movq -0xf0(%rbp), %rdi
movl %eax, -0x70(%rbp)
leaq -0x70(%rbp), %rsi
callq 0x3c850
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x77adc
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdi
callq 0x3e320
movq %rax, -0x80(%rbp)
movq -0x78(%rbp), %rdi
callq 0x3e350
movq %rax, -0x88(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3e380
testb $0x1, %al
jne 0x77ba7
jmp 0x77ca1
leaq -0x80(%rbp), %rdi
callq 0x3e3c0
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rdi
callq 0xa800
movq %rax, -0xa0(%rbp)
movq -0x98(%rbp), %rdi
callq 0xa830
movq %rax, -0xa8(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0xa860
testb $0x1, %al
jne 0x77c07
jmp 0x77c91
leaq -0xa0(%rbp), %rdi
callq 0xa8a0
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movl (%rax), %edi
callq 0x5eb20
movq -0xe0(%rbp), %rdi
movl %eax, %ecx
movq -0xb0(%rbp), %rax
movl %ecx, (%rax)
movq -0xb0(%rbp), %rax
movl (%rax), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movl %eax, -0xb4(%rbp)
leaq -0xb4(%rbp), %rsi
callq 0x3e430
movq -0xe0(%rbp), %rdi
movl (%rax), %eax
movl %eax, (%rdi)
movq -0xb0(%rbp), %rax
movl (%rax), %esi
callq 0x77d50
movl %eax, %ecx
movq -0xb0(%rbp), %rax
movl %ecx, (%rax)
leaq -0xa0(%rbp), %rdi
callq 0xa930
jmp 0x77beb
jmp 0x77c93
leaq -0x80(%rbp), %rdi
callq 0x3e3e0
jmp 0x77b8e
movq -0x18(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rdi
callq 0x57d60
movq %rax, -0xc8(%rbp)
movq -0xc0(%rbp), %rdi
callq 0x57cd0
movq %rax, -0xd0(%rbp)
leaq -0xc8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x79da0
testb $0x1, %al
jne 0x77ceb
jmp 0x77d3c
leaq -0xc8(%rbp), %rdi
callq 0x79de0
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
cmpq %rcx, (%rax)
jne 0x77d2c
movq -0xe0(%rbp), %rax
movq 0x1848(%rax), %rcx
movq -0xd8(%rbp), %rax
movq %rcx, (%rax)
jmp 0x77d2e
leaq -0xc8(%rbp), %rdi
callq 0x79e00
jmp 0x77cd2
addq $0xf0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)