// File: vsklad[P]cgen/./bal/cnf/encoding/cnfencoding.cpp
// Function: bal::add(bal::Cnf&, unsigned int*, unsigned long, unsigned long, unsigned int, bool)
void add(Cnf& formula, literalid_t args[],
             const std::size_t input_size, const std::size_t output_size,
             const literalid_t constant, const bool b_2nd_c1) {
        _assert_level_0(input_size > 1);
        _assert_level_0(output_size >= 1 && output_size <= 3);
        _assert_level_0(literal_t__is_constant(constant) && (constant == 0 || constant == 1));
        _assert_level_0(!b_2nd_c1 || input_size == 3);
        _assert_level_0(!b_2nd_c1 || output_size == 2);
        
        bool is_2nd_carry = output_size == 3 && !b_2nd_c1;
        const addition_map_entry_t* p_map = b_2nd_c1 ? &ADD_31_C1_I0O2xC1_MAP : &(ADD_MAP[input_size][constant][is_2nd_carry]);
        
        formula.record_clauses(p_map->map, p_map->map_size, args, input_size, output_size);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %r9b, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
andb $0x1, %al
movb %al, -0x25(%rbp)
cmpq $0x1, -0x18(%rbp)
jbe 0x1378d
jmp 0x137ac
leaq 0x48925(%rip), %rdi     # 0x5c0b9
leaq 0x48609(%rip), %rsi     # 0x5bda4
movl $0x5a, %edx
leaq 0x48921(%rip), %rcx     # 0x5c0c8
callq 0xd1c0
xorl %eax, %eax
cmpq $0x1, -0x20(%rbp)
movb %al, -0x31(%rbp)
jb 0x137c3
cmpq $0x3, -0x20(%rbp)
setbe %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x137cc
jmp 0x137ce
jmp 0x137ed
leaq 0x4895c(%rip), %rdi     # 0x5c131
leaq 0x485c8(%rip), %rsi     # 0x5bda4
movl $0x5b, %edx
leaq 0x488e0(%rip), %rcx     # 0x5c0c8
callq 0xd1c0
xorl %eax, %eax
cmpl $0x1, -0x24(%rbp)
movb %al, -0x32(%rbp)
ja 0x13813
movb $0x1, %al
cmpl $0x0, -0x24(%rbp)
movb %al, -0x33(%rbp)
je 0x1380d
cmpl $0x1, -0x24(%rbp)
sete %al
movb %al, -0x33(%rbp)
movb -0x33(%rbp), %al
movb %al, -0x32(%rbp)
movb -0x32(%rbp), %al
testb $0x1, %al
jne 0x1381c
jmp 0x1381e
jmp 0x1383d
leaq 0x48931(%rip), %rdi     # 0x5c156
leaq 0x48578(%rip), %rsi     # 0x5bda4
movl $0x5c, %edx
leaq 0x48890(%rip), %rcx     # 0x5c0c8
callq 0xd1c0
movb $0x1, %al
testb $0x1, -0x25(%rbp)
movb %al, -0x34(%rbp)
je 0x13853
cmpq $0x3, -0x18(%rbp)
sete %al
movb %al, -0x34(%rbp)
movb -0x34(%rbp), %al
testb $0x1, %al
jne 0x1385c
jmp 0x1385e
jmp 0x1387d
leaq 0x48940(%rip), %rdi     # 0x5c1a5
leaq 0x48538(%rip), %rsi     # 0x5bda4
movl $0x5d, %edx
leaq 0x48850(%rip), %rcx     # 0x5c0c8
callq 0xd1c0
movb $0x1, %al
testb $0x1, -0x25(%rbp)
movb %al, -0x35(%rbp)
je 0x13893
cmpq $0x2, -0x20(%rbp)
sete %al
movb %al, -0x35(%rbp)
movb -0x35(%rbp), %al
testb $0x1, %al
jne 0x1389c
jmp 0x1389e
jmp 0x138bd
leaq 0x4891d(%rip), %rdi     # 0x5c1c2
leaq 0x484f8(%rip), %rsi     # 0x5bda4
movl $0x5e, %edx
leaq 0x48810(%rip), %rcx     # 0x5c0c8
callq 0xd1c0
xorl %eax, %eax
cmpq $0x3, -0x20(%rbp)
movb %al, -0x36(%rbp)
jne 0x138d1
movb -0x25(%rbp), %al
xorb $-0x1, %al
movb %al, -0x36(%rbp)
movb -0x36(%rbp), %al
andb $0x1, %al
movb %al, -0x26(%rbp)
testb $0x1, -0x25(%rbp)
je 0x138ec
leaq 0x6b39a(%rip), %rax     # 0x7ec80
movq %rax, -0x40(%rbp)
jmp 0x1391c
movq -0x18(%rbp), %rcx
leaq 0x6b399(%rip), %rax     # 0x7ec90
shlq $0x6, %rcx
addq %rcx, %rax
movl -0x24(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movb -0x26(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rsi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %r8
movq -0x20(%rbp), %r9
callq 0x13b20
addq $0x40, %rsp
popq %rbp
retq
nop