// File: /workspace/github_cpp_makefile_star2_O1/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, %r12
movq (%rdi), %rax
callq *0x58(%rax)
movq %rbx, -0x38(%rbp)
cmpl 0x8(%rbx), %eax
jne 0xf293
movq 0xa8(%r12), %r13
movq 0xb0(%r12), %rdx
movq %rdx, %rax
subq %r13, %rax
sarq $0x2, %rax
movq %rax, -0x30(%rbp)
cmpq %r13, %rdx
je 0xef89
movq 0xb0(%r12), %rcx
subq %r13, %rcx
sarq $0x2, %rcx
decq %rcx
movq 0x98(%r12), %rsi
movq 0x90(%r12), %rdi
subq %rdi, %rsi
sarq $0x2, %rsi
leaq -0x1(%rsi), %r8
movq 0x78(%r12), %r9
movq 0x80(%r12), %r10
subq %r9, %r10
sarq $0x2, %r10
movq -0x38(%rbp), %rax
movq (%rax), %r11
movq -0x30(%rbp), %rbx
cmpq $0x1, %rbx
adcq $0x0, %rbx
xorl %r14d, %r14d
movq %rsi, %r15
cmpq %r14, %rcx
je 0xef37
movl 0x4(%r13,%r14,4), %r15d
movl (%r13,%r14,4), %eax
subq %rax, %r15
cmpq $0x1, %r15
jne 0xef81
movq %r10, %r15
cmpq %rax, %r8
je 0xef52
movl 0x4(%rdi,%rax,4), %r15d
movl (%rdi,%rax,4), %eax
subq %rax, %r15
cmpq $0x1, %r15
jne 0xef81
movl (%r9,%rax,4), %eax
leal -0x2(%rax), %r15d
cmpl $-0x3, %r15d
jae 0xf274
movl %eax, %r15d
notl %r15d
andl $0x1, %r15d
shrl %eax
movl %r15d, -0x4(%r11,%rax,4)
incq %r14
cmpq %r14, %rbx
jne 0xef2a
movq %r12, -0x40(%rbp)
cmpq %r13, %rdx
je 0xf16d
movq -0x40(%rbp), %rax
movq 0xb0(%rax), %rdx
subq %r13, %rdx
sarq $0x2, %rdx
decq %rdx
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), %rax
subq %r9, %rax
sarq $0x2, %rax
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rax
cmpq $0x1, %rax
adcq $0x0, %rax
movq %rax, -0x30(%rbp)
xorl %r10d, %r10d
movq %r13, -0x48(%rbp)
movq %rdx, -0x68(%rbp)
movq %rsi, -0x60(%rbp)
movq %rsi, %rax
cmpq %r10, %rdx
je 0xf011
movl 0x4(%r13,%r10,4), %eax
movl (%r13,%r10,4), %r12d
subq %r12, %rax
cmpq $0x1, %rax
jne 0xf03e
movq -0x50(%rbp), %rax
cmpq %r12, %r8
je 0xf02d
movl 0x4(%rdi,%r12,4), %eax
movl (%rdi,%r12,4), %ecx
subq %rcx, %rax
cmpq $0x1, %rax
je 0xf160
movq %rsi, %r13
cmpq %r10, %rdx
je 0xf04f
movq -0x48(%rbp), %rax
movl 0x4(%rax,%r10,4), %r13d
movq %r13, %rax
subq %r12, %rax
cmpq $0x1, %rax
jbe 0xf217
movq -0x50(%rbp), %rax
cmpq %r12, %r8
je 0xf06d
movl 0x4(%rdi,%r12,4), %eax
movl (%rdi,%r12,4), %ecx
subq %rcx, %rax
cmpq $0x1, %rax
jne 0xf236
movl (%r9,%rcx,4), %r14d
leal 0x1(%r14), %eax
cmpl $0x2, %eax
jbe 0xf1f8
movl %r14d, %r11d
shrl %r11d
decl %r11d
movq -0x38(%rbp), %rax
movl 0x8(%rax), %ebx
cmpl %ebx, %r11d
jae 0xf255
movq %r10, -0x70(%rbp)
xorb $0x1, %r14b
incl %r12d
cmpq %r12, %r13
jbe 0xf13f
movq -0x40(%rbp), %rax
movq 0x80(%rax), %rdx
subq %r9, %rdx
sarq $0x2, %rdx
movq -0x38(%rbp), %rax
movq (%rax), %r10
movq %rdx, %rcx
cmpq %r12, %r8
je 0xf0e2
movl 0x4(%rdi,%r12,4), %ecx
movl (%rdi,%r12,4), %eax
movb $0x1, %r15b
cmpq %rax, %rcx
jbe 0xf134
leal 0x1(%rax), %esi
movl (%r9,%rax,4), %eax
leal 0x1(%rax), %r15d
cmpl $0x2, %r15d
jbe 0xf17c
testb $0x1, %al
je 0xf19b
shrl %eax
decl %eax
cmpl %ebx, %eax
jae 0xf1d9
movl %eax, %eax
movl (%r10,%rax,4), %eax
cmpl $0x2, %eax
jae 0xf1ba
cmpl $0x1, %eax
sete %r15b
jne 0xf134
movl %esi, %eax
incl %esi
cmpq %rax, %rcx
ja 0xf0f1
xorb %r15b, %r14b
incl %r12d
cmpq %r12, %r13
ja 0xf0d5
movzbl %r14b, %eax
andl $0x1, %eax
movl %r11d, %ecx
movq -0x58(%rbp), %rdx
movl %eax, (%rdx,%rcx,4)
movq -0x48(%rbp), %r13
movq -0x68(%rbp), %rdx
movq -0x60(%rbp), %rsi
movq -0x70(%rbp), %r10
incq %r10
cmpq -0x30(%rbp), %r10
jne 0xf004
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x320d2(%rip), %rdi     # 0x41255
leaq 0x31e95(%rip), %rsi     # 0x4101f
leaq 0x321a5(%rip), %rcx     # 0x41336
movl $0x149, %edx            # imm = 0x149
callq 0xc180
leaq 0x3212b(%rip), %rdi     # 0x412cd
leaq 0x31e76(%rip), %rsi     # 0x4101f
leaq 0x32186(%rip), %rcx     # 0x41336
movl $0x14a, %edx            # imm = 0x14A
callq 0xc180
leaq 0x322ad(%rip), %rdi     # 0x4146e
leaq 0x31e57(%rip), %rsi     # 0x4101f
leaq 0x32167(%rip), %rcx     # 0x41336
movl $0x14d, %edx            # imm = 0x14D
callq 0xc180
leaq 0x32257(%rip), %rdi     # 0x41437
leaq 0x31e38(%rip), %rsi     # 0x4101f
leaq 0x32148(%rip), %rcx     # 0x41336
movl $0x14b, %edx            # imm = 0x14B
callq 0xc180
leaq 0x321e1(%rip), %rdi     # 0x413e0
leaq 0x31e19(%rip), %rsi     # 0x4101f
leaq 0x32129(%rip), %rcx     # 0x41336
movl $0x13d, %edx            # imm = 0x13D
callq 0xc180
leaq 0x32190(%rip), %rdi     # 0x413ae
leaq 0x31dfa(%rip), %rsi     # 0x4101f
leaq 0x3210a(%rip), %rcx     # 0x41336
movl $0x138, %edx            # imm = 0x138
callq 0xc180
leaq 0x32181(%rip), %rdi     # 0x413be
leaq 0x31ddb(%rip), %rsi     # 0x4101f
leaq 0x320eb(%rip), %rcx     # 0x41336
movl $0x13c, %edx            # imm = 0x13C
callq 0xc180
leaq 0x321bc(%rip), %rdi     # 0x41418
leaq 0x31dbc(%rip), %rsi     # 0x4101f
leaq 0x320cc(%rip), %rcx     # 0x41336
movl $0x141, %edx            # imm = 0x141
callq 0xc180
leaq 0x320eb(%rip), %rdi     # 0x41366
leaq 0x31d9d(%rip), %rsi     # 0x4101f
leaq 0x320ad(%rip), %rcx     # 0x41336
movl $0x12f, %edx            # imm = 0x12F
callq 0xc180
leaq 0x394e5(%rip), %rdi     # 0x4877f
leaq 0x31d7e(%rip), %rsi     # 0x4101f
leaq 0x3208e(%rip), %rcx     # 0x41336
movl $0x129, %edx            # imm = 0x129
callq 0xc180