// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movl $0x7fff, %eax           # imm = 0x7FFF
andl (%rsi), %eax
cmpl $0x2, %eax
jne 0x13a6f
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x30(%rdi), %rax
leaq -0x3c(%rbp), %rcx
movq %rax, -0x44(%rcx)
movq %rdi, 0x4(%rcx)
movq %rcx, 0xc(%rcx)
movl 0x4(%rsi), %eax
shrl %eax
decl %eax
leaq -0x28(%rbp), %rsi
movl %eax, (%rsi)
movl 0x8(%rbx), %eax
shrl %eax
decl %eax
movl %eax, 0x4(%rsi)
leaq -0x80(%rbp), %r15
movq %r15, %rdi
callq 0x13d2a
leaq 0x20461(%rip), %r12     # 0x33dcc
cmpl $-0x1, %eax
je 0x13a0e
movq 0x18(%r14), %rcx
movq (%rcx), %rcx
movl %eax, %esi
movl 0xc(%rcx,%rsi,4), %eax
movl %eax, %edx
andl $0x7fff, %edx           # imm = 0x7FFF
cmpl $0x2, %edx
jne 0x13a01
movq -0x30(%rbp), %rdx
movl (%rdx), %edi
cmpq $0x3, %rdi
ja 0x13a01
leaq (%rcx,%rsi,4), %rdx
leaq (%rcx,%rsi,4), %rsi
addq $0xc, %rsi
movslq (%r12,%rdi,4), %rcx
addq %r12, %rcx
jmpq *%rcx
movl 0x4(%rbx), %edi
shrl $0x10, %eax
movzwl %ax, %ecx
cmpl 0x10(%rdx), %edi
jne 0x139f2
movq %r14, %rdi
movq %rbx, %rdx
callq 0x13e00
jmp 0x139fd
movl 0x8(%rbx), %edi
shrl $0x10, %eax
movzwl %ax, %ecx
cmpl 0x10(%rdx), %edi
jne 0x139e5
movq %r14, %rdi
movq %rbx, %rdx
callq 0x14376
jmp 0x139fd
movq %r14, %rdi
movq %rbx, %rdx
callq 0x14666
jmp 0x139fd
movq %r14, %rdi
movq %rbx, %rdx
callq 0x140ba
testl %eax, %eax
jne 0x13a24
movq %r15, %rdi
callq 0x1494a
jmp 0x1396b
movq %r14, %rdi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x11624
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jne 0x13a8e
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x26383(%rip), %rdi     # 0x39dbb
leaq 0x203c9(%rip), %rsi     # 0x33e08
leaq 0x2142e(%rip), %rcx     # 0x34e74
movl $0x455, %edx            # imm = 0x455
callq 0xc180
leaq 0x26364(%rip), %rdi     # 0x39dbb
leaq 0x203aa(%rip), %rsi     # 0x33e08
leaq 0x2140f(%rip), %rcx     # 0x34e74
movl $0x444, %edx            # imm = 0x444
callq 0xc180
leaq 0x213d5(%rip), %rdi     # 0x34e4b
leaq 0x2038b(%rip), %rsi     # 0x33e08
leaq 0x213f0(%rip), %rcx     # 0x34e74
movl $0x433, %edx            # imm = 0x433
callq 0xc180
leaq 0x21421(%rip), %rdi     # 0x34eb6
leaq 0x2036c(%rip), %rsi     # 0x33e08
leaq 0x213d1(%rip), %rcx     # 0x34e74
movl $0x463, %edx            # imm = 0x463
callq 0xc180
nop