// File: /workspace/github_cpp_makefile_star2_O2/Laakeri[P]maxpre/src/preprocessorinterface.cpp
// Function: maxPreprocessor::PreprocessorInterface::alterWeight(int, unsigned long)
bool PreprocessorInterface::alterWeight(int lbl, uint64_t weight) {
		if (!inProcessMode) return false;
		if (lbl < 1) return false;
		int iVar = solverVarToPPVar[lbl-1]-1;
		assert(iVar >= 0);
		int softClause = -1;
		if (preprocessor.pi.isLabel[iVar] == VAR_TRUE) {
			assert(preprocessor.pi.litClauses[posLit(iVar)].size() == 1);
			softClause = preprocessor.pi.litClauses[posLit(iVar)][0];
		}
		else if (preprocessor.pi.isLabel[iVar] == VAR_FALSE) {
			assert(preprocessor.pi.litClauses[negLit(iVar)].size() == 1);
			softClause = preprocessor.pi.litClauses[negLit(iVar)][0];
		}
		else {
			return false;
		}
		if (weight >= topWeight) {
			preprocessor.pi.isLabel[iVar] = 0;
			weight = HARDWEIGHT;
		}
		assert(!preprocessor.pi.clauses[softClause].isHard());
		preprocessor.pi.clauses[softClause].weight = weight;
		if (weight == HARDWEIGHT) {
			assert(preprocessor.pi.clauses[softClause].isHard());
		}
		else {
			assert(preprocessor.pi.labelWeight(iVar) == weight);
		}
		return true;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
xorl %eax, %eax
testl %esi, %esi
jle 0x293f9
cmpb $0x0, 0x1850(%rdi)
je 0x293f9
movq 0x1868(%rdi), %rax
movl %esi, %ecx
movl -0x4(%rax,%rcx,4), %r14d
testl %r14d, %r14d
jle 0x29403
movq %rdx, %rbx
decl %r14d
movl %r14d, %eax
movq 0x50(%rdi), %rcx
movl (%rcx,%rax,4), %edx
cmpl $0x2, %edx
je 0x29347
cmpl $0x1, %edx
jne 0x293e0
leal (%r14,%r14), %edx
movslq %edx, %rdx
movq 0x20(%rdi), %rsi
imulq $0x18, %rdx, %r8
movq (%rsi,%r8), %rdx
movq 0x8(%rsi,%r8), %rsi
subq %rdx, %rsi
cmpq $0x4, %rsi
je 0x29370
leaq 0x7aec(%rip), %rdi      # 0x30e1b
leaq 0x7991(%rip), %rsi      # 0x30cc7
leaq 0x7a96(%rip), %rcx      # 0x30dd3
movl $0x92, %edx
callq 0x31c0
leal 0x1(,%r14,2), %edx
movslq %edx, %rdx
movq 0x20(%rdi), %rsi
imulq $0x18, %rdx, %r8
movq (%rsi,%r8), %rdx
movq 0x8(%rsi,%r8), %rsi
subq %rdx, %rsi
cmpq $0x4, %rsi
jne 0x29441
leaq 0x8(%rdi), %r15
movabsq $-0x8000000000000000, %r12 # imm = 0x8000000000000000
movslq (%rdx), %rdx
cmpq %rbx, 0x1848(%rdi)
ja 0x29391
andl $0x0, (%rcx,%rax,4)
movq %r12, %rbx
imulq $0x28, %rdx, %r13
movq (%r15), %rdi
addq %r13, %rdi
callq 0x21bac
testb %al, %al
jne 0x29422
movq (%r15), %rdi
movq %rbx, 0x18(%rdi,%r13)
cmpq %r12, %rbx
jne 0x293e4
addq %r13, %rdi
callq 0x21bac
movl %eax, %ecx
movb $0x1, %al
testb %cl, %cl
jne 0x293f9
leaq 0x7abe(%rip), %rdi      # 0x30e86
leaq 0x78f8(%rip), %rsi      # 0x30cc7
leaq 0x79fd(%rip), %rcx      # 0x30dd3
movl $0xa3, %edx
callq 0x31c0
xorl %eax, %eax
jmp 0x293f9
movq %r15, %rdi
movl %r14d, %esi
callq 0x20fec
movq %rax, %rcx
movb $0x1, %al
cmpq %rbx, %rcx
jne 0x29460
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x79bf(%rip), %rdi      # 0x30dc9
leaq 0x78b6(%rip), %rsi      # 0x30cc7
leaq 0x79bb(%rip), %rcx      # 0x30dd3
movl $0x8f, %edx
callq 0x31c0
leaq 0x7a5c(%rip), %rdi      # 0x30e85
leaq 0x7897(%rip), %rsi      # 0x30cc7
leaq 0x799c(%rip), %rcx      # 0x30dd3
movl $0xa0, %edx
callq 0x31c0
leaq 0x7a08(%rip), %rdi      # 0x30e50
leaq 0x7878(%rip), %rsi      # 0x30cc7
leaq 0x797d(%rip), %rcx      # 0x30dd3
movl $0x96, %edx
callq 0x31c0
leaq 0x7a4c(%rip), %rdi      # 0x30eb3
leaq 0x7859(%rip), %rsi      # 0x30cc7
leaq 0x795e(%rip), %rcx      # 0x30dd3
movl $0xa6, %edx
callq 0x31c0
nop