// File: /workspace/github_cpp_makefile_star2_O2/vsklad[P]cgen/./bal/cnf/processor/cnfoptimizer.cpp
// Function: bal::CnfOptimizer::update_variables(bool)
inline variableid_t CnfOptimizer::update_variables(const bool b_reindex_variables) {
        literalid_t* var_values = variables_.data();
        variableid_t next_variable_id = VARIABLEID_MIN;
        
        // go through the variables sequentially
        for (variables_size_t i = 0; i < variables_.size(); i++) {
            if (literal_t__is_variable(var_values[i])) {
                variableid_t variable_id = literal_t__variable_id(var_values[i]);
                if (variable_id != i) {
                    // assume referencing of variables with lower ids only
                    // and therefore the reference is updated by now
                    assert(i > variable_id);
                    // all clauses with the variable must have been excluded
                    assert(!is_variable_used(i));
                    // UNASSIGNED may not be referenced
                    assert(!literal_t__is_unassigned(var_values[variable_id]));
                    // take the reference of the reference instead of making a new variable
                    var_values[i] = literal_t__substitute_literal(var_values[i], var_values[variable_id]);
                } else if (is_variable_used(variable_id) || cnf_.is_variable_named(variable_id)) {
                    if (b_reindex_variables) {
                        // generate new variable id
                        if (next_variable_id != variable_id) {
                            // only update after next_variable_id falls behind
                            var_values[i] = literal_t__substitute_variable(var_values[i], next_variable_id);
                        };
                        next_variable_id++;
                    };
                } else {
                    var_values[i] = LITERALID_UNASSIGNED;
                };
            } else {
                // unassigned cannot be created earlier than this stage
                assert(literal_t__is_constant(var_values[i]));
            };
        };
#ifdef CNF_TRACE
        if (p_tracer_ != nullptr) p_tracer_->update_variables(variables_);
#endif
        // validate the new variables size
        _assert_level_1(cnf_.variables_size() <= variables_.size());
        _assert_level_1(next_variable_id <= variables_.size());
        return next_variable_id;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, -0x2c(%rbp)
movq %rdi, %r14
movq 0xb8(%rdi), %rsi
movq (%rsi), %r15
xorl %r12d, %r12d
xorl %ebx, %ebx
movl 0x8(%rsi), %eax
cmpq %rax, %r12
jae 0x10ccb
movl (%r15,%r12,4), %r13d
leal 0x1(%r13), %eax
cmpl $0x3, %eax
jae 0x10c36
cmpl $0x2, %r13d
jae 0x10d12
incq %r12
movq 0xb8(%r14), %rsi
jmp 0x10c07
shrl %r13d
decl %r13d
cmpq %r13, %r12
jne 0x10c86
movq %r14, %rdi
movl %r13d, %esi
callq 0x1527c
testb %al, %al
jne 0x10c60
movq 0x8(%r14), %rdi
movl %r13d, %esi
callq 0x2e2d2
testb %al, %al
je 0x10cc1
cmpb $0x0, -0x2c(%rbp)
je 0x10c2a
cmpl %r13d, %ebx
je 0x10c82
leal 0x3(,%rbx,2), %eax
movl (%r15,%r12,4), %ecx
andl $0x1, %ecx
andl $-0x2, %eax
orl %ecx, %eax
movl %eax, (%r15,%r12,4)
incl %ebx
jmp 0x10c2a
jbe 0x10d6f
movq %r14, %rdi
movl %r12d, %esi
callq 0x1527c
testb %al, %al
jne 0x10d50
movl (%r15,%r13,4), %eax
cmpl $-0x1, %eax
je 0x10d31
movl (%r15,%r12,4), %ecx
andl $0x1, %ecx
xorl %ecx, %eax
xorl $0x1, %eax
movl %eax, (%r15,%r12,4)
jmp 0x10c2a
orl $-0x1, (%r15,%r12,4)
jmp 0x10c2a
movq 0x4062e(%rip), %rdi     # 0x51300
testq %rdi, %rdi
je 0x10cdd
movq (%rdi), %rax
callq *0x38(%rax)
movq 0x8(%r14), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
movq 0xb8(%r14), %rcx
movl 0x8(%rcx), %ecx
cmpl %ecx, %eax
ja 0x10d8e
cmpl %ecx, %ebx
ja 0x10dad
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x25977(%rip), %rdi     # 0x36690
leaq 0x230e8(%rip), %rsi     # 0x33e08
leaq 0x258e4(%rip), %rcx     # 0x3660b
movl $0x4b8, %edx            # imm = 0x4B8
callq 0xc180
leaq 0x25925(%rip), %rdi     # 0x3665d
leaq 0x230c9(%rip), %rsi     # 0x33e08
leaq 0x258c5(%rip), %rcx     # 0x3660b
movl $0x4a7, %edx            # imm = 0x4A7
callq 0xc180
leaq 0x258f1(%rip), %rdi     # 0x36648
leaq 0x230aa(%rip), %rsi     # 0x33e08
leaq 0x258a6(%rip), %rcx     # 0x3660b
movl $0x4a5, %edx            # imm = 0x4A5
callq 0xc180
leaq 0x25885(%rip), %rdi     # 0x365fb
leaq 0x2308b(%rip), %rsi     # 0x33e08
leaq 0x25887(%rip), %rcx     # 0x3660b
movl $0x4a3, %edx            # imm = 0x4A3
callq 0xc180
leaq 0x25921(%rip), %rdi     # 0x366b6
leaq 0x2306c(%rip), %rsi     # 0x33e08
leaq 0x25868(%rip), %rcx     # 0x3660b
movl $0x4bf, %edx            # imm = 0x4BF
callq 0xc180
leaq 0x2592d(%rip), %rdi     # 0x366e1
leaq 0x2304d(%rip), %rsi     # 0x33e08
leaq 0x25849(%rip), %rcx     # 0x3660b
movl $0x4c0, %edx            # imm = 0x4C0
callq 0xc180