// File: chhylp123[P]hifiasm/Overlaps.cpp
// Function: update_weak_by_contain(void*, long, int)
static void update_weak_by_contain(void *data, long i, int tid)
{
    sset_aux *sl = (sset_aux *)data;
    ma_hit_t_alloc *x = &(sl->src[i]);
    uint32_t k, qn, tn; int32_t idx;
    if(sl->ul_occ == 0) {
        for (k = 0; k < x->length; k++) {
            if(x->buffer[k].bl&((uint32_t)0x40000000)) x->buffer[k].del = 1;
        }
    } else if(sl->ul_occ == 1) {
        for (k = 0; k < x->length; k++) {
            qn = Get_qn(x->buffer[k]);
            tn = Get_tn(x->buffer[k]);
            if(qn > tn) continue;
            if((x->buffer[k].del) && (x->buffer[k].bl&((uint32_t)0x40000000))) {
                if(reset_weak_ovlp(sl->src, qn, tn)) {
                    idx = get_specific_overlap(&(sl->src[tn]), tn, qn);
                    sl->src[tn].buffer[idx].del = x->buffer[k].del = 0;
                }
            }            
        }
    } else {
        for (k = 0; k < x->length; k++) {
            if(x->buffer[k].bl&((uint32_t)0x40000000)) {
                x->buffer[k].bl -= ((uint32_t)0x40000000);
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
imulq $0x18, -0x10(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x30(%rax)
jne 0xf1118
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jae 0xf1113
movq -0x28(%rbp), %rax
movq (%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x20, %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
andl $0x40000000, %eax       # imm = 0x40000000
cmpl $0x0, %eax
je 0xf1106
movq -0x28(%rbp), %rax
movq (%rax), %rax
movl -0x2c(%rbp), %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)
jmp 0xf1108
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xf10a1
jmp 0xf1319
movq -0x20(%rbp), %rax
cmpq $0x1, 0x30(%rax)
jne 0xf1278
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jae 0xf1273
movq -0x28(%rbp), %rax
movq (%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
shrq $0x20, %rax
movl %eax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, -0x34(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x34(%rbp), %eax
jbe 0xf117d
jmp 0xf1265
movq -0x28(%rbp), %rax
movq (%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x3f, %rax
cmpl $0x0, %eax
je 0xf1263
movq -0x28(%rbp), %rax
movq (%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x20, %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
andl $0x40000000, %eax       # imm = 0x40000000
cmpl $0x0, %eax
je 0xf1263
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0x30(%rbp), %esi
movl -0x34(%rbp), %edx
callq 0xf0bb0
cmpl $0x0, %eax
je 0xf1261
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0x34(%rbp), %eax
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl -0x34(%rbp), %esi
movl -0x30(%rbp), %edx
callq 0xce1b0
movl %eax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
andq 0x18(%rax), %rcx
orq $0x0, %rcx
movq %rcx, 0x18(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x34(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq -0x38(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
andq 0x18(%rax), %rcx
orq $0x0, %rcx
movq %rcx, 0x18(%rax)
jmp 0xf1263
jmp 0xf1265
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xf112e
jmp 0xf1317
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jae 0xf1315
movq -0x28(%rbp), %rax
movq (%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
shrq $0x20, %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
andl $0x40000000, %eax       # imm = 0x40000000
cmpl $0x0, %eax
je 0xf1305
movq -0x28(%rbp), %rax
movq (%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rcx
shrq $0x20, %rcx
andq $0x7fffffff, %rcx       # imm = 0x7FFFFFFF
subl $0x40000000, %ecx       # imm = 0x40000000
movl %ecx, %ecx
movl %ecx, %edx
movq 0x18(%rax), %rcx
andq $0x7fffffff, %rdx       # imm = 0x7FFFFFFF
shlq $0x20, %rdx
movabsq $-0x7fffffff00000001, %rsi # imm = 0x80000000FFFFFFFF
andq %rsi, %rcx
orq %rdx, %rcx
movq %rcx, 0x18(%rax)
jmp 0xf1307
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xf127f
jmp 0xf1317
jmp 0xf1319
addq $0x40, %rsp
popq %rbp
retq
nop