// File: vsklad[P]cgen/./bal/cnf/processor/cnfsubsumption.cpp
// Function: bal::processor_result_t bal::CnfSubsumptionOptimizer::process_clause_subsumption_ca<(unsigned short)2>(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
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
andl $0x7fff, %ecx           # imm = 0x7FFF
movl $0x2, %eax
cmpl %ecx, %eax
jne 0x1fbf5
jmp 0x1fc14
leaq 0x41261(%rip), %rdi     # 0x60e5d
leaq 0x41289(%rip), %rsi     # 0x60e8c
movl $0x2a, %edx
leaq 0x412a4(%rip), %rcx     # 0x60eb3
callq 0xd1c0
movq -0x90(%rbp), %rdx
movq %rdx, %rsi
addq $0x30, %rsi
leaq -0x68(%rbp), %rdi
callq 0x1cd70
movl $0x0, -0x74(%rbp)
cmpl $0x2, -0x74(%rbp)
jge 0x1fc5c
movq -0x10(%rbp), %rax
movslq -0x74(%rbp), %rcx
movl 0x4(%rax,%rcx,4), %ecx
shrl %ecx
subl $0x1, %ecx
movslq -0x74(%rbp), %rax
movl %ecx, -0x70(%rbp,%rax,4)
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x1fc32
leaq -0x70(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x1cda0
movl %eax, -0x78(%rbp)
cmpl $-0x1, -0x78(%rbp)
je 0x1fdff
movq -0x90(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
movl -0x78(%rbp), %ecx
shlq $0x2, %rcx
addq %rcx, %rax
addq $0xc, %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movl (%rax), %eax
andl $0x7fff, %eax           # imm = 0x7FFF
movw %ax, -0x82(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x1fdda
movzwl -0x82(%rbp), %eax
cmpl $0x3, %eax
jne 0x1fd13
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x80(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x1fce0
movq -0x10(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x20320
jmp 0x1fd0e
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x80(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x1fcff
movq -0x10(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x203b0
jmp 0x1fd0c
movq -0x10(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x20440
jmp 0x1fd0e
jmp 0x1fdd8
movzwl -0x82(%rbp), %eax
cmpl $0x4, %eax
jne 0x1fdd6
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x80(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jne 0x1fd45
movq -0x10(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x204d0
jmp 0x1fdd4
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x80(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x1fd64
movq -0x10(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x20560
jmp 0x1fdd2
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x80(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x1fda2
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x80(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jne 0x1fd93
movq -0x10(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x205f0
jmp 0x1fda0
movq -0x10(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x20680
jmp 0x1fdd0
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x80(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jne 0x1fdc1
movq -0x10(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x20710
jmp 0x1fdce
movq -0x10(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x207a0
jmp 0x1fdd0
jmp 0x1fdd2
jmp 0x1fdd4
jmp 0x1fdd6
jmp 0x1fdd8
jmp 0x1fdda
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0x8000, %eax           # imm = 0x8000
cmpl $0x0, %eax
jne 0x1fdf8
leaq -0x68(%rbp), %rdi
callq 0x1e180
movl %eax, -0x78(%rbp)
jmp 0x1fdfa
jmp 0x1fdff
jmp 0x1fc6c
xorl %eax, %eax
addq $0x90, %rsp
popq %rbp
retq
nopw (%rax,%rax)