// File: /workspace/github_cpp_makefile_star2_O3/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 0x15b42
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x30(%rdi), %rcx
leaq -0x34(%rbp), %rax
movq %rcx, -0x44(%rax)
movq %rdi, 0x4(%rax)
movq %rax, 0xc(%rax)
movl 0x4(%rsi), %r11d
movl 0x8(%rsi), %edx
leaq -0x40(%rbp), %rsi
movq $0x0, (%rsi)
movl 0x68(%rdi), %edi
movb $0x1, %r8b
xorl %ecx, %ecx
xorl %r9d, %r9d
shrl %r11d
decl %r11d
cmpl %edi, %r11d
jae 0x159f6
movq 0x60(%r14), %r10
movl %r11d, %r15d
movl (%r10,%r15,4), %r15d
cmpl $-0x1, %r15d
je 0x159f6
leaq (%rcx,%rcx,2), %r10
leaq (%rax,%r10,8), %r10
addq $-0x3c, %r10
movl $0x1, %r12d
shll %cl, %r12d
movl %r12d, (%r10)
movl %r11d, 0x4(%r10)
movl $0xffffffff, 0x8(%r10)  # imm = 0xFFFFFFFF
movl %r15d, 0xc(%r10)
testq %r9, %r9
je 0x159c6
cmpl %r15d, 0xc(%r9)
jbe 0x159d1
movq %r9, %r11
jmp 0x159c9
xorl %r11d, %r11d
movq %rsi, %rcx
movq %r10, %r9
jmp 0x159ef
movq %r9, %r11
movq %r11, %rcx
movq 0x10(%r11), %r11
testq %r11, %r11
je 0x159e8
cmpl %r15d, 0xc(%r11)
jb 0x159d4
jmp 0x159eb
xorl %r11d, %r11d
addq $0x10, %rcx
movq %r11, 0x10(%r10)
movq %r10, (%rcx)
movl $0x1, %ecx
movl %edx, %r11d
testb $0x1, %r8b
movl $0x0, %r8d
jne 0x15972
testq %r9, %r9
je 0x15ae1
movq 0x38(%r14), %rax
movl 0xc(%r9), %ecx
movl 0x4(%rax,%rcx,8), %eax
leaq -0x78(%rbp), %rdi
movl %eax, 0x40(%rdi)
callq 0x16b96
cmpl $-0x1, %eax
je 0x15ae1
leaq 0x2c38d(%rip), %r12     # 0x41dcc
leaq -0x78(%rbp), %r15
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 0x15ad0
movq -0x28(%rbp), %rdx
movl (%rdx), %edi
cmpq $0x3, %rdi
ja 0x15ad0
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 0x15ac1
movq %r14, %rdi
movq %rbx, %rdx
callq 0x15e3a
jmp 0x15acc
movl 0x8(%rbx), %edi
shrl $0x10, %eax
movzwl %ax, %ecx
cmpl 0x10(%rdx), %edi
jne 0x15ab4
movq %r14, %rdi
movq %rbx, %rdx
callq 0x164b0
jmp 0x15acc
movq %r14, %rdi
movq %rbx, %rdx
callq 0x16822
jmp 0x15acc
movq %r14, %rdi
movq %rbx, %rdx
callq 0x16174
testl %eax, %eax
jne 0x15af7
movq %r15, %rdi
callq 0x16b96
cmpl $-0x1, %eax
jne 0x15a43
movq %r14, %rdi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x12d5e
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jne 0x15b61
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x32197(%rip), %rdi     # 0x47ca2
leaq 0x2c2f6(%rip), %rsi     # 0x41e08
leaq 0x2d35b(%rip), %rcx     # 0x42e74
movl $0x455, %edx            # imm = 0x455
callq 0xb180
leaq 0x32178(%rip), %rdi     # 0x47ca2
leaq 0x2c2d7(%rip), %rsi     # 0x41e08
leaq 0x2d33c(%rip), %rcx     # 0x42e74
movl $0x444, %edx            # imm = 0x444
callq 0xb180
leaq 0x2d302(%rip), %rdi     # 0x42e4b
leaq 0x2c2b8(%rip), %rsi     # 0x41e08
leaq 0x2d31d(%rip), %rcx     # 0x42e74
movl $0x433, %edx            # imm = 0x433
callq 0xb180
leaq 0x2d34e(%rip), %rdi     # 0x42eb6
leaq 0x2c299(%rip), %rsi     # 0x41e08
leaq 0x2d2fe(%rip), %rcx     # 0x42e74
movl $0x463, %edx            # imm = 0x463
callq 0xb180