// File: /workspace/github_c_makefile_star2_O1/heltilda[P]cicada/ciclib.c
// Function: cclib_bytecode
void cclib_bytecode()
{
    window *hostWindow;
    linkedlist *codeRefsList = NULL;
    ccInt memberNumber, loopCode, *holdPC, numArgs = numBIF_args(), rtrn;
    
    if ((numArgs < 1) || (numArgs > 2))
        {  setError(wrong_argument_count_err, pcCodePtr-1);  return;  }
    
    
        // load the variable containing the member or variable code (arg 1)
    
    hostWindow = getBIFmember(1);
    if (hostWindow == NULL)  {  setError(void_member_err, pcCodePtr-1);  return;  }
    if (hostWindow->variable_ptr->type != composite_type)  {  setError(not_composite_err, pcCodePtr-1);  return;  }
    
    
        // if it's something about a member we want to know, then we have to provide the member number (arg 2)
    
    if (numArgs == 1)
        codeRefsList = (linkedlist *) &(hostWindow->variable_ptr->codeList);
    
    else  {
        memberNumber = (ccInt) getBIFnumArg(2, 1., (ccFloat) hostWindow->variable_ptr->mem.members.elementNum);
        if (errCode == passed)  {
            codeRefsList = (linkedlist *) &(LL_member(hostWindow->variable_ptr, memberNumber)->codeList);
    }   }
    
    if (errCode != passed)  return;
    
    
        // get each code sequentially into the string (if there is more than one then they will be separated by 0s)
    
    rtrn = resizeLinkedList(&stringRegister, 0, ccFalse);
    if (rtrn != passed)  {  setError(rtrn, pcCodePtr-1);  return;  }
    
    for (loopCode = 1; loopCode <= codeRefsList->elementNum; loopCode++)  {
        
        code_ref *soughtCodeRef = (code_ref *) element(codeRefsList, loopCode);
        ccInt oldTop = stringRegister.elementNum;
        
        
            // copy the bytecode into a string (this includes the final 0)
        
        holdPC = pcCodePtr;
        pcCodePtr = soughtCodeRef->code_ptr;
        runSkipMode(0);    // should always work (code's already been checked); just in case, check errCode (index would be off, though)
        if (errCode != passed)  {  pcCodePtr = holdPC;  return;  }
        pcCodePtr++;
        
        rtrn = addElements(&stringRegister, (ccInt) (pcCodePtr-soughtCodeRef->code_ptr)*sizeof(ccInt), ccFalse);
        pcCodePtr = holdPC;
        if (rtrn != passed)  {  setError(rtrn, pcCodePtr-1);  return;  }
        
        setElements(&stringRegister, oldTop+1, oldTop+stringRegister.elementNum, (void *) soughtCodeRef->code_ptr);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x1926a
movl %eax, %r15d
leal -0x3(%r15), %eax
cmpl $-0x3, %eax
ja 0x18fe0
leaq 0xc792(%rip), %rax      # 0x25760
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x2d, %edi
jmp 0x19041
movl $0x1, %edi
callq 0x192b4
testq %rax, %rax
je 0x19011
movq %rax, %r14
movq 0x10(%rax), %rbx
cmpl $0x5, 0xc0(%rbx)
jne 0x1902a
cmpl $0x1, %r15d
jne 0x19054
addq $0xd0, %rbx
jmp 0x19094
leaq 0xc748(%rip), %rax      # 0x25760
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x1a, %edi
jmp 0x19041
leaq 0xc72f(%rip), %rax      # 0x25760
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x24, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xd1a9
cvtsi2sdl 0x10(%rbx), %xmm1
movsd 0x1fa7(%rip), %xmm0     # 0x1b008
movl $0x2, %edi
callq 0x19324
leaq 0xc6ee(%rip), %rax      # 0x25760
cmpl $0x0, 0x18(%rax)
je 0x1907c
xorl %ebx, %ebx
jmp 0x19094
cvttsd2si %xmm0, %esi
movq 0x10(%r14), %rdi
addq $0x10, %rdi
callq 0x911c
movq %rax, %rbx
addq $0x20, %rbx
leaq 0xc6c5(%rip), %r13      # 0x25760
cmpl $0x0, 0x18(%r13)
je 0x190b1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x78(%r13), %r14
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x8b7e
testl %eax, %eax
je 0x190d7
movq 0xb8(%r13), %rsi
addq $-0x4, %rsi
movl %eax, %edi
jmp 0x19041
cmpl $0x0, (%rbx)
jle 0x190a2
xorl %ebp, %ebp
movq %rbx, (%rsp)
incl %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x911c
movq %rax, %r12
movl 0x78(%r13), %r15d
movq 0xb8(%r13), %rbx
movq 0x10(%rax), %rax
movq %rax, 0xb8(%r13)
xorl %edi, %edi
callq 0x1569b
cmpl $0x0, 0x18(%r13)
jne 0x1916d
movq 0xb8(%r13), %rsi
addq $0x4, %rsi
movq %rsi, 0xb8(%r13)
subl 0x10(%r12), %esi
andl $-0x4, %esi
movq %r14, %rdi
xorl %edx, %edx
callq 0x8b6a
movq %rbx, 0xb8(%r13)
testl %eax, %eax
jne 0x19179
leal 0x1(%r15), %esi
addl 0x78(%r13), %r15d
movq 0x10(%r12), %rcx
movq %r14, %rdi
movl %r15d, %edx
callq 0x8f0d
movq (%rsp), %rbx
cmpl (%rbx), %ebp
jl 0x190e2
jmp 0x190a2
movq %rbx, 0xb8(%r13)
jmp 0x190a2
addq $-0x4, %rbx
movl %eax, %edi
movq %rbx, %rsi
jmp 0x19041