// File: 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
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpq -0x18(%rbp), %rax
jae 0x31a072
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x3c(%rbp)
movq -0x28(%rbp), %rax
movl -0x3c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpq -0x18(%rbp), %rax
jae 0x31a062
movq -0x10(%rbp), %rax
movl -0x38(%rbp), %ecx
movq (%rax,%rcx,8), %rax
xorq $0x1, %rax
movl %eax, -0x40(%rbp)
movq -0x48(%rbp), %rdi
movl -0x3c(%rbp), %esi
shrl %esi
movl -0x40(%rbp), %edx
shrl %edx
callq 0xce1b0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jl 0x319d71
movq -0x48(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x3f, %rax
cmpl $0x0, %eax
je 0x319d76
jmp 0x31a054
movq -0x48(%rbp), %rax
movq (%rax), %rdi
movslq -0x2c(%rbp), %rax
imulq $0x28, %rax, %rax
addq %rax, %rdi
leaq 0xab541(%rip), %rax     # 0x3c52d0
movq 0x18(%rax), %rax
movl -0x3c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, %esi
leaq 0xab529(%rip), %rax     # 0x3c52d0
movq 0x18(%rax), %rax
movl -0x40(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
cvtsi2ssq 0x18(%rax), %xmm0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %r8d
leaq -0x60(%rbp), %r9
callq 0x31a080
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
jge 0x319dee
jmp 0x31a054
movq -0x60(%rbp), %rax
shrq $0x20, %rax
movl -0x3c(%rbp), %ecx
cmpq %rcx, %rax
jne 0x319e06
movl -0x58(%rbp), %eax
cmpl -0x40(%rbp), %eax
je 0x319e0b
jmp 0x31a054
movq -0x48(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x20, %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
cmpl $0x3fff, %eax           # imm = 0x3FFF
jbe 0x319e3c
movl $0x3fff, %eax           # imm = 0x3FFF
movl %eax, -0x7c(%rbp)
jmp 0x319e5f
movq -0x48(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x20, %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movw %ax, %cx
movw -0x50(%rbp), %ax
andw $0x3fff, %cx            # imm = 0x3FFF
andw $0xc000, %ax            # imm = 0xC000
orw %cx, %ax
movw %ax, -0x50(%rbp)
movq -0x28(%rbp), %rdi
movl -0x40(%rbp), %eax
shrl %eax
movl %eax, %eax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl -0x40(%rbp), %esi
shrl %esi
movl -0x3c(%rbp), %edx
shrl %edx
callq 0xce1b0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jl 0x319ed0
movq -0x28(%rbp), %rax
movl -0x40(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x3f, %rax
cmpl $0x0, %eax
je 0x319ed5
jmp 0x31a054
movq -0x28(%rbp), %rax
movl -0x40(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movslq -0x2c(%rbp), %rax
imulq $0x28, %rax, %rax
addq %rax, %rdi
leaq 0xab3d4(%rip), %rax     # 0x3c52d0
movq 0x18(%rax), %rax
movl -0x40(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, %esi
leaq 0xab3bc(%rip), %rax     # 0x3c52d0
movq 0x18(%rax), %rax
movl -0x3c(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
cvtsi2ssq 0x18(%rax), %xmm0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %r8d
leaq -0x78(%rbp), %r9
callq 0x31a080
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
jge 0x319f5b
jmp 0x31a054
movq -0x78(%rbp), %rax
shrq $0x20, %rax
movl -0x40(%rbp), %ecx
xorl $0x1, %ecx
movl %ecx, %ecx
cmpq %rcx, %rax
jne 0x319f7d
movl -0x70(%rbp), %eax
movl -0x3c(%rbp), %ecx
xorl $0x1, %ecx
cmpl %ecx, %eax
je 0x319f82
jmp 0x31a054
movq -0x28(%rbp), %rax
movl -0x40(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x20, %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
cmpl $0x3fff, %eax           # imm = 0x3FFF
jbe 0x319fc1
movl $0x3fff, %eax           # imm = 0x3FFF
movl %eax, -0x80(%rbp)
jmp 0x319ff2
movq -0x28(%rbp), %rax
movl -0x40(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x20, %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %eax
movw %ax, %cx
movw -0x68(%rbp), %ax
andw $0x3fff, %cx            # imm = 0x3FFF
andw $0xc000, %ax            # imm = 0xC000
orw %cx, %ax
movw %ax, -0x68(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq -0x60(%rbp), %rsi
callq 0x3196c0
cmpl $0x0, %eax
je 0x31a052
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq -0x78(%rbp), %rsi
callq 0x3196c0
cmpl $0x0, %eax
je 0x31a052
movq -0x8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x3199f0
movq -0x8(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x3199f0
jmp 0x31a054
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x319d17
jmp 0x31a064
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x319cdd
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax,%rax)