// File: /workspace/github_c_makefile_star2_O1/heltilda[P]cicada/bytecd.c
// Function: checkBytecode
void checkBytecode()
{
    ccInt jumpCounter, sentenceCounter, rtrn;
    
    
        // We keep track of all the goto addresses and sentence beginnings.
    
    errIndex = 1;
    rtrn = newLinkedList(&jumpList, 0, sizeof(ccInt *), 2., ccFalse);
    if (rtrn != passed)  {  setError(out_of_memory_err, pcCodePtr);  return;  }
    rtrn = newLinkedList(&jumpFromList, 0, sizeof(ccInt *), 2., ccFalse);
    if (rtrn != passed)  {  setError(out_of_memory_err, pcCodePtr);  return;  }
    rtrn = newLinkedList(&sentenceList, 0, sizeof(ccInt *), 2., ccFalse);
    if (rtrn != passed)  {  setError(out_of_memory_err, pcCodePtr);  return;  }
    
    
        // Check the outermost layer of bytecode.
    
    checkBytecodeSentences();
    
    
        // Ensure that all gotos point to the start of some sentence.
    
    if (errCode == passed)  {
    for (jumpCounter = 1; jumpCounter <= jumpList.elementNum; jumpCounter++)    {
        for (sentenceCounter = 1; sentenceCounter <= sentenceList.elementNum; sentenceCounter++)   {
            if (*(ccInt **) findElement(&jumpList, jumpCounter) == *(ccInt **) findElement(&sentenceList, sentenceCounter))  break;
            else if (sentenceCounter == sentenceList.elementNum)  {
                pcCodePtr = *(ccInt **) findElement(&jumpFromList, jumpCounter);    // to set errIndex correctly below
                setError(bad_jump_err, pcCodePtr);      // do this manually, since the code isn't yet loaded into memory
                jumpCounter = jumpList.elementNum;
                break;
    }}  }   }
    
    deleteLinkedList(&jumpList);      // clean up
    deleteLinkedList(&sentenceList);
    deleteLinkedList(&jumpFromList);
    
    
        // If we didn't get to the end of the code, we'll set a warning -- at least it won't crash the interpreter.
    
    if ((errCode == passed) && (pcCodePtr != endCodePtr))  setWarning(inaccessible_code_warning, pcCodePtr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0x1, 0xfc25(%rip)      # 0x2577c
leaq 0xfe2a(%rip), %rdi      # 0x25988
movsd 0x54ba(%rip), %xmm0     # 0x1b020
xorl %esi, %esi
movl $0x8, %edx
xorl %ecx, %ecx
callq 0x83e1
testl %eax, %eax
jne 0x15bba
leaq 0xfe29(%rip), %rdi      # 0x259a8
movsd 0x5499(%rip), %xmm0     # 0x1b020
xorl %esi, %esi
movl $0x8, %edx
xorl %ecx, %ecx
callq 0x83e1
testl %eax, %eax
jne 0x15bba
leaq 0xfe28(%rip), %rdi      # 0x259c8
movsd 0x5478(%rip), %xmm0     # 0x1b020
xorl %esi, %esi
movl $0x8, %edx
xorl %ecx, %ecx
callq 0x83e1
testl %eax, %eax
je 0x15bd9
movq 0xfc57(%rip), %rsi      # 0x25818
movl $0x1, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xd1a9
callq 0x15cea
cmpl $0x0, 0xfb93(%rip)      # 0x25778
jne 0x15c86
cmpl $0x0, 0xfd96(%rip)      # 0x25988
jle 0x15c86
movl $0x1, %r12d
leaq 0xfd83(%rip), %rbx      # 0x25988
leaq 0xfdbc(%rip), %r14      # 0x259c8
leaq 0xfd95(%rip), %r15      # 0x259a8
cmpl $0x0, 0xfdae(%rip)      # 0x259c8
jle 0x15c75
xorl %ebp, %ebp
incl %ebp
movq %rbx, %rdi
movl %r12d, %esi
callq 0x90da
movq (%rax), %r13
movq %r14, %rdi
movl %ebp, %esi
callq 0x90da
cmpq (%rax), %r13
je 0x15c75
cmpl 0xfd85(%rip), %ebp      # 0x259c8
je 0x15c4f
cmpl 0xfd7d(%rip), %ebp      # 0x259c8
jl 0x15c1e
jmp 0x15c75
movq %r15, %rdi
movl %r12d, %esi
callq 0x90da
movq (%rax), %rsi
movq %rsi, 0xfbb4(%rip)      # 0x25818
movl $0x15, %edi
callq 0xd1a9
movl 0xfd13(%rip), %r12d     # 0x25988
leal 0x1(%r12), %eax
cmpl 0xfd07(%rip), %r12d     # 0x25988
movl %eax, %r12d
jl 0x15c13
leaq 0xfcfb(%rip), %rdi      # 0x25988
callq 0x847e
leaq 0xfd2f(%rip), %rdi      # 0x259c8
callq 0x847e
leaq 0xfd03(%rip), %rdi      # 0x259a8
callq 0x847e
cmpl $0x0, 0xfac7(%rip)      # 0x25778
je 0x15cc2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xfb4f(%rip), %rsi      # 0x25818
cmpq 0xfb58(%rip), %rsi      # 0x25828
je 0x15cb3
movl $0x14, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xd275