// File: akinanop[P]mvl-solver/src/Formula.cc
// Function: Formula::addLiteral(int, bool, int)
inline void Formula::addLiteral ( int var, bool equals, int val ) {

	vector<int>::iterator current;
	vector<int>::iterator end;

	//for every record of this literal increase the number of
	//unassigned literals from unsatisfied clauses

	if ( equals ) current = VARLIST[var] -> ATOMRECPOS[val].begin();
	else current = VARLIST[var] -> ATOMRECNEG[val].begin();
	if ( equals ) end = VARLIST[var] -> ATOMRECPOS[val].end();
	else end = VARLIST[var] -> ATOMRECNEG[val].end();

	while ( current != end ) {
		if ( CLAUSELIST[*current] -> LEVEL == -1 ) {

			CLAUSELIST[*current] -> NumUnAss++;

			if (heuristic==Heuristic::BK) {
				if ( equals ) VARLIST[var] -> ATOMCNTPOS[val]++;
				else VARLIST[var] -> ATOMCNTNEG[val]++;
			}
		}
		++current;
	}
}

// Assembly:
subq $0x68, %rsp
movb %dl, %al
movq %rdi, 0x60(%rsp)
movl %esi, 0x5c(%rsp)
andb $0x1, %al
movb %al, 0x5b(%rsp)
movl %ecx, 0x54(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x14580
leaq 0x40(%rsp), %rdi
callq 0x14580
testb $0x1, 0x5b(%rsp)
je 0x13746
movq 0x18(%rsp), %rdi
movslq 0x5c(%rsp), %rsi
callq 0xaab0
movq (%rax), %rax
movq 0x60(%rax), %rdi
movslq 0x54(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x79c0
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x48(%rsp)
jmp 0x1377c
movq 0x18(%rsp), %rdi
movslq 0x5c(%rsp), %rsi
callq 0xaab0
movq (%rax), %rax
movq 0x68(%rax), %rdi
movslq 0x54(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x79c0
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x48(%rsp)
testb $0x1, 0x5b(%rsp)
je 0x137bb
movq 0x18(%rsp), %rdi
movslq 0x5c(%rsp), %rsi
callq 0xaab0
movq (%rax), %rax
movq 0x60(%rax), %rdi
movslq 0x54(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x7840
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x137f1
movq 0x18(%rsp), %rdi
movslq 0x5c(%rsp), %rsi
callq 0xaab0
movq (%rax), %rax
movq 0x68(%rax), %rdi
movslq 0x54(%rsp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x7840
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x40(%rsp)
jmp 0x137f3
leaq 0x48(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x145a0
testb $0x1, %al
jne 0x1380b
jmp 0x138e3
movq 0x18(%rsp), %rax
addq $0x18, %rax
movq %rax, 0x10(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x145e0
movq 0x10(%rsp), %rdi
movslq (%rax), %rsi
callq 0x12f20
movq (%rax), %rax
cmpl $-0x1, 0x1c(%rax)
jne 0x138d4
movq 0x18(%rsp), %rax
addq $0x18, %rax
movq %rax, 0x8(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x145e0
movq 0x8(%rsp), %rdi
movslq (%rax), %rsi
callq 0x12f20
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq (%rcx), %rcx
movl 0x18(%rcx), %edx
addl $0x1, %edx
movl %edx, 0x18(%rcx)
cmpl $0x0, 0xa8(%rax)
jne 0x138d2
testb $0x1, 0x5b(%rsp)
je 0x138ac
movq 0x18(%rsp), %rdi
movslq 0x5c(%rsp), %rsi
callq 0xaab0
movq (%rax), %rax
movq 0x28(%rax), %rax
movslq 0x54(%rsp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
jmp 0x138d0
movq 0x18(%rsp), %rdi
movslq 0x5c(%rsp), %rsi
callq 0xaab0
movq (%rax), %rax
movq 0x30(%rax), %rax
movslq 0x54(%rsp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
jmp 0x138d2
jmp 0x138d4
leaq 0x48(%rsp), %rdi
callq 0x145f0
jmp 0x137f3
addq $0x68, %rsp
retq
nopl (%rax,%rax)