// File: /workspace/github_c_makefile_star2_O2/heltilda[P]cicada/intrpt.c
// Function: checkMemberOverlap
ccInt checkMemberOverlap(window *theWindow, ccInt newOffset, ccInt newWidth, ccInt mode)
{
    ccInt counter, rtrn;
    member *loopMember;
    pinned_LL *windowsPLL;
    window *loopWindow;
    
    if (theWindow->variable_ptr->type >= composite_type)  {
        if (isBusy(theWindow, busy_overlap_flag))  return passed;
        setBusy(theWindow, busy_overlap_flag);
        
        for (counter = 1; counter <= theWindow->variable_ptr->mem.members.elementNum; counter++)  {
            
            loopMember = LL_member(theWindow->variable_ptr, counter);
            if (loopMember->memberWindow != NULL)  {
            if ((loopMember->memberWindow->jamStatus == can_jam) && (!isBusy(loopMember, busy_overlap_flag)))  {
                setBusy(loopMember, busy_overlap_flag);
                rtrn = checkMemberOverlap(loopMember->memberWindow,
                            newOffset*loopMember->indices, newWidth*loopMember->indices, mode);
                if (rtrn != passed)  return rtrn;
        }   }}
        
        if ((mode == cbo_set_flags) || (mode == cbo_unset_flags))  return passed;
    }
    
    else  {
        if (mode == cbo_set_flags)  {
            setBusy(theWindow, busy_resize_flag);
            return passed;       }
        else if (mode == cbo_unset_flags)  {
            clearBusy(theWindow, busy_resize_flag);
            return passed;
    }   }
    
    windowsPLL = &(theWindow->variable_ptr->windows);
    
    for (counter = 1; counter <= windowsPLL->data.elementNum; counter++)  {
    if ((counter != theWindow->PLL_index) && (*LL_int(&(windowsPLL->references), counter) != 0))  {
        loopWindow = (window *) element(&(windowsPLL->data), counter);
        
        if ((loopWindow->offset < newOffset + newWidth) &&
            (loopWindow->offset + loopWindow->width > newOffset) && (~isBusy(loopWindow, busy_resize_flag)))  {
            
            if ((mode == cbo_check) && (loopWindow->jamStatus == can_jam))  {
                return overlapping_window_err;         }
            else if ((mode == cbo_unjam) && (loopWindow->jamStatus == cannot_jam))  {
                loopWindow->jamStatus = unjammed;
                clearBusy(loopWindow, busy_resize_flag);        }
    }}  }
    
    return passed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %ebp
movl %esi, %r12d
movq %rdi, %r14
movq 0x10(%rdi), %r13
cmpl $0x5, 0xc0(%r13)
jl 0xf05a
movl 0x24(%r14), %ecx
xorl %eax, %eax
testb $0x20, %cl
jne 0xf0f7
orl $0x20, %ecx
movl %ecx, 0x24(%r14)
pushq $0x1
popq %r15
cmpl 0x10(%r13), %r15d
jg 0xf072
addq $0x10, %r13
movq %r13, %rdi
movl %r15d, %esi
callq 0x9088
movq (%rax), %rdi
testq %rdi, %rdi
je 0xf051
cmpb $0x1, 0x20(%rdi)
jne 0xf051
movl 0x44(%rax), %ecx
testb $0x20, %cl
jne 0xf051
orl $0x20, %ecx
movl %ecx, 0x44(%rax)
movl 0xc(%rax), %edx
movl %edx, %esi
imull %r12d, %esi
imull %ebp, %edx
movl %ebx, %ecx
callq 0xefc8
testl %eax, %eax
jne 0xf0f7
incl %r15d
movq 0x10(%r14), %r13
jmp 0xf005
cmpl $0x4, %ebx
je 0xf0f0
cmpl $0x1, %ebx
jne 0xf081
orb $-0x80, 0x24(%r14)
jmp 0xf0f5
cmpl $0x1, %ebx
je 0xf0f5
cmpl $0x4, %ebx
movl $0x0, %eax
je 0xf0f7
movl %r12d, %eax
pushq $0x1
popq %r12
leaq 0x30(%r13), %r15
addq $0x50, %r13
movl %eax, 0x4(%rsp)
addl %eax, %ebp
cmpl (%r15), %r12d
jg 0xf0f5
cmpl (%r14), %r12d
je 0xf0eb
movq %r13, %rdi
movl %r12d, %esi
callq 0x9088
cmpl $0x0, (%rax)
je 0xf0eb
movq %r15, %rdi
movl %r12d, %esi
callq 0x9088
movl 0x18(%rax), %ecx
cmpl %ebp, %ecx
jge 0xf0eb
addl 0x1c(%rax), %ecx
cmpl 0x4(%rsp), %ecx
jle 0xf0eb
cmpl $0x3, %ebx
je 0xf0dd
cmpl $0x2, %ebx
jne 0xf0eb
cmpb $0x1, 0x20(%rax)
jne 0xf0eb
jmp 0xf106
cmpb $0x0, 0x20(%rax)
jne 0xf0eb
movb $0x2, 0x20(%rax)
andb $0x7f, 0x24(%rax)
incl %r12d
jmp 0xf096
andb $0x7f, 0x24(%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x2a
popq %rax
jmp 0xf0f7