// File: /workspace/github_cpp_makefile_star2_O1/chhylp123[P]hifiasm/inter.cpp
// Function: update_ug_arch_ul(void*, long, int)
static void update_ug_arch_ul(void *data, long i, int tid) // callback for kt_for()
{
	const ma_ug_t *ug = (ma_ug_t *)data;
	asg_arc_t *e = &(ug->g->arc[i]); e->ou = 0;
	uint32_t v = e->ul>>32, w = e->v, k, uv, uw;
	uint64_t *a, a_n; uc_block_t *p, *n;
	a = UL_INF.ridx.occ.a + UL_INF.ridx.idx.a[v>>1];
	a_n = UL_INF.ridx.idx.a[(v>>1)+1] - UL_INF.ridx.idx.a[v>>1]; 
	for (k = 0; k < a_n; k++) {
		p = &(UL_INF.a[a[k]>>32].bb.a[(uint32_t)(a[k])]);
		if(p->base || (!p->el) || (!p->pchain)) continue;
		uv = (((uint32_t)(p->hid))<<1)|((uint32_t)(p->rev));
		if((uv == v) && (p->aidx != (uint32_t)-1)) {
			n = &(UL_INF.a[a[k]>>32].bb.a[p->aidx]);
			assert((!n->base)&&(n->el)&&(n->pchain)&&(n->pidx==((uint32_t)(a[k]))));
			uw = (((uint32_t)(n->hid))<<1)|((uint32_t)(n->rev));
			if(uw == w) e->ou++;
		}

		if(((uv^1) == v) && (p->pidx != (uint32_t)-1)) {
			n = &(UL_INF.a[a[k]>>32].bb.a[p->pidx]);
			// if(!((!n->base)&&(n->el)&&(n->pchain)&&(n->aidx==((uint32_t)(a[k]))))) {
			// 	fprintf(stderr, "ulid->%ld, n->base::%u, n->el::%u, n->pchain::%u, n->aidx::%u, ((uint32_t)(a[k]))::%u\n", 
			// 	i, n->base, n->el, n->pchain, n->aidx, ((uint32_t)(a[k])));
			// }
			assert((!n->base)&&(n->el)&&(n->pchain)&&(n->aidx==((uint32_t)(a[k]))));
			uw = (((uint32_t)(n->hid))<<1)|((uint32_t)(n->rev)); uw ^= 1;
			if(uw == w) e->ou++;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x18(%rdi), %rax
movq 0x8(%rax), %rdi
leaq (%rsi,%rsi,2), %r8
andw $0xc000, 0x10(%rdi,%r8,8) # imm = 0xC000
movq (%rdi,%r8,8), %rax
leaq 0xb4512(%rip), %rcx     # 0x28b318
movq 0x28(%rcx), %rsi
movq %rax, %r9
shrq $0x21, %r9
movl (%rsi,%r9,4), %edx
movl 0x4(%rsi,%r9,4), %esi
subl %edx, %esi
je 0x1d6fa1
leaq (%rdi,%r8,8), %rdi
shrq $0x20, %rax
movl 0x8(%rdi), %r8d
shlq $0x3, %rdx
addq 0x40(%rcx), %rdx
xorl %r9d, %r9d
movl $0xffffffff, %r10d      # imm = 0xFFFFFFFF
movq 0x48(%rcx), %r11
movq (%rdx,%r9,8), %rbx
movq %rbx, %r14
shrq $0x20, %r14
imulq $0x58, %r14, %r14
movq 0x30(%r11,%r14), %r14
movl %ebx, %r11d
leaq (%r11,%r11,8), %r11
movzbl 0x20(%r14,%r11,4), %r15d
movl %r15d, %ebp
andb $-0x40, %bpl
negb %bpl
setno %bpl
testb $0x1f, %r15b
sete %r12b
orb %bpl, %r12b
jne 0x1d6f95
leaq (%r14,%r11,4), %r11
movl (%r11), %r12d
shrl $0x5, %r15d
andl $0x1, %r15d
leal (%r15,%r12,2), %ebp
cmpl %eax, %ebp
jne 0x1d6f07
movl 0x1c(%r11), %r15d
cmpq %r10, %r15
je 0x1d6f07
leaq (%r15,%r15,8), %r12
movzbl 0x20(%r14,%r12,4), %r15d
movl %r15d, %r13d
andb $-0x40, %r13b
negb %r13b
jno 0x1d6fb0
movl %r15d, %r13d
andb $0x1f, %r13b
je 0x1d6fb0
leaq (%r14,%r12,4), %r14
cmpl %ebx, 0x14(%r14)
jne 0x1d6fb0
movl (%r14), %ebx
shrl $0x5, %r15d
andl $0x1, %r15d
leal (%r15,%rbx,2), %ebx
cmpl %r8d, %ebx
jne 0x1d6f07
movl 0x10(%rdi), %ebx
leal 0x1(%rbx), %r14d
andl $0x3fff, %r14d          # imm = 0x3FFF
andl $0xffffc000, %ebx       # imm = 0xFFFFC000
orl %r14d, %ebx
movw %bx, 0x10(%rdi)
xorl %eax, %ebp
cmpl $0x1, %ebp
jne 0x1d6f95
movl 0x14(%r11), %r11d
cmpq %r10, %r11
je 0x1d6f95
movq 0x48(%rcx), %r14
movq (%rdx,%r9,8), %rbx
movq %rbx, %r15
shrq $0x20, %r15
imulq $0x58, %r15, %r15
movq 0x30(%r14,%r15), %r14
leaq (%r11,%r11,8), %r15
movzbl 0x20(%r14,%r15,4), %r11d
movl %r11d, %ebp
andb $-0x40, %bpl
negb %bpl
jno 0x1d6fcf
movl %r11d, %ebp
andb $0x1f, %bpl
je 0x1d6fcf
leaq (%r14,%r15,4), %r14
cmpl %ebx, 0x1c(%r14)
jne 0x1d6fcf
movl (%r14), %ebx
shrl $0x5, %r11d
andl $0x1, %r11d
leal (%r11,%rbx,2), %r11d
xorl %r8d, %r11d
cmpl $0x1, %r11d
jne 0x1d6f95
movl 0x10(%rdi), %r11d
leal 0x1(%r11), %ebx
andl $0x3fff, %ebx           # imm = 0x3FFF
andl $0xffffc000, %r11d      # imm = 0xFFFFC000
orl %ebx, %r11d
movw %r11w, 0x10(%rdi)
incq %r9
cmpq %r9, %rsi
jne 0x1d6e3f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x61c65(%rip), %rdi     # 0x238c1c
leaq 0x5c9cd(%rip), %rsi     # 0x23398b
leaq 0x61c97(%rip), %rcx     # 0x238c5c
movl $0x4cab, %edx           # imm = 0x4CAB
callq 0x2110
leaq 0x61cb0(%rip), %rdi     # 0x238c86
leaq 0x5c9ae(%rip), %rsi     # 0x23398b
leaq 0x61c78(%rip), %rcx     # 0x238c5c
movl $0x4cb6, %edx           # imm = 0x4CB6
callq 0x2110