// File: vsklad[P]cgen/./bal/cnf/io/cnfvig.hpp
// Function: void bal::CnfVigStreamWriter<true, false>::compute_edge<false>(unsigned int const*, unsigned int, std::map<unsigned long, bal::CnfVigStreamWriter<true, false>::__edge_data_t, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, bal::CnfVigStreamWriter<true, false>::__edge_data_t>>>&, unsigned int&)
void compute_edge(const uint32_t* const p_clause, const timestamp_t timestamp,
                          edges_data_t& edges, unsigned& next_edge_id) {
            // iterate literal pairs
            // it is guaranteed that the sequence is sorted and no duplicates exist
            // weight is calculated such that the sum of weights of edges generated from a clause is 1
            for (auto i = 0; i < _clause_size(p_clause); i++) {
                if (_clause_size(p_clause) > 1) {
                    // determine weight and cardinality contribution to each edge
                    for (auto j = i + 1; j < _clause_size(p_clause); j++) {
                        const variableid_t source = literal_t__variable_id(_clause_literal(p_clause, i));
                        const variableid_t target = literal_t__variable_id(_clause_literal(p_clause, j));
                        const uint64_t key = ((uint64_t)target << 32) | source;
                        
                        // check if the adge exists already; ignore if so, add otherwise
                        auto it = edges.find(key);
                        if (it == edges.end()) {
                            _assert_level_1(!REMOVE);
                            edge_data_t edge_data;
                            edge_data.id = next_edge_id++;
                            edge_data.update(*p_clause, eaInsert, timestamp);
                            edges.insert({key, edge_data});
                        } else {
                            it->second.update(*p_clause, (REMOVE ? eaRemove : eaUpdate), timestamp);
                        };
                    };
                };
            };
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fff, %ecx           # imm = 0x7FFF
cmpl %ecx, %eax
jae 0x3e04d
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0x7fff, %eax           # imm = 0x7FFF
cmpl $0x1, %eax
jbe 0x3e03d
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
andl $0x7fff, %ecx           # imm = 0x7FFF
cmpl %ecx, %eax
jae 0x3e03b
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl 0x4(%rax,%rcx,4), %eax
shrl %eax
subl $0x1, %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl 0x4(%rax,%rcx,4), %eax
shrl %eax
subl $0x1, %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
shlq $0x20, %rax
movl -0x34(%rbp), %ecx
orq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x3e060
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rdi
callq 0x3e0c0
movq %rax, -0x50(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x3e090
testb $0x1, %al
jne 0x3df9a
jmp 0x3e008
leaq -0x68(%rbp), %rdi
callq 0x3e0f0
movq -0x28(%rbp), %rcx
movl (%rcx), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, (%rcx)
movl %eax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %esi
movl -0x14(%rbp), %ecx
leaq -0x68(%rbp), %rdi
xorl %edx, %edx
callq 0x3e110
movq -0x20(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x68(%rbp), %rdx
callq 0x3e1a0
movq -0xa0(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x3e160
movq %rax, -0x98(%rbp)
movb %dl, -0x90(%rbp)
jmp 0x3e02b
leaq -0x48(%rbp), %rdi
callq 0x3e1e0
movq %rax, %rdi
addq $0x8, %rdi
movq -0x10(%rbp), %rax
movl (%rax), %esi
movl -0x14(%rbp), %ecx
movl $0x1, %edx
callq 0x3e110
jmp 0x3e02d
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x3df19
jmp 0x3e03d
jmp 0x3e03f
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x3dee5
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)