// File: /workspace/github_c_makefile_star2_O1/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, %r13d
movq %rdi, %r14
movq 0x10(%rdi), %rax
cmpl $0x5, 0xc0(%rax)
jl 0xfe7c
movl 0x24(%r14), %eax
xorl %r12d, %r12d
testb $0x20, %al
jne 0xff1b
orl $0x20, %eax
movl %eax, 0x24(%r14)
movq 0x10(%r14), %rdi
cmpl $0x0, 0x10(%rdi)
jle 0xfe68
addq $0x10, %rdi
xorl %r15d, %r15d
incl %r15d
movl %r15d, %esi
callq 0x911c
movq (%rax), %rdi
testq %rdi, %rdi
je 0xfe5a
cmpb $0x1, 0x20(%rdi)
jne 0xfe5a
movl 0x44(%rax), %ecx
testb $0x20, %cl
jne 0xfe5a
orl $0x20, %ecx
movl %ecx, 0x44(%rax)
movl 0xc(%rax), %edx
movl %edx, %esi
imull %r13d, %esi
imull %ebp, %edx
movl %ebx, %ecx
callq 0xfdcb
testl %eax, %eax
jne 0xff2d
movq 0x10(%r14), %rax
leaq 0x10(%rax), %rdi
cmpl 0x10(%rax), %r15d
jl 0xfe18
cmpl $0x1, %ebx
je 0xff1b
cmpl $0x4, %ebx
je 0xff1b
jmp 0xfe94
cmpl $0x4, %ebx
je 0xff13
cmpl $0x1, %ebx
jne 0xfe94
orb $-0x80, 0x24(%r14)
jmp 0xff18
movq 0x10(%r14), %r12
cmpl $0x0, 0x30(%r12)
jle 0xff18
movl %r13d, %eax
leaq 0x30(%r12), %r13
addq $0x50, %r12
movl %eax, 0x4(%rsp)
addl %eax, %ebp
xorl %r15d, %r15d
incl %r15d
cmpl (%r14), %r15d
je 0xff0b
movq %r12, %rdi
movl %r15d, %esi
callq 0x911c
cmpl $0x0, (%rax)
je 0xff0b
movq %r13, %rdi
movl %r15d, %esi
callq 0x911c
movl 0x18(%rax), %ecx
cmpl %ebp, %ecx
jge 0xff0b
addl 0x1c(%rax), %ecx
cmpl 0x4(%rsp), %ecx
jle 0xff0b
cmpl $0x3, %ebx
je 0xfefd
cmpl $0x2, %ebx
jne 0xff0b
cmpb $0x1, 0x20(%rax)
je 0xff32
cmpl $0x3, %ebx
jne 0xff0b
cmpb $0x0, 0x20(%rax)
jne 0xff0b
movb $0x2, 0x20(%rax)
andb $0x7f, 0x24(%rax)
cmpl (%r13), %r15d
jl 0xfeb5
jmp 0xff18
andb $0x7f, 0x24(%r14)
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %r12d
jmp 0xff1b
movl $0x2a, %r12d
jmp 0xff1b