// File: /workspace/github_c_makefile_star2_O0/heltilda[P]cicada/intrpt.c
// Function: addMemory
ccInt addMemory(window *theWindow, ccInt insertionOffset, ccInt newIndices)
{
    member *loopMember;
    window *loopWindow;
    view *loopView;
    variable *theVariable = theWindow->variable_ptr;
    ccInt counter, rtrn, fullInsertionOffset = insertionOffset + theWindow->offset;
    
    if (newIndices == 0)  return passed;
    
    theVariable->instances += newIndices;
    
    
        // adjust the offset/index_width of any window that could conceivably be affected
    
    for (counter = 1; counter <= theVariable->windows.data.elementNum; counter++)  {
        loopWindow = (window *) element(&(theVariable->windows.data), counter);    // 1st cond below:  if theWindow isn't yet ref'd
        if ((loopWindow == theWindow) || (*LL_int(&(theVariable->windows.references), counter) != 0))  {
            adjustOffsetAndIW(loopWindow == theWindow,
                    &(loopWindow->offset), &(loopWindow->width), fullInsertionOffset, newIndices);
    }   }
    
    if (baseView.windowPtr != NULL)  {
    if (baseView.windowPtr->variable_ptr == theVariable)  {
        adjustOffsetAndIW(baseView.windowPtr->variable_ptr == theWindow->variable_ptr,
                    &(baseView.offset), &(baseView.width), fullInsertionOffset, newIndices);
    }}
    if (searchView.windowPtr != NULL)  {
    if (searchView.windowPtr->variable_ptr == theVariable)  {
        adjustOffsetAndIW(searchView.windowPtr->variable_ptr == theWindow->variable_ptr,
                    &(searchView.offset), &(searchView.width), fullInsertionOffset, newIndices);
    }}
    
    for (counter = 1; counter <= PCStack.top; counter++)  {
        loopView = (view *) element(&(PCStack.data), counter);
        if (loopView->windowPtr != NULL)  {
        if (loopView->windowPtr->variable_ptr == theVariable)     {
            adjustOffsetAndIW(loopView->windowPtr->variable_ptr == theWindow->variable_ptr,
                    &(loopView->offset), &(loopView->width), fullInsertionOffset, newIndices);
    }   }}
    
    
        // recursively call addMemory() for each member, if it is a composite or array variable
    
    if (theVariable->type >= composite_type)  {
        if (isBusy(theVariable, busy_add_flag))  return passed;
        setBusy(theVariable, busy_add_flag);
        
        for (counter = 1; counter <= theVariable->mem.members.elementNum; counter++)  {
            loopMember = LL_member(theVariable, counter);
            if ((loopMember->memberWindow != NULL) && (loopMember->memberWindow->jamStatus != unjammed))  {
                if (((ccFloat) newIndices)*loopMember->indices > ccIntMax)  return index_argument_err;
                rtrn = addMemory(loopMember->memberWindow,
                        insertionOffset*(loopMember->indices)+loopMember->memberWindow->offset, newIndices*loopMember->indices);
                if (rtrn != passed)  return rtrn;
        }   }
        
        if (GL_Path.stemView.windowPtr != NULL)  {
        if (GL_Path.stemView.windowPtr->variable_ptr == theVariable)  {
            adjustOffsetAndIW(GL_Path.stemView.windowPtr == theWindow,
                    &(GL_Path.stemView.offset), &(GL_Path.stemView.width), fullInsertionOffset, newIndices);
            GL_Path.stemMember = NULL;       // we can't tell if it was added to or pushed up
    }   }}
    
    
            // if a primitive variable, add the memory directly to the linked lists
    
    else  {
        if (newIndices > 0)  {
            
            if (theVariable->type != string_type)  {
                rtrn = insertElements(&(theVariable->mem.data), fullInsertionOffset+1, newIndices, ccTrue);
                if (rtrn != passed)  return rtrn;       }
            
            else  {         // allocate one big sublist in case the members LL isn't set up with spare room
                rtrn = addMember(theVariable, fullInsertionOffset+1, 0, NULL, ccFalse, newIndices, ccFalse);
                if (rtrn != passed)  return rtrn;
                
                for (counter = fullInsertionOffset+1; counter <= fullInsertionOffset+newIndices; counter++)  {
                    
                    variable *oneStringVar;
                    window *oneStringWindow = NULL;
                    member *oneStringMember = NULL;
                    
                    rtrn = addVariable(&oneStringVar, char_type, char_type, 0, ccFalse);
                    if (rtrn == passed)  rtrn = addWindow(oneStringVar, 0, 0, &oneStringWindow, ccTrue);
                    if (rtrn == passed)  rtrn = addMember(theVariable, counter, 0, &oneStringMember, ccFalse, 0, ccTrue);
                    if (rtrn != passed)  return rtrn;
                    
                    oneStringMember->memberWindow = oneStringWindow;
                    refWindow(oneStringWindow);
        }   }   }
        else  {
            if (theVariable->type == string_type)  {
            for (counter = fullInsertionOffset+(-newIndices); counter >= fullInsertionOffset+1; counter--)  {
                removeMember(theVariable, counter);
            }}
            else  deleteElements(&(theVariable->mem.data), fullInsertionOffset+1, fullInsertionOffset+(-newIndices));
    }   }
    
    return passed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
addl 0x18(%rcx), %eax
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x18(%rbp)
jne 0x11a8d
movl $0x0, -0x4(%rbp)
jmp 0x11fdb
movl -0x18(%rbp), %ecx
movq -0x38(%rbp), %rax
addl 0xf0(%rax), %ecx
movl %ecx, 0xf0(%rax)
movl $0x1, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl 0x30(%rcx), %eax
jg 0x11b23
movq -0x38(%rbp), %rdi
addq $0x30, %rdi
movl -0x3c(%rbp), %esi
callq 0x9700
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x10(%rbp), %rax
je 0x11aea
movq -0x38(%rbp), %rdi
addq $0x30, %rdi
addq $0x20, %rdi
movl -0x3c(%rbp), %esi
callq 0x9700
cmpl $0x0, (%rax)
je 0x11b16
movq -0x28(%rbp), %rax
cmpq -0x10(%rbp), %rax
sete %al
andb $0x1, %al
movq -0x28(%rbp), %rsi
addq $0x18, %rsi
movq -0x28(%rbp), %rdx
addq $0x1c, %rdx
movl -0x44(%rbp), %ecx
movl -0x18(%rbp), %r8d
movsbl %al, %edi
callq 0x13f10
jmp 0x11b18
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x11aa7
leaq 0x1ac26(%rip), %rax     # 0x2c750
cmpq $0x0, 0x140(%rax)
je 0x11b95
leaq 0x1ac15(%rip), %rax     # 0x2c750
movq 0x140(%rax), %rax
movq 0x10(%rax), %rax
cmpq -0x38(%rbp), %rax
jne 0x11b93
leaq 0x1abfd(%rip), %rax     # 0x2c750
movq 0x140(%rax), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
sete %al
andb $0x1, %al
movl -0x44(%rbp), %ecx
movl -0x18(%rbp), %r8d
leaq 0x1abd7(%rip), %rdx     # 0x2c750
addq $0x140, %rdx            # imm = 0x140
movq %rdx, %rsi
addq $0x8, %rsi
addq $0xc, %rdx
movsbl %al, %edi
callq 0x13f10
jmp 0x11b95
leaq 0x1abb4(%rip), %rax     # 0x2c750
cmpq $0x0, 0x158(%rax)
je 0x11c07
leaq 0x1aba3(%rip), %rax     # 0x2c750
movq 0x158(%rax), %rax
movq 0x10(%rax), %rax
cmpq -0x38(%rbp), %rax
jne 0x11c05
leaq 0x1ab8b(%rip), %rax     # 0x2c750
movq 0x158(%rax), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
sete %al
andb $0x1, %al
movl -0x44(%rbp), %ecx
movl -0x18(%rbp), %r8d
leaq 0x1ab65(%rip), %rdx     # 0x2c750
addq $0x158, %rdx            # imm = 0x158
movq %rdx, %rsi
addq $0x8, %rsi
addq $0xc, %rdx
movsbl %al, %edi
callq 0x13f10
jmp 0x11c07
movl $0x1, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl 0x1ab11(%rip), %eax     # 0x2c728
jg 0x11c9f
movl -0x3c(%rbp), %esi
leaq 0x1aa71(%rip), %rdi     # 0x2c698
addq $0x90, %rdi
addq $0x8, %rdi
callq 0x9700
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
je 0x11c8f
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
cmpq -0x38(%rbp), %rax
jne 0x11c8d
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
sete %al
andb $0x1, %al
movq -0x30(%rbp), %rsi
addq $0x8, %rsi
movq -0x30(%rbp), %rdx
addq $0xc, %rdx
movl -0x44(%rbp), %ecx
movl -0x18(%rbp), %r8d
movsbl %al, %edi
callq 0x13f10
jmp 0x11c8f
jmp 0x11c91
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x11c0e
movq -0x38(%rbp), %rax
cmpl $0x5, 0xc0(%rax)
jl 0x11e2d
movq -0x38(%rbp), %rax
movl 0xf4(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x11cce
movl $0x0, -0x4(%rbp)
jmp 0x11fdb
movq -0x38(%rbp), %rax
movl 0xf4(%rax), %ecx
orl $0x10, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0xf4(%rax)
movl $0x1, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jg 0x11da8
movq -0x38(%rbp), %rdi
addq $0x10, %rdi
movl -0x3c(%rbp), %esi
callq 0x9700
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
je 0x11d98
movq -0x20(%rbp), %rax
movq (%rax), %rax
movsbl 0x20(%rax), %eax
cmpl $0x2, %eax
je 0x11d98
cvtsi2sdl -0x18(%rbp), %xmm0
movq -0x20(%rbp), %rax
cvtsi2sdl 0xc(%rax), %xmm1
mulsd %xmm1, %xmm0
movsd 0x10f3c(%rip), %xmm1    # 0x22c80
ucomisd %xmm1, %xmm0
jbe 0x11d56
movl $0x20, -0x4(%rbp)
jmp 0x11fdb
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rax
imull 0xc(%rax), %esi
movq -0x20(%rbp), %rax
movq (%rax), %rax
addl 0x18(%rax), %esi
movl -0x18(%rbp), %edx
movq -0x20(%rbp), %rax
imull 0xc(%rax), %edx
callq 0x11a50
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
je 0x11d96
movl -0x40(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x11fdb
jmp 0x11d98
jmp 0x11d9a
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x11cec
leaq 0x1a9a1(%rip), %rax     # 0x2c750
cmpq $0x0, 0x120(%rax)
je 0x11e28
leaq 0x1a990(%rip), %rax     # 0x2c750
movq 0x120(%rax), %rax
movq 0x10(%rax), %rax
cmpq -0x38(%rbp), %rax
jne 0x11e26
leaq 0x1a978(%rip), %rax     # 0x2c750
movq 0x120(%rax), %rax
cmpq -0x10(%rbp), %rax
sete %al
andb $0x1, %al
movl -0x44(%rbp), %ecx
movl -0x18(%rbp), %r8d
leaq 0x1a95a(%rip), %rdx     # 0x2c750
addq $0x108, %rdx            # imm = 0x108
addq $0x18, %rdx
movq %rdx, %rsi
addq $0x8, %rsi
addq $0xc, %rdx
movsbl %al, %edi
callq 0x13f10
leaq 0x1a935(%rip), %rax     # 0x2c750
movq $0x0, 0x108(%rax)
jmp 0x11e28
jmp 0x11fd4
cmpl $0x0, -0x18(%rbp)
jle 0x11f73
movq -0x38(%rbp), %rax
cmpl $0x4, 0xc0(%rax)
je 0x11e78
movq -0x38(%rbp), %rdi
addq $0x10, %rdi
movl -0x44(%rbp), %esi
addl $0x1, %esi
movl -0x18(%rbp), %edx
movl $0x1, %ecx
callq 0x8590
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
je 0x11e73
movl -0x40(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x11fdb
jmp 0x11f71
movq -0x38(%rbp), %rdi
movl -0x44(%rbp), %esi
addl $0x1, %esi
movl -0x18(%rbp), %r9d
xorl %r8d, %r8d
xorl %eax, %eax
movl %eax, %ecx
movl %r8d, %edx
movl $0x0, (%rsp)
callq 0x127d0
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
je 0x11eb0
movl -0x40(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x11fdb
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl -0x44(%rbp), %ecx
addl -0x18(%rbp), %ecx
cmpl %ecx, %eax
jg 0x11f6f
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
leaq -0x50(%rbp), %rdi
movl $0x1, %edx
xorl %r8d, %r8d
movl %edx, %esi
movl %r8d, %ecx
callq 0x12cb0
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
jne 0x11f13
movq -0x50(%rbp), %rdi
xorl %edx, %edx
leaq -0x58(%rbp), %rcx
movl $0x1, %r8d
movl %edx, %esi
callq 0xf600
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
jne 0x11f3c
movq -0x38(%rbp), %rdi
movl -0x3c(%rbp), %esi
xorl %r9d, %r9d
leaq -0x60(%rbp), %rcx
movl %r9d, %edx
movl %r9d, %r8d
movl $0x1, (%rsp)
callq 0x127d0
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
je 0x11f4d
movl -0x40(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x11fdb
movq -0x58(%rbp), %rcx
movq -0x60(%rbp), %rax
movq %rcx, (%rax)
movq -0x58(%rbp), %rdi
callq 0xf780
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x11eb9
jmp 0x11f71
jmp 0x11fd2
movq -0x38(%rbp), %rax
cmpl $0x4, 0xc0(%rax)
jne 0x11fb3
movl -0x44(%rbp), %eax
xorl %ecx, %ecx
subl -0x18(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl -0x44(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jl 0x11fb1
movq -0x38(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x136e0
movl -0x3c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x11f8d
jmp 0x11fd0
movq -0x38(%rbp), %rdi
addq $0x10, %rdi
movl -0x44(%rbp), %esi
addl $0x1, %esi
movl -0x44(%rbp), %edx
xorl %eax, %eax
subl -0x18(%rbp), %eax
addl %eax, %edx
callq 0x8880
jmp 0x11fd2
jmp 0x11fd4
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)