// File: /workspace/github_cpp_makefile_star2_O3/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 0x1755f
movq %r8, %r9
andq $0x7fff, %r9            # imm = 0x7FFF
je 0x1755f
movq 0xb8(%rdi), %rax
movq (%rax), %rdi
addl %r9d, %r9d
xorl %r10d, %r10d
leaq 0x2d7e0(%rip), %r11     # 0x44c8c
leaq 0x2d7d1(%rip), %rbx     # 0x44c84
xorl %eax, %eax
movl %r8d, %r14d
movl 0x4(%rsi,%r10,2), %ecx
movl %ecx, %edx
shrl %edx
decl %edx
movl (%rdi,%rdx,4), %edx
movl %ecx, %r12d
andl $0x1, %r12d
xorl %edx, %r12d
movl %r12d, %r15d
xorl $0x1, %r15d
cmpl %r15d, %ecx
je 0x17550
cmpl $0x2, %edx
jb 0x17575
cmpl $-0x2, %r12d
je 0x17575
testb $0x1, %r12b
je 0x1754b
movl %r14d, %r12d
andl $0x7fff, %r12d          # imm = 0x7FFF
cmpl $0x4, %r12d
ja 0x1754b
xorl %ecx, %edx
cmpl $0x2, %edx
jae 0x17594
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, %r14d
orl %r13d, %r14d
movl %r14d, (%rsi)
jmp 0x17550
movl %r15d, 0x4(%rsi,%r10,2)
incl %eax
addq $0x2, %r10
cmpq %r10, %r9
jne 0x174b8
testw %r8w, %r8w
setns %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2d5e8(%rip), %rdi     # 0x44b64
leaq 0x2a885(%rip), %rsi     # 0x41e08
leaq 0x2d62e(%rip), %rcx     # 0x44bb8
movl $0x484, %edx            # imm = 0x484
callq 0xb180
leaq 0x2d665(%rip), %rdi     # 0x44c00
leaq 0x2a866(%rip), %rsi     # 0x41e08
leaq 0x2d60f(%rip), %rcx     # 0x44bb8
movl $0x487, %edx            # imm = 0x487
callq 0xb180
nop