// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x5, 0xc0(%rax)
jl 0x13daa
movq -0x10(%rbp), %rax
movl 0x24(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x13cc5
movl $0x0, -0x4(%rbp)
jmp 0x13ef8
movq -0x10(%rbp), %rax
movl 0x24(%rax), %ecx
orl $0x20, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x24(%rax)
movl $0x1, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
cmpl 0x10(%rcx), %eax
jg 0x13d90
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
addq $0x10, %rdi
movl -0x20(%rbp), %esi
callq 0x9700
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
je 0x13d80
movq -0x30(%rbp), %rax
movq (%rax), %rax
movsbl 0x20(%rax), %eax
cmpl $0x1, %eax
jne 0x13d7e
movq -0x30(%rbp), %rax
movl 0x44(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
jne 0x13d7e
movq -0x30(%rbp), %rax
movl 0x44(%rax), %ecx
orl $0x20, %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x44(%rax)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movl -0x14(%rbp), %esi
movq -0x30(%rbp), %rax
imull 0xc(%rax), %esi
movl -0x18(%rbp), %edx
movq -0x30(%rbp), %rax
imull 0xc(%rax), %edx
movl -0x1c(%rbp), %ecx
callq 0x13c80
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x13d7c
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x13ef8
jmp 0x13d7e
jmp 0x13d80
jmp 0x13d82
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x13cdd
cmpl $0x1, -0x1c(%rbp)
je 0x13d9c
cmpl $0x4, -0x1c(%rbp)
jne 0x13da8
movl $0x0, -0x4(%rbp)
jmp 0x13ef8
jmp 0x13dfa
cmpl $0x1, -0x1c(%rbp)
jne 0x13dd0
movq -0x10(%rbp), %rax
movl 0x24(%rax), %ecx
orl $0x80, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x24(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x13ef8
cmpl $0x4, -0x1c(%rbp)
jne 0x13df6
movq -0x10(%rbp), %rax
movl 0x24(%rax), %ecx
andl $0xffffff7f, %ecx       # imm = 0xFFFFFF7F
movq -0x10(%rbp), %rax
movl %ecx, 0x24(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x13ef8
jmp 0x13df8
jmp 0x13dfa
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
addq $0x30, %rax
movq %rax, -0x38(%rbp)
movl $0x1, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl (%rcx), %eax
jg 0x13ef1
movl -0x20(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
je 0x13ee1
movq -0x38(%rbp), %rdi
addq $0x20, %rdi
movl -0x20(%rbp), %esi
callq 0x9700
cmpl $0x0, (%rax)
je 0x13ee1
movq -0x38(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0x9700
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movl 0x18(%rax), %eax
movl -0x14(%rbp), %ecx
addl -0x18(%rbp), %ecx
cmpl %ecx, %eax
jge 0x13edf
movq -0x40(%rbp), %rax
movl 0x18(%rax), %eax
movq -0x40(%rbp), %rcx
addl 0x1c(%rcx), %eax
cmpl -0x14(%rbp), %eax
jle 0x13edf
movq -0x40(%rbp), %rax
movl 0x24(%rax), %eax
andl $0x80, %eax
xorl $-0x1, %eax
cmpl $0x0, %eax
je 0x13edf
cmpl $0x2, -0x1c(%rbp)
jne 0x13eac
movq -0x40(%rbp), %rax
movsbl 0x20(%rax), %eax
cmpl $0x1, %eax
jne 0x13eac
movl $0x2a, -0x4(%rbp)
jmp 0x13ef8
cmpl $0x3, -0x1c(%rbp)
jne 0x13edb
movq -0x40(%rbp), %rax
movsbl 0x20(%rax), %eax
cmpl $0x0, %eax
jne 0x13edb
movq -0x40(%rbp), %rax
movb $0x2, 0x20(%rax)
movq -0x40(%rbp), %rax
movl 0x24(%rax), %ecx
andl $0xffffff7f, %ecx       # imm = 0xFFFFFF7F
movq -0x40(%rbp), %rax
movl %ecx, 0x24(%rax)
jmp 0x13edd
jmp 0x13edf
jmp 0x13ee1
jmp 0x13ee3
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x13e11
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)