// File: /workspace/github_cpp_makefile_star2_O1/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 $0x28, %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), %eax
andl $-0x10, %eax
movq %rsp, %rbx
subq %rax, %rbx
movq %rbx, %rsp
movq 0x49d4f(%rip), %rdi     # 0x5f310
testq %rdi, %rdi
je 0x155d4
movq (%rdi), %rax
movq %r15, %rsi
movl %r12d, %edx
xorl %ecx, %ecx
callq *0x40(%rax)
andl (%r15), %r13d
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
cmpl $0x4, %r13d
ja 0x155ed
callq 0x141ac
jmp 0x155f2
callq 0x143c8
movl %eax, %r15d
testl %eax, %eax
je 0x15691
cmpl $0x2, %r15d
ja 0x156e4
movl (%rbx), %eax
andl $0x7fff, %eax           # imm = 0x7FFF
cmpl $0x4, %eax
ja 0x15733
cmpl %r12d, 0xb0(%r14)
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
cmovel %r12d, %r15d
movq 0x49ce1(%rip), %rdi     # 0x5f310
testq %rdi, %rdi
je 0x1564f
movq 0x18(%r14), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
testb $-0x80, 0xd(%rax,%rcx,4)
jne 0x1564f
movq (%rdi), %rax
movl %r12d, %esi
callq *0x60(%rax)
movq 0x18(%r14), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
orl $0x8000, 0xc(%rax,%rcx,4) # imm = 0x8000
movq 0x49ca7(%rip), %rdi     # 0x5f310
testq %rdi, %rdi
je 0x15681
movq (%rdi), %rax
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
callq *0x40(%rax)
movq %r14, %rdi
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %r15d, %ecx
jmp 0x156d7
movl $0x7fff, %eax           # imm = 0x7FFF
andl (%rbx), %eax
xorl %r15d, %r15d
cmpl $0x4, %eax
ja 0x157c1
cmpl %r12d, 0xb0(%r14)
jne 0x15a0d
movq 0x49c58(%rip), %rdi     # 0x5f310
testq %rdi, %rdi
je 0x156cb
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 0x15a4c
movl %eax, %r15d
jmp 0x157c1
cmpl $0x3, %r15d
jne 0x157c1
movq 0x49c1b(%rip), %rdi     # 0x5f310
testq %rdi, %rdi
je 0x15715
movq 0x18(%r14), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
testb $-0x80, 0xd(%rax,%rcx,4)
jne 0x15715
movq (%rdi), %rax
movl %r12d, %esi
callq *0x60(%rax)
movq 0x18(%r14), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
orl $0x8000, 0xc(%rax,%rcx,4) # imm = 0x8000
movl $0x3, %r15d
jmp 0x157c1
movl $0xffffffff, -0x40(%rbp) # imm = 0xFFFFFFFF
movq 0x10(%r14), %rcx
movl 0x50(%rcx), %edx
cmpl $-0x1, %edx
setne %sil
cmpl %r12d, %edx
seta %dl
testb %dl, %sil
jne 0x15762
cmpl $0x2, %r15d
jne 0x157d3
cmpl %r12d, 0xb0(%r14)
jbe 0x157d3
movq 0x49ba7(%rip), %rdi     # 0x5f310
testq %rdi, %rdi
je 0x15789
movq 0x18(%r14), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
testb $-0x80, 0xd(%rax,%rcx,4)
jne 0x15789
movq (%rdi), %rax
movl %r12d, %esi
callq *0x60(%rax)
movq 0x18(%r14), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
orl $0x8000, 0xc(%rax,%rcx,4) # imm = 0x8000
movq 0x10(%r14), %rdi
leaq -0x44(%rbp), %rdx
movq %rbx, %rsi
callq 0x113ba
movq 0x49b5d(%rip), %rdi     # 0x5f310
testq %rdi, %rdi
je 0x157c1
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
movl 0x5c(%rcx), %edx
movl %edx, -0x40(%rbp)
movl $0xffffffff, -0x44(%rbp) # imm = 0xFFFFFFFF
leal -0x1(%rax), %edx
movl 0x4(%rbx,%rdx,4), %esi
shrl %esi
decl %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpl 0x38(%rcx), %esi
jae 0x157fe
movq 0x30(%rcx), %rdx
movl %esi, %edi
movl (%rdx,%rdi,4), %edx
cmpl $-0x1, %edx
je 0x15903
movq 0x8(%rcx), %rcx
leaq 0x49ae2(%rip), %rsi     # 0x5f2f4
movl (%rsi), %edi
movl -0x3c(%rbp), %esi
movl %esi, -0x34(%rbp)
movl %edx, %r10d
incl %edi
leaq 0x49ace(%rip), %rsi     # 0x5f2f4
movl %edi, (%rsi)
movzwl 0xc(%rcx,%r10,4), %r11d
andl $0x7fff, %r11d          # imm = 0x7FFF
testw %ax, %ax
je 0x1587b
testw %r11w, %r11w
je 0x1587b
leaq (%rcx,%r10,4), %r8
addq $0xc, %r8
movl %eax, %r13d
movzwl %r13w, %esi
movzwl %r11w, %r9d
movl (%r8,%r9,4), %r9d
cmpl %r9d, (%rbx,%rsi,4)
jne 0x15896
leal -0x1(%r13), %esi
leal -0x1(%r11), %r9d
cmpw $0x1, %r11w
je 0x15880
movl %r9d, %r11d
cmpw $0x1, %r13w
movl %esi, %r13d
jne 0x1584b
jmp 0x15880
movl %eax, %esi
movl %r11d, %r9d
xorl %r8d, %r8d
cmpw %r9w, %si
setne %r8b
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
cmovbl %esi, %r8d
jmp 0x158a3
movl $0x0, %r8d
sbbl %r8d, %r8d
orl $0x1, %r8d
leaq (%rcx,%r10,4), %rsi
testl %r8d, %r8d
jle 0x158c3
movl 0x4(%rsi), %esi
movb $0x1, %r10b
cmpl $-0x1, %esi
jne 0x158d7
movl %edx, -0x38(%rbp)
movl $0x2, -0x34(%rbp)
jmp 0x158d2
js 0x158e4
movl %edx, -0x38(%rbp)
movl %edx, -0x44(%rbp)
movl $0x3, -0x34(%rbp)
xorl %r10d, %r10d
movl %edx, %esi
movl %esi, %edx
testb %r10b, %r10b
jne 0x1581a
jmp 0x158fb
movl 0x8(%rsi), %esi
movb $0x1, %r10b
cmpl $-0x1, %esi
jne 0x158d7
movl %edx, -0x38(%rbp)
movl $0x1, -0x34(%rbp)
jmp 0x158d2
movl -0x34(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0x1590d
movl $0x0, -0x3c(%rbp)
movl %esi, -0x38(%rbp)
movl -0x44(%rbp), %eax
cmpl $-0x1, %eax
jne 0x1591e
leaq 0x499d4(%rip), %rcx     # 0x5f2f0
jmp 0x15925
leaq 0x499c7(%rip), %rcx     # 0x5f2ec
incl (%rcx)
movq 0x499e2(%rip), %rdi     # 0x5f310
cmpl $-0x1, %eax
je 0x159b2
testq %rdi, %rdi
je 0x15953
movq 0x18(%r14), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
testb $-0x80, 0xd(%rax,%rcx,4)
jne 0x15953
movq (%rdi), %rax
movl %r12d, %esi
callq *0x60(%rax)
movq 0x18(%r14), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
orl $0x8000, 0xc(%rax,%rcx,4) # imm = 0x8000
movq 0x499a3(%rip), %rdi     # 0x5f310
testq %rdi, %rdi
je 0x15978
movq (%rdi), %rax
callq *0x20(%rax)
movq 0x49991(%rip), %rdi     # 0x5f310
testq %rdi, %rdi
je 0x15997
movq (%rdi), %rax
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
callq *0x40(%rax)
movq 0x49972(%rip), %rdi     # 0x5f310
testq %rdi, %rdi
je 0x157c1
movq (%rdi), %rax
callq *0x28(%rax)
jmp 0x157c1
testq %rdi, %rdi
je 0x159c0
movq (%rdi), %rax
movl %r12d, %esi
callq *0x60(%rax)
movq 0x10(%r14), %rdi
leaq -0x44(%rbp), %rdx
movl %r12d, %esi
callq 0x169f2
movl (%rbx), %eax
testw %ax, %ax
js 0x15a2c
andl $0x7fff, %eax           # imm = 0x7FFF
leaq (%rbx,%rax,4), %rdx
addq $0x4, %rdx
subq %rbx, %rdx
je 0x157ac
movq 0x18(%r14), %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
leaq (%rax,%rcx,4), %rdi
addq $0xc, %rdi
movq %rbx, %rsi
callq 0xc450
jmp 0x157ac
leaq 0x2ef27(%rip), %rdi     # 0x4493b
leaq 0x2e3dd(%rip), %rsi     # 0x43df8
leaq 0x2ef35(%rip), %rcx     # 0x44957
movl $0xb9, %edx
callq 0xc180
leaq 0x2ef6a(%rip), %rdi     # 0x4499d
leaq 0x2e3be(%rip), %rsi     # 0x43df8
leaq 0x2ef16(%rip), %rcx     # 0x44957
movl $0xd6, %edx
callq 0xc180
nop