// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/inter.cpp
// Function: debug_update_uovlp_chain_qse(ma_ug_t*, mg_lchain_t*, long, long)
void debug_update_uovlp_chain_qse(ma_ug_t *ug, mg_lchain_t *a, int64_t a_n, int64_t ulid)
{
	if(a_n <= 2) return;
	int64_t r0_s, r0_e, q0_s, q0_e, k;
	int64_t r1_s, r1_e, q1_s, q1_e;
	get_u_offset(ug, &(a[0]), &r0_s, &r0_e, &q0_s, &q0_e);
	get_u_offset(ug, &(a[a_n-1]), &r1_s, &r1_e, &q1_s, &q1_e);
	/**if(r0_s <= r1_s && r0_e <= r1_e && q0_s <= q1_s && q0_e <= q1_e)**/ {
		for (k = 1; k + 1 < a_n; k++) a[k].qs = a[k].qe = -1;
		update_uovlp_chain_qse(ug, 0, a_n-1, a, a_n);
		for (k = 1; k < a_n; k++) {
			get_u_offset(ug, a + k - 1, &r0_s, &r0_e, &q0_s, &q0_e);
			get_u_offset(ug, a + k, &r1_s, &r1_e, &q1_s, &q1_e);
			// if(!(r0_s <= r1_s && r0_e <= r1_e && q0_s <= q1_s && q0_e <= q1_e)) {
			// 	fprintf(stderr, "ulid:%ld, r0_s:%ld, r1_s:%ld, r0_e:%ld, r1_e:%ld, q0_s:%ld, q1_s:%ld, q0_e:%ld, q1_e:%ld\n", ulid, 
			// 	r0_s, r1_s, r0_e, r1_e, q0_s, q1_s, q0_e, q1_e);
			// }
			// assert(q0_s <= q1_s && q0_e <= q1_e && q0_s <= q0_e && q1_s <= q1_e);
			if(r0_s <= r1_s) assert(q0_s <= q1_s);
			if(r0_e <= r1_e) assert(q0_e <= q1_e);
			// assert(r0_s <= r1_s && r0_e <= r1_e && q0_s <= q1_s && q0_e <= q1_e);
			assert(q0_s>=0 && q0_e>=0 && q1_s>=0 && q1_e>=0);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
cmpq $0x3, %rdx
jge 0x167915
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x40(%rsp), %rdx
leaq 0x38(%rsp), %rcx
leaq 0x10(%rsp), %r8
leaq 0x30(%rsp), %r9
callq 0x1665b6
leaq -0x1(%rbx), %r12
imulq $0x28, %r12, %rsi
addq %r14, %rsi
leaq 0x28(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x8(%rsp), %r8
leaq 0x18(%rsp), %r9
movq %r15, %rdi
callq 0x1665b6
leaq 0x40(%r14), %rax
pushq $0x2
popq %rcx
cmpq %rcx, %rbx
je 0x167978
orq $-0x1, -0x4(%rax)
incq %rcx
addq $0x28, %rax
jmp 0x167965
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r14, %rcx
movq %rbx, %r8
callq 0x1674fc
leaq 0x8(%rsp), %r12
leaq 0x18(%rsp), %r13
decq %rbx
je 0x167906
leaq 0x28(%r14), %rbp
movq %r15, %rdi
movq %r14, %rsi
leaq 0x40(%rsp), %rdx
leaq 0x38(%rsp), %rcx
leaq 0x10(%rsp), %r8
leaq 0x30(%rsp), %r9
callq 0x1665b6
movq %r15, %rdi
movq %rbp, %rsi
leaq 0x28(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %r12, %r8
movq %r13, %r9
callq 0x1665b6
movq 0x40(%rsp), %rax
cmpq 0x28(%rsp), %rax
jg 0x1679f8
movq 0x10(%rsp), %rax
cmpq 0x8(%rsp), %rax
jg 0x167a7f
movq 0x38(%rsp), %rax
cmpq 0x20(%rsp), %rax
setle %dl
movq 0x30(%rsp), %rcx
movq 0x18(%rsp), %rax
cmpq %rax, %rcx
setg %sil
andb %dl, %sil
cmpb $0x1, %sil
je 0x167a60
cmpq $0x0, 0x10(%rsp)
js 0x167a41
testq %rcx, %rcx
js 0x167a41
cmpq $0x0, 0x8(%rsp)
js 0x167a41
addq $0x28, %r14
testq %rax, %rax
jns 0x167995
leaq 0x8b3f1(%rip), %rdi     # 0x1f2e39
leaq 0x8a0d4(%rip), %rsi     # 0x1f1b23
leaq 0x8b388(%rip), %rcx     # 0x1f2dde
movl $0x134b, %edx           # imm = 0x134B
callq 0x2110
leaq 0x8b3c5(%rip), %rdi     # 0x1f2e2c
leaq 0x8a0b5(%rip), %rsi     # 0x1f1b23
leaq 0x8b369(%rip), %rcx     # 0x1f2dde
movl $0x1349, %edx           # imm = 0x1349
callq 0x2110
leaq 0x8b34b(%rip), %rdi     # 0x1f2dd1
leaq 0x8a096(%rip), %rsi     # 0x1f1b23
leaq 0x8b34a(%rip), %rcx     # 0x1f2dde
movl $0x1348, %edx           # imm = 0x1348
callq 0x2110