// File: /workspace/github_c_makefile_star2_O2/heltilda[P]cicada/bytecd.c
// Function: sub_code
void _sub_code()
{
    searchPath **loopPath, *oldPath, *stemPath;
    ccInt counter, holdCodeNumber, numIndices, rtrn;
    linkedlist tempCodeRegister;
    
    
        // get the right-hand argument:  containing the code to substitute
    
    callCodeFunction();
    if (errCode != passed)  return;
    
    getCurrentCodeList(&tempCodeRegister);
    if (errCode != passed)  return;
    
    holdCodeNumber = codeNumber;
    
    
        // get the left-hand argument:  the variable to substitute into
    
    callBytecodeFunction();
    if (GL_Object.type != var_type)  setError(not_a_variable_err, pcCodePtr-1);
    else if (searchView.windowPtr == NULL)  setError(void_member_err, pcCodePtr-1);
    else if (searchView.windowPtr->variable_ptr->type < composite_type)  setError(not_a_function_err, pcCodePtr-1);
    
    
        // copy our code list into the official code register
    
    derefCodeList(&codeRegister);
    rtrn = resizeLinkedList(&codeRegister, tempCodeRegister.elementNum, ccFalse);
    if (rtrn != passed)  {  setError(rtrn, pcCodePtr-1);  return;  }
    copyElements(&tempCodeRegister, 1, &codeRegister, 1, tempCodeRegister.elementNum);
    
    if (errCode != passed)  return;
    
    
        // 'fix' the anchoring paths of each code in the codeRegister:  have their stems drawn
        // from the original stem of the anchors from the function that donated the code
    
    for (counter = 1; counter <= codeRegister.elementNum; counter++)  {
        
        loopPath = &(((code_ref *) element(&codeRegister, counter))->anchor);
        oldPath = *loopPath;
        
        if (oldPath == NULL)  stemPath = PCCodeRef.anchor;
        else  stemPath = oldPath->stem;
        
        numIndices = 1;
        if (stemPath != NULL)  {
            if (searchView.windowPtr->width % stemPath->jamb->width != 0)
                {  setError(mismatched_indices_err, pcCodePtr-1);  return;  }
            numIndices = searchView.windowPtr->width / stemPath->jamb->width;       }
        
        rtrn = drawPath(loopPath, searchView.windowPtr, stemPath, numIndices, PCCodeRef.PLL_index);  // in case GL_P.sM == NULL 
        if (rtrn != passed)  {  setError(rtrn, pcCodePtr-1);  return;  }
        
        refPath(*loopPath);
        derefPath(&oldPath);         }
    
    GL_Object.codeList = &codeRegister;
    codeNumber = holdCodeNumber;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
callq 0xf33b
cmpl $0x0, 0x11658(%rip)     # 0x24778
jne 0x131f4
leaq 0x18(%rsp), %rdi
callq 0x132ca
cmpl $0x0, 0x11641(%rip)     # 0x24778
jne 0x131f4
movl 0x11811(%rip), %ebp     # 0x24954
movq 0x116ce(%rip), %rax     # 0x24818
movslq (%rax), %rcx
addq $0x4, %rax
movq %rax, 0x116c0(%rip)     # 0x24818
leaq 0x10401(%rip), %rax     # 0x23560
callq *(%rax,%rcx,8)
cmpl $-0x1, 0x116cf(%rip)    # 0x24838
je 0x131b3
pushq $0x22
popq %rdi
movq 0x116a3(%rip), %rsi     # 0x24818
addq $-0x4, %rsi
callq 0xc7c2
leaq 0x11673(%rip), %rbx     # 0x247f8
movq %rbx, %rdi
callq 0x133db
movl 0x18(%rsp), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x8b23
testl %eax, %eax
je 0x131d0
movq 0x11672(%rip), %rsi     # 0x24818
addq $-0x4, %rsi
movl %eax, %edi
callq 0xc7c2
jmp 0x131f4
movq 0x116fe(%rip), %rax     # 0x248b8
testq %rax, %rax
je 0x13203
movq 0x10(%rax), %rax
cmpl $0x4, 0xc0(%rax)
jg 0x1317e
pushq $0x23
jmp 0x1316d
leaq 0x18(%rsp), %rdi
movl (%rdi), %r8d
leaq 0x11619(%rip), %rdx     # 0x247f8
pushq $0x1
popq %rbx
movl %ebx, %esi
movl %ebx, %ecx
callq 0x87c7
cmpl $0x0, 0x11586(%rip)     # 0x24778
je 0x1320a
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1a
jmp 0x1316d
movl %ebp, 0xc(%rsp)
leaq 0x115e3(%rip), %r14     # 0x247f8
leaq 0x11764(%rip), %r13     # 0x24980
leaq 0x10(%rsp), %r15
movl %ebx, %ebp
cmpl 0x115cf(%rip), %ebp     # 0x247f8
jg 0x132a1
movq %r14, %rdi
movl %ebp, %esi
callq 0x9088
movq %rax, %r12
movq 0x18(%rax), %rax
movq %rax, 0x10(%rsp)
leaq 0x20(%rax), %rcx
testq %rax, %rax
cmoveq %r13, %rcx
movq (%rcx), %rcx
movq 0x11662(%rip), %rsi     # 0x248b8
movl %ebx, %eax
testq %rcx, %rcx
je 0x1326c
movl 0x1c(%rsi), %eax
movq 0x18(%rcx), %rdi
cltd
idivl 0x1c(%rdi)
testl %edx, %edx
jne 0x132b7
addq $0x18, %r12
movl 0x116f1(%rip), %r8d     # 0x24968
movq %r12, %rdi
movq %rcx, %rdx
movl %eax, %ecx
callq 0xecb1
testl %eax, %eax
jne 0x1319f
movq (%r12), %rdi
callq 0xec75
movq %r15, %rdi
callq 0xebb6
incl %ebp
jmp 0x13223
movq %r14, 0x115b8(%rip)     # 0x24860
movl 0xc(%rsp), %eax
movl %eax, 0x116a2(%rip)     # 0x24954
jmp 0x131f4
movq 0x1155a(%rip), %rsi     # 0x24818
addq $-0x4, %rsi
pushq $0x4
popq %rdi
jmp 0x131ac