// File: /workspace/github_cpp_makefile_star2_O2/vsklad[P]cgen/./bal/cnf/processor/cnfoptimizer.cpp
// Function: bal::CnfOptimizer::_update_clause_variables(unsigned int*) const
inline bool CnfOptimizer::_update_clause_variables(uint32_t* const p_clause) const {
        if (_clause_is_included(p_clause)) {
            const uint32_t clause_size = _clause_size(p_clause);
            const literalid_t* var_values = variables_.data();
            
            // assign reindexed variable numbers
            // sort order / normalization must be preserved because the only possible change is reindexing
            // all other changes must have been handled while evaluating
            for (auto i = 0; i < clause_size; i++) {
                const literalid_t old_literal = _clause_literal(p_clause, i);
                const literalid_t new_literal = literal_t__lookup(var_values, old_literal);
                if (old_literal != new_literal) {
                    // constants not possible as those clauses must have been eliminated
                    _assert_level_1(literal_t__is_variable(new_literal));
                    if (literal_t__is_negation(new_literal) && _clause_is_aggregated(p_clause)) {
                        // only unnegated mappings are possible for variables within an aggregated clause
                        _assert_level_3(literal_t__is_same_variable(old_literal, new_literal));
                        clause_flags_t flags = _clause_flags(p_clause);
                        ca_flags_negate(flags, i);
                        _clause_flags_set(p_clause, flags);
                    } else {
                        _clause_literal(p_clause, i) = new_literal;
                    };
                };
            };
            return true;
        } else {
            return false;
        };
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl (%rsi), %r15d
testw %r15w, %r15w
js 0x15423
movq %rsi, %rbx
movl %r15d, %r12d
andl $0x7fff, %r12d          # imm = 0x7FFF
movq 0xb8(%rdi), %rax
movq (%rax), %r13
xorl %r14d, %r14d
movl %r15d, %eax
cmpq %r14, %r12
je 0x15423
movl 0x4(%rbx,%r14,4), %ecx
movl %ecx, %edx
shrl %edx
decl %edx
movl (%r13,%rdx,4), %edx
movl %ecx, %edi
andl $0x1, %edi
xorl %edx, %edi
movl %edi, %esi
xorl $0x1, %esi
cmpl %esi, %ecx
je 0x1541e
cmpl $0x2, %edx
jb 0x15439
cmpl $-0x2, %edi
je 0x15439
testb $0x1, %dil
je 0x15419
movl %eax, %edi
andl $0x7fff, %edi           # imm = 0x7FFF
cmpl $0x4, %edi
ja 0x15419
xorl %ecx, %edx
cmpl $0x2, %edx
jae 0x15458
shrl $0x10, %eax
movw %ax, -0x2a(%rbp)
movzwl %r14w, %esi
leaq -0x2a(%rbp), %rdi
callq 0x119c1
movzwl -0x2a(%rbp), %ecx
shll $0x10, %ecx
movzwl (%rbx), %eax
orl %ecx, %eax
movl %eax, (%rbx)
jmp 0x1541e
movl %esi, 0x4(%rbx,%r14,4)
incq %r14
jmp 0x153ac
testw %r15w, %r15w
setns %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x21724(%rip), %rdi     # 0x36b64
leaq 0x1e9c1(%rip), %rsi     # 0x33e08
leaq 0x2176a(%rip), %rcx     # 0x36bb8
movl $0x484, %edx            # imm = 0x484
callq 0xc180
leaq 0x217a1(%rip), %rdi     # 0x36c00
leaq 0x1e9a2(%rip), %rsi     # 0x33e08
leaq 0x2174b(%rip), %rcx     # 0x36bb8
movl $0x487, %edx            # imm = 0x487
callq 0xc180
nop