// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: normalize_ma_hit_t_single_side_advance_mult(ma_hit_t_alloc*, long, long)
void normalize_ma_hit_t_single_side_advance_mult(ma_hit_t_alloc* src, int64_t n_src, int64_t n_thread)
{
    ma_hit_t_aux aux; int64_t k; uint64_t z; ma_hit_t e;
    aux.n_thread = n_thread; aux.src = src; CALLOC(aux.buf, aux.n_thread);

    kt_for(aux.n_thread, update_ma_hit_t_norm, &aux, n_src);

    for (k = 0; k < aux.n_thread; k++) {
        for (z = 0; z < aux.buf[k].a.n; z++) {
            set_reverse_overlap(&e, &(src[aux.buf[k].a.a[z]>>32].buffer[(uint32_t)(aux.buf[k].a.a[z])]));
            src[aux.buf[k].a.a[z]>>32].buffer[(uint32_t)(aux.buf[k].a.a[z])].del = e.del = 1;
            add_ma_hit_t_alloc(&(src[Get_qn(e)]), &e);
        }
        free(aux.buf[k].a.a);
    }
    free(aux.buf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movl $0x20, %esi
callq 0x2140
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movl %eax, %edi
movq -0x10(%rbp), %rcx
leaq 0x199(%rip), %rsi       # 0xcea00
leaq -0x30(%rbp), %rdx
callq 0x16d710
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0xce9eb
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
jae 0xce9c2
movq -0x8(%rbp), %rax
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movq 0x10(%rcx), %rcx
movq -0x40(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rsi
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %eax, %eax
imulq $0x28, %rax, %rax
addq %rax, %rsi
leaq -0x68(%rbp), %rdi
callq 0xce230
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
andq -0x50(%rbp), %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
orq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movq 0x10(%rcx), %rcx
movq -0x40(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
shrq $0x20, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movq 0x10(%rcx), %rcx
movq -0x40(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movl %ecx, %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
andq 0x18(%rax), %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
orq %rdx, %rcx
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rdi
movq -0x68(%rbp), %rax
shrq $0x20, %rax
movl %eax, %eax
imulq $0x18, %rax, %rax
addq %rax, %rdi
leaq -0x68(%rbp), %rsi
callq 0xcd340
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xce88e
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
callq 0x2210
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xce878
movq -0x30(%rbp), %rdi
callq 0x2210
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)