// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: set_rset(ma_ug_t*, unsigned int, unsigned char*, unsigned char)
void set_rset(ma_ug_t *ug, uint32_t uid, uint8_t *ff, uint8_t s)
{
    if(ug->g->seq[uid].del) return;
    ma_utg_t* u; uint32_t k, v, nv, w, z; 
    asg_arc_t *av = NULL;

    u = &(ug->u.a[uid]);
    for (k = 0; k < u->n; k++) ff[u->a[k]>>33] = s;

    v = uid<<1; 
    nv = asg_arc_n(ug->g, v);
    av = asg_arc_a(ug->g, v);
    for (k = 0; k < nv; k++) {
        w = av[k].v;
        if(av[k].del) continue;
        if(ug->g->seq[w>>1].del) continue;
        u = &(ug->u.a[w>>1]);
        for (z = 0; z < u->n; z++) ff[u->a[z]>>33] = s;
    }
        
    v = (uid<<1)+1; 
    nv = asg_arc_n(ug->g, v);
    av = asg_arc_a(ug->g, v);
    for (k = 0; k < nv; k++) {
        w = av[k].v;
        if(av[k].del) continue;
        if(ug->g->seq[w>>1].del) continue;
        u = &(ug->u.a[w>>1]);
        for (z = 0; z < u->n; z++) ff[u->a[z]>>33] = s;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %cl, %al
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movl -0xc(%rbp), %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x1075c3
jmp 0x107845
movq $0x0, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xc(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x10761c
movb -0x19(%rbp), %dl
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x2c(%rbp), %esi
movq (%rcx,%rsi,8), %rcx
shrq $0x21, %rcx
movb %dl, (%rax,%rcx)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x1075e8
movl -0xc(%rbp), %eax
shll %eax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rax
movl -0x30(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x28(%rcx), %rcx
movl -0x30(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jae 0x10772f
movq -0x48(%rbp), %rax
movl -0x2c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x38(%rbp)
movq -0x48(%rbp), %rax
movl -0x2c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x1076aa
jmp 0x107721
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movl -0x38(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x1076ca
jmp 0x107721
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x38(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x10771f
movb -0x19(%rbp), %dl
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x3c(%rbp), %esi
movq (%rcx,%rsi,8), %rcx
shrq $0x21, %rcx
movb %dl, (%rax,%rcx)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x1076eb
jmp 0x107721
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x10766f
movl -0xc(%rbp), %eax
shll %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rax
movl -0x30(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq 0x28(%rcx), %rcx
movl -0x30(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jae 0x107845
movq -0x48(%rbp), %rax
movl -0x2c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x38(%rbp)
movq -0x48(%rbp), %rax
movl -0x2c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x1077c0
jmp 0x107837
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rax
movl -0x38(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
movl (%rax,%rcx,8), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x1077e0
jmp 0x107837
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x38(%rbp), %ecx
shrl %ecx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x107835
movb -0x19(%rbp), %dl
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x18(%rcx), %rcx
movl -0x3c(%rbp), %esi
movq (%rcx,%rsi,8), %rcx
shrq $0x21, %rcx
movb %dl, (%rax,%rcx)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x107801
jmp 0x107837
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x107785
popq %rbp
retq
nopw (%rax,%rax)