// File: chhylp123[P]hifiasm/Purge_Dups.cpp
// Function: get_hap_arch(hap_overlaps*, unsigned int, unsigned int, int, float, int, asg_arc_t*)
int get_hap_arch(hap_overlaps* hap, uint32_t qLen, uint32_t tLen, int max_hang, float max_hang_rate, 
int min_ovlp, asg_arc_t* t)
{
    int r;
    ma_hit_t h;
    h.qns = hap->xUid;
    h.qns = h.qns << 32;
    h.qns = h.qns | hap->x_beg_pos;
    h.qe = hap->x_end_pos;
    h.tn = hap->yUid;
    h.ts = hap->y_beg_pos;
    h.te = hap->y_end_pos;
    h.rev = hap->rev;
    h.del = 0;
    h.bl = h.el = h.ml = h.no_l_indel = 0;

    r = ma_hit2arc(&h, qLen, tLen, max_hang, max_hang_rate, min_ovlp, t);
    if(r < 0) return r;
    uint64_t score = (hap->score >= 0? (hap->score) : (hap->score*(-1)));
    if(hap->score >= 0) score += (((uint64_t)1)<<63);
    t->ol = (uint32_t)score;
    t->ul >>= 32; t->ul <<= 32; t->ul |= (score>>32);
    return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movss %xmm0, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq %r9, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl 0x24(%rax), %eax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
shlq $0x20, %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x4(%rcx), %ecx
orq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, -0x54(%rbp)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x4c(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %eax
movl %eax, %ecx
movq -0x48(%rbp), %rax
andq $0x1, %rcx
shlq $0x1f, %rcx
movabsq $-0x80000001, %rdx      # imm = 0xFFFFFFFF7FFFFFFF
andq %rdx, %rax
orq %rcx, %rax
movq %rax, -0x48(%rbp)
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
andq -0x48(%rbp), %rax
orq $0x0, %rax
movq %rax, -0x48(%rbp)
movb $0x0, -0x3f(%rbp)
movq -0x48(%rbp), %rax
andq $-0x40000001, %rax      # imm = 0xBFFFFFFF
orq $0x0, %rax
movq %rax, -0x48(%rbp)
movb $0x0, -0x40(%rbp)
movabsq $-0x7fffffff00000001, %rax # imm = 0x80000000FFFFFFFF
andq -0x48(%rbp), %rax
orq $0x0, %rax
movq %rax, -0x48(%rbp)
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
movl -0x1c(%rbp), %ecx
movss -0x20(%rbp), %xmm0
movl -0x24(%rbp), %r8d
movq -0x30(%rbp), %r9
leaq -0x60(%rbp), %rdi
callq 0x172eb0
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jge 0x17cf57
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x17cff4
movq -0x10(%rbp), %rax
cmpq $0x0, 0x30(%rax)
jl 0x17cf70
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x70(%rbp)
jmp 0x17cf7d
movq -0x10(%rbp), %rax
imulq $-0x1, 0x30(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x30(%rax)
jl 0x17cfa2
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
addq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movl %eax, %edx
movq -0x30(%rbp), %rax
movl 0xc(%rax), %ecx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl $0x80000000, %ecx       # imm = 0x80000000
orl %edx, %ecx
movl %ecx, 0xc(%rax)
movq -0x30(%rbp), %rax
movq (%rax), %rcx
shrq $0x20, %rcx
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq (%rax), %rcx
shlq $0x20, %rcx
movq %rcx, (%rax)
movq -0x68(%rbp), %rcx
shrq $0x20, %rcx
movq -0x30(%rbp), %rax
orq (%rax), %rcx
movq %rcx, (%rax)
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)