// File: /workspace/github_c_makefile_star2_O2/heltilda[P]cicada/bytecd.c
// Function: masterInsert
void masterInsert(ccBool multipleIndices, ccBool allowAddMember)
{
    ccInt firstIndex, secondIndex, rtrn;
    
    
        // get the first steps on the search path
    
    callSearchPathFunction();
    if (errCode != passed)  return;
    
    
        // find the first index to insert
    
    firstIndex = callIndexFunction();
    if (errCode != passed)  return;
    
    
        // now read in the second index (there are two for this operator)
    
    if (multipleIndices)  {
        secondIndex = callIndexFunction();
        if (errCode != passed)  return;         }
    
    else  secondIndex = firstIndex;
    
    if (GL_Path.stemMember == NULL)  {  setError(undefined_member_err, pcCodePtr-1);  return;  }
    
    searchView.multipleIndices = multipleIndices;
    if (secondIndex < firstIndex)  secondIndex = firstIndex-1;
    GL_Path.indices = secondIndex - firstIndex + 1;
    
    
        // add members if we're in a composite variable
    
    if (searchView.windowPtr->variable_ptr->type == composite_type)   {
        linkedlist *memberLL = &(searchView.windowPtr->variable_ptr->mem.members);
        ccInt lastMemberNumber, lastMemberOffset, loopMember;
        member *oneMember;
        
        rtrn = findMemberIndex(searchView.windowPtr->variable_ptr, 0, firstIndex,
                                        &oneMember, &lastMemberNumber, &lastMemberOffset, ccFalse);
        if (rtrn != passed)  {
            if (firstIndex == numMemberIndices(&searchView)+1)  lastMemberNumber = memberLL->elementNum+1;
            else  {  setError(rtrn, pcCodePtr-1);  return;  }       }
        
        rtrn = addMember(searchView.windowPtr->variable_ptr, lastMemberNumber, 1, &oneMember, ccFalse, secondIndex-firstIndex+1, ccFalse);
        if (rtrn != passed)  {  setError(rtrn, pcCodePtr-1);  return;  }
        for (loopMember = firstIndex; loopMember <= secondIndex; loopMember++)  {
            rtrn = addMember(searchView.windowPtr->variable_ptr, loopMember-firstIndex+lastMemberNumber, 1, &oneMember, ccFalse, 0, ccTrue);
            if (rtrn != passed)  {  setError(rtrn, pcCodePtr-1);  return;  }        }
        
        findMemberIndex(searchView.windowPtr->variable_ptr, 0, firstIndex, &(GL_Path.stemMember),
                                                        &(GL_Path.stemMemberNumber), &(GL_Path.offset), ccFalse);
        return;         }
    
    
        // otherwise it's an array or a string -- resize it using resizeIndices()
    
    rtrn = findMemberIndex(searchView.windowPtr->variable_ptr, searchView.offset, firstIndex, &(GL_Path.stemMember),
                                                        &(GL_Path.stemMemberNumber), &(GL_Path.offset), ccFalse);
    if (rtrn != passed)  setError(rtrn, pcCodePtr-1);
    
    
        // 2nd condition on next line:  a([+top(a)+1]) is legal
    
    if ((errCode == invalid_index_err) && (firstIndex == GL_Path.offset))   {
        errCode = passed;
        if (firstIndex == 1)  {      // if all indices have been deleted, fix the error as long as there is a member to add to
            if (searchView.windowPtr->variable_ptr->type == string_type)
                GL_Path.stemMemberNumber = searchView.offset+1;
            else  GL_Path.stemMemberNumber = 1;
            GL_Path.stemMember = LL_member(searchView.windowPtr->variable_ptr, GL_Path.stemMemberNumber);
            GL_Path.offset = 0;     }
        else  {
            rtrn = findMemberIndex(searchView.windowPtr->variable_ptr, searchView.offset, firstIndex-1, &(GL_Path.stemMember),
                                                                        &(GL_Path.stemMemberNumber), &(GL_Path.offset), ccFalse);
            if (rtrn != passed)  {  setError(rtrn, pcCodePtr-1);  return;  }
            GL_Path.offset++;       // by default, append to the index just below
    }   }
    
    if (errCode != passed)  return;
    
    if ((searchView.windowPtr->variable_ptr->type != string_type)
                && (searchView.width != searchView.windowPtr->variable_ptr->instances))
        {  setError(incomplete_variable_err, pcCodePtr-1);  return;  }
    
    
        // resizeIndices() takes care of the resize of both the member and the variable
    
    resizeIndices(GL_Path.stemMember, searchView.width, GL_Path.offset, GL_Path.indices);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %edi, %r14d
callq 0x11be6
cmpl $0x0, 0x123ce(%rip)     # 0x24778
jne 0x123ba
callq 0x11cfc
cmpl $0x0, 0x123c0(%rip)     # 0x24778
je 0x123c7
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %ebx
movl %eax, %ebp
testb %r14b, %r14b
je 0x123e0
callq 0x11cfc
cmpl $0x0, 0x1239c(%rip)     # 0x24778
jne 0x123ba
movl %eax, %ebp
cmpq $0x0, 0x12480(%rip)     # 0x24868
je 0x12475
movb %r14b, 0x124d3(%rip)    # 0x248c8
leal -0x1(%rbx), %r14d
cmpl %ebx, %ebp
cmovll %r14d, %ebp
movl %ebp, %r15d
subl %ebx, %r15d
incl %r15d
movl %r15d, 0x12469(%rip)    # 0x24878
movq 0x124a2(%rip), %rax     # 0x248b8
movq 0x10(%rax), %r12
cmpl $0x5, 0xc0(%r12)
jne 0x12494
andl $0x0, (%rsp)
leaq 0x10(%rsp), %rcx
leaq 0xc(%rsp), %r8
leaq 0x1c(%rsp), %r9
movq %r12, %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0xe374
testl %eax, %eax
je 0x1253d
movl %eax, %r14d
leaq 0x12462(%rip), %rdi     # 0x248b8
callq 0xe479
incl %eax
cmpl %eax, %ebx
jne 0x125bf
movl 0x10(%r12), %esi
incl %esi
movl %esi, 0xc(%rsp)
jmp 0x12541
movq 0x1239c(%rip), %rsi     # 0x24818
addq $-0x4, %rsi
pushq $0x19
popq %rdi
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xc7c2
movl 0x12426(%rip), %esi     # 0x248c0
andl $0x0, (%rsp)
leaq 0x123c3(%rip), %rcx     # 0x24868
leaq 0x123c4(%rip), %r8      # 0x24870
leaq 0x123c1(%rip), %r9      # 0x24874
movq %r12, %rdi
movl %ebx, %edx
callq 0xe374
testl %eax, %eax
je 0x124d3
movq 0x12350(%rip), %rsi     # 0x24818
addq $-0x4, %rsi
movl %eax, %edi
callq 0xc7c2
movl 0x1229f(%rip), %eax     # 0x24778
movl %eax, %ecx
xorl $0x1e, %ecx
movl 0x12390(%rip), %edx     # 0x24874
movl %edx, %esi
xorl %ebx, %esi
orl %ecx, %esi
jne 0x1264f
andl $0x0, 0x12281(%rip)     # 0x24778
movq 0x123ba(%rip), %rax     # 0x248b8
movq 0x10(%rax), %rdi
cmpl $0x1, %ebx
jne 0x125d7
movl 0x123af(%rip), %eax     # 0x248c0
incl %eax
cmpl $0x4, 0xc0(%rdi)
pushq $0x1
popq %rsi
cmovel %eax, %esi
movl %esi, 0x1234a(%rip)     # 0x24870
addq $0x10, %rdi
callq 0x9088
movq %rax, 0x12332(%rip)     # 0x24868
xorl %edx, %edx
jmp 0x12643
movl 0xc(%rsp), %esi
movq 0x12370(%rip), %rax     # 0x248b8
movq 0x10(%rax), %rdi
andl $0x0, (%rsp)
pushq $0x1
popq %rdx
leaq 0x10(%rsp), %rcx
xorl %r12d, %r12d
xorl %r8d, %r8d
movl %r15d, %r9d
callq 0xe2d6
testl %eax, %eax
jne 0x125b0
pushq $0x1
popq %r14
leaq 0x10(%rsp), %r15
leal (%rbx,%r12), %eax
movq 0x1233a(%rip), %rcx     # 0x248b8
movq 0x10(%rcx), %rdi
cmpl %ebp, %eax
jg 0x12614
movl 0xc(%rsp), %esi
addl %r12d, %esi
movl $0x1, (%rsp)
movl %r14d, %edx
movq %r15, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0xe2d6
incl %r12d
testl %eax, %eax
je 0x12573
movq 0x12261(%rip), %rsi     # 0x24818
addq $-0x4, %rsi
movl %eax, %edi
jmp 0x125cd
movq 0x12252(%rip), %rsi     # 0x24818
addq $-0x4, %rsi
movl %r14d, %edi
callq 0xc7c2
jmp 0x123ba
movl 0x122e3(%rip), %esi     # 0x248c0
andl $0x0, (%rsp)
leaq 0x12280(%rip), %rcx     # 0x24868
leaq 0x12281(%rip), %r8      # 0x24870
leaq 0x1227e(%rip), %r9      # 0x24874
movl %r14d, %edx
callq 0xe374
testl %eax, %eax
je 0x1263b
movq 0x1220f(%rip), %rsi     # 0x24818
addq $-0x4, %rsi
movl %eax, %edi
jmp 0x12483
andl $0x0, (%rsp)
leaq 0x12249(%rip), %rcx     # 0x24868
leaq 0x1224a(%rip), %r8      # 0x24870
leaq 0x12247(%rip), %r9      # 0x24874
xorl %esi, %esi
movl %ebx, %edx
callq 0xe374
jmp 0x123ba
movl 0x12233(%rip), %edx     # 0x24874
incl %edx
movl %edx, 0x1222b(%rip)     # 0x24874
movl 0x12129(%rip), %eax     # 0x24778
testl %eax, %eax
jne 0x123ba
movq 0x1225a(%rip), %rax     # 0x248b8
movq 0x10(%rax), %rax
cmpl $0x4, 0xc0(%rax)
movl 0x12255(%rip), %esi     # 0x248c4
je 0x12679
cmpl 0xf0(%rax), %esi
jne 0x12697
movq 0x121e8(%rip), %rdi     # 0x24868
movl 0x121f2(%rip), %ecx     # 0x24878
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x126a9
movq 0x1217a(%rip), %rsi     # 0x24818
addq $-0x4, %rsi
pushq $0x1d
jmp 0x12482