// File: chhylp123[P]hifiasm/gfa_ut.cpp
// Function: utg_cover_read_occ_by_qs(ma_ug_t*, long, long, uc_block_t*)
int64_t utg_cover_read_occ_by_qs(ma_ug_t *ug, int64_t oqs, int64_t oqe, uc_block_t *x)
{
    assert(oqs >= (int64_t)x->qs && oqs <= (int64_t)x->qe);
    assert(oqe >= (int64_t)x->qs && oqe <= (int64_t)x->qe);
    assert(oqe > oqs);
    int64_t s_off, e_off, k;
    s_off = get_offset_adjust(oqs-x->qs, x->qe-x->qs, x->te-x->ts);
	e_off = get_offset_adjust(x->qe-oqe, x->qe-x->qs, x->te-x->ts);
    if(x->rev) {
        k = s_off; s_off = e_off; e_off = k;
    }

    return ug_occ_w(x->ts + s_off, x->te - e_off, &(ug->u.a[x->hid]));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, %edx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x39(%rbp)
jl 0x32b363
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movl 0x8(%rcx), %ecx
cmpq %rcx, %rax
setle %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
testb $0x1, %al
jne 0x32b36c
jmp 0x32b36e
jmp 0x32b38d
leaq 0x6bf40(%rip), %rdi     # 0x3972b5
leaq 0x6ae3d(%rip), %rsi     # 0x3961b9
movl $0x131c, %edx           # imm = 0x131C
leaq 0x6bf5c(%rip), %rcx     # 0x3972e4
callq 0x2130
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, %edx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x3a(%rbp)
jl 0x32b3b8
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
movl 0x8(%rcx), %ecx
cmpq %rcx, %rax
setle %al
movb %al, -0x3a(%rbp)
movb -0x3a(%rbp), %al
testb $0x1, %al
jne 0x32b3c1
jmp 0x32b3c3
jmp 0x32b3e2
leaq 0x6bf66(%rip), %rdi     # 0x397330
leaq 0x6ade8(%rip), %rsi     # 0x3961b9
movl $0x131d, %edx           # imm = 0x131D
leaq 0x6bf07(%rip), %rcx     # 0x3972e4
callq 0x2130
movq -0x18(%rbp), %rax
cmpq -0x10(%rbp), %rax
jle 0x32b3ee
jmp 0x32b40d
leaq 0x6bf6a(%rip), %rdi     # 0x39735f
leaq 0x6adbd(%rip), %rsi     # 0x3961b9
movl $0x131e, %edx           # imm = 0x131E
leaq 0x6bedc(%rip), %rcx     # 0x3972e4
callq 0x2130
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movl 0x4(%rcx), %ecx
subq %rcx, %rax
movl %eax, %edi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %esi
movq -0x20(%rbp), %rax
subl 0x4(%rax), %esi
movq -0x20(%rbp), %rax
movl 0x10(%rax), %edx
movq -0x20(%rbp), %rax
subl 0xc(%rax), %edx
callq 0xc14d0
movl %eax, %eax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl 0x8(%rax), %eax
subq -0x18(%rbp), %rax
movl %eax, %edi
movq -0x20(%rbp), %rax
movl 0x8(%rax), %esi
movq -0x20(%rbp), %rax
subl 0x4(%rax), %esi
movq -0x20(%rbp), %rax
movl 0x10(%rax), %edx
movq -0x20(%rbp), %rax
subl 0xc(%rax), %edx
callq 0xc14d0
movl %eax, %eax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movb 0x20(%rax), %al
shrb $0x5, %al
andb $0x1, %al
cmpb $0x0, %al
je 0x32b4a0
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, %edi
addq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %esi
subq -0x30(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x20(%rbp), %rax
movl (%rax), %eax
imulq $0x28, %rax, %rax
addq %rax, %rdx
callq 0x327090
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)