// File: /workspace/github_c_makefile_star2_O3/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 %r12
pushq %rbx
movl $0x1, 0xfc75(%rip)      # 0x2577c
leaq 0xfe7a(%rip), %rdi      # 0x25988
movsd 0x550a(%rip), %xmm0     # 0x1b020
xorl %esi, %esi
movl $0x8, %edx
xorl %ecx, %ecx
callq 0x83e1
testl %eax, %eax
jne 0x15b6a
leaq 0xfe79(%rip), %rdi      # 0x259a8
movsd 0x54e9(%rip), %xmm0     # 0x1b020
xorl %esi, %esi
movl $0x8, %edx
xorl %ecx, %ecx
callq 0x83e1
testl %eax, %eax
jne 0x15b6a
leaq 0xfe78(%rip), %rdi      # 0x259c8
movsd 0x54c8(%rip), %xmm0     # 0x1b020
xorl %esi, %esi
movl $0x8, %edx
xorl %ecx, %ecx
callq 0x83e1
testl %eax, %eax
je 0x15b83
movq 0xfca7(%rip), %rsi      # 0x25818
movl $0x1, %edi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xcfa3
callq 0x15c72
cmpl $0x0, 0xfbe9(%rip)      # 0x25778
setne %cl
movl 0xfdf0(%rip), %eax      # 0x25988
testl %eax, %eax
setle %dl
orb %cl, %dl
jne 0x15c1a
movl $0x1, %ebx
leaq 0xfddb(%rip), %r14      # 0x25988
leaq 0xfe14(%rip), %r15      # 0x259c8
cmpl $0x0, 0xfe0d(%rip)      # 0x259c8
jle 0x15bed
xorl %ebp, %ebp
incl %ebp
movq %r14, %rdi
movl %ebx, %esi
callq 0x9196
movq (%rax), %r12
movq %r15, %rdi
movl %ebp, %esi
callq 0x9196
cmpq (%rax), %r12
je 0x15be7
cmpl 0xfde5(%rip), %ebp      # 0x259c8
je 0x15bf8
jl 0x15bbf
movl 0xfd9b(%rip), %eax      # 0x25988
leal 0x1(%rbx), %ecx
cmpl %eax, %ebx
movl %ecx, %ebx
jl 0x15bb4
jmp 0x15c1a
leaq 0xfda9(%rip), %rdi      # 0x259a8
movl %ebx, %esi
callq 0x9196
movq (%rax), %rsi
movq %rsi, 0xfc08(%rip)      # 0x25818
movl $0x15, %edi
callq 0xcfa3
leaq 0xfd67(%rip), %rdi      # 0x25988
callq 0x847e
leaq 0xfd9b(%rip), %rdi      # 0x259c8
callq 0x847e
leaq 0xfd6f(%rip), %rdi      # 0x259a8
callq 0x847e
cmpl $0x0, 0xfb33(%rip)      # 0x25778
je 0x15c50
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0xfbc1(%rip), %rsi      # 0x25818
cmpq 0xfbca(%rip), %rsi      # 0x25828
je 0x15c47
movl $0x14, %edi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xd06f