// File: chhylp123[P]hifiasm/inter.cpp
// Function: extract_rovlp_by_ug(utg_ct_t*, mg_lchain_t*, vec_mg_lchain_t*, long)
int64_t extract_rovlp_by_ug(utg_ct_t *p, mg_lchain_t* o, vec_mg_lchain_t *chains, int64_t tOff)
{
	int64_t rs, re;
	rs = MAX((int32_t)p->s, o->rs); re = MIN((int32_t)p->e, o->re);
	if(rs > re) return 0;
	mg_lchain_t *x = NULL;
	kv_pushp(mg_lchain_t, *chains, &x); memset(x, 0, sizeof(*x));
	x->v = (p->x>>1)<<1; x->v += (((o->v&1) == (p->x&1))?0:1); x->rs = rs; x->re = re; x->off = tOff; 
	x->hash_pre = (uint32_t)-1; x->dist_pre = -1; x->qs = x->qe = -1;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jl 0x2d81e4
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x44(%rbp)
jmp 0x2d81ee
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
cltq
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jg 0x2d8213
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x48(%rbp)
jmp 0x2d821d
movq -0x18(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
cltq
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x38(%rbp), %rax
jle 0x2d823d
movq $0x0, -0x8(%rbp)
jmp 0x2d8372
movq $0x0, -0x40(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x20(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x2d82a9
movq -0x20(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x2d8273
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
shlq %rax
movq %rax, -0x50(%rbp)
jmp 0x2d827e
movl $0x2, %eax
movq %rax, -0x50(%rbp)
jmp 0x2d827e
movq -0x50(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rax
imulq $0x28, 0x10(%rax), %rsi
callq 0x2360
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rdx
movq 0x8(%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, 0x8(%rdx)
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x2100
movq -0x10(%rbp), %rax
movl (%rax), %ecx
shrl %ecx
shll %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x18(%rbp), %rax
movl 0x8(%rax), %edx
andl $0x1, %edx
movq -0x10(%rbp), %rax
movl (%rax), %esi
andl $0x1, %esi
movl $0x1, %ecx
xorl %eax, %eax
cmpl %esi, %edx
cmovel %eax, %ecx
movq -0x40(%rbp), %rax
addl 0x8(%rax), %ecx
movl %ecx, 0x8(%rax)
movq -0x30(%rbp), %rax
movl %eax, %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x38(%rbp), %rax
movl %eax, %ecx
movq -0x40(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x28(%rbp), %rax
movl %eax, %ecx
movq -0x40(%rbp), %rax
movl %ecx, (%rax)
movq -0x40(%rbp), %rax
movl $0xffffffff, 0x24(%rax) # imm = 0xFFFFFFFF
movq -0x40(%rbp), %rax
movl $0xffffffff, 0x20(%rax) # imm = 0xFFFFFFFF
movq -0x40(%rbp), %rax
movl $0xffffffff, 0x18(%rax) # imm = 0xFFFFFFFF
movq -0x40(%rbp), %rax
movl $0xffffffff, 0x14(%rax) # imm = 0xFFFFFFFF
movq $0x1, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)