// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0x18b74
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x18af2
cmpl $0x0, -0x14(%rbp)
jle 0x18a5b
movl -0x14(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x18a63
xorl %eax, %eax
subl -0x14(%rbp), %eax
movl %eax, -0x30(%rbp)
movl $0x1, -0x28(%rbp)
cmpl $0x4, -0x28(%rbp)
jg 0x18ac4
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl -0x2c(%rbp), %esi
movq -0x8(%rbp), %rax
imull 0xc(%rax), %esi
addl -0x10(%rbp), %esi
movl -0x30(%rbp), %edx
movl -0x28(%rbp), %ecx
callq 0x13c80
movl %eax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl $0x20, %esi
callq 0x13fc0
cmpl $0x0, -0x38(%rbp)
je 0x18ab7
movl -0x38(%rbp), %eax
movl %eax, -0x34(%rbp)
movl $0x3, -0x28(%rbp)
jmp 0x18ab9
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x18a6a
cmpl $0x0, -0x34(%rbp)
je 0x18ae2
movl -0x34(%rbp), %edi
movq 0x13d34(%rip), %rsi     # 0x2c808
addq $-0x4, %rsi
callq 0xf740
jmp 0x18b81
jmp 0x18ae4
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x18a41
movq 0x13d5f(%rip), %rax     # 0x2c858
movq %rax, -0x20(%rbp)
movl -0xc(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jl 0x18b69
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl -0x24(%rbp), %esi
movq -0x8(%rbp), %rax
imull 0xc(%rax), %esi
addl -0x10(%rbp), %esi
movl -0x14(%rbp), %edx
callq 0x11a50
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rdi
movl $0x10, %esi
callq 0x12fd0
cmpl $0x0, -0x34(%rbp)
je 0x18b5c
movl -0x34(%rbp), %edi
movq 0x13cb7(%rip), %rsi     # 0x2c808
addq $-0x4, %rsi
callq 0xf740
jmp 0x18b81
jmp 0x18b5e
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x18b06
movq -0x20(%rbp), %rax
movq %rax, 0x13ce4(%rip)     # 0x2c858
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
addl 0xc(%rax), %ecx
movl %ecx, 0xc(%rax)
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)