// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/gfa_ut.cpp
// Function: update_thread_path(usg_t*, asg64_v*, asg64_v*, unsigned long, unsigned long, unsigned long*, unsigned int*, unsigned long*, unsigned char*, unsigned long, asg64_v*)
void update_thread_path(usg_t *g, asg64_v *b64, asg64_v *ub64, uint64_t g_s, uint64_t g_e, uint64_t *integer_seq, 
uint32_t *ng_occ, uint64_t *reliable_idx, uint8_t *f, uint64_t max_ext, asg64_v *res)
{
    uint64_t i, k, s, e; 
    for (i = g_s; i < g_e; i++) {///available intervals within the same cluster
        s = b64->a[((uint32_t)b64->a[i])]>>32; e = ((uint32_t)b64->a[((uint32_t)b64->a[i])]); assert(s < e);
        for (k = s + 1; k < e; k++) {///note: here is [s, e]
            f[integer_seq[k]] = f[integer_seq[k]^1] = 1;
        }
        f[integer_seq[s]] = f[integer_seq[e]^1] = 1;
    }

    for (i = g_s; i < g_e; i++) {///available intervals within the same cluster
        s = b64->a[((uint32_t)b64->a[i])]>>32; e = ((uint32_t)b64->a[((uint32_t)b64->a[i])]); assert(s < e);
        // fprintf(stderr, "[M::%s::] i::%lu, chain_id::%u\n", __func__, i, ((uint32_t)b64->a[i]));
        // select_unqiue_path_on_fly(g, s, e, b64, ub64, integer_seq, ng_occ, reliable_idx, f, max_ext, res);
        select_unqiue_path_on_fly_raw(g, s, e, b64, ub64, integer_seq, ng_occ, reliable_idx, f, max_ext, res);
    }

    for (i = g_s; i < g_e; i++) {///available intervals within the same cluster
        s = b64->a[((uint32_t)b64->a[i])]>>32; e = ((uint32_t)b64->a[((uint32_t)b64->a[i])]); assert(s < e);
        for (k = s + 1; k < e; k++) {///note: here is [s, e]
            f[integer_seq[k]] = f[integer_seq[k]^1] = 0;
        }
        f[integer_seq[s]] = f[integer_seq[e]^1] = 0;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x30(%rsp)
movq %rdi, 0x28(%rsp)
cmpq %r8, %rcx
jae 0x21b978
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %rbp
movq %rsi, %r12
movq 0x80(%rsp), %r13
movb $0x1, %al
movq 0x10(%r12), %rdx
movl (%rdx,%rcx,8), %esi
movq (%rdx,%rsi,8), %rdx
movl %edx, %esi
shrq $0x20, %rdx
cmpq %rsi, %rdx
jae 0x21b987
leaq 0x1(%rdx), %rdi
cmpq %rsi, %rdi
jae 0x21b886
movq (%rbx,%rdi,8), %r8
xorq $0x1, %r8
movb %al, (%r13,%r8)
movq (%rbx,%rdi,8), %r8
movb %al, (%r13,%r8)
incq %rdi
cmpq %rdi, %rsi
jne 0x21b868
movq (%rbx,%rsi,8), %rsi
xorq $0x1, %rsi
movb %al, (%r13,%rsi)
movq (%rbx,%rdx,8), %rdx
movb %al, (%r13,%rdx)
incq %rcx
cmpq %r14, %rcx
jne 0x21b844
cmpq %r14, %rbp
jae 0x21b978
movq %rbp, %r15
movq 0x10(%r12), %rax
movl (%rax,%r15,8), %ecx
movq (%rax,%rcx,8), %rsi
movl %esi, %edx
shrq $0x20, %rsi
cmpq %rdx, %rsi
jae 0x21b9a6
movq 0x90(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x88(%rsp), %rax
movq %rax, 0x18(%rsp)
movq %r13, 0x10(%rsp)
movq 0x70(%rsp), %rax
movq %rax, (%rsp)
movq 0x28(%rsp), %rdi
movq %r12, %rcx
movq 0x30(%rsp), %r8
movq %rbx, %r9
callq 0x21b70e
incq %r15
cmpq %r15, %r14
jne 0x21b8b0
cmpq %r14, %rbp
jae 0x21b978
xorl %eax, %eax
movq 0x10(%r12), %rcx
movl (%rcx,%rbp,8), %edx
movq (%rcx,%rdx,8), %rcx
movl %ecx, %edx
shrq $0x20, %rcx
cmpq %rdx, %rcx
jae 0x21b9c5
leaq 0x1(%rcx), %rsi
cmpq %rdx, %rsi
jae 0x21b95a
movq (%rbx,%rsi,8), %rdi
xorq $0x1, %rdi
movb %al, (%r13,%rdi)
movq (%rbx,%rsi,8), %rdi
movb %al, (%r13,%rdi)
incq %rsi
cmpq %rsi, %rdx
jne 0x21b93c
movq (%rbx,%rdx,8), %rdx
xorq $0x1, %rdx
movb %al, (%r13,%rdx)
movq (%rbx,%rcx,8), %rcx
movb %al, (%r13,%rcx)
incq %rbp
cmpq %r14, %rbp
jne 0x21b918
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2cffa(%rip), %rdi     # 0x248988
leaq 0x29c74(%rip), %rsi     # 0x245609
leaq 0x2d446(%rip), %rcx     # 0x248de2
movl $0x32cf, %edx           # imm = 0x32CF
callq 0x2110
leaq 0x2cfdb(%rip), %rdi     # 0x248988
leaq 0x29c55(%rip), %rsi     # 0x245609
leaq 0x2d427(%rip), %rcx     # 0x248de2
movl $0x32d7, %edx           # imm = 0x32D7
callq 0x2110
leaq 0x2cfbc(%rip), %rdi     # 0x248988
leaq 0x29c36(%rip), %rsi     # 0x245609
leaq 0x2d408(%rip), %rcx     # 0x248de2
movl $0x32de, %edx           # imm = 0x32DE
callq 0x2110