// File: /workspace/github_c_makefile_star2_O1/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 0x10185
cmpl $0x0, 0x109f4(%rip)     # 0x25778
jne 0x14f2c
leaq 0x8(%rsp), %rdi
callq 0x14f5a
cmpl $0x0, 0x109dd(%rip)     # 0x25778
jne 0x14f2c
movl 0x10bac(%rip), %r13d    # 0x25954
movq 0x10a69(%rip), %rax     # 0x25818
movslq (%rax), %rcx
addq $0x4, %rax
movq %rax, 0x10a5b(%rip)     # 0x25818
leaq 0xf79c(%rip), %rax      # 0x24560
callq *(%rax,%rcx,8)
movl $0x22, %edi
cmpl $-0x1, 0x10a65(%rip)    # 0x25838
je 0x14e1d
movq 0x10a3c(%rip), %rsi     # 0x25818
addq $-0x4, %rsi
callq 0xd1a9
leaq 0x10a0c(%rip), %rbx     # 0x257f8
movq %rbx, %rdi
callq 0x1507c
movl 0x8(%rsp), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x8b7e
testl %eax, %eax
je 0x14e41
movq 0x10a0b(%rip), %rsi     # 0x25818
addq $-0x4, %rsi
movl %eax, %edi
callq 0xd1a9
jmp 0x14f2c
movq 0x10a94(%rip), %rax     # 0x258b8
testq %rax, %rax
je 0x14f3b
movq 0x10(%rax), %rax
movl $0x23, %edi
cmpl $0x4, 0xc0(%rax)
jle 0x14dd5
jmp 0x14de5
leaq 0x8(%rsp), %rdi
movl (%rdi), %r8d
leaq 0x109a8(%rip), %rdx     # 0x257f8
movl $0x1, %esi
movl $0x1, %ecx
callq 0x8821
cmpl $0x0, 0x10912(%rip)     # 0x25778
jne 0x14f2c
cmpl $0x0, 0x10985(%rip)     # 0x257f8
jle 0x14f17
xorl %ebp, %ebp
leaq 0x10976(%rip), %r14     # 0x257f8
leaq 0x10af7(%rip), %rbx     # 0x25980
movq %rsp, %r15
incl %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x911c
movq %rax, %r12
movq 0x18(%rax), %rax
movq %rax, (%rsp)
leaq 0x20(%rax), %rcx
testq %rax, %rax
cmoveq %rbx, %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x14ece
movq 0x109fb(%rip), %rax     # 0x258b8
movl 0x1c(%rax), %eax
movq 0x18(%rcx), %rsi
cltd
idivl 0x1c(%rsi)
testl %edx, %edx
je 0x14ed3
jmp 0x14f45
movl $0x1, %eax
addq $0x18, %r12
movq 0x109da(%rip), %rsi     # 0x258b8
movl 0x10a83(%rip), %r8d     # 0x25968
movq %r12, %rdi
movq %rcx, %rdx
movl %eax, %ecx
callq 0xfaa3
testl %eax, %eax
jne 0x14e06
movq (%r12), %rdi
callq 0xfa4d
movq %r15, %rdi
callq 0xf972
cmpl 0x108e7(%rip), %ebp     # 0x257f8
jl 0x14e8c
leaq 0x108da(%rip), %rax     # 0x257f8
movq %rax, 0x1093b(%rip)     # 0x25860
movl %r13d, 0x10a28(%rip)    # 0x25954
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1a, %edi
jmp 0x14dd5
movq 0x108cc(%rip), %rsi     # 0x25818
addq $-0x4, %rsi
movl $0x4, %edi
jmp 0x14e13