// File: chhylp123[P]hifiasm/Process_Read.cpp
// Function: debug_append_ul_t(ul_ov_t*, long, ul_vec_t*)
void debug_append_ul_t(ul_ov_t *o, int64_t on, ul_vec_t *p)
{
	int64_t k, l = 0;
    uint32_t sp = (uint32_t)-1, ep = (uint32_t)-1, qss, qee, m;
    for (k = on-1; k >= 0; k--) {
        if(sp == (uint32_t)-1 || o[k].qe <= sp) {
            if(sp != (uint32_t)-1) l += ep - sp;

			if(sp == (uint32_t)-1) qss = o[k].qe, qee = p->rlen;
			else qss = o[k].qe, qee = sp;
			if(qee > qss) {
				for (m = 0; m < p->bb.n; m++) {
					if(qss == (p->bb.a[m].qs+((p->bb.a[m].hid>>15)&(0x7fffU))) && 
							qee == (p->bb.a[m].qe-(p->bb.a[m].hid&(0x7fffU)))) {
						break;
					}
				}
				if(m >= p->bb.n) fprintf(stderr, "ERROR\n");
			}

            sp = o[k].qs;
            ep = o[k].qe;
        } else {
            sp = MIN(sp, o[k].qs);
        }
    }
    if(sp != (uint32_t)-1) l += ep - sp;

	if(sp == (uint32_t)-1) qss = 0, qee = p->rlen;
	else qss = 0, qee = sp;
	if(qee > qss) {
		for (m = 0; m < p->bb.n; m++) {
			if(qss == (p->bb.a[m].qs+((p->bb.a[m].hid>>15)&(0x7fffU))) && 
					qee == (p->bb.a[m].qe-(p->bb.a[m].hid&(0x7fffU)))) {
				break;
			}
		}
		if(m >= p->bb.n) fprintf(stderr, "ERROR\n");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x28(%rbp)
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x30(%rbp) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
subq $0x1, %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jl 0xd25e
cmpl $-0x1, -0x2c(%rbp)
je 0xd0cf
movq -0x8(%rbp), %rax
imulq $0x1c, -0x20(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl -0x2c(%rbp), %eax
ja 0xd217
cmpl $-0x1, -0x2c(%rbp)
je 0xd0e5
movl -0x30(%rbp), %eax
subl -0x2c(%rbp), %eax
movl %eax, %eax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpl $-0x1, -0x2c(%rbp)
jne 0xd109
movq -0x8(%rbp), %rax
imulq $0x1c, -0x20(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x18(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x38(%rbp)
jmp 0xd121
movq -0x8(%rbp), %rax
imulq $0x1c, -0x20(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x34(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x34(%rbp), %eax
jbe 0xd1f1
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0xd1ca
movl -0x34(%rbp), %eax
movq -0x18(%rbp), %rcx
movq 0x30(%rcx), %rcx
movl -0x3c(%rbp), %edx
imulq $0x24, %rdx, %rdx
addq %rdx, %rcx
movl 0x4(%rcx), %ecx
movq -0x18(%rbp), %rdx
movq 0x30(%rdx), %rdx
movl -0x3c(%rbp), %esi
imulq $0x24, %rsi, %rsi
addq %rsi, %rdx
movl (%rdx), %edx
shrl $0xf, %edx
andl $0x7fff, %edx           # imm = 0x7FFF
addl %edx, %ecx
cmpl %ecx, %eax
jne 0xd1ba
movl -0x38(%rbp), %eax
movq -0x18(%rbp), %rcx
movq 0x30(%rcx), %rcx
movl -0x3c(%rbp), %edx
imulq $0x24, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
movq -0x18(%rbp), %rdx
movq 0x30(%rdx), %rdx
movl -0x3c(%rbp), %esi
imulq $0x24, %rsi, %rsi
addq %rsi, %rdx
movl (%rdx), %edx
andl $0x7fff, %edx           # imm = 0x7FFF
subl %edx, %ecx
cmpl %ecx, %eax
jne 0xd1ba
jmp 0xd1ca
jmp 0xd1bc
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xd134
movl -0x3c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jb 0xd1ef
movq 0x3b6e02(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x37c8c7(%rip), %rsi    # 0x389aaf
movb $0x0, %al
callq 0x22a0
jmp 0xd1f1
movq -0x8(%rbp), %rax
imulq $0x1c, -0x20(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rax
imulq $0x1c, -0x20(%rbp), %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movl %eax, -0x30(%rbp)
jmp 0xd24b
movl -0x2c(%rbp), %eax
movq -0x8(%rbp), %rcx
imulq $0x1c, -0x20(%rbp), %rdx
addq %rdx, %rcx
cmpl 0x4(%rcx), %eax
ja 0xd233
movl -0x2c(%rbp), %eax
movl %eax, -0x40(%rbp)
jmp 0xd245
movq -0x8(%rbp), %rax
imulq $0x1c, -0x20(%rbp), %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0xd24d
movq -0x20(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xd0a6
cmpl $-0x1, -0x2c(%rbp)
je 0xd274
movl -0x30(%rbp), %eax
subl -0x2c(%rbp), %eax
movl %eax, %eax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpl $-0x1, -0x2c(%rbp)
jne 0xd28d
movl $0x0, -0x34(%rbp)
movq -0x18(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x38(%rbp)
jmp 0xd29a
movl $0x0, -0x34(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x34(%rbp), %eax
jbe 0xd36a
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0xd343
movl -0x34(%rbp), %eax
movq -0x18(%rbp), %rcx
movq 0x30(%rcx), %rcx
movl -0x3c(%rbp), %edx
imulq $0x24, %rdx, %rdx
addq %rdx, %rcx
movl 0x4(%rcx), %ecx
movq -0x18(%rbp), %rdx
movq 0x30(%rdx), %rdx
movl -0x3c(%rbp), %esi
imulq $0x24, %rsi, %rsi
addq %rsi, %rdx
movl (%rdx), %edx
shrl $0xf, %edx
andl $0x7fff, %edx           # imm = 0x7FFF
addl %edx, %ecx
cmpl %ecx, %eax
jne 0xd333
movl -0x38(%rbp), %eax
movq -0x18(%rbp), %rcx
movq 0x30(%rcx), %rcx
movl -0x3c(%rbp), %edx
imulq $0x24, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
movq -0x18(%rbp), %rdx
movq 0x30(%rdx), %rdx
movl -0x3c(%rbp), %esi
imulq $0x24, %rsi, %rsi
addq %rsi, %rdx
movl (%rdx), %edx
andl $0x7fff, %edx           # imm = 0x7FFF
subl %edx, %ecx
cmpl %ecx, %eax
jne 0xd333
jmp 0xd343
jmp 0xd335
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xd2ad
movl -0x3c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jb 0xd368
movq 0x3b6c89(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
leaq 0x37c74e(%rip), %rsi    # 0x389aaf
movb $0x0, %al
callq 0x22a0
jmp 0xd36a
addq $0x40, %rsp
popq %rbp
retq