// File: /workspace/github_c_makefile_star2_O3/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 $0x28, %rsp
callq 0xff3d
cmpl $0x0, 0x109f7(%rip)     # 0x25778
jne 0x14f1e
leaq 0x8(%rsp), %rdi
callq 0x14f4c
cmpl $0x0, 0x109e0(%rip)     # 0x25778
jne 0x14f1e
movl 0x10baf(%rip), %r13d    # 0x25954
movq 0x10a6c(%rip), %rax     # 0x25818
movslq (%rax), %rcx
addq $0x4, %rax
movq %rax, 0x10a5e(%rip)     # 0x25818
leaq 0xf79f(%rip), %rax      # 0x24560
callq *(%rax,%rcx,8)
movl $0x22, %edi
cmpl $-0x1, 0x10a68(%rip)    # 0x25838
je 0x14e1a
movq 0x10a3f(%rip), %rsi     # 0x25818
addq $-0x4, %rsi
callq 0xcfa3
leaq 0x10a0f(%rip), %rbx     # 0x257f8
movq %rbx, %rdi
callq 0x15071
movl 0x8(%rsp), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x8bc7
testl %eax, %eax
je 0x14e3e
movq 0x10a0e(%rip), %rsi     # 0x25818
addq $-0x4, %rsi
movl %eax, %edi
callq 0xcfa3
jmp 0x14f1e
movq 0x10a97(%rip), %rax     # 0x258b8
testq %rax, %rax
je 0x14f2d
movq 0x10(%rax), %rax
movl $0x23, %edi
cmpl $0x4, 0xc0(%rax)
jle 0x14dd2
jmp 0x14de2
leaq 0x8(%rsp), %rdi
movl (%rdi), %r8d
leaq 0x109ab(%rip), %rdx     # 0x257f8
movl $0x1, %esi
movl $0x1, %ecx
callq 0x8856
cmpl $0x0, 0x10915(%rip)     # 0x25778
jne 0x14f1e
cmpl $0x0, 0x10988(%rip)     # 0x257f8
jle 0x14f09
xorl %ebp, %ebp
leaq 0x10979(%rip), %r14     # 0x257f8
leaq 0x10afa(%rip), %rbx     # 0x25980
movq %rsp, %r15
incl %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x91d8
movq %rax, %r12
movq 0x18(%rax), %rax
leaq 0x20(%rax), %rcx
testq %rax, %rax
cmoveq %rbx, %rcx
movq %rax, (%rsp)
movq (%rcx), %rcx
movq 0x10a03(%rip), %rsi     # 0x258b8
testq %rcx, %rcx
je 0x14ecb
movl 0x1c(%rsi), %eax
movq 0x18(%rcx), %rdi
cltd
idivl 0x1c(%rdi)
testl %edx, %edx
je 0x14ed0
jmp 0x14f37
movl $0x1, %eax
addq $0x18, %r12
movl 0x10a8d(%rip), %r8d     # 0x25968
movq %r12, %rdi
movq %rcx, %rdx
movl %eax, %ecx
callq 0xf85f
testl %eax, %eax
jne 0x14e03
movq (%r12), %rdi
callq 0xf809
movq %r15, %rdi
callq 0xf72e
cmpl 0x108f1(%rip), %ebp     # 0x257f8
jl 0x14e89
leaq 0x108e8(%rip), %rax     # 0x257f8
movq %rax, 0x10949(%rip)     # 0x25860
movl %r13d, 0x10a36(%rip)    # 0x25954
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1a, %edi
jmp 0x14dd2
movq 0x108da(%rip), %rsi     # 0x25818
addq $-0x4, %rsi
movl $0x4, %edi
jmp 0x14e10