// File: /workspace/github_cpp_makefile_star2_O1/vsklad[P]cgen/./bal/cnf/processor/cnfsubsumption.cpp
// Function: bal::processor_result_t bal::CnfSubsumptionOptimizer::process_clause_subsumption_ca<(unsigned short)4>(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 %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl $0x7fff, %eax           # imm = 0x7FFF
andl (%rsi), %eax
cmpl $0x4, %eax
jne 0x19931
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x30(%rdi), %rax
leaq -0x54(%rbp), %rcx
movq %rax, -0x74(%rcx)
movq %rdi, 0x4(%rcx)
movq %rcx, 0xc(%rcx)
xorl %eax, %eax
movl 0x4(%rbx,%rax,4), %ecx
shrl %ecx
decl %ecx
movl %ecx, -0x40(%rbp,%rax,4)
incq %rax
cmpq $0x4, %rax
jne 0x1951a
leaq -0x60(%rbp), %rax
movq $0x0, (%rax)
movl 0x68(%r14), %edx
movq 0x60(%r14), %rsi
xorl %ecx, %ecx
xorl %edi, %edi
movl -0x40(%rbp,%rcx,4), %r10d
movl $0xffffffff, %r9d       # imm = 0xFFFFFFFF
cmpl %edx, %r10d
jae 0x1955a
movl (%rsi,%r10,4), %r9d
cmpl $-0x1, %r9d
je 0x195be
leaq (%rcx,%rcx,2), %r8
leaq (%rax,%r8,8), %r8
addq $-0x60, %r8
movl $0x1, %r11d
shll %cl, %r11d
movl %r11d, (%r8)
movl %r10d, 0x4(%r8)
movl $0xffffffff, 0x8(%r8)   # imm = 0xFFFFFFFF
movl %r9d, 0xc(%r8)
testq %rdi, %rdi
je 0x19593
cmpl %r9d, 0xc(%rdi)
jbe 0x1959e
movq %rdi, %r10
movq %rax, %r11
movq %r8, %rdi
jmp 0x195b7
movq %rdi, %r10
movq %r10, %r11
movq 0x10(%r10), %r10
testq %r10, %r10
je 0x195b3
cmpl %r9d, 0xc(%r10)
jb 0x195a1
addq $0x10, %r11
movq %r10, 0x10(%r8)
movq %r8, (%r11)
incq %rcx
cmpq $0x4, %rcx
jne 0x19546
movq -0x60(%rbp), %rax
testq %rax, %rax
je 0x195f0
movq 0x38(%r14), %rcx
movl 0xc(%rax), %eax
movl 0x4(%rcx,%rax,8), %eax
leaq -0xc8(%rbp), %rdi
movl %eax, 0x70(%rdi)
callq 0x19b50
jmp 0x195f5
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
leaq 0x2d734(%rip), %r12     # 0x46d30
leaq 0x2d74d(%rip), %r13     # 0x46d50
cmpl $-0x1, %eax
je 0x1991d
movq 0x18(%r14), %rcx
movq (%rcx), %rcx
movl %eax, %edx
movl 0xc(%rcx,%rdx,4), %edx
movl %edx, %ecx
andl $0x7fff, %ecx           # imm = 0x7FFF
cmpl $0x3, %ecx
je 0x1966b
cmpl $0x2, %ecx
jne 0x198d2
movq -0x48(%rbp), %rcx
movl (%rcx), %ecx
addl $-0x3, %ecx
cmpl $0x9, %ecx
ja 0x198d2
movslq (%r13,%rcx,4), %rcx
addq %r13, %rcx
jmpq *%rcx
movl (%rbx), %ecx
movl %ecx, %esi
shrl $0x10, %esi
shrl $0x10, %edx
movl %edx, %edi
shll $0x4, %edi
orl %edx, %edi
movl %edi, %edx
shll $0x8, %edx
orl %edi, %edx
movzwl %dx, %edi
jmp 0x1982d
movq -0x48(%rbp), %rcx
movl (%rcx), %ecx
addl $-0x7, %ecx
cmpl $0x7, %ecx
ja 0x198d2
movslq (%r12,%rcx,4), %rcx
addq %r12, %rcx
jmpq *%rcx
movl (%rbx), %ecx
movl %ecx, %esi
shrl $0x10, %esi
shrl $0x10, %edx
movl %edx, %edi
shll $0x8, %edi
movzwl %di, %edi
orl %edx, %edi
jmp 0x1982d
movl (%rbx), %ecx
movl %ecx, %esi
shrl $0x10, %esi
movl %edx, %edi
shrl $0x10, %edi
andl $0x3, %edi
movl %edx, %r8d
shrl $0xe, %r8d
andl $0x30, %r8d
orl %edi, %r8d
movl %edx, %edi
shrl $0xc, %edi
andl $0x300, %edi            # imm = 0x300
orl %r8d, %edi
shrl $0xa, %edx
andl $0x3000, %edx           # imm = 0x3000
orl %edi, %edx
leal (%rdx,%rdx,4), %edi
jmp 0x1982d
movl (%rbx), %ecx
movl %ecx, %esi
shrl $0x10, %esi
movl %edx, %edi
shrl $0x10, %edi
andl $0xf, %edi
movl %edx, %r8d
shrl $0xc, %r8d
andl $0xff0, %r8d            # imm = 0xFF0
orl %edi, %r8d
shrl $0x8, %edx
andl $0xf000, %edx           # imm = 0xF000
orl %r8d, %edx
movl %edx, %edi
notl %edi
andl %esi, %edi
je 0x198ca
testl %edx, %esi
je 0x198d2
shll $0x10, %edi
movzwl %cx, %ecx
orl %edi, %ecx
jmp 0x198d0
movl (%rbx), %ecx
movl %ecx, %esi
shrl $0x10, %esi
movl %edx, %edi
shrl $0x10, %edi
andl $0x1, %edi
movl %edx, %r8d
shrl $0xf, %r8d
andl $0x4, %r8d
orl %edi, %r8d
movl %edx, %edi
shrl $0xe, %edi
andl $0x10, %edi
orl %r8d, %edi
movl %edx, %r8d
shrl $0xd, %r8d
andl $0x40, %r8d
orl %edi, %r8d
movl %edx, %edi
shrl $0xc, %edi
andl $0x100, %edi            # imm = 0x100
orl %r8d, %edi
movl %edx, %r8d
shrl $0xb, %r8d
andl $0x400, %r8d            # imm = 0x400
orl %edi, %r8d
movl %edx, %edi
shrl $0xa, %edi
andl $0x1000, %edi           # imm = 0x1000
orl %r8d, %edi
shrl $0x9, %edx
andl $0x4000, %edx           # imm = 0x4000
orl %edi, %edx
leal (%rdx,%rdx), %edi
orl %edx, %edi
movzwl %di, %edi
jmp 0x1982d
movl (%rbx), %ecx
movl %ecx, %esi
shrl $0x10, %esi
movl %edx, %edi
shrl $0x10, %edi
andl $0x1, %edi
movl %edx, %r8d
shrl $0xf, %r8d
andl $0x4, %r8d
orl %edi, %r8d
movl %edx, %edi
shrl $0xe, %edi
andl $0x10, %edi
orl %r8d, %edi
shrl $0xd, %edx
andl $0x40, %edx
orl %edi, %edx
imull $0x303, %edx, %edi      # imm = 0x303
jmp 0x1982d
shrl $0x10, %edx
leal -0x1(%rdx), %esi
cmpl $0x7, %esi
ja 0x19950
movl (%rbx), %ecx
leaq 0x2d583(%rip), %rdi     # 0x46d78
movslq (%rdi,%rsi,4), %rsi
addq %rdi, %rsi
jmpq *%rsi
cmpl $0x4, %edx
movl $0xf000, %edx           # imm = 0xF000
movl $0xf00, %esi            # imm = 0xF00
jmp 0x198ac
movl (%rbx), %ecx
movl %ecx, %esi
shrl $0x10, %esi
movl %edx, %edi
shrl $0x10, %edi
andl $0x3, %edi
shrl $0xe, %edx
andl $0x30, %edx
orl %edi, %edx
imull $0x505, %edx, %edi      # imm = 0x505
movl %edi, %edx
notl %edx
andl %esi, %edx
je 0x198ca
testl %edi, %esi
je 0x198d2
shll $0x10, %edx
movzwl %cx, %ecx
orl %edx, %ecx
jmp 0x198d0
shrl $0x10, %edx
leal -0x1(%rdx), %esi
cmpl $0x7, %esi
ja 0x1997e
movl (%rbx), %ecx
leaq 0x2d552(%rip), %rdi     # 0x46db8
movslq (%rdi,%rsi,4), %rsi
addq %rdi, %rsi
jmpq *%rsi
cmpl $0x4, %edx
movl $0xaa00, %edx           # imm = 0xAA00
movl $0x5500, %esi           # imm = 0x5500
jmp 0x198ac
shrl $0x10, %edx
leal -0x1(%rdx), %esi
cmpl $0x7, %esi
ja 0x19967
movl (%rbx), %ecx
leaq 0x2d502(%rip), %rdi     # 0x46d98
movslq (%rdi,%rsi,4), %rsi
addq %rdi, %rsi
jmpq *%rsi
cmpl $0x4, %edx
movl $0xcc00, %edx           # imm = 0xCC00
movl $0x3300, %esi           # imm = 0x3300
cmovel %esi, %edx
movl %ecx, %edi
shrl $0x10, %edi
movl %edx, %esi
notl %esi
andl %edi, %esi
je 0x198ca
testl %edi, %edx
je 0x198d2
shll $0x10, %esi
movzwl %cx, %ecx
orl %esi, %ecx
jmp 0x198d0
orl $0x8000, %ecx           # imm = 0x8000
movl %ecx, (%rbx)
movl (%rbx), %r15d
testw %r15w, %r15w
js 0x198e7
leaq -0xc8(%rbp), %rdi
callq 0x19b50
testw %r15w, %r15w
jns 0x19603
jmp 0x1991d
movl $0xf0, %edx
jmp 0x198af
movl $0xf, %edx
jmp 0x198af
movl $0xaa, %edx
jmp 0x198af
movl $0x55, %edx
jmp 0x198af
movl $0xcc, %edx
jmp 0x198af
movl $0x33, %edx
jmp 0x198af
xorl %eax, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2d4d5(%rip), %rdi     # 0x46e0d
leaq 0x2d4fd(%rip), %rsi     # 0x46e3c
leaq 0x2d8d4(%rip), %rcx     # 0x4721a
movl $0x2a, %edx
callq 0xc180
leaq 0x2d58a(%rip), %rdi     # 0x46ee1
leaq 0x2b82e(%rip), %rsi     # 0x4518c
leaq 0x2d5cf(%rip), %rcx     # 0x46f34
jmp 0x19993
leaq 0x2d573(%rip), %rdi     # 0x46ee1
leaq 0x2b817(%rip), %rsi     # 0x4518c
leaq 0x2d736(%rip), %rcx     # 0x470b2
jmp 0x19993
leaq 0x2d55c(%rip), %rdi     # 0x46ee1
leaq 0x2b800(%rip), %rsi     # 0x4518c
leaq 0x2d660(%rip), %rcx     # 0x46ff3
movl $0xaf, %edx
callq 0xc180
nop