// File: /workspace/github_cpp_makefile_star2_O1/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), %r8d
testw %r8w, %r8w
js 0x18ac6
movq %r8, %r9
andq $0x7fff, %r9            # imm = 0x7FFF
je 0x18ac6
movq 0xb8(%rdi), %rax
movq (%rax), %rdi
addl %r9d, %r9d
xorl %r10d, %r10d
leaq 0x2e268(%rip), %r11     # 0x46c7c
leaq 0x2e259(%rip), %rbx     # 0x46c74
xorl %eax, %eax
movl 0x4(%rsi,%r10,2), %ecx
movl %ecx, %edx
shrl %edx
decl %edx
movl (%rdi,%rdx,4), %edx
movl %ecx, %r14d
andl $0x1, %r14d
xorl %edx, %r14d
movl %r14d, %r15d
xorl $0x1, %r15d
cmpl %r15d, %ecx
je 0x18ab7
cmpl $0x2, %edx
jb 0x18adc
cmpl $-0x2, %r14d
je 0x18adc
testb $0x1, %r14b
je 0x18ab2
movl (%rsi), %r14d
movl %r14d, %r12d
andl $0x7fff, %r12d          # imm = 0x7FFF
cmpl $0x4, %r12d
ja 0x18ab2
xorl %ecx, %edx
cmpl $0x2, %edx
jae 0x18afb
movl $0x1, %edx
movl %eax, %ecx
shll %cl, %edx
movl %r14d, %r15d
shrl $0x10, %r15d
movzwl (%r10,%r11), %r12d
andl %r15d, %r12d
movl %edx, %ecx
shrl %cl, %r12d
movzwl (%r10,%rbx), %r13d
andl %r15d, %r13d
shll %cl, %r13d
orl %r12d, %r13d
shll $0x10, %r13d
movzwl %r14w, %ecx
orl %r13d, %ecx
movl %ecx, (%rsi)
jmp 0x18ab7
movl %r15d, 0x4(%rsi,%r10,2)
incl %eax
addq $0x2, %r10
cmpq %r10, %r9
jne 0x18a1d
testw %r8w, %r8w
setns %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2e071(%rip), %rdi     # 0x46b54
leaq 0x2b30e(%rip), %rsi     # 0x43df8
leaq 0x2e0b7(%rip), %rcx     # 0x46ba8
movl $0x484, %edx            # imm = 0x484
callq 0xc180
leaq 0x2e0ee(%rip), %rdi     # 0x46bf0
leaq 0x2b2ef(%rip), %rsi     # 0x43df8
leaq 0x2e098(%rip), %rcx     # 0x46ba8
movl $0x487, %edx            # imm = 0x487
callq 0xc180
nop