// File: /workspace/github_c_makefile_star2_O2/heltilda[P]cicada/ciclib.c
// Function: cclib_compile
void cclib_compile()
{
    window *textStringWindow, *varNamesWindow;
    member *varNamesStringMember;
    linkedlist *textString;
    ccInt numArgs = numBIF_args(), nextVarName, rtrn;
    char *scriptCopy;
    
    if ((numArgs < 1) || (numArgs > 4))  {  setError(wrong_argument_count_err, pcCodePtr-1);  return;  }
    
    
        // make sure the script ends with a 0 (which we will later take out) and lies in one contiguous block of memory
    
    textStringWindow = getBIFstringArg(1);
    if (errCode != passed)  return;
    textString = &(textStringWindow->variable_ptr->mem.data);
    
    
        // add the trailing null character at the end of (our own copy of) the script
    
    scriptCopy = (char *) malloc(textStringWindow->width+1);
    if (scriptCopy == NULL)  {  setError(out_of_memory_err, pcCodePtr-1);  return;  }
    getElements(textString, textStringWindow->offset+1, textStringWindow->offset+textStringWindow->width, (void *) scriptCopy);
    scriptCopy[textStringWindow->width] = 0;
    
    
        // Run the compiler.  Store the error code/index (which may be zero -- no error).
    
    rtrn = compile(currentCompiler, scriptCopy);
    
    if (((rtrn != passed) || (compilerWarning != passed)) && (doPrintError))  {
        
        char *fileString = NULL;
        ccInt fileStringLength = -1;
        
        if (numArgs >= 2)  {
        if (getBIFmember(2) != NULL)  {
            window *fileStringWindow = getBIFstringArg(2);
            if (errCode != passed)  {  free((void *) scriptCopy);  return;  }
            if (fileStringWindow->width > 0)  {
                if (defragmentLinkedList(&(fileStringWindow->variable_ptr->mem.data)) != passed)  rtrn = out_of_memory_err;
                else  {
                    fileString = (char *) element(&(fileStringWindow->variable_ptr->mem.data), fileStringWindow->offset+1);
                    fileStringLength = fileStringWindow->width;
        }}  }   }
        
        if (rtrn != passed)  setError(rtrn, pcCodePtr-1);
        else  setWarning(compilerWarning, pcCodePtr-1);
        
        printError(fileString, fileStringLength, scriptCopy, errPosition-1, ccFalse);
        doPrintError = ccFalse;             }
    
    else if (rtrn != passed)  setError(rtrn, pcCodePtr-1);
    
    
        // delete the null character we put in at the end of the string
    
    free((void *) scriptCopy);
    
    if (errCode != passed)  return;
    
    
        // store the bytecode string
    
    rtrn = resizeLinkedList(&stringRegister, currentCompiler->bytecode.elementNum * sizeof(ccInt), ccFalse);
    if (rtrn != passed)  {  setError(out_of_memory_err, pcCodePtr-1);  return;  }
    defragmentLinkedList(&stringRegister);
    
    if (currentCompiler->bytecode.elementNum > 0)
        getElements(&(currentCompiler->bytecode), 1, currentCompiler->bytecode.elementNum, element(&stringRegister, 1));
    
    
        // store the bytecode word -> text position mapping in the provided variable, if it was given
    
    if (numArgs >= 3)  {
        window *opCharNumWindow = NULL, *arg3Window = getBIFmember(3);
        linkedlist *opCharNumLL;
        if (errCode != passed)  return;
        
        if (arg3Window != NULL)  {
            resizeMember(LL_member(arg3Window->variable_ptr, arg3Window->offset+1), 1, currentCompiler->opCharNum.elementNum*sizeof(ccInt));
            if (errCode == passed)  opCharNumWindow = getBIFstringArg(3);
            if (errCode != passed)  return;
            
            opCharNumLL = &(opCharNumWindow->variable_ptr->mem.data);
            rtrn = defragmentLinkedList(opCharNumLL);
            if (rtrn != passed)  {  setError(rtrn, pcCodePtr-1);  return;  }
            
            if (currentCompiler->opCharNum.elementNum > 0)  {
                getElements(&(currentCompiler->opCharNum), 1, currentCompiler->opCharNum.elementNum,
                        (void *) element(opCharNumLL, opCharNumWindow->offset+1));
    }   }   }
    
    
        // store the bytecode word -> text position mapping in the provided variable, if it was given
    
    if (numArgs >= 4)  {
        varNamesWindow = getBIFmember(4);
        if (errCode != passed)  return;
        
        if (varNamesWindow != NULL)  {
            variable *varNamesVar = varNamesWindow->variable_ptr;
            member *varNamesMember;
            
            if ((varNamesVar->eventualType != string_type) || (varNamesVar->arrayDepth != 1))
                {  setError(library_argument_err, pcCodePtr-1);  return;  }
            varNamesStringMember = LL_member(varNamesWindow->variable_ptr, varNamesWindow->offset+1);
            
            varNamesMember = LL_member(varNamesWindow->variable_ptr, 1);
            nextVarName = varNamesMember->indices+1;
            resizeMember(varNamesMember, 1, currentCompiler->varNames.elementNum);
            if (errCode != passed)  return;
            
            if (varNamesMember->memberWindow != NULL)  {
                variable *varNamesStringVar = varNamesMember->memberWindow->variable_ptr;
                
                while (currentCompiler->varNames.elementNum >= nextVarName)  {
                    
                    member *stringCharsMember = LL_member(varNamesStringVar, varNamesMember->memberWindow->offset+nextVarName);
                    varNameType *oneVarName = (varNameType *) element(&(currentCompiler->varNames), nextVarName);
                    
                    resizeMember(stringCharsMember, 1, oneVarName->nameLength);
                    setElements(&(stringCharsMember->memberWindow->variable_ptr->mem.data), stringCharsMember->memberWindow->offset+1,
                                stringCharsMember->memberWindow->offset+oneVarName->nameLength, (void *) oneVarName->theName);
                    
                    nextVarName++;
    }   }   }   }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x170b2
movl %eax, %ebx
leal -0x5(%rbx), %eax
cmpl $-0x5, %eax
ja 0x14ef5
leaq 0xf88c(%rip), %rax      # 0x24760
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
pushq $0x2d
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xc7c2
pushq $0x1
popq %rbp
movl %ebp, %edi
callq 0x17280
movq %rax, %r15
leaq 0xf857(%rip), %rax      # 0x24760
cmpl $0x0, 0x18(%rax)
je 0x14f1e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%r15), %r13
movslq 0x1c(%r15), %r12
leaq 0x1(%r12), %rdi
callq 0x81d0
testq %rax, %rax
je 0x14fd5
movq %rax, %r14
addq $0x10, %r13
movl 0x18(%r15), %eax
leal 0x1(%rax), %esi
addl %eax, %r12d
movq %r13, %rdi
movl %r12d, %edx
movq %r14, %rcx
callq 0x8f8b
movslq 0x1c(%r15), %rax
movb $0x0, (%r14,%rax)
leaq 0xf338(%rip), %r12      # 0x242a0
movq (%r12), %rdi
movq %r14, %rsi
callq 0xb2a8
movl %eax, %r15d
movl 0xc(%r12), %eax
orl %r15d, %eax
leaq 0xf7da(%rip), %r13      # 0x24760
je 0x14fe8
cmpb $0x0, 0x2a9(%r13)
je 0x14fe8
pushq $-0x1
popq %r12
cmpl $0x2, %ebx
jb 0x15033
pushq $0x2
popq %rdi
callq 0x170f5
testq %rax, %rax
je 0x15033
pushq $0x2
popq %rdi
callq 0x17280
cmpl $0x0, 0x18(%r13)
je 0x15009
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x81c0
leaq 0xf784(%rip), %rax      # 0x24760
movq 0xb8(%rax), %rsi
jmp 0x150e6
testl %r15d, %r15d
je 0x150a7
movq 0xb8(%r13), %rsi
addq $-0x4, %rsi
movl %r15d, %edi
callq 0xc7c2
jmp 0x150a7
cmpl $0x0, 0x1c(%rax)
jle 0x15033
movq %rax, %r12
movq 0x10(%rax), %rdi
addq $0x10, %rdi
callq 0x8b50
testl %eax, %eax
je 0x151c9
pushq $-0x1
popq %rax
movl %eax, 0x4(%rsp)
xorl %r12d, %r12d
jmp 0x15043
movl %r12d, 0x4(%rsp)
xorl %r12d, %r12d
testl %r15d, %r15d
je 0x15065
movl %r15d, %ebp
leaq 0xf716(%rip), %r13      # 0x24760
movq 0xb8(%r13), %rsi
addq $-0x4, %rsi
movl %ebp, %edi
callq 0xc7c2
leaq 0xf23d(%rip), %r15      # 0x242a0
jmp 0x15087
leaq 0xf234(%rip), %r15      # 0x242a0
movl 0xc(%r15), %edi
leaq 0xf6e9(%rip), %r13      # 0x24760
movq 0xb8(%r13), %rsi
addq $-0x4, %rsi
callq 0xc87d
movl 0x8(%r15), %ecx
decl %ecx
movq %r12, %rdi
movl 0x4(%rsp), %esi
movq %r14, %rdx
xorl %r8d, %r8d
callq 0x17f79
movb $0x0, 0x2a9(%r13)
movq %r14, %rdi
callq 0x81c0
cmpl $0x0, 0x18(%r13)
jne 0x14f0f
leaq 0xf1df(%rip), %r15      # 0x242a0
movq (%r15), %rax
movl 0x1460(%rax), %esi
shll $0x2, %esi
leaq 0x78(%r13), %r14
movq %r14, %rdi
xorl %edx, %edx
callq 0x8b23
testl %eax, %eax
je 0x150f1
movq 0xb8(%r13), %rsi
addq $-0x4, %rsi
pushq $0x1
jmp 0x14ee1
movq %r14, %rdi
callq 0x8b50
movq (%r15), %r15
movl 0x1460(%r15), %ebp
testl %ebp, %ebp
jle 0x1512d
addq $0x1460, %r15           # imm = 0x1460
pushq $0x1
popq %r12
movq %r14, %rdi
movl %r12d, %esi
callq 0x9088
movq %r15, %rdi
movl %r12d, %esi
movl %ebp, %edx
movq %rax, %rcx
callq 0x8f8b
cmpl $0x3, %ebx
jb 0x14f0f
pushq $0x3
popq %rdi
callq 0x170f5
cmpl $0x0, 0x18(%r13)
jne 0x14f0f
testq %rax, %rax
je 0x1522c
movq 0x10(%rax), %rdi
addq $0x10, %rdi
movl 0x18(%rax), %esi
incl %esi
callq 0x9088
leaq 0xf135(%rip), %rcx      # 0x242a0
movq (%rcx), %rcx
movl 0x1480(%rcx), %edx
shll $0x2, %edx
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x11183
cmpl $0x0, 0x18(%r13)
jne 0x14f0f
pushq $0x3
popq %rdi
callq 0x17280
cmpl $0x0, 0x18(%r13)
jne 0x14f0f
movq %rax, %r14
movq 0x10(%rax), %r15
addq $0x10, %r15
movq %r15, %rdi
callq 0x8b50
testl %eax, %eax
je 0x151f1
movq 0xb8(%r13), %rsi
addq $-0x4, %rsi
movl %eax, %edi
jmp 0x14ee2
movq %r12, %r13
movq 0x10(%r12), %rdi
addq $0x10, %rdi
movl 0x18(%r12), %esi
incl %esi
callq 0x9088
movq %rax, %r12
movl 0x1c(%r13), %eax
movl %eax, 0x4(%rsp)
jmp 0x1503b
leaq 0xf0a8(%rip), %rax      # 0x242a0
movq (%rax), %r12
movl 0x1480(%r12), %ebp
testl %ebp, %ebp
jle 0x1522c
addq $0x1480, %r12           # imm = 0x1480
movl 0x18(%r14), %esi
incl %esi
movq %r15, %rdi
callq 0x9088
pushq $0x1
popq %rsi
movq %r12, %rdi
movl %ebp, %edx
movq %rax, %rcx
callq 0x8f8b
cmpl $0x3, %ebx
je 0x14f0f
pushq $0x4
popq %rdi
callq 0x170f5
movq %rax, %rbx
cmpl $0x0, 0x18(%r13)
setne %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
jne 0x14f0f
movq 0x10(%rbx), %rdi
cmpl $0x4, 0xc4(%rdi)
jne 0x15356
cmpl $0x1, 0xc8(%rdi)
jne 0x15356
addq $0x10, %rdi
movl 0x18(%rbx), %esi
incl %esi
callq 0x9088
movq 0x10(%rbx), %rdi
addq $0x10, %rdi
pushq $0x1
popq %rbp
movl %ebp, %esi
callq 0x9088
movq %rax, %rbx
movl 0xc(%rax), %r14d
leaq 0xeffe(%rip), %rax      # 0x242a0
movq (%rax), %rax
movl 0x14a0(%rax), %edx
movq %rbx, %rdi
movl %ebp, %esi
callq 0x11183
cmpl $0x0, 0x18(%r13)
jne 0x14f0f
movq (%rbx), %rax
testq %rax, %rax
je 0x14f0f
movq 0x10(%rax), %r15
addq $0x10, %r15
incl %r14d
leaq 0xefc2(%rip), %rbp      # 0x242a0
leal -0x1(%r14), %eax
movq (%rbp), %rcx
cmpl %eax, 0x14a0(%rcx)
jle 0x14f0f
movq (%rbx), %rax
movl 0x18(%rax), %esi
addl %r14d, %esi
movq %r15, %rdi
callq 0x9088
movq %rax, %r12
leaq 0xef93(%rip), %rbp      # 0x242a0
movq (%rbp), %rdi
movl $0x14a0, %eax           # imm = 0x14A0
addq %rax, %rdi
movl %r14d, %esi
callq 0x9088
movq %rax, %r13
movl 0x8(%rax), %edx
movq %r12, %rdi
pushq $0x1
popq %rsi
callq 0x11183
movq (%r12), %rax
movq 0x10(%rax), %rdi
addq $0x10, %rdi
movl 0x18(%rax), %edx
leal 0x1(%rdx), %esi
addl 0x8(%r13), %edx
movq (%r13), %rcx
callq 0x8eaa
incl %r14d
jmp 0x152de
movq 0xb8(%r13), %rsi
addq $-0x4, %rsi
pushq $0x2e
jmp 0x14ee1