// File: /workspace/github_cpp_makefile_star2_O1/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 %r9, %rbx
movq %r8, %r14
movq %rcx, %rbp
movq %rdx, 0x30(%rsp)
movq %rsi, %r12
movq %rdi, 0x28(%rsp)
movq 0x80(%rsp), %r13
cmpq %r8, %rcx
jae 0x21049a
movb $0x1, %al
movq %rbp, %rcx
movq 0x10(%r12), %rdx
movl (%rdx,%rcx,8), %esi
movq (%rdx,%rsi,8), %rdx
movl %edx, %esi
shrq $0x20, %rdx
cmpq %rsi, %rdx
jae 0x210579
leaq 0x1(%rdx), %rdi
cmpq %rsi, %rdi
jae 0x21047c
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 0x21045e
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 0x21043a
cmpq %r14, %rbp
jae 0x210503
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 0x210598
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 0x210307
incq %r15
cmpq %r15, %r14
jne 0x2104a2
cmpq %r14, %rbp
jae 0x21056a
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 0x2105b7
leaq 0x1(%rcx), %rsi
cmpq %rdx, %rsi
jae 0x21054c
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 0x21052e
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 0x21050a
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2c124(%rip), %rdi     # 0x23c6a4
leaq 0x28d9e(%rip), %rsi     # 0x239325
leaq 0x2c570(%rip), %rcx     # 0x23cafe
movl $0x32cf, %edx           # imm = 0x32CF
callq 0x2110
leaq 0x2c105(%rip), %rdi     # 0x23c6a4
leaq 0x28d7f(%rip), %rsi     # 0x239325
leaq 0x2c551(%rip), %rcx     # 0x23cafe
movl $0x32d7, %edx           # imm = 0x32D7
callq 0x2110
leaq 0x2c0e6(%rip), %rdi     # 0x23c6a4
leaq 0x28d60(%rip), %rsi     # 0x239325
leaq 0x2c532(%rip), %rcx     # 0x23cafe
movl $0x32de, %edx           # imm = 0x32DE
callq 0x2110