// File: /workspace/github_c_makefile_star2_O2/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, 0x1095e(%rip)     # 0x2477c
leaq 0x10b63(%rip), %rdi     # 0x24988
pushq $0x8
popq %rdx
movsd 0x51f0(%rip), %xmm0     # 0x19020
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x83d5
testl %eax, %eax
jne 0x13e7b
leaq 0x10b64(%rip), %rdi     # 0x249a8
pushq $0x8
popq %rdx
movsd 0x51d1(%rip), %xmm0     # 0x19020
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x83d5
testl %eax, %eax
jne 0x13e7b
leaq 0x10b65(%rip), %rdi     # 0x249c8
pushq $0x8
popq %rdx
movsd 0x51b2(%rip), %xmm0     # 0x19020
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x83d5
testl %eax, %eax
je 0x13e98
movq 0x10996(%rip), %rsi     # 0x24818
pushq $0x1
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc7c2
callq 0x13f99
cmpl $0x0, 0x108d4(%rip)     # 0x24778
je 0x13ee6
leaq 0x10adb(%rip), %rdi     # 0x24988
callq 0x846b
leaq 0x10b0f(%rip), %rdi     # 0x249c8
callq 0x846b
leaq 0x10ae3(%rip), %rdi     # 0x249a8
callq 0x846b
cmpl $0x0, 0x108a7(%rip)     # 0x24778
je 0x13f6f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %r15
leaq 0x10a97(%rip), %rbx     # 0x24988
leaq 0x10ad0(%rip), %r14     # 0x249c8
movl %r15d, %r12d
cmpl 0x10a86(%rip), %r12d    # 0x24988
jg 0x13ea6
movl 0x10abe(%rip), %eax     # 0x249c8
movl %r15d, %r13d
cmpl %eax, %r13d
jg 0x13f6a
movq %rbx, %rdi
movl %r12d, %esi
callq 0x906e
movq (%rax), %rbp
movq %r14, %rdi
movl %r13d, %esi
callq 0x906e
cmpq (%rax), %rbp
je 0x13f6a
movl 0x10a92(%rip), %eax     # 0x249c8
leal 0x1(%r13), %ecx
cmpl %eax, %r13d
movl %ecx, %r13d
jne 0x13f0d
leaq 0x10a5f(%rip), %rdi     # 0x249a8
movl %r12d, %esi
callq 0x906e
movq (%rax), %rsi
movq %rsi, 0x108bd(%rip)     # 0x24818
pushq $0x15
popq %rdi
callq 0xc7c2
movl 0x10a1e(%rip), %r12d    # 0x24988
incl %r12d
jmp 0x13efb
movq 0x108a2(%rip), %rsi     # 0x24818
cmpq 0x108ab(%rip), %rsi     # 0x24828
je 0x13ed7
pushq $0x14
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc87d