// File: /workspace/github_c_makefile_star2_O2/heltilda[P]cicada/ciclib.c
// Function: cclib_throw
void cclib_throw()
{
    window *paramWindows[] = { NULL, NULL, NULL, NULL, NULL };
    code_ref *targetCodeRef = &PCCodeRef;
    ccInt numArgs, cA, *holdPC;
    ccInt theArgs[] = { 0, 0, 1, (ccInt) (pcCodePtr-1 - PCCodeRef.code_ptr + 1), ccFalse };
    ccInt argsMin[] = { ccIntMin, 0, 1, 1, 0 };
    ccInt argsMax[] = { ccIntMax, 0, 1, 1, 1 };
    code_ref *errorScript = &errScript;
    
    numArgs = numBIF_args();
    if ((numArgs < 1) || (numArgs > 5))  {  setError(wrong_argument_count_err, pcCodePtr-1);  return;  }
    
    
        // read in the error code, throwing real errors if something's wrong with the argument
    
    for (cA = 0; cA < numArgs; cA++)    {
        paramWindows[cA] = getBIFmember(cA+1);
        if (paramWindows[cA] != NULL)  {
            
            if (cA == 3)  {
                holdPC = pcCodePtr;
                pcCodePtr = targetCodeRef->code_ptr;
                runSkipMode(0);
                argsMax[3] = (ccInt) (pcCodePtr - targetCodeRef->code_ptr);
                pcCodePtr = holdPC;
                if (errCode != passed)  return;     }
            
            if (cA != 1)    {
                if (cA < 4)  theArgs[cA] = (ccInt) getBIFnumArg(cA+1, argsMin[cA], argsMax[cA]);
                else  theArgs[cA] = (ccInt) getBIFboolArg(cA+1);
                if (errCode != passed)  return;     }
            else    {
                argsMax[2] = paramWindows[cA]->variable_ptr->codeList.elementNum;
                theArgs[3] = 1;       }
            
            if (((cA == 1) || (cA == 2)) && (paramWindows[1] != NULL))  {
                targetCodeRef = (code_ref *) element(&(paramWindows[1]->variable_ptr->codeList), theArgs[2]);
    }   }   }
    
    
        // throw the error/warning
    
    if (theArgs[4] == 0)  {
        errCode = theArgs[0];
        errIndex = theArgs[3];
        errorScript = &errScript;       }
    
    else  {
        warningCode = theArgs[0];
        warningIndex = theArgs[3];
        errorScript = &warningScript;       }
    
    if (errorScript->code_ptr != NULL)  derefCodeRef(errorScript);
    *errorScript = *targetCodeRef;
    errorScript->anchor = NULL;
    refCodeRef(errorScript);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
andq $0x0, 0x90(%rsp)
andl $0x0, (%rsp)
pushq $0x1
popq %rax
leaq 0xe284(%rip), %r12      # 0x24760
movq 0xb8(%r12), %rcx
subq 0x218(%r12), %rcx
movl %eax, 0x8(%rsp)
addq $-0x4, %rcx
shrq $0x2, %rcx
incl %ecx
movl %ecx, 0xc(%rsp)
andl $0x0, 0x10(%rsp)
movaps %xmm0, 0x70(%rsp)
movapd 0x3890(%rip), %xmm0     # 0x19da0
movapd %xmm0, 0x20(%rsp)
movl %eax, 0x30(%rsp)
callq 0x170b2
leal -0x6(%rax), %ecx
cmpl $-0x5, %ecx
jae 0x1654c
movq 0xb8(%r12), %rsi
addq $-0x4, %rsi
pushq $0x2d
popq %rdi
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc7c2
movl $0x208, %ecx            # imm = 0x208
addq 0xaa88(%rip), %rcx      # 0x20fe0
movq %rcx, 0x18(%rsp)
movl %eax, %eax
xorl %r13d, %r13d
movq %rax, 0x38(%rsp)
leaq (,%r13,4), %rcx
movq %rcx, 0x50(%rsp)
leaq (%rsp,%r13,4), %rbx
leal -0x1(%r13), %ebp
subq %r13, %rax
movq %rax, 0x68(%rsp)
leaq (%rsp,%r13,4), %rax
addq $0x20, %rax
movq %rax, 0x48(%rsp)
leaq (%rsp,%r13,8), %rax
addq $0x70, %rax
movq %rax, 0x60(%rsp)
xorl %r15d, %r15d
movq %rbx, 0x40(%rsp)
cmpq %r15, 0x68(%rsp)
je 0x166f4
leaq (%r15,%r13), %r14
incq %r14
movl %r14d, %edi
callq 0x170f5
movq 0x60(%rsp), %rcx
movq %rax, (%rcx,%r15,8)
testq %rax, %rax
je 0x166c5
leal (%r15,%r13), %ecx
cmpl $0x1, %ecx
je 0x1663e
cmpl $0x3, %ecx
jne 0x16656
movq 0xb8(%r12), %rax
movq %rax, 0x58(%rsp)
movq %rbp, %rbx
movq 0x18(%rsp), %rbp
movq 0x10(%rbp), %rax
movq %rax, 0xb8(%r12)
xorl %edi, %edi
callq 0x139ae
movq 0xb8(%r12), %rax
subq 0x10(%rbp), %rax
movq %rbx, %rbp
shrq $0x2, %rax
movl %eax, 0x2c(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0xb8(%r12)
movq 0x40(%rsp), %rbx
cmpl $0x0, 0x18(%r12)
je 0x16660
jmp 0x16778
movq 0x10(%rax), %rax
movl 0xd0(%rax), %eax
movl %eax, 0x28(%rsp)
movl $0x1, 0xc(%rsp)
jmp 0x166a9
leaq (%r15,%r13), %rax
cmpq $0x3, %rax
ja 0x1668e
movq 0x50(%rsp), %rax
leaq (%rax,%r15,4), %rax
leaq 0x3710(%rip), %rcx      # 0x19d80
cvtsi2sdl (%rcx,%rax), %xmm0
movq 0x48(%rsp), %rax
cvtsi2sdl (%rax,%r15,4), %xmm1
movl %r14d, %edi
callq 0x1715f
cvttsd2si %xmm0, %eax
jmp 0x16699
movl %r14d, %edi
callq 0x17403
movsbl %al, %eax
movl %eax, (%rbx,%r15,4)
cmpl $0x0, 0x18(%r12)
jne 0x16778
leal (%r15,%rbp), %eax
cmpl $0x2, %eax
setb %cl
movq 0x78(%rsp), %rax
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
je 0x166cd
incq %r15
jmp 0x165a6
movq 0x10(%rax), %rdi
movl $0xd0, %eax
addq %rax, %rdi
movl 0x8(%rsp), %esi
callq 0x9088
movq %rax, 0x18(%rsp)
movq %r14, %r13
movq 0x38(%rsp), %rax
jmp 0x16567
movl 0x10(%rsp), %ebx
leaq 0x48(%r12), %r14
leaq 0x28(%r12), %rax
leaq 0x38(%r12), %rcx
leaq 0x58(%r12), %rdx
xorl %esi, %esi
testl %ebx, %ebx
setne %sil
cmoveq %rax, %r14
movl (%rsp), %eax
movl 0xc(%rsp), %edi
movl %eax, 0x18(%r12,%rsi,8)
movl %edi, 0x1c(%r12,%rsi,8)
cmoveq %rcx, %rdx
cmpq $0x0, (%rdx)
je 0x1673b
movq %r14, %rdi
callq 0xe533
xorl %eax, %eax
testl %ebx, %ebx
setne %al
movq 0x18(%rsp), %rdx
movq 0x10(%rdx), %rcx
movq %rcx, 0x10(%r14)
movups (%rdx), %xmm0
movups %xmm0, (%r14)
shll $0x5, %eax
andq $0x0, 0x40(%r12,%rax)
movq %r14, %rdi
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe54f
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq