// File: /workspace/github_c_makefile_star2_O3/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 0x19254
movl %eax, %r15d
leal -0x3(%r15), %eax
cmpl $-0x3, %eax
ja 0x18fda
leaq 0xc798(%rip), %rax      # 0x25760
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x2d, %edi
jmp 0x19038
movl $0x1, %edi
callq 0x1929e
testq %rax, %rax
je 0x19008
movq %rax, %r14
movq 0x10(%rax), %rbx
cmpl $0x5, 0xc0(%rbx)
jne 0x19021
cmpl $0x1, %r15d
jne 0x1904b
addq $0xd0, %rbx
jmp 0x19087
leaq 0xc751(%rip), %rax      # 0x25760
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x1a, %edi
jmp 0x19038
leaq 0xc738(%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 0xcfa3
cvtsi2sdl 0x10(%rbx), %xmm1
movsd 0x1fb0(%rip), %xmm0     # 0x1b008
movl $0x2, %edi
callq 0x1930e
leaq 0xc6f7(%rip), %rax      # 0x25760
cmpl $0x0, 0x18(%rax)
jne 0x19095
cvttsd2si %xmm0, %esi
movq 0x10(%r14), %rdi
addq $0x10, %rdi
callq 0x91d8
movq %rax, %rbx
addq $0x20, %rbx
leaq 0xc6d2(%rip), %r13      # 0x25760
cmpl $0x0, 0x18(%r13)
je 0x190a4
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 0x8bc7
testl %eax, %eax
je 0x190ca
movq 0xb8(%r13), %rsi
addq $-0x4, %rsi
movl %eax, %edi
jmp 0x19038
cmpl $0x0, (%rbx)
jle 0x19095
xorl %ebp, %ebp
incl %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x91d8
movq %rax, %r12
movl 0x78(%r13), %r15d
movq 0xb8(%r13), %rax
movq %rax, (%rsp)
movq 0x10(%r12), %rax
movq %rax, 0xb8(%r13)
xorl %edi, %edi
callq 0x15681
cmpl $0x0, 0x18(%r13)
jne 0x19161
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 0x8bb3
movq (%rsp), %rsi
movq %rsi, 0xb8(%r13)
testl %eax, %eax
jne 0x190bf
leal 0x1(%r15), %esi
addl 0x78(%r13), %r15d
movq 0x10(%r12), %rcx
movq %r14, %rdi
movl %r15d, %edx
callq 0x8fba
cmpl (%rbx), %ebp
jl 0x190d1
jmp 0x19095
movq (%rsp), %rax
movq %rax, 0xb8(%r13)
jmp 0x19095