// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %r12d
movq %rdi, %r14
incq 0xc0(%rdi)
movq 0x18(%rdi), %rax
movq (%rax), %rax
movl %esi, %ecx
movq %rcx, -0x30(%rbp)
leaq (%rax,%rcx,4), %r15
addq $0xc, %r15
movl $0x7fff, %r13d          # imm = 0x7FFF
movl (%r15), %eax
andl %r13d, %eax
leal 0x13(,%rax,4), %ecx
andl $-0x10, %ecx
movq %rsp, %rbx
subq %rcx, %rbx
movq %rbx, %rsp
movq 0x3e97d(%rip), %rdi     # 0x51300
testq %rdi, %rdi
je 0x1299c
movq (%rdi), %rax
movq %r15, %rsi
movl %r12d, %edx
xorl %ecx, %ecx
callq *0x40(%rax)
andl (%r15), %r13d
movl %r13d, %eax
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
cmpl $0x4, %eax
ja 0x129b1
callq 0x11624
jmp 0x129b6
callq 0x117e6
movl %eax, %r15d
testl %eax, %eax
je 0x12a1a
cmpl $0x2, %r15d
ja 0x12a6a
movl $0x7fff, %eax           # imm = 0x7FFF
andl (%rbx), %eax
cmpl $0x4, %eax
ja 0x12a81
cmpl %r12d, 0xb0(%r14)
pushq $-0x1
popq %r15
cmovel %r12d, %r15d
movq %r14, %rdi
movl %r12d, %esi
callq 0x135c0
movq 0x3e908(%rip), %rdi     # 0x51300
testq %rdi, %rdi
je 0x12a0c
movq (%rdi), %rax
pushq $-0x1
popq %rdx
pushq $0x1
popq %rcx
movq %rbx, %rsi
callq *0x40(%rax)
pushq $-0x1
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
movl %r15d, %ecx
jmp 0x12a60
movl $0x7fff, %eax           # imm = 0x7FFF
andl (%rbx), %eax
xorl %r15d, %r15d
cmpl $0x4, %eax
ja 0x12adb
cmpl %r12d, 0xb0(%r14)
jne 0x12ba8
movq 0x3e8bf(%rip), %rdi     # 0x51300
testq %rdi, %rdi
je 0x12a54
movq (%rdi), %rax
movq %rbx, %rsi
movl %r12d, %edx
xorl %ecx, %ecx
callq *0x40(%rax)
movq %r14, %rdi
movq %rbx, %rsi
movl %r12d, %edx
movl %r12d, %ecx
callq 0x12be6
movl %eax, %r15d
jmp 0x12adb
cmpl $0x3, %r15d
jne 0x12adb
movq %r14, %rdi
movl %r12d, %esi
callq 0x135c0
pushq $0x3
popq %r15
jmp 0x12adb
orl $-0x1, -0x3c(%rbp)
movq 0x10(%r14), %rdi
movl 0x50(%rdi), %eax
cmpl $-0x1, %eax
setne %cl
cmpl %r12d, %eax
seta %al
testb %al, %cl
jne 0x12aab
cmpl $0x2, %r15d
jne 0x12aed
cmpl %r12d, 0xb0(%r14)
jbe 0x12aed
movq %r14, %rdi
movl %r12d, %esi
callq 0x135c0
movq 0x10(%r14), %rdi
leaq -0x40(%rbp), %rdx
movq %rbx, %rsi
callq 0xf540
movq 0x3e833(%rip), %rdi     # 0x51300
testq %rdi, %rdi
je 0x12adb
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x50(%rax)
movl %r15d, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x40(%rbp), %r13
movq %rbx, %rsi
movq %r13, %rdx
callq 0xfccc
cmpl $-0x1, (%r13)
je 0x12b4f
movq %r14, %rdi
movl %r12d, %esi
callq 0x135c0
movq 0x3e7eb(%rip), %rdi     # 0x51300
testq %rdi, %rdi
je 0x12adb
movq (%rdi), %rax
callq *0x20(%rax)
movq 0x3e7d9(%rip), %rdi     # 0x51300
testq %rdi, %rdi
je 0x12adb
movq (%rdi), %rax
pushq $-0x1
popq %rdx
pushq $0x1
popq %rcx
movq %rbx, %rsi
callq *0x40(%rax)
movq 0x3e7be(%rip), %rdi     # 0x51300
testq %rdi, %rdi
je 0x12adb
movq (%rdi), %rax
callq *0x28(%rax)
jmp 0x12adb
movq 0x3e7aa(%rip), %rdi     # 0x51300
testq %rdi, %rdi
je 0x12b64
movq (%rdi), %rax
movl %r12d, %esi
callq *0x60(%rax)
movq 0x10(%r14), %rdi
leaq -0x40(%rbp), %rdx
movl %r12d, %esi
callq 0x13608
movl (%rbx), %eax
testw %ax, %ax
js 0x12bc7
andl $0x7fff, %eax           # imm = 0x7FFF
leaq 0x4(,%rax,4), %rdx
movq 0x18(%r14), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
leaq (%rax,%rcx,4), %rdi
addq $0xc, %rdi
movq %rbx, %rsi
callq 0xc440
jmp 0x12ac6
leaq 0x21d9c(%rip), %rdi     # 0x3494b
leaq 0x21252(%rip), %rsi     # 0x33e08
leaq 0x21daa(%rip), %rcx     # 0x34967
movl $0xb9, %edx
callq 0xc180
leaq 0x21ddf(%rip), %rdi     # 0x349ad
leaq 0x21233(%rip), %rsi     # 0x33e08
leaq 0x21d8b(%rip), %rcx     # 0x34967
movl $0xd6, %edx
callq 0xc180