// File: /workspace/github_c_makefile_star2_O3/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, 0x4(%rsp)
movq %rdi, %r14
movq 0x10(%rdi), %r12
cmpl $0x5, 0xc0(%r12)
jl 0xfc3c
movl 0x24(%r14), %eax
xorl %r13d, %r13d
testb $0x20, %al
jne 0xfcc8
orl $0x20, %eax
movl %eax, 0x24(%r14)
cmpl $0x0, 0x10(%r12)
jle 0xfc28
addq $0x10, %r12
xorl %r15d, %r15d
movq %r12, %rdi
incl %r15d
movl %r15d, %esi
callq 0x91d8
movq (%rax), %rdi
testq %rdi, %rdi
je 0xfc18
cmpb $0x1, 0x20(%rdi)
jne 0xfc18
movl 0x44(%rax), %ecx
testb $0x20, %cl
jne 0xfc18
orl $0x20, %ecx
movl %ecx, 0x44(%rax)
movl 0xc(%rax), %edx
movl %edx, %esi
imull 0x4(%rsp), %esi
imull %ebp, %edx
movl %ebx, %ecx
callq 0xfb84
testl %eax, %eax
jne 0xfcda
movq 0x10(%r14), %r12
leaq 0x10(%r12), %rdi
cmpl 0x10(%r12), %r15d
jl 0xfbd5
cmpl $0x1, %ebx
je 0xfcc8
cmpl $0x4, %ebx
je 0xfcc8
jmp 0xfc4d
cmpl $0x4, %ebx
je 0xfcc0
cmpl $0x1, %ebx
jne 0xfc4d
orb $-0x80, 0x24(%r14)
jmp 0xfcc5
cmpl $0x0, 0x30(%r12)
jle 0xfcc5
leaq 0x30(%r12), %r13
addq $0x50, %r12
addl 0x4(%rsp), %ebp
xorl %r15d, %r15d
incl %r15d
cmpl (%r14), %r15d
je 0xfcb8
movq %r12, %rdi
movl %r15d, %esi
callq 0x91d8
cmpl $0x0, (%rax)
je 0xfcb8
movq %r13, %rdi
movl %r15d, %esi
callq 0x91d8
movl 0x18(%rax), %ecx
cmpl %ebp, %ecx
jge 0xfcb8
addl 0x1c(%rax), %ecx
cmpl 0x4(%rsp), %ecx
jle 0xfcb8
cmpl $0x3, %ebx
je 0xfcaa
cmpl $0x2, %ebx
jne 0xfcb8
cmpb $0x1, 0x20(%rax)
jne 0xfcb8
jmp 0xfcdf
cmpb $0x0, 0x20(%rax)
jne 0xfcb8
movb $0x2, 0x20(%rax)
andb $0x7f, 0x24(%rax)
cmpl (%r13), %r15d
jl 0xfc65
jmp 0xfcc5
andb $0x7f, 0x24(%r14)
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %r13d
jmp 0xfcc8
movl $0x2a, %r13d
jmp 0xfcc8