// File: /workspace/github_c_makefile_star2_O3/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, %ebp
movq %rdi, %r14
cmpq $0x0, (%rdi)
je 0x14026
movl %esi, %r13d
movl %edx, 0x10(%rsp)
movl %ebp, 0xc(%rsp)
testl %esi, %esi
jle 0x13fcc
movl 0xc(%rsp), %eax
movl %eax, %ebp
negl %ebp
cmovsl %eax, %ebp
xorl %r12d, %r12d
movl %r13d, 0x14(%rsp)
movl $0x1, %ebx
xorl %r13d, %r13d
movq (%r14), %rdi
movl 0xc(%r14), %esi
imull %r12d, %esi
addl 0x10(%rsp), %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0xfb84
movl %eax, %r15d
movq (%r14), %rdi
movl $0x20, %esi
callq 0xfd28
movl $0x4, %ecx
incl %ebx
testl %r15d, %r15d
cmovnel %r15d, %r13d
cmovnel %ecx, %ebx
cmpl $0x5, %ebx
jl 0x13f7c
testl %r13d, %r13d
jne 0x14039
incl %r12d
movl 0x14(%rsp), %r13d
cmpl %r13d, %r12d
jne 0x13f74
movq 0x11895(%rip), %r15     # 0x25868
movl 0xc(%rsp), %ebp
movl 0x10(%rsp), %r12d
testl %r13d, %r13d
jle 0x1401f
decl %r13d
movq (%r14), %rdi
movl 0xc(%r14), %esi
imull %r13d, %esi
addl %r12d, %esi
movl %ebp, %edx
callq 0xe4ce
movl %eax, %ebx
movq (%r14), %rax
movq 0x10(%rax), %rdi
movl $0x10, %esi
callq 0xf27d
testl %ebx, %ebx
je 0x13fdc
movq 0x11801(%rip), %rsi     # 0x25818
addq $-0x4, %rsi
movl %ebx, %edi
jmp 0x14047
movq %r15, 0x11842(%rip)     # 0x25868
addl %ebp, 0xc(%r14)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x117d8(%rip), %rsi     # 0x25818
addq $-0x4, %rsi
movl %r13d, %edi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xcfa3