// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: append_notrans_e(flex_asg_t*, unsigned long*, unsigned long, asg64_v*)
void append_notrans_e(flex_asg_t *fg, uint64_t *a, uint64_t a_n, asg64_v *b)
{
    ma_hit_t_alloc* src = fg->src; int32_t idx, r; 
    uint32_t i, k, v, w; ma_hit_t_alloc *z; asg_arc_t t0, t1; 
    for (i = 0; i < a_n; i++) {
        v = a[i]; 
        z = &(src[v>>1]);
        for (k = i + 1; k < a_n; k++) {
            w = a[k]^1;
            idx = get_specific_overlap(z, v>>1, w>>1);
            if(idx < 0 || z->buffer[idx].del) continue;
            r = ma_hit2arc(&(z->buffer[idx]), Get_READ_LENGTH(R_INF, v>>1), Get_READ_LENGTH(R_INF, w>>1),
						fg->max_hang, fg->max_hang_rate, fg->min_ovlp, &t0);
			if(r < 0) continue;
            if((t0.ul>>32) != v || t0.v != w) continue;
            t0.ou = ((z->buffer[idx].bl>OU_MASK)?OU_MASK:z->buffer[idx].bl);
            // if((v>>1) == 8340 && (w>>1) == 8352) {
            //     fprintf(stderr, "[M::%s] v>>1::%u(%c), w>>1::%u(%c), t0.ou::%u\n", 
            //     __func__, (v>>1), "+-"[v&1], (w>>1), "+-"[w&1], t0.ou);
            // }


            idx = get_specific_overlap(&(src[w>>1]), w>>1, v>>1);
            if(idx < 0 || src[w>>1].buffer[idx].del) continue;
            r = ma_hit2arc(&(src[w>>1].buffer[idx]), Get_READ_LENGTH(R_INF, w>>1), Get_READ_LENGTH(R_INF, v>>1),
						fg->max_hang, fg->max_hang_rate, fg->min_ovlp, &t1);
            if(r < 0) continue;
            if((t1.ul>>32) != (w^1) || t1.v != (v^1)) continue;
            t1.ou = ((src[w>>1].buffer[idx].bl>OU_MASK)?OU_MASK:src[w>>1].buffer[idx].bl);
            // if((v>>1) == 8340 && (w>>1) == 8352) {
            //     fprintf(stderr, "[M::%s] v>>1::%u(%c), w>>1::%u(%c), t1.ou::%u\n", 
            //     __func__, (v>>1), "+-"[v&1], (w>>1), "+-"[w&1], t1.ou);
            // }

            if(trans_check(fg, &t0, b) && trans_check(fg, &t1, b)) {
                push_flex_asg_t(fg, &t0); push_flex_asg_t(fg, &t1);
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, 0x18(%rsp)
movq %rdx, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdi, (%rsp)
movq (%rdi), %rax
movq %rax, 0x20(%rsp)
xorl %eax, %eax
movl %eax, %eax
cmpq 0x30(%rsp), %rax
jae 0x1aac5e
movq 0x28(%rsp), %rcx
movq (%rcx,%rax,8), %rcx
movl %ecx, %edx
movq %rdx, 0x70(%rsp)
movq %rcx, 0x68(%rsp)
shrl %ecx
movq %rcx, 0x8(%rsp)
imulq $0x18, %rcx, %rbp
addq 0x20(%rsp), %rbp
incl %eax
movl %eax, 0x14(%rsp)
movl %eax, %r15d
movl %r15d, %r15d
cmpq 0x30(%rsp), %r15
jae 0x1aac55
movq 0x28(%rsp), %rax
movq (%rax,%r15,8), %r14
movl %r14d, %r13d
shrl %r13d
movq %rbp, %rdi
movq 0x8(%rsp), %rsi
movl %r13d, %edx
callq 0x696ab
testl %eax, %eax
js 0x1aac4d
movq (%rbp), %rdi
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
imulq $0x28, %rax, %rax
movq 0x18(%rdi,%rax), %rbx
testq %rbx, %rbx
js 0x1aac4d
addq %rax, %rdi
leaq 0xa9776(%rip), %rax     # 0x254230
movq 0x18(%rax), %rax
movq 0x8(%rsp), %rcx
movl (%rax,%rcx,8), %esi
movl %r13d, %r12d
movl (%rax,%r12,8), %edx
movq (%rsp), %rax
movl 0x8(%rax), %r8d
movl 0x10(%rax), %ecx
cvtsi2ssq 0x18(%rax), %xmm0
leaq 0x50(%rsp), %r9
callq 0x1aac6d
testl %eax, %eax
js 0x1aac4d
movq 0x70(%rsp), %rax
cmpl %eax, 0x54(%rsp)
jne 0x1aac4d
movl 0x58(%rsp), %eax
xorl %r14d, %eax
cmpl $0x1, %eax
jne 0x1aac4d
movq %rbx, %rax
shrq $0x20, %rax
movl $0x3fff, %edx           # imm = 0x3FFF
andl %edx, %eax
movabsq $0x400000000000, %rcx   # imm = 0x400000000000
cmpq %rcx, %rbx
cmovael %edx, %eax
movl 0x60(%rsp), %ecx
movl $0xffffc000, %edx       # imm = 0xFFFFC000
andl %edx, %ecx
orl %eax, %ecx
movw %cx, 0x60(%rsp)
imulq $0x18, %r12, %rbx
addq 0x20(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %esi
movq 0x8(%rsp), %rdx
callq 0x696ab
testl %eax, %eax
js 0x1aac4d
movq (%rbx), %rdi
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
imulq $0x28, %rax, %rax
movq 0x18(%rdi,%rax), %rbx
testq %rbx, %rbx
js 0x1aac4d
addq %rax, %rdi
leaq 0xa96ac(%rip), %rax     # 0x254230
movq 0x18(%rax), %rax
movl (%rax,%r12,8), %esi
movq 0x8(%rsp), %rcx
movl (%rax,%rcx,8), %edx
movq (%rsp), %rax
movl 0x8(%rax), %r8d
movl 0x10(%rax), %ecx
cvtsi2ssq 0x18(%rax), %xmm0
leaq 0x38(%rsp), %r9
callq 0x1aac6d
testl %eax, %eax
js 0x1aac4d
movl %r14d, %eax
cmpl %eax, 0x3c(%rsp)
jne 0x1aac4d
movl 0x40(%rsp), %eax
xorl 0x68(%rsp), %eax
cmpl $0x1, %eax
jne 0x1aac4d
movq %rbx, %rax
shrq $0x20, %rax
movl $0x3fff, %edx           # imm = 0x3FFF
andl %edx, %eax
movabsq $0x400000000000, %rcx   # imm = 0x400000000000
cmpq %rcx, %rbx
cmovael %edx, %eax
movl 0x48(%rsp), %ecx
movl $0xffffc000, %edx       # imm = 0xFFFFC000
andl %edx, %ecx
orl %eax, %ecx
movw %cx, 0x48(%rsp)
movq (%rsp), %rdi
leaq 0x50(%rsp), %rsi
movq 0x18(%rsp), %rdx
callq 0x1aa697
testl %eax, %eax
je 0x1aac4d
movq (%rsp), %rdi
leaq 0x38(%rsp), %rsi
movq 0x18(%rsp), %rdx
callq 0x1aa697
testl %eax, %eax
je 0x1aac4d
movq (%rsp), %rbx
movq %rbx, %rdi
leaq 0x50(%rsp), %rsi
callq 0x1aa89c
movq %rbx, %rdi
leaq 0x38(%rsp), %rsi
callq 0x1aa89c
incl %r15d
jmp 0x1aaa60
movl 0x14(%rsp), %eax
jmp 0x1aaa25
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq