// File: /workspace/github_c_makefile_star2_O0/heltilda[P]cicada/bytecd.c
// Function: beginExecution
void beginExecution(code_ref *theCode, ccBool ifStorePC, ccInt newPCOffset, ccInt newPCwidth, ccInt codesToSkip)
{
    code_ref holdPCCodeRef = PCCodeRef;
    searchPath *holdPCpath = pcSearchPath;
    view holdTopView = topView, holdThatView = thatView;
    ccInt *holdPCCodePtr = pcCodePtr, *holdStartCodePtr = startCodePtr, rtrn;
    object_params holdObjectParams = GL_Object;
    linkedlist holdLL;
    step_params holdStepParams = GL_Path;
    void *oldStackTop, *newStackTop;
    
    
        // don't go too many levels deep or we will blow the (real) stack
    
    if (recursionCounter >= glMaxRecursions)  {  
        setError(recursion_depth_err, pcCodePtr);  return;  }
    recursionCounter++;
    
    
        // point to the code we will run
        
    PCCodeRef = *theCode;
    startCodePtr = storedCode(theCode->PLL_index)->bytecode;
    pcCodePtr = PCCodeRef.code_ptr;
    
    
        // store the old state on our makeshift 'program stack'
    
    if (ifStorePC)  {
        rtrn = pushStack(&PCStack, &newStackTop);
        if (rtrn != passed)  {  setError(out_of_memory_err, pcCodePtr);  PCCodeRef = holdPCCodeRef;  return;  }
        *(view *) newStackTop = baseView;
        
        rtrn = pushStack(&PCStack, &newStackTop);
        if (rtrn != passed)    {  setError(out_of_memory_err, pcCodePtr);  PCCodeRef = holdPCCodeRef;  return;  }
        *(view *) newStackTop = searchView;     }
    
    
        // move our memory location to the code's variable
    
    pcSearchPath = theCode->anchor;
    baseView.windowPtr = pcSearchPath->jamb;
    baseView.offset = newPCOffset;
    baseView.width = newPCwidth;
    baseView.multipleIndices = ccFalse;
    topView.windowPtr = NULL;
    
    refCodeRef(&PCCodeRef);
    refPath(pcSearchPath);
    refWindow(baseView.windowPtr);
    
    errCode = passed;
    
    
        // Skip over codes we are not running (i.e. find the Nth 'code' marker), and go.
    
    if (codesToSkip != 0)   {
        runSkipMode(codesToSkip);
        if (*pcCodePtr == code_marker)  {
            pcCodePtr++;
            runBytecode();   }   }
    else  runBytecode();
    
    
        // dereference the old location variables
    
    derefWindow(&(baseView.windowPtr));
    derefPath(&pcSearchPath);
    derefCodeRef(&PCCodeRef);
    
    
        // pull the old location info off the program stack
    
    if (ifStorePC)   {
        popStack(&PCStack, &oldStackTop);
        searchView = *(view *) oldStackTop;
        
        popStack(&PCStack, &oldStackTop);
        baseView = *(view *) oldStackTop;    }
    
    
    
        // restore the old code pointer
    
    pcSearchPath = holdPCpath;
    
    startCodePtr = holdStartCodePtr;
    pcCodePtr = holdPCCodePtr;
    PCCodeRef = holdPCCodeRef;
    GL_Path = holdStepParams;
    thatView = holdThatView;
    topView = holdTopView;
    
    holdLL = GL_Object.arrayDimList;
    GL_Object = holdObjectParams;
    GL_Object.arrayDimList = holdLL;
    
    recursionCounter--;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
movq 0x18222(%rip), %rax     # 0x2c958
movq %rax, -0x38(%rbp)
movq 0x1821f(%rip), %rax     # 0x2c960
movq %rax, -0x30(%rbp)
movq 0x1821c(%rip), %rax     # 0x2c968
movq %rax, -0x28(%rbp)
movq 0x18219(%rip), %rax     # 0x2c970
movq %rax, -0x20(%rbp)
movq 0x1815e(%rip), %rax     # 0x2c8c0
movq %rax, -0x40(%rbp)
movq 0x181bb(%rip), %rax     # 0x2c928
movq %rax, -0x58(%rbp)
movq 0x181b8(%rip), %rax     # 0x2c930
movq %rax, -0x50(%rbp)
movq 0x181b5(%rip), %rax     # 0x2c938
movq %rax, -0x48(%rbp)
movq 0x18182(%rip), %rax     # 0x2c910
movq %rax, -0x70(%rbp)
movq 0x1817f(%rip), %rax     # 0x2c918
movq %rax, -0x68(%rbp)
movq 0x1817c(%rip), %rax     # 0x2c920
movq %rax, -0x60(%rbp)
movq 0x18059(%rip), %rax     # 0x2c808
movq %rax, -0x78(%rbp)
movq 0x18056(%rip), %rax     # 0x2c810
movq %rax, -0x80(%rbp)
leaq -0xb8(%rbp), %rdi
leaq 0x17f84(%rip), %rsi     # 0x2c750
addq $0xd8, %rsi
movl $0x30, %edx
callq 0x8120
leaq -0x108(%rbp), %rdi
leaq 0x17f65(%rip), %rsi     # 0x2c750
addq $0x108, %rsi            # imm = 0x108
movl $0x30, %edx
callq 0x8120
cmpl $0x64, 0x1814d(%rip)    # 0x2c950
jl 0x1481b
movq 0x17ffc(%rip), %rsi     # 0x2c808
movl $0x30, %edi
callq 0xf740
jmp 0x14c75
movl 0x1812f(%rip), %eax     # 0x2c950
addl $0x1, %eax
movl %eax, 0x18126(%rip)     # 0x2c950
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq %rcx, 0x18120(%rip)     # 0x2c958
movq 0x8(%rax), %rcx
movq %rcx, 0x1811d(%rip)     # 0x2c960
movq 0x10(%rax), %rcx
movq %rcx, 0x1811a(%rip)     # 0x2c968
movq 0x18(%rax), %rax
movq %rax, 0x18117(%rip)     # 0x2c970
movq -0x8(%rbp), %rax
movl (%rax), %esi
leaq 0x17e32(%rip), %rdi     # 0x2c698
callq 0x9700
movq 0x10(%rax), %rax
movq %rax, 0x17f9a(%rip)     # 0x2c810
movq 0x180eb(%rip), %rax     # 0x2c968
movq %rax, 0x17f84(%rip)     # 0x2c808
cmpb $0x0, -0x9(%rbp)
je 0x149b2
leaq 0x17e03(%rip), %rdi     # 0x2c698
addq $0x90, %rdi
leaq -0x118(%rbp), %rsi
callq 0x9ba0
movl %eax, -0x84(%rbp)
cmpl $0x0, -0x84(%rbp)
je 0x148f9
movq 0x17f4a(%rip), %rsi     # 0x2c808
movl $0x1, %edi
callq 0xf740
movq -0x38(%rbp), %rax
movq %rax, 0x18085(%rip)     # 0x2c958
movq -0x30(%rbp), %rax
movq %rax, 0x18082(%rip)     # 0x2c960
movq -0x28(%rbp), %rax
movq %rax, 0x1807f(%rip)     # 0x2c968
movq -0x20(%rbp), %rax
movq %rax, 0x1807c(%rip)     # 0x2c970
jmp 0x14c75
movq -0x118(%rbp), %rax
movq 0x17f89(%rip), %rcx     # 0x2c890
movq %rcx, (%rax)
movq 0x17f87(%rip), %rcx     # 0x2c898
movq %rcx, 0x8(%rax)
movq 0x17f84(%rip), %rcx     # 0x2c8a0
movq %rcx, 0x10(%rax)
leaq 0x17d71(%rip), %rdi     # 0x2c698
addq $0x90, %rdi
leaq -0x118(%rbp), %rsi
callq 0x9ba0
movl %eax, -0x84(%rbp)
cmpl $0x0, -0x84(%rbp)
je 0x1498b
movq 0x17eb8(%rip), %rsi     # 0x2c808
movl $0x1, %edi
callq 0xf740
movq -0x38(%rbp), %rax
movq %rax, 0x17ff3(%rip)     # 0x2c958
movq -0x30(%rbp), %rax
movq %rax, 0x17ff0(%rip)     # 0x2c960
movq -0x28(%rbp), %rax
movq %rax, 0x17fed(%rip)     # 0x2c968
movq -0x20(%rbp), %rax
movq %rax, 0x17fea(%rip)     # 0x2c970
jmp 0x14c75
movq -0x118(%rbp), %rax
movq 0x17f0f(%rip), %rcx     # 0x2c8a8
movq %rcx, (%rax)
movq 0x17f0d(%rip), %rcx     # 0x2c8b0
movq %rcx, 0x8(%rax)
movq 0x17f0a(%rip), %rcx     # 0x2c8b8
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x17eff(%rip)     # 0x2c8c0
movq 0x17ef8(%rip), %rax     # 0x2c8c0
movq 0x18(%rax), %rax
movq %rax, 0x17ebd(%rip)     # 0x2c890
movl -0x10(%rbp), %eax
movl %eax, 0x17ebc(%rip)     # 0x2c898
movl -0x14(%rbp), %eax
movl %eax, 0x17eb7(%rip)     # 0x2c89c
movb $0x0, 0x17eb4(%rip)     # 0x2c8a0
movq $0x0, 0x17f31(%rip) # 0x2c928
leaq 0x17d52(%rip), %rdi     # 0x2c750
addq $0x208, %rdi            # imm = 0x208
callq 0x12c80
movq 0x17eaf(%rip), %rdi     # 0x2c8c0
callq 0x13770
movq 0x17e73(%rip), %rdi     # 0x2c890
callq 0xf780
movl $0x0, 0x17d3c(%rip)     # 0x2c768
cmpl $0x0, -0x18(%rbp)
je 0x14a5f
movl -0x18(%rbp), %edi
callq 0x1a6b0
movq 0x17dc7(%rip), %rax     # 0x2c808
cmpl $0x4, (%rax)
jne 0x14a5d
movq 0x17dbb(%rip), %rax     # 0x2c808
addq $0x4, %rax
movq %rax, 0x17db0(%rip)     # 0x2c808
callq 0x1b7c0
jmp 0x14a64
callq 0x1b7c0
leaq 0x17ce5(%rip), %rdi     # 0x2c750
addq $0x140, %rdi            # imm = 0x140
callq 0xf7d0
leaq 0x17cd2(%rip), %rdi     # 0x2c750
addq $0x170, %rdi            # imm = 0x170
callq 0x13630
leaq 0x17cbf(%rip), %rdi     # 0x2c750
addq $0x208, %rdi            # imm = 0x208
callq 0x12c40
cmpb $0x0, -0x9(%rbp)
je 0x14b29
leaq 0x17bea(%rip), %rdi     # 0x2c698
addq $0x90, %rdi
leaq -0x110(%rbp), %rsi
callq 0x9c20
movq -0x110(%rbp), %rax
movq (%rax), %rcx
movq %rcx, 0x17dd6(%rip)     # 0x2c8a8
movq 0x8(%rax), %rcx
movq %rcx, 0x17dd3(%rip)     # 0x2c8b0
movq 0x10(%rax), %rax
movq %rax, 0x17dd0(%rip)     # 0x2c8b8
leaq 0x17ba9(%rip), %rdi     # 0x2c698
addq $0x90, %rdi
leaq -0x110(%rbp), %rsi
callq 0x9c20
movq -0x110(%rbp), %rax
movq (%rax), %rcx
movq %rcx, 0x17d7d(%rip)     # 0x2c890
movq 0x8(%rax), %rcx
movq %rcx, 0x17d7a(%rip)     # 0x2c898
movq 0x10(%rax), %rax
movq %rax, 0x17d77(%rip)     # 0x2c8a0
movq -0x40(%rbp), %rax
movq %rax, 0x17d8c(%rip)     # 0x2c8c0
movq -0x80(%rbp), %rax
movq %rax, 0x17cd1(%rip)     # 0x2c810
movq -0x78(%rbp), %rax
movq %rax, 0x17cbe(%rip)     # 0x2c808
movq -0x38(%rbp), %rax
movq %rax, 0x17e03(%rip)     # 0x2c958
movq -0x30(%rbp), %rax
movq %rax, 0x17e00(%rip)     # 0x2c960
movq -0x28(%rbp), %rax
movq %rax, 0x17dfd(%rip)     # 0x2c968
movq -0x20(%rbp), %rax
movq %rax, 0x17dfa(%rip)     # 0x2c970
leaq 0x17bd3(%rip), %rdi     # 0x2c750
addq $0x108, %rdi            # imm = 0x108
leaq -0x108(%rbp), %rsi
movl $0x30, %edx
callq 0x8120
movq -0x70(%rbp), %rax
movq %rax, 0x17d70(%rip)     # 0x2c910
movq -0x68(%rbp), %rax
movq %rax, 0x17d6d(%rip)     # 0x2c918
movq -0x60(%rbp), %rax
movq %rax, 0x17d6a(%rip)     # 0x2c920
movq -0x58(%rbp), %rax
movq %rax, 0x17d67(%rip)     # 0x2c928
movq -0x50(%rbp), %rax
movq %rax, 0x17d64(%rip)     # 0x2c930
movq -0x48(%rbp), %rax
movq %rax, 0x17d61(%rip)     # 0x2c938
movq 0x17c52(%rip), %rax     # 0x2c830
movq %rax, -0xd8(%rbp)
movq 0x17c4c(%rip), %rax     # 0x2c838
movq %rax, -0xd0(%rbp)
movq 0x17c46(%rip), %rax     # 0x2c840
movq %rax, -0xc8(%rbp)
movq 0x17c40(%rip), %rax     # 0x2c848
movq %rax, -0xc0(%rbp)
leaq 0x17b3a(%rip), %rdi     # 0x2c750
addq $0xd8, %rdi
leaq -0xb8(%rbp), %rsi
movl $0x30, %edx
callq 0x8120
movq -0xd8(%rbp), %rax
movq %rax, 0x17bf4(%rip)     # 0x2c830
movq -0xd0(%rbp), %rax
movq %rax, 0x17bee(%rip)     # 0x2c838
movq -0xc8(%rbp), %rax
movq %rax, 0x17be8(%rip)     # 0x2c840
movq -0xc0(%rbp), %rax
movq %rax, 0x17be2(%rip)     # 0x2c848
movl 0x17ce4(%rip), %eax     # 0x2c950
addl $-0x1, %eax
movl %eax, 0x17cdb(%rip)     # 0x2c950
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nop