// File: vsklad[P]cgen/./bal/cnf/encoding/cnfencoding.cpp
// Function: bal::eor(bal::Cnf*, unsigned int, unsigned int const*, unsigned long)
void eor(Cnf* const formula, const literalid_t r, const literalid_t args[], const std::size_t args_size) {
        // more than one variable, generate 2^(N-1) clauses
        _assert_level_0(formula != nullptr);
        _assert_level_1(args_size > 1 && args_size < MAX_XOR_SIZE); // args_size + 1 for result
        literalid_t clause_args[args_size + 1];
        
        for (uint32_t i = 0; i < (1 << args_size); i++) {
            // i bits can be used to determine the negation and the result
            literalid_t constant = 0b0;
            for (auto j = 0; j < args_size; j++) {
                clause_args[j] = literal_t__negated_onlyif(args[j], i & (0x1 << j));
                literal_t__negate_onlyif(constant, i & (0x1 << j));
            };
            clause_args[args_size] = literal_t__negated_onlyif(r, literal_t__is_constant_0(constant));
            formula->append_clause(clause_args, args_size + 1);
        };
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x12fa0
jmp 0x12fbf
leaq 0x53e55(%rip), %rdi     # 0x66dfc
leaq 0x48df6(%rip), %rsi     # 0x5bda4
movl $0x10, %edx
leaq 0x48e0d(%rip), %rcx     # 0x5bdc7
callq 0xd1c0
xorl %eax, %eax
cmpq $0x1, -0x20(%rbp)
movb %al, -0x3d(%rbp)
jbe 0x12fd6
cmpq $0x20, -0x20(%rbp)
setb %al
movb %al, -0x3d(%rbp)
movb -0x3d(%rbp), %al
testb $0x1, %al
jne 0x12fdf
jmp 0x12fe1
jmp 0x13000
leaq 0x48e34(%rip), %rdi     # 0x5be1c
leaq 0x48db5(%rip), %rsi     # 0x5bda4
movl $0x11, %edx
leaq 0x48dcc(%rip), %rcx     # 0x5bdc7
callq 0xd1c0
movq -0x20(%rbp), %rcx
movq %rcx, %rax
incq %rax
movq %rsp, %rdx
movq %rdx, -0x28(%rbp)
leaq 0x13(,%rcx,4), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x48(%rbp)
movq %rcx, %rsp
movq %rax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x20(%rbp), %rcx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
cmpl %ecx, %eax
jae 0x13112
movl $0x0, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movslq -0x3c(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x130cc
movq -0x48(%rbp), %rax
movq -0x18(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
movl (%rcx,%rdx,4), %edx
movl -0x34(%rbp), %edi
movl -0x3c(%rbp), %ecx
movl $0x1, %esi
shll %cl, %esi
movl %esi, %ecx
andl %ecx, %edi
xorl %ecx, %ecx
movl $0x1, %esi
cmpl $0x0, %edi
cmovnel %esi, %ecx
xorl %ecx, %edx
movslq -0x3c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x38(%rbp), %eax
movl -0x34(%rbp), %esi
movl -0x3c(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %esi
xorl %ecx, %ecx
movl $0x1, %edx
cmpl $0x0, %esi
cmovnel %edx, %ecx
xorl %ecx, %eax
movl %eax, -0x38(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x1305b
movq -0x48(%rbp), %rsi
movl -0xc(%rbp), %ecx
movl -0x38(%rbp), %edi
xorl %eax, %eax
movl $0x1, %edx
cmpl $0x0, %edi
cmovel %edx, %eax
xorl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rsi,%rax,4)
movq -0x8(%rbp), %rdi
addq $0x78, %rdi
movq -0x20(%rbp), %rax
addq $0x1, %rax
movzwl %ax, %edx
callq 0x13950
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x13035
movq -0x28(%rbp), %rax
movq %rax, %rsp
movq %rbp, %rsp
popq %rbp
retq
nop