// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x1, 0x11a1a(%rip)     # 0x2c76c
leaq 0x119f7(%rip), %rdi     # 0x2c750
addq $0x228, %rdi            # imm = 0x228
xorl %ecx, %ecx
movl $0x8, %edx
movsd 0x72b1(%rip), %xmm0     # 0x22020
movl %ecx, %esi
callq 0x8460
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x1ad95
movq 0x11a82(%rip), %rsi     # 0x2c808
movl $0x1, %edi
callq 0xf740
jmp 0x1af68
leaq 0x119b4(%rip), %rdi     # 0x2c750
addq $0x248, %rdi            # imm = 0x248
xorl %ecx, %ecx
movl $0x8, %edx
movsd 0x726e(%rip), %xmm0     # 0x22020
movl %ecx, %esi
callq 0x8460
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x1add8
movq 0x11a3f(%rip), %rsi     # 0x2c808
movl $0x1, %edi
callq 0xf740
jmp 0x1af68
leaq 0x11971(%rip), %rdi     # 0x2c750
addq $0x268, %rdi            # imm = 0x268
xorl %ecx, %ecx
movl $0x8, %edx
movsd 0x722b(%rip), %xmm0     # 0x22020
movl %ecx, %esi
callq 0x8460
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x1ae1b
movq 0x119fc(%rip), %rsi     # 0x2c808
movl $0x1, %edi
callq 0xf740
jmp 0x1af68
callq 0x1af70
cmpl $0x0, 0x11941(%rip)     # 0x2c768
jne 0x1af05
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl 0x11b3b(%rip), %eax     # 0x2c978
jg 0x1af03
movl $0x1, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl 0x11b65(%rip), %eax     # 0x2c9b8
jg 0x1aef3
movl -0x4(%rbp), %esi
leaq 0x118ed(%rip), %rdi     # 0x2c750
addq $0x228, %rdi            # imm = 0x228
callq 0x96b0
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movl -0x8(%rbp), %esi
leaq 0x118d0(%rip), %rdi     # 0x2c750
addq $0x268, %rdi            # imm = 0x268
callq 0x96b0
movq %rax, %rcx
movq -0x18(%rbp), %rax
cmpq (%rcx), %rax
jne 0x1ae9a
jmp 0x1aef3
movl -0x8(%rbp), %eax
cmpl 0x11b15(%rip), %eax     # 0x2c9b8
jne 0x1aee1
movl -0x4(%rbp), %esi
leaq 0x118a1(%rip), %rdi     # 0x2c750
addq $0x248, %rdi            # imm = 0x248
callq 0x96b0
movq (%rax), %rax
movq %rax, 0x11943(%rip)     # 0x2c808
movq 0x1193c(%rip), %rsi     # 0x2c808
movl $0x15, %edi
callq 0xf740
movl 0x11a9c(%rip), %eax     # 0x2c978
movl %eax, -0x4(%rbp)
jmp 0x1aef3
jmp 0x1aee3
jmp 0x1aee5
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x1ae4a
jmp 0x1aef5
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x1ae34
jmp 0x1af05
leaq 0x11844(%rip), %rdi     # 0x2c750
addq $0x228, %rdi            # imm = 0x228
callq 0x8540
leaq 0x11831(%rip), %rdi     # 0x2c750
addq $0x268, %rdi            # imm = 0x268
callq 0x8540
leaq 0x1181e(%rip), %rdi     # 0x2c750
addq $0x248, %rdi            # imm = 0x248
callq 0x8540
cmpl $0x0, 0x11823(%rip)     # 0x2c768
jne 0x1af68
movq 0x118ba(%rip), %rax     # 0x2c808
cmpq 0x118c3(%rip), %rax     # 0x2c818
je 0x1af68
movq 0x118aa(%rip), %rsi     # 0x2c808
movl $0x14, %edi
callq 0xf940
addq $0x20, %rsp
popq %rbp
retq
nop