// File: /workspace/github_cpp_makefile_star2_O3/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, %rbx
movq 0xb8(%rdi), %rsi
cmpl $0x0, 0x8(%rsi)
je 0x12014
movq (%rsi), %r13
xorl %r15d, %r15d
xorl %r14d, %r14d
movl (%r13,%r15,4), %eax
leal 0x1(%rax), %ecx
cmpl $0x3, %ecx
jae 0x11f25
cmpl $0x2, %eax
jae 0x1207f
incq %r15
movq 0xb8(%rbx), %rsi
movl 0x8(%rsi), %eax
cmpq %rax, %r15
jb 0x11ef8
jmp 0x12017
movl %eax, %r12d
shrl %r12d
decl %r12d
cmpq %r12, %r15
jne 0x11fa7
cmpl %r12d, 0x68(%rbx)
jbe 0x11f66
movq 0x60(%rbx), %rax
movl (%rax,%r15,4), %edx
cmpl $-0x1, %edx
je 0x11f66
movq 0x18(%rbx), %rcx
movq 0x38(%rbx), %rax
movq (%rcx), %rcx
movl %edx, %edx
movl 0x4(%rax,%rdx,8), %esi
testb $-0x80, 0xd(%rcx,%rsi,4)
je 0x11f7a
movl (%rax,%rdx,8), %edx
cmpl $-0x1, %edx
jne 0x11f51
movq 0x8(%rbx), %rdi
movl %r12d, %esi
callq 0x3b2c0
testb %al, %al
je 0x12006
cmpb $0x0, -0x2c(%rbp)
je 0x11f0e
cmpl %r12d, %r14d
je 0x11f9f
leal 0x3(,%r14,2), %eax
movl (%r13,%r15,4), %ecx
andl $0x1, %ecx
andl $-0x2, %eax
orl %ecx, %eax
movl %eax, (%r13,%r15,4)
incl %r14d
jmp 0x11f0e
jbe 0x120bd
movl 0x68(%rbx), %ecx
cmpq %rcx, %r15
jae 0x11fe6
movq 0x60(%rbx), %rcx
movl (%rcx,%r15,4), %esi
cmpl $-0x1, %esi
je 0x11fe6
movq 0x18(%rbx), %rdx
movq 0x38(%rbx), %rcx
movq (%rdx), %rdx
movl %esi, %esi
movl 0x4(%rcx,%rsi,8), %edi
testb $-0x80, 0xd(%rdx,%rdi,4)
je 0x12060
movl (%rcx,%rsi,8), %esi
cmpl $-0x1, %esi
jne 0x11fcd
movl (%r13,%r12,4), %ecx
cmpl $-0x1, %ecx
je 0x1209e
andl $0x1, %eax
xorl %ecx, %eax
xorl $0x1, %eax
movl %eax, (%r13,%r15,4)
jmp 0x11f0e
movl $0xffffffff, (%r13,%r15,4) # imm = 0xFFFFFFFF
jmp 0x11f0e
xorl %r14d, %r14d
movq 0x4a2f2(%rip), %rdi     # 0x5c310
testq %rdi, %rdi
je 0x12029
movq (%rdi), %rax
callq *0x38(%rax)
movq 0x8(%rbx), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
movq 0xb8(%rbx), %rcx
movl 0x8(%rcx), %ecx
cmpl %ecx, %eax
ja 0x120dc
cmpl %ecx, %r14d
ja 0x120fb
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x325e1(%rip), %rdi     # 0x44648
leaq 0x2fd9a(%rip), %rsi     # 0x41e08
leaq 0x32596(%rip), %rcx     # 0x4460b
movl $0x4a5, %edx            # imm = 0x4A5
callq 0xb180
leaq 0x3260a(%rip), %rdi     # 0x44690
leaq 0x2fd7b(%rip), %rsi     # 0x41e08
leaq 0x32577(%rip), %rcx     # 0x4460b
movl $0x4b8, %edx            # imm = 0x4B8
callq 0xb180
leaq 0x325b8(%rip), %rdi     # 0x4465d
leaq 0x2fd5c(%rip), %rsi     # 0x41e08
leaq 0x32558(%rip), %rcx     # 0x4460b
movl $0x4a7, %edx            # imm = 0x4A7
callq 0xb180
leaq 0x32537(%rip), %rdi     # 0x445fb
leaq 0x2fd3d(%rip), %rsi     # 0x41e08
leaq 0x32539(%rip), %rcx     # 0x4460b
movl $0x4a3, %edx            # imm = 0x4A3
callq 0xb180
leaq 0x325d3(%rip), %rdi     # 0x446b6
leaq 0x2fd1e(%rip), %rsi     # 0x41e08
leaq 0x3251a(%rip), %rcx     # 0x4460b
movl $0x4bf, %edx            # imm = 0x4BF
callq 0xb180
leaq 0x325df(%rip), %rdi     # 0x446e1
leaq 0x2fcff(%rip), %rsi     # 0x41e08
leaq 0x324fb(%rip), %rcx     # 0x4460b
movl $0x4c0, %edx            # imm = 0x4C0
callq 0xb180