// File: /workspace/github_cpp_makefile_star2_O1/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 $0x58, %rsp
movq %r8, -0x48(%rbp)
movq %rcx, -0x38(%rbp)
movl %edx, -0x2c(%rbp)
movl $0x7fff, %eax           # imm = 0x7FFF
andl (%rsi), %eax
je 0x2cf44
movq %rsi, %r12
movq -0x38(%rbp), %rcx
leaq 0x8(%rcx), %r13
cmpl $0x1, %eax
setne %al
movl $0x1, %ecx
movq %rcx, -0x40(%rbp)
xorl %ebx, %ebx
testb $0x1, %al
je 0x2cf28
leaq 0x1(%rbx), %rax
movl (%r12), %esi
movl %esi, %ecx
andl $0x7fff, %ecx           # imm = 0x7FFF
cmpq %rcx, %rax
jae 0x2cf28
movq -0x40(%rbp), %r15
movl 0x4(%r12,%rbx,4), %r14d
shrl %r14d
decl %r14d
movl 0x4(%r12,%r15,4), %eax
shrl %eax
decl %eax
shlq $0x20, %rax
orq %rax, %r14
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rcx
movq %r13, %rax
testq %rcx, %rcx
je 0x2ce93
movq %r13, %rax
xorl %edx, %edx
cmpq %r14, 0x20(%rcx)
setb %dl
cmovaeq %rcx, %rax
movq 0x10(%rcx,%rdx,8), %rcx
testq %rcx, %rcx
jne 0x2ce7c
movq %r13, %rdi
cmpq %r13, %rax
je 0x2cea6
cmpq 0x20(%rax), %r14
cmovbq %r13, %rax
movq %rax, %rdi
cmpq %r13, %rdi
je 0x2cebe
addq $0x28, %rdi
movl $0x1, %edx
movl -0x2c(%rbp), %ecx
callq 0x2cf54
jmp 0x2cf11
movl $0x0, -0x60(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x48(%rbp), %rdx
movl (%rdx), %eax
leal 0x1(%rax), %ecx
movl %ecx, (%rdx)
movl %eax, -0x50(%rbp)
movl (%r12), %esi
leaq -0x60(%rbp), %rdi
xorl %edx, %edx
movl -0x2c(%rbp), %ecx
callq 0x2cf54
movq %r14, -0x80(%rbp)
movq -0x50(%rbp), %rax
leaq -0x78(%rbp), %rcx
movq %rax, 0x10(%rcx)
movups -0x60(%rbp), %xmm0
movups %xmm0, (%rcx)
movq -0x38(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x2d00c
incq %r15
movl (%r12), %esi
movl %esi, %eax
andl $0x7fff, %eax           # imm = 0x7FFF
cmpq %rax, %r15
jb 0x2ce4e
incq %rbx
movl (%r12), %ecx
andl $0x7fff, %ecx           # imm = 0x7FFF
incq -0x40(%rbp)
movb $0x1, %al
cmpq %rcx, %rbx
jb 0x2ce29
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop