// File: /workspace/github_cpp_makefile_star2_O2/vsklad[P]cgen/./bal/cnf/processor/cnfsubsumption.cpp
// Function: bal::processor_result_t bal::CnfSubsumptionOptimizer::process_clause_subsumption_ca<(unsigned short)3>(unsigned int*)
inline processor_result_t CnfSubsumptionOptimizer::process_clause_subsumption_ca(uint32_t* const p_clause) {
        static_assert(_clause_size_is_aggregated(ca_size), "invalid clause size");
        _assert_level_0(ca_size == _clause_size(p_clause));
        
        CnfProcessor::clauses_iterator_t<ca_size> iterator(clauses_index_, *this);
        container_offset_t ca_variables[ca_size];
        for (auto i = 0; i < ca_size; i++) {
            ca_variables[i] = literal_t__variable_id(_clause_literal(p_clause, i));
        };
        container_offset_t ci_offset = iterator.first(ca_variables);
        while (ci_offset != CLAUSES_END) {
            uint32_t* p_ci = _clauses_offset_clause(clauses_data_, ci_offset);
            const clause_size_t ci_size = _clause_size(p_ci);
            if (ca_size == 2) {
                if (iterator.instance_bits == 0b11) {
                    if (ci_size == 3) {
                        if (_clause_literal(p_clause, 0) == _clause_literal(p_ci, 1)) {
                            __process_clause_subsumption_caca<2, 3, 1, 2>(p_clause, p_ci);
                        } else if (_clause_literal(p_clause, 1) == _clause_literal(p_ci, 1)) {
                            __process_clause_subsumption_caca<2, 3, 0, 1>(p_clause, p_ci);
                        } else {
                            __process_clause_subsumption_caca<2, 3, 0, 2>(p_clause, p_ci);
                        };
                    } else if (ci_size == 4) {
                        if (_clause_literal(p_clause, 0) == _clause_literal(p_ci, 2)) {
                            __process_clause_subsumption_caca<2, 4, 2, 3>(p_clause, p_ci);
                        } else if (_clause_literal(p_clause, 1) == _clause_literal(p_ci, 1)) {
                            __process_clause_subsumption_caca<2, 4, 0, 1>(p_clause, p_ci);
                        } else if (_clause_literal(p_clause, 0) == _clause_literal(p_ci, 0)) {
                            if (_clause_literal(p_clause, 1) == _clause_literal(p_ci, 2)) {
                                __process_clause_subsumption_caca<2, 4, 0, 2>(p_clause, p_ci);
                            } else {
                                __process_clause_subsumption_caca<2, 4, 0, 3>(p_clause, p_ci);
                            };
                        } else {
                            if (_clause_literal(p_clause, 1) == _clause_literal(p_ci, 2)) {
                                __process_clause_subsumption_caca<2, 4, 1, 2>(p_clause, p_ci);
                            } else {
                                __process_clause_subsumption_caca<2, 4, 1, 3>(p_clause, p_ci);
                            };
                        };
                    };
                };
            } else if (ca_size == 3) {
                if (ci_size == 2) {
                    switch(iterator.instance_bits) {
                        case 0b0011:
                            __process_clause_subsumption_caca<2, 3, 0, 1>(p_ci, p_clause);
                            break;
                        case 0b0101:
                            __process_clause_subsumption_caca<2, 3, 0, 2>(p_ci, p_clause);
                            break;
                        case 0b0110:
                            __process_clause_subsumption_caca<2, 3, 1, 2>(p_ci, p_clause);
                            break;
                    };
                } else if (ci_size == 4 && iterator.instance_bits == 0b0111) {
                    if (_clause_literal(p_clause, 0) == _clause_literal(p_ci, 1)) {
                        __process_clause_subsumption_caca<3, 4, 1, 2, 3>(p_clause, p_ci);
                    } else if (_clause_literal(p_clause, 2) == _clause_literal(p_ci, 2)) {
                        __process_clause_subsumption_caca<3, 4, 0, 1, 2>(p_clause, p_ci);
                    } else if (_clause_literal(p_clause, 1) == _clause_literal(p_ci, 1)) {
                        __process_clause_subsumption_caca<3, 4, 0, 1, 3>(p_clause, p_ci);
                    } else {
                        _assert_level_3(_clause_literal(p_clause, 1) == _clause_literal(p_ci, 2));
                        __process_clause_subsumption_caca<3, 4, 0, 2, 3>(p_clause, p_ci);
                    };
                };
            } else if (ca_size == 4) {
                if (ci_size == 2) {
                    switch(iterator.instance_bits) {
                        case 0b0011:
                            __process_clause_subsumption_caca<2, 4, 0, 1>(p_ci, p_clause);
                            break;
                        case 0b0101:
                            __process_clause_subsumption_caca<2, 4, 0, 2>(p_ci, p_clause);
                            break;
                        case 0b0110:
                            __process_clause_subsumption_caca<2, 4, 1, 2>(p_ci, p_clause);
                            break;
                        case 0b1001:
                            __process_clause_subsumption_caca<2, 4, 0, 3>(p_ci, p_clause);
                            break;
                        case 0b1010:
                            __process_clause_subsumption_caca<2, 4, 1, 3>(p_ci, p_clause);
                            break;
                        case 0b1100:
                            __process_clause_subsumption_caca<2, 4, 2, 3>(p_ci, p_clause);
                            break;
                    };
                } else if (ci_size == 3) {
                    switch(iterator.instance_bits) {
                        case 0b0111:
                            __process_clause_subsumption_caca<3, 4, 0, 1, 2>(p_ci, p_clause);
                            break;
                        case 0b1011:
                            __process_clause_subsumption_caca<3, 4, 0, 1, 3>(p_ci, p_clause);
                            break;
                        case 0b1101:
                            __process_clause_subsumption_caca<3, 4, 0, 2, 3>(p_ci, p_clause);
                            break;
                        case 0b1110:
                            __process_clause_subsumption_caca<3, 4, 1, 2, 3>(p_ci, p_clause);
                            break;
                    };
                };
            };
            
            if (_clause_is_included(p_clause)) {
                ci_offset = iterator.next();
            } else {
                break;
            };
        };
        
        return erUndetermined;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
movl $0x7fff, %eax           # imm = 0x7FFF
andl (%rsi), %eax
cmpl $0x3, %eax
jne 0x15844
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x30(%rdi), %rax
leaq -0x44(%rbp), %rcx
movq %rax, -0x5c(%rcx)
movq %rdi, 0x4(%rcx)
movq %rcx, 0xc(%rcx)
pushq $0x1
popq %rax
cmpq $0x4, %rax
je 0x1574f
movl (%rbx,%rax,4), %ecx
shrl %ecx
decl %ecx
movl %ecx, -0x30(%rbp,%rax,4)
incq %rax
jmp 0x15739
leaq -0xa0(%rbp), %r15
leaq -0x2c(%rbp), %rsi
movq %r15, %rdi
callq 0x15de4
movl $0x7fff, %r12d          # imm = 0x7FFF
cmpl $-0x1, %eax
je 0x15832
movq 0x18(%r14), %rcx
movq (%rcx), %rcx
movl %eax, %eax
leaq (%rcx,%rax,4), %rsi
addq $0xc, %rsi
movl (%rsi), %edx
andl %r12d, %edx
cmpl $0x4, %edx
je 0x157b7
cmpl $0x2, %edx
jne 0x1581f
movq -0x38(%rbp), %rax
movl (%rax), %eax
cmpl $0x6, %eax
je 0x157e3
cmpl $0x5, %eax
je 0x157d6
cmpl $0x3, %eax
jne 0x1581f
movq %rsi, %rdi
movq %rbx, %rsi
callq 0x15a56
jmp 0x1581f
movq -0x38(%rbp), %rdx
cmpl $0x7, (%rdx)
jne 0x1581f
leaq (%rcx,%rax,4), %rcx
movl 0x14(%rcx), %eax
cmpl %eax, 0x4(%rbx)
jne 0x157f0
movq %rbx, %rdi
callq 0x15eb9
jmp 0x1581f
movq %rsi, %rdi
movq %rbx, %rsi
callq 0x15a8f
jmp 0x1581f
movq %rsi, %rdi
movq %rbx, %rsi
callq 0x159fe
jmp 0x1581f
movl 0x18(%rcx), %ecx
cmpl %ecx, 0xc(%rbx)
jne 0x15802
movq %rbx, %rdi
callq 0x15f11
jmp 0x1581f
movl 0x8(%rbx), %edx
cmpl %eax, %edx
jne 0x15813
movq %rbx, %rdi
callq 0x15f4a
jmp 0x1581f
cmpl %ecx, %edx
jne 0x1585d
movq %rbx, %rdi
callq 0x15f9b
testb $-0x80, 0x1(%rbx)
jne 0x15832
movq %r15, %rdi
callq 0x15ff4
jmp 0x15768
xorl %eax, %eax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x21512(%rip), %rdi     # 0x36d5d
leaq 0x2153a(%rip), %rsi     # 0x36d8c
leaq 0x21868(%rip), %rcx     # 0x370c1
pushq $0x2a
jmp 0x15874
leaq 0x218db(%rip), %rdi     # 0x3713f
leaq 0x21521(%rip), %rsi     # 0x36d8c
leaq 0x2184f(%rip), %rcx     # 0x370c1
pushq $0x68
popq %rdx
callq 0xc180