// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movb %sil, %al
movb %dil, %cl
movb %cl, -0x1(%rbp)
movb %al, -0x2(%rbp)
callq 0x17b20
cmpl $0x0, 0x14158(%rip)     # 0x2c768
je 0x18617
jmp 0x18a01
callq 0x17cb0
movl %eax, -0x8(%rbp)
cmpl $0x0, 0x14142(%rip)     # 0x2c768
je 0x1862d
jmp 0x18a01
cmpb $0x0, -0x1(%rbp)
je 0x1864b
callq 0x17cb0
movl %eax, -0xc(%rbp)
cmpl $0x0, 0x14126(%rip)     # 0x2c768
je 0x18649
jmp 0x18a01
jmp 0x18651
movl -0x8(%rbp), %eax
movl %eax, -0xc(%rbp)
cmpq $0x0, 0x141ff(%rip)     # 0x2c858
jne 0x18675
movq 0x141a6(%rip), %rsi     # 0x2c808
addq $-0x4, %rsi
movl $0x19, %edi
callq 0xf740
jmp 0x18a01
movb -0x1(%rbp), %al
movb %al, 0x1423a(%rip)      # 0x2c8b8
movl -0xc(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x1868f
movl -0x8(%rbp), %eax
subl $0x1, %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
subl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, 0x141ca(%rip)     # 0x2c868
movq 0x14203(%rip), %rax     # 0x2c8a8
movq 0x10(%rax), %rax
cmpl $0x5, 0xc0(%rax)
jne 0x18842
movq 0x141eb(%rip), %rax     # 0x2c8a8
movq 0x10(%rax), %rax
addq $0x10, %rax
movq %rax, -0x18(%rbp)
movq 0x141d8(%rip), %rax     # 0x2c8a8
movq 0x10(%rax), %rdi
movl -0x8(%rbp), %edx
xorl %esi, %esi
leaq -0x30(%rbp), %rcx
leaq -0x1c(%rbp), %r8
leaq -0x20(%rbp), %r9
movl $0x0, (%rsp)
callq 0x128f0
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x18747
movl -0x8(%rbp), %eax
movl %eax, -0x34(%rbp)
leaq 0x14049(%rip), %rdi     # 0x2c750
addq $0x158, %rdi            # imm = 0x158
callq 0x12ad0
movl %eax, %ecx
movl -0x34(%rbp), %eax
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1872d
movq -0x18(%rbp), %rax
movl (%rax), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x18745
movl -0x10(%rbp), %edi
movq 0x140d1(%rip), %rsi     # 0x2c808
addq $-0x4, %rsi
callq 0xf740
jmp 0x18a01
jmp 0x18747
movq 0x1415a(%rip), %rax     # 0x2c8a8
movq 0x10(%rax), %rdi
movl -0x1c(%rbp), %esi
movl -0xc(%rbp), %r9d
subl -0x8(%rbp), %r9d
addl $0x1, %r9d
movl $0x1, %edx
leaq -0x30(%rbp), %rcx
xorl %r8d, %r8d
movl $0x0, (%rsp)
callq 0x127d0
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x1879a
movl -0x10(%rbp), %edi
movq 0x1407c(%rip), %rsi     # 0x2c808
addq $-0x4, %rsi
callq 0xf740
jmp 0x18a01
movl -0x8(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0xc(%rbp), %eax
jg 0x18805
movq 0x140f9(%rip), %rax     # 0x2c8a8
movq 0x10(%rax), %rdi
movl -0x24(%rbp), %esi
subl -0x8(%rbp), %esi
addl -0x1c(%rbp), %esi
movl $0x1, %edx
leaq -0x30(%rbp), %rcx
xorl %r9d, %r9d
movl %r9d, %r8d
movl $0x1, (%rsp)
callq 0x127d0
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x187f8
movl -0x10(%rbp), %edi
movq 0x1401e(%rip), %rsi     # 0x2c808
addq $-0x4, %rsi
callq 0xf740
jmp 0x18a01
jmp 0x187fa
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x187a0
movq 0x1409c(%rip), %rax     # 0x2c8a8
movq 0x10(%rax), %rdi
movl -0x8(%rbp), %edx
xorl %esi, %esi
leaq 0x13f34(%rip), %rcx     # 0x2c750
addq $0x108, %rcx            # imm = 0x108
movq %rcx, %r8
addq $0x8, %r8
movq %rcx, %r9
addq $0xc, %r9
movl $0x0, (%rsp)
callq 0x128f0
jmp 0x18a01
movq 0x1405f(%rip), %rax     # 0x2c8a8
movq 0x10(%rax), %rdi
movl 0x1405d(%rip), %esi     # 0x2c8b0
movl -0x8(%rbp), %edx
leaq 0x13ef3(%rip), %rcx     # 0x2c750
addq $0x108, %rcx            # imm = 0x108
movq %rcx, %r8
addq $0x8, %r8
movq %rcx, %r9
addq $0xc, %r9
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x128f0
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x1889c
movl -0x10(%rbp), %edi
movq 0x13f75(%rip), %rsi     # 0x2c808
addq $-0x4, %rsi
callq 0xf740
cmpl $0x1e, 0x13ec5(%rip)    # 0x2c768
jne 0x18994
movl -0x8(%rbp), %eax
cmpl 0x13fb2(%rip), %eax     # 0x2c864
jne 0x18994
movl $0x0, 0x13ea6(%rip)     # 0x2c768
cmpl $0x1, -0x8(%rbp)
jne 0x18924
movq 0x13fd9(%rip), %rax     # 0x2c8a8
movq 0x10(%rax), %rax
cmpl $0x4, 0xc0(%rax)
jne 0x188ed
movl 0x13fce(%rip), %eax     # 0x2c8b0
addl $0x1, %eax
movl %eax, 0x13f75(%rip)     # 0x2c860
jmp 0x188f7
movl $0x1, 0x13f69(%rip)     # 0x2c860
movq 0x13faa(%rip), %rax     # 0x2c8a8
movq 0x10(%rax), %rdi
addq $0x10, %rdi
movl 0x13f54(%rip), %esi     # 0x2c860
callq 0x9700
movq %rax, 0x13f40(%rip)     # 0x2c858
movl $0x0, 0x13f42(%rip)     # 0x2c864
jmp 0x18992
movq 0x13f7d(%rip), %rax     # 0x2c8a8
movq 0x10(%rax), %rdi
movl 0x13f7b(%rip), %esi     # 0x2c8b0
movl -0x8(%rbp), %edx
subl $0x1, %edx
leaq 0x13e0e(%rip), %rcx     # 0x2c750
addq $0x108, %rcx            # imm = 0x108
movq %rcx, %r8
addq $0x8, %r8
movq %rcx, %r9
addq $0xc, %r9
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x128f0
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x18983
movl -0x10(%rbp), %edi
movq 0x13e90(%rip), %rsi     # 0x2c808
addq $-0x4, %rsi
callq 0xf740
jmp 0x18a01
movl 0x13edb(%rip), %eax     # 0x2c864
addl $0x1, %eax
movl %eax, 0x13ed2(%rip)     # 0x2c864
jmp 0x18994
cmpl $0x0, 0x13dcd(%rip)     # 0x2c768
je 0x1899f
jmp 0x18a01
movq 0x13f02(%rip), %rax     # 0x2c8a8
movq 0x10(%rax), %rax
cmpl $0x4, 0xc0(%rax)
je 0x189e3
movl 0x13efb(%rip), %eax     # 0x2c8b4
movq 0x13ee8(%rip), %rcx     # 0x2c8a8
movq 0x10(%rcx), %rcx
cmpl 0xf0(%rcx), %eax
je 0x189e3
movq 0x13e35(%rip), %rsi     # 0x2c808
addq $-0x4, %rsi
movl $0x1d, %edi
callq 0xf740
jmp 0x18a01
movq 0x13e6e(%rip), %rdi     # 0x2c858
movl 0x13ec4(%rip), %esi     # 0x2c8b4
movl 0x13e6e(%rip), %edx     # 0x2c864
movl 0x13e6c(%rip), %ecx     # 0x2c868
callq 0x18a10
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)