// File: /workspace/github_c_makefile_star2_O1/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 0x1926a
movl %eax, %ebx
leal -0x5(%rbx), %eax
movl $0x2d, %ebp
cmpl $-0x4, %eax
jae 0x16d34
leaq 0xea4c(%rip), %rax      # 0x25760
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl %ebp, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xd1a9
movl $0x1, %ebp
movl $0x1, %edi
callq 0x19452
movq %rax, %r15
leaq 0xea13(%rip), %rax      # 0x25760
cmpl $0x0, 0x18(%rax)
je 0x16d62
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 0x16d0d
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 0x8fee
movslq 0x1c(%r15), %rax
movb $0x0, (%r14,%rax)
leaq 0xe4f8(%rip), %r12      # 0x252a0
movq (%r12), %rdi
movq %r14, %rsi
callq 0xb945
movl %eax, %r15d
movl 0xc(%r12), %eax
orl %r15d, %eax
leaq 0xe99a(%rip), %rax      # 0x25760
je 0x16e24
cmpb $0x0, 0x2a9(%rax)
je 0x16e24
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
cmpl $0x2, %ebx
jl 0x16e49
movl $0x2, %edi
callq 0x192b4
testq %rax, %rax
je 0x16e4d
movl $0x2, %edi
callq 0x19452
movq %rax, %rcx
leaq 0xe961(%rip), %rax      # 0x25760
movl 0x18(%rax), %r13d
testl %r13d, %r13d
je 0x16e58
movq %r14, %rdi
callq 0x81c0
leaq 0xe949(%rip), %rax      # 0x25760
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
xorl %ecx, %ecx
jmp 0x16eab
testl %r15d, %r15d
movq %rax, %r12
je 0x16f1d
movq 0xb8(%r12), %rsi
addq $-0x4, %rsi
movl %r15d, %edi
callq 0xd1a9
jmp 0x16f1d
xorl %ecx, %ecx
jmp 0x16eb4
xorl %ecx, %ecx
leaq 0xe90a(%rip), %rax      # 0x25760
jmp 0x16eb4
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
cmpl $0x0, 0x1c(%rcx)
jle 0x16e1d
movq %rcx, (%rsp)
movq 0x10(%rcx), %rdi
addq $0x10, %rdi
callq 0x8bb7
testl %eax, %eax
je 0x16e83
movl $0x1, %r15d
xorl %ecx, %ecx
jmp 0x16ea4
movq (%rsp), %r12
movq 0x10(%r12), %rdi
addq $0x10, %rdi
movl 0x18(%r12), %esi
incl %esi
callq 0x911c
movq %rax, %rcx
movl 0x1c(%r12), %r12d
leaq 0xe8b5(%rip), %rax      # 0x25760
testl %r13d, %r13d
jne 0x16d53
movl %r12d, (%rsp)
movq %rcx, %r13
testl %r15d, %r15d
je 0x16edf
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl %r15d, %edi
movq %rax, %r12
callq 0xd1a9
leaq 0xe3c3(%rip), %r15      # 0x252a0
jmp 0x16efd
leaq 0xe3ba(%rip), %r15      # 0x252a0
movl 0xc(%r15), %edi
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movq %rax, %r12
callq 0xd275
movl 0x8(%r15), %ecx
decl %ecx
movq %r13, %rdi
movl (%rsp), %esi
movq %r14, %rdx
xorl %r8d, %r8d
callq 0x1a232
movb $0x0, 0x2a9(%r12)
movq %r14, %rdi
callq 0x81c0
cmpl $0x0, 0x18(%r12)
jne 0x16d53
leaq 0xe368(%rip), %r15      # 0x252a0
movq (%r15), %rax
movl 0x1460(%rax), %esi
shll $0x2, %esi
leaq 0x78(%r12), %r14
movq %r14, %rdi
xorl %edx, %edx
callq 0x8b7e
testl %eax, %eax
jne 0x16d0d
movq %r14, %rdi
callq 0x8bb7
movq (%r15), %r15
movl 0x1460(%r15), %ebp
testl %ebp, %ebp
jle 0x16f97
addq $0x1460, %r15           # imm = 0x1460
movq %r14, %rdi
movl $0x1, %esi
callq 0x911c
movq %r15, %rdi
movl $0x1, %esi
movl %ebp, %edx
movq %rax, %rcx
callq 0x8fee
cmpl $0x3, %ebx
jl 0x1707d
movl $0x3, %edi
callq 0x192b4
leaq 0xe7af(%rip), %rcx      # 0x25760
cmpl $0x0, 0x18(%rcx)
jne 0x16d53
testq %rax, %rax
je 0x1707d
movq 0x10(%rax), %rdi
addq $0x10, %rdi
movl 0x18(%rax), %esi
incl %esi
callq 0x911c
leaq 0xe2c3(%rip), %rcx      # 0x252a0
movq (%rcx), %rcx
movl 0x1480(%rcx), %edx
shll $0x2, %edx
movq %rax, %rdi
movl $0x1, %esi
callq 0x121b3
leaq 0xe763(%rip), %rcx      # 0x25760
cmpl $0x0, 0x18(%rcx)
je 0x17008
xorl %r14d, %r14d
jmp 0x1701c
movl $0x3, %edi
callq 0x19452
leaq 0xe747(%rip), %rcx      # 0x25760
movq %rax, %r14
cmpl $0x0, 0x18(%rcx)
jne 0x16d53
movq 0x10(%r14), %r15
addq $0x10, %r15
movq %r15, %rdi
callq 0x8bb7
movl %eax, %ebp
testl %eax, %eax
leaq 0xe25f(%rip), %rax      # 0x252a0
jne 0x16d0d
movq (%rax), %r12
movl 0x1480(%r12), %ebp
testl %ebp, %ebp
jle 0x1707d
addq $0x1480, %r12           # imm = 0x1480
movl 0x18(%r14), %esi
incl %esi
movq %r15, %rdi
callq 0x911c
movq %r12, %rdi
movl $0x1, %esi
movl %ebp, %edx
movq %rax, %rcx
callq 0x8fee
cmpl $0x4, %ebx
jl 0x16d53
movl $0x4, %edi
callq 0x192b4
leaq 0xe6c9(%rip), %r12      # 0x25760
movq %rax, %rbx
cmpl $0x0, 0x18(%r12)
setne %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
jne 0x16d53
movq 0x10(%rbx), %rdi
movl $0x2e, %ebp
cmpl $0x4, 0xc4(%rdi)
jne 0x16d0d
cmpl $0x1, 0xc8(%rdi)
leaq 0xe1cb(%rip), %r15      # 0x252a0
jne 0x16d0d
addq $0x10, %rdi
movl 0x18(%rbx), %esi
incl %esi
callq 0x911c
movq 0x10(%rbx), %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x911c
movq %rax, %rbx
movl 0xc(%rax), %r14d
movq (%r15), %rax
movl 0x14a0(%rax), %edx
movq %rbx, %rdi
movl $0x1, %esi
callq 0x121b3
cmpl $0x0, 0x18(%r12)
jne 0x16d53
movq (%rbx), %rax
testq %rax, %rax
je 0x16d53
leaq 0xe169(%rip), %rcx      # 0x252a0
movq (%rcx), %rcx
cmpl %r14d, 0x14a0(%rcx)
jle 0x16d53
movq 0x10(%rax), %r15
addq $0x10, %r15
incl %r14d
movq (%rbx), %rax
movl 0x18(%rax), %esi
addl %r14d, %esi
movq %r15, %rdi
callq 0x911c
movq %rax, %r12
leaq 0xe133(%rip), %rbp      # 0x252a0
movq (%rbp), %rdi
movl $0x14a0, %eax           # imm = 0x14A0
addq %rax, %rdi
movl %r14d, %esi
callq 0x911c
movq %rax, %r13
movl 0x8(%rax), %edx
movq %r12, %rdi
movl $0x1, %esi
callq 0x121b3
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 0x8f0d
movq (%rbp), %rax
leal 0x1(%r14), %ecx
cmpl %r14d, 0x14a0(%rax)
movl %ecx, %r14d
jg 0x17152
jmp 0x16d53