// File: /workspace/github_cpp_makefile_star2_O3/vsklad[P]cgen/./bal/anf/anf.cpp
// Function: bal::Anf::evaluate(bal::VariablesArray&) const
void Anf::evaluate(VariablesArray& variables) const {
        assert(variables_size() == variables.size());
        
        // pass 1 - gather values from unit clauses
        for (auto i = 0; i < equations_.size(); i++) {
            if (terms_size_(i) == 1 && symbols_size_(equations_[i]) == 1) {
                const literalid_t value = symbols_[terms_[equations_[i]]];
                _assert_level_1(literal_t__is_variable(value));
                variables.data()[literal_t__variable_id(value)] = literal_t__is_negation(value) ? 0b1 : 0b0;
            };
        };
        
        // pass 2 - try to evaluate all equations
        for (auto i = 0; i < equations_.size(); i++) {
            if (!(terms_size_(i) == 1 && symbols_size_(equations_[i]) == 1)) {
                const size_t terms_size = terms_size_(i);
                assert(terms_size >= 2);
                
                // assume the first term is the variable to assign
                // and the constant combined
                assert(symbols_size_(equations_[i]) == 1);
                assert(literal_t__is_variable(symbols_[terms_[equations_[i]]]));
                
                bool value = literal_t__is_negation(symbols_[terms_[equations_[i]]]);
                variableid_t variable_id = literal_t__variable_id(symbols_[terms_[equations_[i]]]);
                assert(variable_id < variables.size());
                
                // calculate variable value from the rest of equation
                for (auto j = equations_[i] + 1; j < equations_[i] + terms_size; j++) {
                    const size_t symbols_size = symbols_size_(j);
                    bool term_value = true;
                    for (auto k = terms_[j]; (k < terms_[j] + symbols_size) && term_value; k++) {
                        // require that all symbols are constants at this point
                        assert(literal_t__is_variable(symbols_[k]));
                        assert(!literal_t__is_negation(symbols_[k]));
                        assert(literal_t__variable_id(symbols_[k]) < variables.size());
                        const literalid_t symbol_value = variables.data()[literal_t__variable_id(symbols_[k])];
                        assert(literal_t__is_constant(symbol_value));
                        term_value &= literal_t__is_constant_1(symbol_value);
                    };
                    value ^= term_value;
                };
                
                variables.data()[variable_id] = literal_t__constant(value);
            };
        };
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rax
callq *0x58(%rax)
movq %rbx, -0x30(%rbp)
cmpl 0x8(%rbx), %eax
jne 0xe195
movq 0xa8(%r14), %r15
movq %r14, -0x38(%rbp)
movq 0xb0(%r14), %rcx
movq %rcx, %rax
subq %r15, %rax
je 0xe06f
movq %rax, %rbx
sarq $0x2, %rbx
leaq -0x1(%rbx), %r13
movq -0x38(%rbp), %rax
movq 0x98(%rax), %rsi
movq 0x90(%rax), %rdi
subq %rdi, %rsi
sarq $0x2, %rsi
leaq -0x1(%rsi), %r8
movq 0x78(%rax), %r9
movq 0x80(%rax), %r10
subq %r9, %r10
sarq $0x2, %r10
movq -0x30(%rbp), %rax
movq (%rax), %r11
cmpq $0x1, %rbx
movq %rbx, %r12
adcq $0x0, %rbx
xorl %r14d, %r14d
movq %rsi, %rdx
cmpq %r14, %r13
je 0xde5c
movl 0x4(%r15,%r14,4), %edx
movl (%r15,%r14,4), %eax
subq %rax, %rdx
cmpq $0x1, %rdx
jne 0xde9f
movq %r10, %rdx
cmpq %rax, %r8
je 0xde75
movl 0x4(%rdi,%rax,4), %edx
movl (%rdi,%rax,4), %eax
subq %rax, %rdx
cmpq $0x1, %rdx
jne 0xde9f
movl (%r9,%rax,4), %eax
leal -0x2(%rax), %edx
cmpl $-0x3, %edx
jae 0xe176
movl %eax, %edx
notl %edx
andl $0x1, %edx
shrl %eax
movl %edx, -0x4(%r11,%rax,4)
incq %r14
cmpq %r14, %rbx
jne 0xde4f
cmpq %r15, %rcx
je 0xe06f
movq -0x38(%rbp), %rax
movq 0x98(%rax), %rdx
movq 0x90(%rax), %rdi
subq %rdi, %rdx
sarq $0x2, %rdx
leaq -0x1(%rdx), %r8
movq 0x78(%rax), %r9
movq 0x80(%rax), %rax
subq %r9, %rax
sarq $0x2, %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
cmpq $0x1, %r12
adcq $0x0, %r12
movq %r12, -0x68(%rbp)
xorl %esi, %esi
movq %r15, -0x60(%rbp)
movq %r13, -0x58(%rbp)
movq %rdx, -0x50(%rbp)
movq %rdx, %rax
cmpq %rsi, %r13
je 0xdf15
movl 0x4(%r15,%rsi,4), %eax
movl (%r15,%rsi,4), %r12d
subq %r12, %rax
cmpq $0x1, %rax
jne 0xdf41
movq -0x40(%rbp), %rax
cmpq %r12, %r8
je 0xdf30
movl 0x4(%rdi,%r12,4), %eax
movl (%rdi,%r12,4), %ecx
subq %rcx, %rax
cmpq $0x1, %rax
je 0xe062
movq %r13, %rax
movq %rdx, %r13
cmpq %rsi, %rax
je 0xdf51
movl 0x4(%r15,%rsi,4), %r13d
movq %r13, %rax
subq %r12, %rax
cmpq $0x1, %rax
jbe 0xe119
movq -0x40(%rbp), %rax
cmpq %r12, %r8
je 0xdf6f
movl 0x4(%rdi,%r12,4), %eax
movl (%rdi,%r12,4), %ecx
subq %rcx, %rax
cmpq $0x1, %rax
jne 0xe138
movl (%r9,%rcx,4), %r14d
leal 0x1(%r14), %eax
cmpl $0x2, %eax
jbe 0xe0fa
movl %r14d, %r11d
shrl %r11d
decl %r11d
movq -0x30(%rbp), %rax
movl 0x8(%rax), %ebx
cmpl %ebx, %r11d
jae 0xe157
movq %rsi, -0x70(%rbp)
xorb $0x1, %r14b
incl %r12d
cmpq %r12, %r13
jbe 0xe041
movq -0x38(%rbp), %rax
movq 0x80(%rax), %rsi
subq %r9, %rsi
sarq $0x2, %rsi
movq -0x30(%rbp), %rax
movq (%rax), %r10
movq %rsi, %rcx
cmpq %r12, %r8
je 0xdfe4
movl 0x4(%rdi,%r12,4), %ecx
movl (%rdi,%r12,4), %eax
movb $0x1, %r15b
cmpq %rax, %rcx
jbe 0xe036
leal 0x1(%rax), %edx
movl (%r9,%rax,4), %eax
leal 0x1(%rax), %r15d
cmpl $0x2, %r15d
jbe 0xe07e
testb $0x1, %al
je 0xe09d
shrl %eax
decl %eax
cmpl %ebx, %eax
jae 0xe0db
movl %eax, %eax
movl (%r10,%rax,4), %eax
cmpl $0x2, %eax
jae 0xe0bc
cmpl $0x1, %eax
sete %r15b
jne 0xe036
movl %edx, %eax
incl %edx
cmpq %rax, %rcx
ja 0xdff3
xorb %r15b, %r14b
incl %r12d
cmpq %r12, %r13
ja 0xdfd7
movzbl %r14b, %eax
andl $0x1, %eax
movl %r11d, %ecx
movq -0x48(%rbp), %rdx
movl %eax, (%rdx,%rcx,4)
movq -0x60(%rbp), %r15
movq -0x58(%rbp), %r13
movq -0x50(%rbp), %rdx
movq -0x70(%rbp), %rsi
incq %rsi
cmpq -0x68(%rbp), %rsi
jne 0xdf08
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x311d0(%rip), %rdi     # 0x3f255
leaq 0x30f93(%rip), %rsi     # 0x3f01f
leaq 0x312a3(%rip), %rcx     # 0x3f336
movl $0x149, %edx            # imm = 0x149
callq 0xb180
leaq 0x31229(%rip), %rdi     # 0x3f2cd
leaq 0x30f74(%rip), %rsi     # 0x3f01f
leaq 0x31284(%rip), %rcx     # 0x3f336
movl $0x14a, %edx            # imm = 0x14A
callq 0xb180
leaq 0x313ab(%rip), %rdi     # 0x3f46e
leaq 0x30f55(%rip), %rsi     # 0x3f01f
leaq 0x31265(%rip), %rcx     # 0x3f336
movl $0x14d, %edx            # imm = 0x14D
callq 0xb180
leaq 0x31355(%rip), %rdi     # 0x3f437
leaq 0x30f36(%rip), %rsi     # 0x3f01f
leaq 0x31246(%rip), %rcx     # 0x3f336
movl $0x14b, %edx            # imm = 0x14B
callq 0xb180
leaq 0x312df(%rip), %rdi     # 0x3f3e0
leaq 0x30f17(%rip), %rsi     # 0x3f01f
leaq 0x31227(%rip), %rcx     # 0x3f336
movl $0x13d, %edx            # imm = 0x13D
callq 0xb180
leaq 0x3128e(%rip), %rdi     # 0x3f3ae
leaq 0x30ef8(%rip), %rsi     # 0x3f01f
leaq 0x31208(%rip), %rcx     # 0x3f336
movl $0x138, %edx            # imm = 0x138
callq 0xb180
leaq 0x3127f(%rip), %rdi     # 0x3f3be
leaq 0x30ed9(%rip), %rsi     # 0x3f01f
leaq 0x311e9(%rip), %rcx     # 0x3f336
movl $0x13c, %edx            # imm = 0x13C
callq 0xb180
leaq 0x312ba(%rip), %rdi     # 0x3f418
leaq 0x30eba(%rip), %rsi     # 0x3f01f
leaq 0x311ca(%rip), %rcx     # 0x3f336
movl $0x141, %edx            # imm = 0x141
callq 0xb180
leaq 0x311e9(%rip), %rdi     # 0x3f366
leaq 0x30e9b(%rip), %rsi     # 0x3f01f
leaq 0x311ab(%rip), %rcx     # 0x3f336
movl $0x12f, %edx            # imm = 0x12F
callq 0xb180
leaq 0x385f3(%rip), %rdi     # 0x4678f
leaq 0x30e7c(%rip), %rsi     # 0x3f01f
leaq 0x3118c(%rip), %rcx     # 0x3f336
movl $0x129, %edx            # imm = 0x129
callq 0xb180