// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edx, -0x2c(%rbp)
movq %rsi, %r12
movl (%rsi), %esi
movl %esi, %eax
andl $0x7fff, %eax           # imm = 0x7FFF
je 0x2b545
movq %r8, %rbx
movq %rcx, %r14
addq $0x8, %rcx
movq %rcx, -0x38(%rbp)
cmpl $0x1, %eax
setne %cl
movl $0x1, %r13d
xorl %edx, %edx
movq %rdx, -0x50(%rbp)
incq %rdx
movl %esi, %eax
andl $0x7fff, %eax           # imm = 0x7FFF
testb $0x1, %cl
movq %r13, -0x48(%rbp)
movq %rdx, -0x40(%rbp)
je 0x2b52f
cmpq %rax, %rdx
jae 0x2b52f
movq -0x50(%rbp), %rax
movl 0x4(%r12,%rax,4), %r15d
shrl %r15d
decl %r15d
movl 0x4(%r12,%r13,4), %eax
shrl %eax
decl %eax
shlq $0x20, %rax
orq %rax, %r15
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x2b4af
movq -0x38(%rbp), %rdi
xorl %ecx, %ecx
cmpq %r15, 0x20(%rax)
setb %cl
cmovaeq %rax, %rdi
movq 0x10(%rax,%rcx,8), %rax
testq %rax, %rax
jne 0x2b48c
cmpq -0x38(%rbp), %rdi
je 0x2b4af
cmpq 0x20(%rdi), %r15
jae 0x2b51c
movl $0x0, -0x68(%rbp)
movq $0x0, -0x60(%rbp)
movl (%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, (%rbx)
movl %eax, -0x58(%rbp)
movl (%r12), %esi
leaq -0x68(%rbp), %rdi
xorl %edx, %edx
movl -0x2c(%rbp), %ecx
callq 0x2b554
movq %r15, -0x88(%rbp)
movq -0x58(%rbp), %rax
leaq -0x80(%rbp), %rcx
movq %rax, 0x10(%rcx)
movups -0x68(%rbp), %xmm0
movups %xmm0, (%rcx)
movq %r14, %rdi
leaq -0x88(%rbp), %rsi
callq 0x2b60c
incq %r13
movl (%r12), %esi
movl %esi, %eax
andl $0x7fff, %eax           # imm = 0x7FFF
cmpq %rax, %r13
jb 0x2b460
jmp 0x2b52f
addq $0x28, %rdi
movl $0x1, %edx
movl -0x2c(%rbp), %ecx
callq 0x2b554
jmp 0x2b503
movq -0x48(%rbp), %r13
incq %r13
movb $0x1, %cl
movq -0x40(%rbp), %rdx
cmpq %rax, %rdx
jb 0x2b438
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq