// File: vsklad[P]cgen/./bal/cnf/processor/cnfoptimizer.cpp
// Function: bal::CnfOptimizer::resolve_c2(unsigned int*)
inline processor_result_t CnfOptimizer::resolve_c2(uint32_t* const p_clause) {
        _assert_level_0(_clause_size(p_clause) == 2);
        processor_result_t result = erUndetermined;
        
        CnfProcessor::clauses_iterator_t<2> iterator(clauses_index_, *this);
        const container_offset_t c2_variables[2] = {
            literal_t__variable_id(_clause_literal(p_clause, 0)),
            literal_t__variable_id(_clause_literal(p_clause, 1))
        };
        
        container_offset_t ca_offset = iterator.first(c2_variables);
        while (ca_offset != CLAUSES_END) {
            uint32_t* p_ca = _clauses_offset_clause(clauses_data_, ca_offset);
            const clause_size_t ca_size = _clause_size(p_ca);
            switch(ca_size) {
                case 2:
                    switch(iterator.instance_bits) {
                        case 0b00:
                            _assert_level_0(false);
                            break;
                        case 0b01:
                            if (_clause_literal(p_clause, 0) == _clause_literal(p_ca, 0)) {
                                result = resolve_ca_c2<false, 2, 0, 0>(p_ca, p_clause, _clause_flags(p_ca));
                            } else {
                                result = resolve_ca_c2<false, 2, 1, 0>(p_ca, p_clause, _clause_flags(p_ca));
                            };
                            break;
                        case 0b10:
                            if (_clause_literal(p_clause, 1) == _clause_literal(p_ca, 0)) {
                                result = resolve_ca_c2<false, 2, 0, 1>(p_ca, p_clause, _clause_flags(p_ca));
                            } else {
                                result = resolve_ca_c2<false, 2, 1, 1>(p_ca, p_clause, _clause_flags(p_ca));
                            };
                            break;
                        case 0b11:
                            _assert_level_0(false);
                            break;
                    };
                    break;
            };
            
            if (result == erUndetermined) {
                ca_offset = iterator.next();
            } else {
                break;
            };
        };
    
        // no resolvents changed while processing means no changes to the clause
        _assert_level_3(result != erUndetermined || normalize_ca(p_clause, p_clause) == erUndetermined);
        return result;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0x7fff, %eax           # imm = 0x7FFF
cmpl $0x2, %eax
jne 0x1c6a0
jmp 0x1c6bf
leaq 0x428b0(%rip), %rdi     # 0x5ef57
leaq 0x41866(%rip), %rsi     # 0x5df14
movl $0x433, %edx            # imm = 0x433
leaq 0x428c6(%rip), %rcx     # 0x5ef80
callq 0xd1c0
movq -0x98(%rbp), %rdx
movl $0x0, -0x14(%rbp)
movq %rdx, %rsi
addq $0x30, %rsi
leaq -0x70(%rbp), %rdi
callq 0x1cd70
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
shrl %eax
subl $0x1, %eax
movl %eax, -0x78(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
shrl %eax
subl $0x1, %eax
movl %eax, -0x74(%rbp)
leaq -0x78(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0x1cda0
movl %eax, -0x7c(%rbp)
cmpl $-0x1, -0x7c(%rbp)
je 0x1c8b9
movq -0x98(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
movl -0x7c(%rbp), %ecx
leaq 0xc(%rax,%rcx,4), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movzwl (%rax), %eax
andl $0x7fff, %eax           # imm = 0x7FFF
movw %ax, -0x8a(%rbp)
movw -0x8a(%rbp), %ax
subw $0x2, %ax
jne 0x1c89e
jmp 0x1c75b
movq -0x20(%rbp), %rax
movl (%rax), %eax
movq %rax, -0xa0(%rbp)
subq $0x3, %rax
ja 0x1c89c
movq -0xa0(%rbp), %rax
leaq 0x41758(%rip), %rcx     # 0x5ded8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x476d7(%rip), %rdi     # 0x63e67
leaq 0x4177d(%rip), %rsi     # 0x5df14
movl $0x444, %edx            # imm = 0x444
leaq 0x427dd(%rip), %rcx     # 0x5ef80
callq 0xd1c0
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x88(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x1c7e6
movq -0x98(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x88(%rbp), %rax
movl (%rax), %eax
shrl $0x10, %eax
movzwl %ax, %ecx
callq 0x1cf50
movl %eax, -0x14(%rbp)
jmp 0x1c80f
movq -0x98(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x88(%rbp), %rax
movl (%rax), %eax
shrl $0x10, %eax
movzwl %ax, %ecx
callq 0x1d3d0
movl %eax, -0x14(%rbp)
jmp 0x1c89c
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x88(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x1c852
movq -0x98(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x88(%rbp), %rax
movl (%rax), %eax
shrl $0x10, %eax
movzwl %ax, %ecx
callq 0x1d860
movl %eax, -0x14(%rbp)
jmp 0x1c87b
movq -0x98(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x88(%rbp), %rax
movl (%rax), %eax
shrl $0x10, %eax
movzwl %ax, %ecx
callq 0x1dcf0
movl %eax, -0x14(%rbp)
jmp 0x1c89c
leaq 0x475e3(%rip), %rdi     # 0x63e67
leaq 0x41689(%rip), %rsi     # 0x5df14
movl $0x455, %edx            # imm = 0x455
leaq 0x426e9(%rip), %rcx     # 0x5ef80
callq 0xd1c0
jmp 0x1c89e
cmpl $0x0, -0x14(%rbp)
jne 0x1c8b2
leaq -0x70(%rbp), %rdi
callq 0x1e180
movl %eax, -0x7c(%rbp)
jmp 0x1c8b4
jmp 0x1c8b9
jmp 0x1c70b
movb $0x1, %al
cmpl $0x0, -0x14(%rbp)
movb %al, -0xa1(%rbp)
jne 0x1c8e7
movq -0x98(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x180b0
cmpl $0x0, %eax
sete %al
movb %al, -0xa1(%rbp)
movb -0xa1(%rbp), %al
testb $0x1, %al
jne 0x1c8f3
jmp 0x1c8f5
jmp 0x1c914
leaq 0x426c6(%rip), %rdi     # 0x5efc2
leaq 0x41611(%rip), %rsi     # 0x5df14
movl $0x463, %edx            # imm = 0x463
leaq 0x42671(%rip), %rcx     # 0x5ef80
callq 0xd1c0
movl -0x14(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq