// File: chhylp123[P]hifiasm/inter.cpp
// Function: ck_ul_alignment(ul_vec_t*)
uint32_t ck_ul_alignment(ul_vec_t *x)
{
	uc_block_t *a = x->bb.a, *p, *z0, *z1; uint64_t a_n = x->bb.n, k, rlen = x->rlen;
	for (k = 0; k < a_n; k++) {
		p = &(a[k]);
		if(p->base) continue;
		if(p->qs > rlen || p->qe > rlen || p->qs > p->qe) break;
		if(p->pidx != (uint32_t)-1) {
			if(a[p->pidx].aidx == (uint32_t)-1 || a[p->pidx].aidx != k) break;
			if(p->pidx >= k) break;
			z1 = p; z0 = &(a[p->pidx]);
			if(!(z1->qs >= z0->qs && z1->qe >= z0->qe)) break;
		}

		if(p->aidx != (uint32_t)-1) {
			if(a[p->aidx].pidx == (uint32_t)-1 || a[p->aidx].pidx != k) break;
			if(p->aidx <= k) break;
			z0 = p; z1 = &(a[p->aidx]);
			if(!(z1->qs >= z0->qs && z1->qe >= z0->qe)) break;
		}
	}
	if(k >= a_n) return 1;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movq %rax, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x2bb7b9
movq -0x18(%rbp), %rax
imulq $0x24, -0x40(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movb 0x20(%rax), %al
shrb $0x6, %al
andb $0x1, %al
cmpb $0x0, %al
je 0x2bb646
jmp 0x2bb7a8
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
cmpq -0x48(%rbp), %rax
ja 0x2bb670
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
cmpq -0x48(%rbp), %rax
ja 0x2bb670
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x20(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jbe 0x2bb675
jmp 0x2bb7b9
movq -0x20(%rbp), %rax
cmpl $-0x1, 0x14(%rax)
je 0x2bb712
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movl 0x14(%rcx), %ecx
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
cmpl $-0x1, 0x1c(%rax)
je 0x2bb6b6
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movl 0x14(%rcx), %ecx
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
cmpq -0x40(%rbp), %rax
je 0x2bb6bb
jmp 0x2bb7b9
movq -0x20(%rbp), %rax
movl 0x14(%rax), %eax
cmpq -0x40(%rbp), %rax
jb 0x2bb6cd
jmp 0x2bb7b9
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movl 0x14(%rcx), %ecx
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x28(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jb 0x2bb70b
movq -0x30(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x28(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jae 0x2bb710
jmp 0x2bb7b9
jmp 0x2bb712
movq -0x20(%rbp), %rax
cmpl $-0x1, 0x1c(%rax)
je 0x2bb7a6
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movl 0x1c(%rcx), %ecx
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
cmpl $-0x1, 0x14(%rax)
je 0x2bb753
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movl 0x1c(%rcx), %ecx
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %eax
cmpq -0x40(%rbp), %rax
je 0x2bb755
jmp 0x2bb7b9
movq -0x20(%rbp), %rax
movl 0x1c(%rax), %eax
cmpq -0x40(%rbp), %rax
ja 0x2bb764
jmp 0x2bb7b9
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movl 0x1c(%rcx), %ecx
imulq $0x24, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x28(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jb 0x2bb7a2
movq -0x30(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x28(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jae 0x2bb7a4
jmp 0x2bb7b9
jmp 0x2bb7a6
jmp 0x2bb7a8
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x2bb613
movq -0x40(%rbp), %rax
cmpq -0x38(%rbp), %rax
jb 0x2bb7cc
movl $0x1, -0x4(%rbp)
jmp 0x2bb7d3
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)