// File: vsklad[P]cgen/./bal/cnf/cnf/cnfclausescontainer.hpp
// Function: bal::CnfClausesIndexedContainer<false>::normalize_clause_literals(unsigned int*, unsigned short)
inline static clause_size_t normalize_clause_literals(uint32_t* const literals, const clause_size_t literals_size) {
            assert(literals_size > 0);
            
            std::sort(literals, literals + literals_size);
            
            assert(literal_t__is_variable(literals[0]));
            clause_size_t validated_size = 1;
            for (auto i = 1; i < literals_size; i++) {
                assert(literal_t__is_variable(literals[i]));
                if (literals[i] == literals[validated_size - 1]) {
                    //warning(literals_size, literals, "ignoring duplicate literal");
                    continue;
                } else if (literal_t__is_negation_of(literals[i], literals[validated_size - 1])) {
                    //warning(literals_size, literals, "ignoring the clause, always satisfied");
                    return 0;
                } else {
                    if (validated_size < i) {
                        literals[validated_size] = literals[i];
                    };
                    validated_size++;
                };
            };
            
            return validated_size;
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %si, %ax
movq %rdi, -0x10(%rbp)
movw %ax, -0x12(%rbp)
movzwl -0x12(%rbp), %eax
cmpl $0x0, %eax
jle 0x13e0e
jmp 0x13e2d
leaq 0x49476(%rip), %rdi     # 0x5d28b
leaq 0x49481(%rip), %rsi     # 0x5d29d
movl $0x40, %edx
leaq 0x4949b(%rip), %rcx     # 0x5d2c3
callq 0xd1c0
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
movzwl -0x12(%rbp), %eax
cltq
shlq $0x2, %rax
addq %rax, %rsi
callq 0x145b0
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpl $0x1, (%rcx)
movb %al, -0x19(%rbp)
jbe 0x13e62
movq -0x10(%rbp), %rax
cmpl $-0x2, (%rax)
setbe %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
testb $0x1, %al
jne 0x13e6b
jmp 0x13e6d
jmp 0x13e8c
leaq 0x494e9(%rip), %rdi     # 0x5d35d
leaq 0x49422(%rip), %rsi     # 0x5d29d
movl $0x44, %edx
leaq 0x4943c(%rip), %rcx     # 0x5d2c3
callq 0xd1c0
movw $0x1, -0x14(%rbp)
movl $0x1, -0x18(%rbp)
movl -0x18(%rbp), %eax
movzwl -0x12(%rbp), %ecx
cmpl %ecx, %eax
jge 0x13f7d
movq -0x10(%rbp), %rcx
movslq -0x18(%rbp), %rdx
xorl %eax, %eax
cmpl $0x1, (%rcx,%rdx,4)
movb %al, -0x1a(%rbp)
jbe 0x13ecd
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
cmpl $-0x2, (%rax,%rcx,4)
setbe %al
movb %al, -0x1a(%rbp)
movb -0x1a(%rbp), %al
testb $0x1, %al
jne 0x13ed6
jmp 0x13ed8
jmp 0x13ef7
leaq 0x494a2(%rip), %rdi     # 0x5d381
leaq 0x493b7(%rip), %rsi     # 0x5d29d
movl $0x47, %edx
leaq 0x493d1(%rip), %rcx     # 0x5d2c3
callq 0xd1c0
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
movzwl -0x14(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jne 0x13f17
jmp 0x13f6f
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
movzwl -0x14(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
xorl (%rcx,%rdx,4), %eax
cmpl $0x1, %eax
jne 0x13f40
movw $0x0, -0x2(%rbp)
jmp 0x13f85
movzwl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x13f5f
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x10(%rbp), %rax
movzwl -0x14(%rbp), %ecx
movl %edx, (%rax,%rcx,4)
movw -0x14(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x14(%rbp)
jmp 0x13f6d
jmp 0x13f6f
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x13e99
movw -0x14(%rbp), %ax
movw %ax, -0x2(%rbp)
movw -0x2(%rbp), %ax
addq $0x20, %rsp
popq %rbp
retq
nop