// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl $0x7fff, %eax           # imm = 0x7FFF
andl (%rsi), %eax
cmpl $0x2, %eax
jne 0x16ff8
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x30(%rdi), %rcx
leaq -0x44(%rbp), %rax
movq %rcx, -0x44(%rax)
movq %rdi, 0x4(%rax)
movq %rax, 0xc(%rax)
movl 0x4(%rsi), %ecx
shrl %ecx
decl %ecx
movl %ecx, -0x30(%rbp)
movl 0x8(%rsi), %ecx
shrl %ecx
decl %ecx
movl %ecx, -0x2c(%rbp)
leaq -0x50(%rbp), %rdx
movq $0x0, (%rdx)
movl 0x68(%rdi), %esi
movq 0x60(%rdi), %rdi
xorl %ecx, %ecx
xorl %r8d, %r8d
movl -0x30(%rbp,%rcx,4), %r11d
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
cmpl %esi, %r11d
jae 0x16e2e
movl (%rdi,%r11,4), %r10d
cmpl $-0x1, %r10d
je 0x16e92
leaq (%rcx,%rcx,2), %r9
leaq (%rax,%r9,8), %r9
addq $-0x3c, %r9
movl $0x1, %r15d
shll %cl, %r15d
movl %r15d, (%r9)
movl %r11d, 0x4(%r9)
movl $0xffffffff, 0x8(%r9)   # imm = 0xFFFFFFFF
movl %r10d, 0xc(%r9)
testq %r8, %r8
je 0x16e67
cmpl %r10d, 0xc(%r8)
jbe 0x16e72
movq %r8, %r11
movq %rdx, %r15
movq %r9, %r8
jmp 0x16e8b
movq %r8, %r11
movq %r11, %r15
movq 0x10(%r11), %r11
testq %r11, %r11
je 0x16e87
cmpl %r10d, 0xc(%r11)
jb 0x16e75
addq $0x10, %r15
movq %r11, 0x10(%r9)
movq %r9, (%r15)
leaq 0x1(%rcx), %r9
testq %rcx, %rcx
movq %r9, %rcx
je 0x16e1a
movq -0x50(%rbp), %rax
testq %rax, %rax
je 0x16eca
movq 0x38(%r14), %rcx
movl 0xc(%rax), %eax
movl 0x4(%rcx,%rax,8), %eax
leaq -0x88(%rbp), %rdi
movl %eax, 0x40(%rdi)
callq 0x180ea
movl %eax, %r15d
jmp 0x16ed0
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
xorl %r13d, %r13d
leaq 0x2cee2(%rip), %r12     # 0x43dbc
cmpl $-0x1, %r15d
je 0x16f91
movq 0x18(%r14), %rax
movq (%rax), %rcx
movl %r15d, %esi
movl 0xc(%rcx,%rsi,4), %eax
movl %eax, %edx
andl $0x7fff, %edx           # imm = 0x7FFF
cmpl $0x2, %edx
jne 0x16f74
movq -0x38(%rbp), %rdx
movl (%rdx), %edi
cmpq $0x3, %rdi
ja 0x16f74
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), %ecx
shrl $0x10, %eax
cmpl 0x10(%rdx), %ecx
jne 0x16f63
movzwl %ax, %ecx
movq %r14, %rdi
movq %rbx, %rdx
callq 0x1731a
jmp 0x16f71
movl 0x8(%rbx), %edi
shrl $0x10, %eax
movzwl %ax, %ecx
cmpl 0x10(%rdx), %edi
jne 0x16f56
movq %r14, %rdi
movq %rbx, %rdx
callq 0x179fc
jmp 0x16f71
movq %r14, %rdi
movq %rbx, %rdx
callq 0x17d72
jmp 0x16f71
movzwl %ax, %ecx
movq %r14, %rdi
movq %rbx, %rdx
callq 0x1768a
movl %eax, %r13d
testl %r13d, %r13d
jne 0x16f88
leaq -0x88(%rbp), %rdi
callq 0x180ea
movl %eax, %r15d
testl %r13d, %r13d
je 0x16eda
testl %r13d, %r13d
jne 0x16fa8
movq %r14, %rdi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x141ac
testl %eax, %eax
jne 0x17017
movl %r13d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x32cd1(%rip), %rdi     # 0x49c92
leaq 0x2ce30(%rip), %rsi     # 0x43df8
leaq 0x2de95(%rip), %rcx     # 0x44e64
movl $0x455, %edx            # imm = 0x455
callq 0xc180
leaq 0x32cb2(%rip), %rdi     # 0x49c92
leaq 0x2ce11(%rip), %rsi     # 0x43df8
leaq 0x2de76(%rip), %rcx     # 0x44e64
movl $0x444, %edx            # imm = 0x444
callq 0xc180
leaq 0x2de3c(%rip), %rdi     # 0x44e3b
leaq 0x2cdf2(%rip), %rsi     # 0x43df8
leaq 0x2de57(%rip), %rcx     # 0x44e64
movl $0x433, %edx            # imm = 0x433
callq 0xc180
leaq 0x2de88(%rip), %rdi     # 0x44ea6
leaq 0x2cdd3(%rip), %rsi     # 0x43df8
leaq 0x2de38(%rip), %rcx     # 0x44e64
movl $0x463, %edx            # imm = 0x463
callq 0xc180