// File: /workspace/github_cpp_makefile_star2_O3/chhylp123[P]hifiasm/inter.cpp
// Function: filter_by_reliable_ovlp_adv(unsigned int, kv_u_trans_t*, st_mt_t*, overlap_region_alloc*, ul_idx_t const*, double, unsigned long, unsigned long, unsigned long*)
void filter_by_reliable_ovlp_adv(uint32_t id, kv_u_trans_t *idx, st_mt_t *sp, overlap_region_alloc* ol, const ul_idx_t *udb, double sec_rate, uint64_t avoid_dup_aln, 
uint64_t dedup_by_reliable_ovlp, uint64_t *occ1)
{
	(*occ1) = 0;
	u_trans_t *a; uint64_t n, k, l, s, e, s0, e0, z, ov, rr, r1, spn; overlap_region *m, t;
	a = u_trans_a(*idx, id); n = u_trans_n(*idx, id);
	if(avoid_dup_aln) {
		kv_resize(uint64_t, *sp, (ol->length)+n);
		for (k = sp->n = 0; k < n; k++) {
			if(a[k].del) continue;
			// if(id == 160) {
			// 	fprintf(stderr, "[rid::%u]\tutg%.6u%c\t%u\t%u\t%u\t%c\tutg%.6u%c\t%u\t%u\t%u\tnw::%f\tf::%u\n", id, 
			// 		a[k].qn+1, "lc"[udb->ug->u.a[a[k].qn].circ], udb->ug->u.a[a[k].qn].len, a[k].qs, a[k].qe, "+-"[a[k].rev],
			// 		a[k].tn+1, "lc"[udb->ug->u.a[a[k].tn].circ], udb->ug->u.a[a[k].tn].len, a[k].ts, a[k].te, a[k].nw, a[k].f);
			// }
			if(a[k].f == RC_0 || a[k].f == RC_1) {
				z = a[k].tn; z <<= 1; z |= a[k].rev; z <<= 32; 
				kv_push(uint64_t, *sp, z);
			}
		}
		if(sp->n > 0) {
			for (k = 0; k < ol->length; k++) {
				z = ol->list[k].y_id; z <<= 1; z |= ol->list[k].y_pos_strand; 
				z <<= 32; z |= k; z |= ((uint64_t)0x80000000);
				kv_push(uint64_t, *sp, z);
			}

			radix_sort_gfa64(sp->a, sp->a + sp->n); 
			for (k = 1, l = 0, rr = 0; k <= sp->n; k++) {
				if(k == sp->n || (sp->a[l]>>32)!=(sp->a[k]>>32)) {
					if((k - l > 1) && (!(sp->a[l]&((uint64_t)0x80000000)))) {///overlap within bck
						for (z = l; z < k; z++) {
							if(sp->a[z]&((uint64_t)0x80000000)) {
								ol->list[(uint32_t)(sp->a[z]-((uint64_t)0x80000000))].y_id = ((uint32_t)-1);
								rr++;
							}
						}
					}
					l = k;
				}
			}

			if(rr > 0) {
				for (k = rr = 0; k < ol->length; k++) {
					if(ol->list[k].y_id == ((uint32_t)-1)) continue;
					if(rr != k) {
						t = ol->list[rr];
						ol->list[rr] = ol->list[k];
						ol->list[k] = t;
					}
					rr++;
				}
				ol->length = rr;
			}
		}
	}

	sp->n = 0;
	if(dedup_by_reliable_ovlp) {
		for (k = sp->n = 0; k < n; k++) {
			if(a[k].del) continue;
			if(a[k].f == RC_0 || a[k].f == RC_1) {
				kv_push(uint64_t, *sp, (((uint64_t)a[k].qs)<<32)|((uint64_t)a[k].qe));
			}
		}
		if(sp->n > 1) {
			radix_sort_gfa64(sp->a, sp->a + sp->n);
			for (k = z = 0; k < sp->n; k++) {
				s = sp->a[k]>>32; e = (uint32_t)sp->a[k];
				if(z > 0 && s <= ((uint32_t)sp->a[z-1])) {
					if(e > ((uint32_t)sp->a[z-1])) {
						sp->a[z-1] >>= 32; sp->a[z-1] <<= 32; sp->a[z-1] |= e;
					}
				} else {
					sp->a[z++] = sp->a[k];
				}
			}
			sp->n = z;
		}
	}

	for (k = rr = r1 = 0, spn = sp->n; k < ol->length; k++) {
		m = &(ol->list[k]);
		// if(id == 160) {
		// 	fprintf(stderr, "[M::%s] utg%.6u%c\t%u\t%u\t%u\t%c\tutg%.6u%c\t%u\t%u\t%u\txstr::%u\n", __func__, 
		// 		ol->list[k].x_id+1, "lc"[udb->ug->u.a[ol->list[k].x_id].circ], udb->ug->u.a[ol->list[k].x_id].len, 
		// 		ol->list[k].x_pos_s, ol->list[k].x_pos_e+1, "+-"[ol->list[k].y_pos_strand],
		// 		ol->list[k].y_id+1, "lc"[udb->ug->u.a[ol->list[k].y_id].circ], udb->ug->u.a[ol->list[k].y_id].len, 
		// 		ol->list[k].y_pos_s, ol->list[k].y_pos_e+1, ol->list[k].x_pos_strand);
		// }
		if((dedup_by_reliable_ovlp) && (m->x_pos_strand == 0)) {
			s = m->x_pos_s; e = m->x_pos_e + 1; l = 0; 
			for (z = 0; z < spn; z++) {
				s0 = sp->a[z]>>32; e0 = (uint32_t)sp->a[z];
				ov = ((MIN(e, e0) > MAX(s, s0))? (MIN(e, e0) - MAX(s, s0)):0);
				l += ov;
				if((l) && (l > ((e-s)*sec_rate))) break;
			}
			///filter by the overlaps of id/m->x_id
			if(z < spn) continue;
			///filter by the overlaps of m->y_id
			if(filter_by_reliable_ovlp0(u_trans_a(*idx, m->y_id), u_trans_n(*idx, m->y_id), 
			m->y_pos_strand?udb->ug->u.a[m->y_id].len-m->y_pos_e-1:m->y_pos_s, 
			m->y_pos_strand?udb->ug->u.a[m->y_id].len-m->y_pos_s:m->y_pos_e+1, sec_rate)) {
				continue;
			}
		} 
		// else {
		// 	if(id == 7) {
		// 		fprintf(stderr, "[M::%s] utg%.6u%c\t%u\t%u\t%u\t%c\tutg%.6u%c\t%u\t%u\t%u\n", __func__, 
		// 		ol->list[k].x_id+1, "lc"[udb->ug->u.a[ol->list[k].x_id].circ], udb->ug->u.a[ol->list[k].x_id].len, 
		// 		ol->list[k].x_pos_s, ol->list[k].x_pos_e+1, "+-"[ol->list[k].y_pos_strand],
		// 		ol->list[k].y_id+1, "lc"[udb->ug->u.a[ol->list[k].y_id].circ], udb->ug->u.a[ol->list[k].y_id].len, 
		// 		ol->list[k].y_pos_s, ol->list[k].y_pos_e+1);
		// 	}
		// }
		if(rr != k) {
			t = ol->list[k];
            ol->list[k] = ol->list[rr];
            ol->list[rr] = t;
		}
		if(ol->list[rr].x_pos_strand) {
			ol->list[rr].x_pos_strand = 0;
			if(r1 != rr) {
				t = ol->list[r1];
            	ol->list[r1] = ol->list[rr];
            	ol->list[rr] = t;
			}
			r1++;
		}
		// fprintf(stderr, ">>>utg%.6u%c\t%u\t%u\t%u\t%c\tutg%.6u%c\t%u\t%u\t%u\n", 
		// 		ol->list[rr].x_id+1, "lc"[udb->ug->u.a[ol->list[rr].x_id].circ], udb->ug->u.a[ol->list[rr].x_id].len, 
		// 		ol->list[rr].x_pos_s, ol->list[rr].x_pos_e+1, "+-"[ol->list[rr].y_pos_strand],
		// 		ol->list[rr].y_id+1, "lc"[udb->ug->u.a[ol->list[rr].y_id].circ], udb->ug->u.a[ol->list[rr].y_id].len, 
		// 		ol->list[rr].y_pos_s, ol->list[rr].y_pos_e+1);
		rr++;
	}
	// if(id == 1576) {
		// fprintf(stderr, "[M::%s] utg%.6ul, ol->length0::%lu, ol->length::%lu\n", __func__, id+1, ol->length, rr);
	// }
	ol->length = rr; (*occ1) = r1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movsd %xmm0, 0x20(%rsp)
movq %r8, 0x28(%rsp)
movq 0x128(%rsp), %rax
movq 0x120(%rsp), %r14
movq $0x0, (%rax)
movq 0x10(%rsi), %r12
movq %rsi, 0x30(%rsp)
movq 0x28(%rsi), %rax
movl %edi, %esi
movq (%rax,%rsi,8), %rax
movl %eax, %r15d
shrq $0x20, %rax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
movq %rax, 0x10(%rsp)
testq %r9, %r9
movq %rdx, %r9
movq %rcx, (%rsp)
movq %rdx, 0x8(%rsp)
je 0x1c47a2
movq 0x10(%rcx), %rax
addq %r15, %rax
cmpq %rax, 0x8(%r9)
jae 0x1c44ce
decq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x10, %rcx
orq %rax, %rcx
leaq 0x1(%rcx), %rax
movq %rax, 0x8(%r9)
movq 0x10(%r9), %rdi
leaq 0x8(,%rcx,8), %rsi
callq 0x2370
movq 0x8(%rsp), %r9
movq (%rsp), %rcx
movq %rax, 0x10(%r9)
movq $0x0, (%r9)
testq %r15, %r15
je 0x1c4625
movq %r15, 0x18(%rsp)
movq %r15, %rax
shlq $0x4, %rax
leaq (%rax,%rax,2), %rbx
movq 0x10(%rsp), %rax
leaq (%rax,%r12), %r14
addq $0x28, %r14
xorl %r15d, %r15d
movzbl (%r14,%r15), %ebp
testb $-0x42, %bpl
jne 0x1c4564
movl -0x14(%r14,%r15), %r13d
movq (%r9), %rdi
movq 0x10(%r9), %rax
cmpq 0x8(%r9), %rdi
jne 0x1c454b
leaq (%rdi,%rdi), %rsi
testq %rdi, %rdi
movl $0x2, %ecx
cmoveq %rcx, %rsi
movq %rsi, 0x8(%r9)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq 0x8(%rsp), %r9
movq (%rsp), %rcx
movq %rax, 0x10(%r9)
movq (%r9), %rdi
shrl $0x6, %ebp
shlq $0x21, %r13
shlq $0x20, %rbp
orq %r13, %rbp
leaq 0x1(%rdi), %rdx
movq %rdx, (%r9)
movq %rbp, (%rax,%rdi,8)
addq $0x30, %r15
cmpq %r15, %rbx
jne 0x1c44fe
movq (%r9), %rax
testq %rax, %rax
movq 0x120(%rsp), %r14
movq 0x18(%rsp), %r15
je 0x1c47a2
cmpq $0x0, 0x10(%rcx)
movq 0x10(%r9), %rdi
je 0x1c4630
movl $0x1c, %ebx
xorl %r14d, %r14d
movl $0x2, %r15d
movq (%rcx), %rax
movl -0xc(%rax,%rbx), %ebp
movl (%rax,%rbx), %r13d
movq (%r9), %rax
cmpq 0x8(%r9), %rax
jne 0x1c45e2
leaq (%rax,%rax), %rsi
testq %rax, %rax
cmoveq %r15, %rsi
movq %rsi, 0x8(%r9)
shlq $0x3, %rsi
callq 0x2370
movq 0x8(%rsp), %r9
movq (%rsp), %rcx
movq %rax, %rdi
movq %rax, 0x10(%r9)
movq (%r9), %rax
shlq $0x21, %rbp
shlq $0x20, %r13
orq %rbp, %r13
orq %r14, %r13
btsq $0x1f, %r13
leaq 0x1(%rax), %rdx
movq %rdx, (%r9)
movq %r13, (%rdi,%rax,8)
incq %r14
addq $0xa8, %rbx
cmpq 0x10(%rcx), %r14
jb 0x1c45a3
movq (%r9), %rax
movq %r9, %rbx
movq 0x120(%rsp), %r14
movq 0x18(%rsp), %r15
jmp 0x1c4633
testq %r14, %r14
sete %al
jmp 0x1c48bb
movq %r9, %rbx
leaq (%rdi,%rax,8), %rsi
callq 0x19dd99
movq (%rbx), %rax
testq %rax, %rax
movq (%rsp), %rcx
movq %rbx, %r9
je 0x1c47a2
leaq 0x1(%rax), %rdx
cmpq $0x3, %rdx
movl $0x2, %r11d
cmovaeq %rdx, %r11
movl $0x1, %edx
xorl %edi, %edi
xorl %esi, %esi
cmpq %rax, %rdx
je 0x1c4686
movq 0x10(%r9), %r8
movq (%r8,%rdx,8), %r9
xorq (%r8,%rdi,8), %r9
shrq $0x20, %r9
movq 0x8(%rsp), %r9
je 0x1c46eb
movq %rdx, %r8
subq %rdi, %r8
cmpq $0x2, %r8
jb 0x1c46e8
movq 0x10(%r9), %r8
testb $-0x80, 0x3(%r8,%rdi,8)
sete %r9b
cmpq %rdi, %rdx
seta %r10b
andb %r9b, %r10b
cmpb $0x1, %r10b
jne 0x1c46de
movq (%r8,%rdi,8), %r9
testl %r9d, %r9d
jns 0x1c46d6
movq (%rcx), %r10
andl $0x7fffffff, %r9d       # imm = 0x7FFFFFFF
imulq $0xa8, %r9, %r9
movl $0xffffffff, 0x10(%r10,%r9) # imm = 0xFFFFFFFF
incq %rsi
incq %rdi
cmpq %rdi, %rdx
jne 0x1c46b0
movq %rdx, %rdi
movq 0x8(%rsp), %r9
jmp 0x1c46eb
movq %rdx, %rdi
incq %rdx
cmpq %r11, %rdx
jne 0x1c466a
testq %rsi, %rsi
je 0x1c47a2
movq 0x10(%rcx), %rax
testq %rax, %rax
je 0x1c478e
xorl %ebx, %ebx
xorl %r14d, %r14d
xorl %r15d, %r15d
movq (%rcx), %r13
cmpl $-0x1, 0x10(%r13,%rbx)
je 0x1c477d
cmpq %r15, %r14
je 0x1c477a
imulq $0xa8, %r15, %rbp
addq %r13, %rbp
movl $0xa8, %edx
leaq 0x40(%rsp), %rdi
movq %rbp, %rsi
callq 0x2160
addq %rbx, %r13
movl $0xa8, %edx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x2160
movq (%rsp), %rax
movq (%rax), %rdi
addq %rbx, %rdi
movl $0xa8, %edx
leaq 0x40(%rsp), %rsi
callq 0x2160
movq 0x8(%rsp), %r9
movq (%rsp), %rcx
movq 0x10(%rcx), %rax
incq %r15
incq %r14
addq $0xa8, %rbx
cmpq %rax, %r14
jb 0x1c4715
jmp 0x1c4791
xorl %r15d, %r15d
movq %r15, 0x10(%rcx)
movq 0x120(%rsp), %r14
movq 0x18(%rsp), %r15
movq $0x0, (%r9)
testq %r14, %r14
je 0x1c48b9
testq %r15, %r15
je 0x1c48c2
addq 0x10(%rsp), %r12
shlq $0x4, %r15
leaq (%r15,%r15,2), %rbx
xorl %r14d, %r14d
movl $0x2, %r15d
testb $-0x42, 0x28(%r12,%r14)
jne 0x1c482c
movq (%r9), %rdi
movq 0x10(%r9), %rax
cmpq 0x8(%r9), %rdi
jne 0x1c4811
leaq (%rdi,%rdi), %rsi
testq %rdi, %rdi
cmoveq %r15, %rsi
movq %rsi, 0x8(%r9)
shlq $0x3, %rsi
movq %rax, %rdi
callq 0x2370
movq 0x8(%rsp), %r9
movq (%rsp), %rcx
movq %rax, 0x10(%r9)
movq (%r9), %rdi
movl (%r12,%r14), %edx
movl 0x4(%r12,%r14), %esi
shlq $0x20, %rdx
orq %rdx, %rsi
leaq 0x1(%rdi), %rdx
movq %rdx, (%r9)
movq %rsi, (%rax,%rdi,8)
addq $0x30, %r14
cmpq %r14, %rbx
jne 0x1c47d1
movq (%r9), %r12
cmpq $0x2, %r12
jb 0x1c48df
movq 0x10(%r9), %rdi
leaq (%rdi,%r12,8), %rsi
callq 0x19dd99
movq 0x8(%rsp), %rax
cmpq $0x0, (%rax)
je 0x1c48d0
movq 0x10(%rax), %rax
xorl %r9d, %r9d
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
xorl %r12d, %r12d
movq (%rsp), %rcx
movq (%rax,%r9,8), %rdi
testq %r12, %r12
je 0x1c488c
movq %rdi, %r8
shrq $0x20, %r8
movq -0x8(%rax,%r12,8), %rsi
cmpl %esi, %r8d
jbe 0x1c48a2
movq %rdi, (%rax,%r12,8)
incq %r12
incq %r9
movq 0x8(%rsp), %rsi
cmpq (%rsi), %r9
jb 0x1c4872
jmp 0x1c48d7
movl %edi, %edi
movl %esi, %r8d
cmpl %r8d, %edi
jbe 0x1c4893
andq %rdx, %rsi
orq %rdi, %rsi
movq %rsi, -0x8(%rax,%r12,8)
jmp 0x1c4893
movb $0x1, %al
movq %rax, 0x10(%rsp)
jmp 0x1c48cb
movq $0x0, 0x10(%rsp)
xorl %r12d, %r12d
jmp 0x1c48e8
xorl %r12d, %r12d
movq (%rsp), %rcx
movq 0x8(%rsp), %rax
movq %r12, (%rax)
movq $0x0, 0x10(%rsp)
movq 0x10(%rcx), %r13
testq %r13, %r13
je 0x1c4b76
xorl %r15d, %r15d
movq 0x6c980(%rip), %xmm3    # 0x231280
movapd 0x6c988(%rip), %xmm4    # 0x231290
xorl %r11d, %r11d
xorl %ebx, %ebx
movq %r12, 0x18(%rsp)
movq (%rcx), %rbp
imulq $0xa8, %r15, %r14
addq %rbp, %r14
cmpb $0x0, 0x10(%rsp)
jne 0x1c4931
cmpl $0x0, 0xc(%r14)
je 0x1c4a41
cmpq %r15, %rbx
je 0x1c499d
movl $0xa8, %edx
leaq 0x40(%rsp), %rdi
movq %r14, %rsi
movq %r11, %r13
callq 0x2160
imulq $0xa8, %rbx, %r12
addq %r12, %rbp
movl $0xa8, %edx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2160
movq (%rsp), %rax
addq (%rax), %r12
movl $0xa8, %edx
movq %r12, %rdi
leaq 0x40(%rsp), %rsi
movq 0x18(%rsp), %r12
callq 0x2160
movapd 0x6c905(%rip), %xmm4    # 0x231290
movq 0x6c8ed(%rip), %xmm3    # 0x231280
movq %r13, %r11
movq (%rsp), %rcx
movq (%rcx), %rbp
imulq $0xa8, %rbx, %r14
cmpl $0x0, 0xc(%rbp,%r14)
je 0x1c4a29
leaq (%r14,%rbp), %rax
addq $0xc, %rax
movl $0x0, (%rax)
cmpq %rbx, %r11
je 0x1c4a26
imulq $0xa8, %r11, %r12
addq %rbp, %r12
movl $0xa8, %edx
leaq 0x40(%rsp), %rdi
movq %r12, %rsi
movq %r11, %r13
callq 0x2160
addq %r14, %rbp
movl $0xa8, %edx
movq %r12, %rdi
movq %rbp, %rsi
callq 0x2160
movq (%rsp), %rax
addq (%rax), %r14
movl $0xa8, %edx
movq %r14, %rdi
leaq 0x40(%rsp), %rsi
movq 0x18(%rsp), %r12
callq 0x2160
movapd 0x6c879(%rip), %xmm4    # 0x231290
movq 0x6c861(%rip), %xmm3    # 0x231280
movq %r13, %r11
movq (%rsp), %rcx
incq %r11
incq %rbx
movq 0x10(%rcx), %r13
incq %r15
cmpq %r13, %r15
jb 0x1c4912
jmp 0x1c4b7b
testq %r12, %r12
je 0x1c4adf
movl 0x4(%r14), %eax
movl 0x8(%r14), %r10d
incl %r10d
movq 0x8(%rsp), %rdx
movq 0x10(%rdx), %rdx
movq %r10, %rsi
subq %rax, %rsi
movq %rsi, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm4, %xmm1
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x20(%rsp), %xmm0
xorl %edi, %edi
xorl %esi, %esi
movq %rdi, %r8
movq (%rdx,%rsi,8), %rdi
movl %edi, %r9d
shrq $0x20, %rdi
cmpq %r10, %r9
cmovaeq %r10, %r9
cmpq %rax, %rdi
cmovbeq %rax, %rdi
subq %rdi, %r9
movl $0x0, %edi
cmovaeq %r9, %rdi
addq %r8, %rdi
movq %rdi, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm4, %xmm1
je 0x1c4ad7
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
ucomisd %xmm0, %xmm2
ja 0x1c4a30
incq %rsi
cmpq %rsi, %r12
jne 0x1c4a87
movl 0x10(%r14), %edx
cmpl $0x0, 0x1c(%r14)
movq %r11, 0x38(%rsp)
je 0x1c4b17
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
leaq (%rdx,%rdx,4), %rcx
movl (%rax,%rcx,8), %eax
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl %ecx, %eax
movl 0x18(%r14), %ecx
notl %ecx
addl %eax, %ecx
subl 0x14(%r14), %eax
jmp 0x1c4b21
movl 0x14(%r14), %ecx
movl 0x18(%r14), %eax
incl %eax
movq 0x30(%rsp), %r8
movq 0x28(%r8), %rsi
movq (%rsi,%rdx,8), %rdx
movl %edx, %esi
shrq $0x20, %rdx
leaq (%rdx,%rdx,2), %rdi
shlq $0x4, %rdi
addq 0x10(%r8), %rdi
movl %ecx, %edx
movl %eax, %ecx
movsd 0x20(%rsp), %xmm0
callq 0x1c3def
testq %rax, %rax
movq (%rsp), %rcx
movq 0x38(%rsp), %r11
movq 0x6c71d(%rip), %xmm3    # 0x231280
movapd 0x6c725(%rip), %xmm4    # 0x231290
jne 0x1c4a30
jmp 0x1c4931
xorl %ebx, %ebx
xorl %r11d, %r11d
movq %rbx, 0x10(%rcx)
movq 0x128(%rsp), %rax
movq %r11, (%rax)
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq