// File: /workspace/github_c_makefile_star2_O0/heltilda[P]cicada/ciclib.c
// Function: cclib_trap
void cclib_trap()
{
    code_ref argCodeRef;
    ccInt counter, codeNo;
    ccBool ifErrorWasTrapped = ccFalse, holdDoPrintError = doPrintError, doClearError = ccTrue;
    
    
        // run each code in our args constructor
    
    for (counter = 1; counter <= BIF_argsView.windowPtr->variable_ptr->codeList.elementNum; counter++)  {
        
        
            // get a handle on the code
        
        argCodeRef = *(code_ref *) element(&(BIF_argsView.windowPtr->variable_ptr->codeList), counter);
        argCodeRef.anchor = pcSearchPath;
        refCodeRef(&argCodeRef);   // in case bE() changes something
        
        doPrintError = (argCodeRef.code_ptr[0] == code_marker);
        if (doPrintError)  {
            doClearError = (argCodeRef.code_ptr[1] != code_marker);
            if (doClearError)  codeNo = 1;
            else  codeNo = 2;       }
        else  codeNo = 0;
        
        
            // run the code
        
        warningCode = passed;
        beginExecution(&argCodeRef, ccTrue, BIF_argsView.offset, BIF_argsView.width, codeNo);
        derefCodeRef(&argCodeRef);
        if (errCode == return_flag)  errCode = passed;
        
        
            // print errors/warnings if we are instructed to do so
        
        if ((errCode != passed) || (warningCode != passed))  {
            
            if (doPrintError)  {
                
                storedCodeType *errorBaseScript;
                ccInt errIndexToPrint, errCharNum = 0;
                code_ref *errScriptToPrint;
                
                if (errCode != passed)  {  errIndexToPrint = errIndex;  errScriptToPrint = &errScript;  }
                else  {  errIndexToPrint = warningIndex;  errScriptToPrint = &warningScript;  }
                
                errorBaseScript = storedCode(errScriptToPrint->PLL_index);
                if (errorBaseScript->opCharNum != NULL)  errCharNum = errorBaseScript->opCharNum[
                                   errIndexToPrint + (ccInt) (errScriptToPrint->code_ptr - errorBaseScript->bytecode) - 1] - 1;
                
                printError(errorBaseScript->fileName, -1, errorBaseScript->sourceCode, errCharNum, ccFalse);       }
            
            if (errCode != passed)  {  intRegister = errCode;  if (doClearError)  errCode = passed;  }
            else  intRegister = -warningCode;
            if (doClearError)  warningCode = passed;
            
            ifErrorWasTrapped = ccTrue;
            if (intRegister > passed)  break;       // break if it was an error that stops execution
    }   }
    
    
        // clear intRegister if no error and no warning
    
    if (!ifErrorWasTrapped)  intRegister = passed;
    
    doPrintError = holdDoPrintError;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movb $0x0, -0x29(%rbp)
leaq 0xe0cd(%rip), %rax      # 0x2c750
movb 0x2a9(%rax), %al
movb %al, -0x2a(%rbp)
movb $0x1, -0x2b(%rbp)
movl $0x1, -0x24(%rbp)
movl -0x24(%rbp), %eax
leaq 0xe0af(%rip), %rcx      # 0x2c750
movq 0x178(%rcx), %rcx
movq 0x10(%rcx), %rcx
cmpl 0xd0(%rcx), %eax
jg 0x1e943
leaq 0xe091(%rip), %rax      # 0x2c750
movq 0x178(%rax), %rax
movq 0x10(%rax), %rdi
addq $0xd0, %rdi
movl -0x24(%rbp), %esi
callq 0x9700
movq (%rax), %rcx
movq %rcx, -0x20(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x18(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0x10(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0x8(%rbp)
leaq 0xe051(%rip), %rax      # 0x2c750
movq 0x170(%rax), %rax
movq %rax, -0x8(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x12c80
movq -0x10(%rbp), %rax
cmpl $0x4, (%rax)
sete %cl
andb $0x1, %cl
leaq 0xe029(%rip), %rax      # 0x2c750
movb %cl, 0x2a9(%rax)
leaq 0xe01c(%rip), %rax      # 0x2c750
cmpb $0x0, 0x2a9(%rax)
je 0x1e765
movq -0x10(%rbp), %rax
cmpl $0x4, 0x4(%rax)
setne %al
andb $0x1, %al
movb %al, -0x2b(%rbp)
cmpb $0x0, -0x2b(%rbp)
je 0x1e75c
movl $0x1, -0x28(%rbp)
jmp 0x1e763
movl $0x2, -0x28(%rbp)
jmp 0x1e76c
movl $0x0, -0x28(%rbp)
leaq 0xdfdd(%rip), %rax      # 0x2c750
movl $0x0, 0x20(%rax)
leaq 0xdfcf(%rip), %rax      # 0x2c750
movl 0x180(%rax), %edx
leaq 0xdfc2(%rip), %rax      # 0x2c750
movl 0x184(%rax), %ecx
movl -0x28(%rbp), %r8d
leaq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x14710
leaq -0x20(%rbp), %rdi
callq 0x12c40
leaq 0xdf9a(%rip), %rax      # 0x2c750
cmpl $0x32, 0x18(%rax)
jne 0x1e7ca
leaq 0xdf8d(%rip), %rax      # 0x2c750
movl $0x0, 0x18(%rax)
leaq 0xdf7f(%rip), %rax      # 0x2c750
cmpl $0x0, 0x18(%rax)
jne 0x1e7e8
leaq 0xdf72(%rip), %rax      # 0x2c750
cmpl $0x0, 0x20(%rax)
je 0x1e933
leaq 0xdf61(%rip), %rax      # 0x2c750
cmpb $0x0, 0x2a9(%rax)
je 0x1e8bd
movl $0x0, -0x40(%rbp)
leaq 0xdf46(%rip), %rax      # 0x2c750
cmpl $0x0, 0x18(%rax)
je 0x1e82e
leaq 0xdf39(%rip), %rax      # 0x2c750
movl 0x1c(%rax), %eax
movl %eax, -0x3c(%rbp)
leaq 0xdf2c(%rip), %rax      # 0x2c750
addq $0x28, %rax
movq %rax, -0x48(%rbp)
jmp 0x1e84a
leaq 0xdf1b(%rip), %rax      # 0x2c750
movl 0x24(%rax), %eax
movl %eax, -0x3c(%rbp)
leaq 0xdf0e(%rip), %rax      # 0x2c750
addq $0x48, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movl (%rax), %esi
leaq 0xde41(%rip), %rdi      # 0x2c698
callq 0x9700
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x1e89e
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x3c(%rbp), %ecx
movq -0x48(%rbp), %rdx
movq 0x10(%rdx), %rdx
movq -0x38(%rbp), %rsi
movq 0x10(%rsi), %rsi
subq %rsi, %rdx
sarq $0x2, %rdx
addl %edx, %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
subl $0x1, %eax
movl %eax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rdi
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdx
movl -0x40(%rbp), %ecx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %r8d, %r8d
callq 0x21350
leaq 0xde8c(%rip), %rax      # 0x2c750
cmpl $0x0, 0x18(%rax)
je 0x1e8f4
leaq 0xde7f(%rip), %rax      # 0x2c750
movl 0x18(%rax), %ecx
leaq 0xde75(%rip), %rax      # 0x2c750
movl %ecx, 0x6c(%rax)
cmpb $0x0, -0x2b(%rbp)
je 0x1e8f2
leaq 0xde65(%rip), %rax      # 0x2c750
movl $0x0, 0x18(%rax)
jmp 0x1e90a
xorl %ecx, %ecx
leaq 0xde53(%rip), %rax      # 0x2c750
subl 0x20(%rax), %ecx
leaq 0xde49(%rip), %rax      # 0x2c750
movl %ecx, 0x6c(%rax)
cmpb $0x0, -0x2b(%rbp)
je 0x1e91e
leaq 0xde39(%rip), %rax      # 0x2c750
movl $0x0, 0x20(%rax)
movb $0x1, -0x29(%rbp)
leaq 0xde27(%rip), %rax      # 0x2c750
cmpl $0x0, 0x6c(%rax)
jle 0x1e931
jmp 0x1e943
jmp 0x1e933
jmp 0x1e935
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1e697
cmpb $0x0, -0x29(%rbp)
jne 0x1e957
leaq 0xde00(%rip), %rax      # 0x2c750
movl $0x0, 0x6c(%rax)
movb -0x2a(%rbp), %cl
leaq 0xddef(%rip), %rax      # 0x2c750
movb %cl, 0x2a9(%rax)
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)