// File: /workspace/github_c_makefile_star2_O2/heltilda[P]cicada/bytecd.c
// Function: resizeIndices
void resizeIndices(member *stemMember, ccInt stemWidth, ccInt insertionOffset, ccInt newIndices)
{
    member *holdGLMember;
    ccInt counter, count_to_four, c2, cboIndices, rtrn = passed;
    
    
        // First check to see if there are overlaps with existing members before resizing, as this is disallowed.
        // We don't want to have a partial resize if there's an overlap error midway through.
    
    if (stemMember->memberWindow != NULL)  {
        
        for (c2 = 0; c2 < stemWidth; c2++)  {    // in general baseView straddles multiple indices
            if (newIndices > 0)  cboIndices = newIndices;
            else  cboIndices = -newIndices;
            
                // Checking involves a four-step procedure, calling checkMemberOverlap each time.
                // Just run it 4 times and pass the counter.  Need to unflagWindow() after each CBO() call.
            
            for (count_to_four = 1; count_to_four <= 4; count_to_four++)    {
                ccInt onePassRtrn = checkMemberOverlap(stemMember->memberWindow,
                            c2*stemMember->indices + insertionOffset, cboIndices, count_to_four);
                unflagWindow(stemMember->memberWindow, busy_overlap_flag);
                if (onePassRtrn != passed)  {  rtrn = onePassRtrn;  count_to_four = 3;  }     }
            if (rtrn != passed)  {  setError(rtrn, pcCodePtr-1);  return;  }    }
        
        holdGLMember = GL_Path.stemMember;   // delete GLPath.stemMember for safety (AddMem() won't know it stores correct value after resize)
        
        
            // Start from the highest index and work backwards, so we don't delete from under our own feet
            // (element numbers above the deletion point will change when we delete).
        
        for (counter = stemWidth-1; counter >= 0; counter--)  {                            // stemMember should never be 'unjammed'?
            rtrn = addMemory(stemMember->memberWindow, counter*stemMember->indices + insertionOffset, newIndices);
            unflagVariables(stemMember->memberWindow->variable_ptr, busy_add_flag);
            if (rtrn != passed)  {  setError(rtrn, pcCodePtr-1);  return;  }        }
        
        GL_Path.stemMember = holdGLMember;      }
    
    
        // lastly, update the member indices
    
    stemMember->indices += newIndices;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r13d
movq %rdi, %r14
cmpq $0x0, (%rdi)
je 0x127c8
movl %edx, %ebp
movl %r13d, %r12d
negl %r12d
movl %r13d, 0x10(%rsp)
cmovsl %r13d, %r12d
xorl %r13d, %r13d
testl %esi, %esi
movl $0x0, %eax
movl %esi, 0xc(%rsp)
cmovgl %esi, %eax
movl %eax, 0x14(%rsp)
cmpl 0x14(%rsp), %r13d
je 0x12751
movl $0x0, (%rsp)
pushq $0x1
popq %r15
cmpl $0x4, %r15d
ja 0x1273a
movq (%r14), %rdi
movl 0xc(%r14), %esi
imull %r13d, %esi
addl %ebp, %esi
movl %r12d, %edx
movl %r15d, %ecx
callq 0xefc8
movl %eax, %ebx
movq (%r14), %rdi
pushq $0x20
popq %rsi
callq 0xf14c
incl %r15d
testl %ebx, %ebx
je 0x126ff
pushq $0x4
popq %r15
movl %ebx, (%rsp)
jmp 0x126ff
incl %r13d
movl (%rsp), %edi
testl %edi, %edi
je 0x126ed
movq 0x120cd(%rip), %rsi     # 0x24818
addq $-0x4, %rsi
jmp 0x127aa
movq 0x12110(%rip), %rax     # 0x24868
movq %rax, (%rsp)
pushq $0x10
popq %rbx
movl 0x10(%rsp), %r13d
movl 0xc(%rsp), %r15d
testl %r15d, %r15d
jle 0x127bd
decl %r15d
movq (%r14), %rdi
movl 0xc(%r14), %esi
imull %r15d, %esi
addl %ebp, %esi
movl %r13d, %edx
callq 0xdaa5
movl %eax, %r12d
movq (%r14), %rax
movq 0x10(%rax), %rdi
movl %ebx, %esi
callq 0xe756
testl %r12d, %r12d
je 0x12769
movq 0x12075(%rip), %rsi     # 0x24818
addq $-0x4, %rsi
movl %r12d, %edi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc7c2
movq (%rsp), %rax
movq %rax, 0x120a0(%rip)     # 0x24868
addl %r13d, 0xc(%r14)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq