// File: vsklad[P]cgen/./bal/cnf/processor/cnfoptimizer.cpp
// Function: bal::CnfOptimizer::evaluate_clause(unsigned int)
inline processor_result_t CnfOptimizer::evaluate_clause(const uint32_t offset) {
        evaluations_++;
        
        processor_result_t result = erUndetermined;
        uint32_t* p_clause = _clauses_offset_clause(clauses_data_, offset);
        uint32_t dst[_clause_memory_size(p_clause)];
        
        // copy literals checking for constants and changes
        // if an aggregate, reduce/ensure literals are uncomplemented
        TRACE_CLAUSE(p_clause, offset);
        if (_clause_is_aggregated(p_clause)) {
            result = normalize_ca(p_clause, dst);
        } else {
            result = normalize_cu(p_clause, dst);
        };
        
        if (result == erUndetermined) {
            if (_clause_is_aggregated(dst)) {
                // recursive update may assign valiables so that subsequent evaluation results into this
                // need to avoid ideally; for that, separate normalization for assign_literal is needed
                _assert_level_1(offset == processed_offset_);
                TRACE_CLAUSE(dst, offset);
                result = evaluate_clause_a(dst, offset, offset);
            };
        } else if (result == erChangedC || result == erChangedV) {
            if (_clause_is_aggregated(dst)) {
                container_offset_t original_offset = CONTAINER_END;
                if (offset == processed_offset_
                    ) {
                    original_offset = offset;
                };
                // no transitive closure if the clause is changed
                // instead, the derived clause is saved and the closure is produced later
                exclude_clause(offset);
                TRACE_CLAUSE_RESOLVENT(dst);
                result = evaluate_clause_a(dst, CONTAINER_END,  original_offset);
            } else {
                Cnf::insertion_point_t insertion_point;
                __insertion_point_t_init(insertion_point);
                if (clauses_.transaction_offset_is_immutable(offset) || (offset < processed_offset_ && result == erChangedV)) {
                    exclude_clause(offset);
                    clauses_.append<false>(dst, insertion_point);
                    TRACE_CLAUSE_APPEND(dst);
                } else {
                    clauses_.find(dst, insertion_point);
                    if (insertion_point.container_offset == CONTAINER_END) {
                        TRACE_CLAUSE_REMOVE(offset);
                        // copying must occur afterwards to indentify old clause
                        clauses_.update(offset, insertion_point);
                        _assert_level_1(_clause_is_included(dst));
                        _clause_copy(dst, _clauses_offset_clause(clauses_data_, offset));
                        TRACE_CLAUSE_APPEND(dst);
                    } else {
                        exclude_clause(offset);
                        TRACE_LEVEL_NEXT;
                        TRACE_CLAUSE_RESOLVENT(dst);
                        TRACE_LEVEL_PREV;
                    };
                };
            };
        } else if (result == erSatisfied) {
            exclude_clause(offset);
        };
        
        return result;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq 0xc0(%rax), %rcx
incq %rcx
movq %rcx, 0xc0(%rax)
movl $0x0, -0x10(%rbp)
movq 0x18(%rax), %rax
movq (%rax), %rax
movl -0xc(%rbp), %ecx
leaq 0xc(%rax,%rcx,4), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %edx
andl $0x7fff, %edx           # imm = 0x7FFF
movl %edx, %eax
incl %eax
movq %rsp, %rcx
movq %rcx, -0x20(%rbp)
movl %edx, %ecx
leal 0x13(,%rcx,4), %ecx
andl $-0x10, %ecx
movl %ecx, %edx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x48(%rbp)
movq %rcx, %rsp
movq %rax, -0x28(%rbp)
leaq 0x68571(%rip), %rdi     # 0x83390
callq 0x16210
cmpq $0x0, %rax
je 0x1ae48
leaq 0x6855f(%rip), %rdi     # 0x83390
callq 0x178d0
movq %rax, %rdi
movq -0x18(%rbp), %rsi
movl -0xc(%rbp), %edx
movq (%rdi), %rax
xorl %ecx, %ecx
callq *0x40(%rax)
movq -0x18(%rbp), %rax
movl (%rax), %eax
andl $0x7fff, %eax           # imm = 0x7FFF
cmpl $0x4, %eax
ja 0x1ae6e
movq -0x48(%rbp), %rdx
movq -0x50(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x180b0
movl %eax, -0x10(%rbp)
jmp 0x1ae82
movq -0x48(%rbp), %rdx
movq -0x50(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x18400
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jne 0x1af17
movq -0x48(%rbp), %rax
movl (%rax), %eax
andl $0x7fff, %eax           # imm = 0x7FFF
cmpl $0x4, %eax
ja 0x1af12
movq -0x50(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl 0xb0(%rcx), %eax
jne 0x1aead
jmp 0x1aecc
leaq 0x43ba3(%rip), %rdi     # 0x5ea57
leaq 0x43059(%rip), %rsi     # 0x5df14
movl $0xb9, %edx
leaq 0x43bac(%rip), %rcx     # 0x5ea73
callq 0xd1c0
leaq 0x684bd(%rip), %rdi     # 0x83390
callq 0x16210
cmpq $0x0, %rax
je 0x1aefc
leaq 0x684ab(%rip), %rdi     # 0x83390
callq 0x178d0
movq -0x48(%rbp), %rsi
movq %rax, %rdi
movl -0xc(%rbp), %edx
movq (%rdi), %rax
xorl %ecx, %ecx
callq *0x40(%rax)
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdi
movl -0xc(%rbp), %edx
movl -0xc(%rbp), %ecx
callq 0x1b1f0
movl %eax, -0x10(%rbp)
jmp 0x1b1d6
cmpl $0x1, -0x10(%rbp)
je 0x1af27
cmpl $0x2, -0x10(%rbp)
jne 0x1b1c0
movq -0x48(%rbp), %rax
movl (%rax), %eax
andl $0x7fff, %eax           # imm = 0x7FFF
cmpl $0x4, %eax
ja 0x1afb1
movq -0x50(%rbp), %rcx
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
movl -0xc(%rbp), %eax
cmpl 0xb0(%rcx), %eax
jne 0x1af53
movl -0xc(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x50(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x1c0e0
leaq 0x6842a(%rip), %rdi     # 0x83390
callq 0x16210
cmpq $0x0, %rax
je 0x1af94
leaq 0x68418(%rip), %rdi     # 0x83390
callq 0x178d0
movq -0x48(%rbp), %rsi
movq %rax, %rdi
movq (%rdi), %rax
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
callq *0x40(%rax)
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdi
movl -0x2c(%rbp), %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1b1f0
movl %eax, -0x10(%rbp)
jmp 0x1b1be
movq -0x50(%rbp), %rax
movl $0xffffffff, -0x38(%rbp) # imm = 0xFFFFFFFF
movq 0x10(%rax), %rdi
movl -0xc(%rbp), %esi
callq 0x151f0
testb $0x1, %al
jne 0x1afe1
movq -0x50(%rbp), %rcx
movl -0xc(%rbp), %eax
cmpl 0xb0(%rcx), %eax
jae 0x1b032
cmpl $0x2, -0x10(%rbp)
jne 0x1b032
movq -0x50(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x1c0e0
movq -0x50(%rbp), %rax
movq -0x48(%rbp), %rsi
movq 0x10(%rax), %rdi
leaq -0x3c(%rbp), %rdx
callq 0x13f90
leaq 0x68387(%rip), %rdi     # 0x83390
callq 0x16210
cmpq $0x0, %rax
je 0x1b02d
leaq 0x68375(%rip), %rdi     # 0x83390
callq 0x178d0
movq -0x48(%rbp), %rsi
movq %rax, %rdi
movq (%rdi), %rax
callq *0x50(%rax)
jmp 0x1b1bc
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rdi
leaq -0x3c(%rbp), %rdx
callq 0x15190
cmpl $-0x1, -0x3c(%rbp)
jne 0x1b129
leaq 0x68338(%rip), %rdi     # 0x83390
callq 0x16210
cmpq $0x0, %rax
je 0x1b07b
leaq 0x68326(%rip), %rdi     # 0x83390
callq 0x178d0
movq %rax, %rdi
movl -0xc(%rbp), %esi
movq (%rdi), %rax
callq *0x60(%rax)
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0xc(%rbp), %esi
leaq -0x3c(%rbp), %rdx
callq 0x1c180
movq -0x48(%rbp), %rax
movl (%rax), %eax
andl $0x8000, %eax           # imm = 0x8000
cmpl $0x0, %eax
jne 0x1b0a1
jmp 0x1b0c0
leaq 0x43a11(%rip), %rdi     # 0x5eab9
leaq 0x42e65(%rip), %rsi     # 0x5df14
movl $0xd6, %edx
leaq 0x439b8(%rip), %rcx     # 0x5ea73
callq 0xd1c0
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rax
movl (%rdi), %ecx
andl $0x7fff, %ecx           # imm = 0x7FFF
addl $0x1, %ecx
movl %ecx, %ecx
shlq $0x2, %rcx
movq %rdi, %rsi
addq %rcx, %rsi
movq 0x18(%rax), %rax
movq (%rax), %rdx
movl -0xc(%rbp), %eax
shlq $0x2, %rax
addq %rax, %rdx
addq $0xc, %rdx
callq 0x115c0
leaq 0x68290(%rip), %rdi     # 0x83390
callq 0x16210
cmpq $0x0, %rax
je 0x1b124
leaq 0x6827e(%rip), %rdi     # 0x83390
callq 0x178d0
movq -0x48(%rbp), %rsi
movq %rax, %rdi
movq (%rdi), %rax
callq *0x50(%rax)
jmp 0x1b1ba
movq -0x50(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x1c0e0
leaq 0x68254(%rip), %rdi     # 0x83390
callq 0x16210
cmpq $0x0, %rax
je 0x1b15c
leaq 0x68242(%rip), %rdi     # 0x83390
callq 0x178d0
movq %rax, %rdi
movq (%rdi), %rax
callq *0x20(%rax)
leaq 0x6822d(%rip), %rdi     # 0x83390
callq 0x16210
cmpq $0x0, %rax
je 0x1b191
leaq 0x6821b(%rip), %rdi     # 0x83390
callq 0x178d0
movq -0x48(%rbp), %rsi
movq %rax, %rdi
movq (%rdi), %rax
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
callq *0x40(%rax)
leaq 0x681f8(%rip), %rdi     # 0x83390
callq 0x16210
cmpq $0x0, %rax
je 0x1b1b8
leaq 0x681e6(%rip), %rdi     # 0x83390
callq 0x178d0
movq %rax, %rdi
movq (%rdi), %rax
callq *0x28(%rax)
jmp 0x1b1ba
jmp 0x1b1bc
jmp 0x1b1be
jmp 0x1b1d4
cmpl $0x3, -0x10(%rbp)
jne 0x1b1d2
movq -0x50(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x1c0e0
jmp 0x1b1d4
jmp 0x1b1d6
movl -0x10(%rbp), %eax
movq -0x20(%rbp), %rcx
movq %rcx, %rsp
movq %rbp, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop