// File: /workspace/github_c_makefile_star2_O3/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 0x19254
movl %eax, %ebx
leal -0x5(%rbx), %eax
cmpl $-0x5, %eax
ja 0x16cbc
leaq 0xeac7(%rip), %rax      # 0x25760
movq 0xb8(%rax), %rsi
addq $-0x4, %rsi
movl $0x2d, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xcfa3
movl $0x1, %edi
callq 0x1943c
movq %rax, %r15
leaq 0xea90(%rip), %rax      # 0x25760
cmpl $0x0, 0x18(%rax)
je 0x16ce5
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 0x16d97
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 0x90a5
movslq 0x1c(%r15), %rax
movb $0x0, (%r14,%rax)
leaq 0xe571(%rip), %r13      # 0x252a0
movq (%r13), %rdi
movq %r14, %rsi
callq 0xb7fe
movl %eax, %ebp
movl 0xc(%r13), %eax
orl %ebp, %eax
leaq 0xea16(%rip), %r12      # 0x25760
je 0x16daa
cmpb $0x0, 0x2a9(%r12)
je 0x16daa
cmpl $0x2, %ebx
jb 0x16dc3
movl $0x2, %edi
callq 0x1929e
testq %rax, %rax
je 0x16dc3
movl $0x2, %edi
callq 0x1943c
cmpl $0x0, 0x18(%r12)
je 0x16f5d
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x81c0
leaq 0xe9c2(%rip), %rax      # 0x25760
movq 0xb8(%rax), %rsi
jmp 0x16e67
testl %ebp, %ebp
je 0x16e2b
movq 0xb8(%r12), %rsi
addq $-0x4, %rsi
movl %ebp, %edi
callq 0xcfa3
jmp 0x16e2b
movl $0xffffffff, 0x4(%rsp)  # imm = 0xFFFFFFFF
xorl %r15d, %r15d
testl %ebp, %ebp
je 0x16dee
leaq 0xe987(%rip), %r12      # 0x25760
movq 0xb8(%r12), %rsi
addq $-0x4, %rsi
movl %ebp, %edi
callq 0xcfa3
jmp 0x16e0a
movl 0xc(%r13), %edi
leaq 0xe967(%rip), %r12      # 0x25760
movq 0xb8(%r12), %rsi
addq $-0x4, %rsi
callq 0xd06f
movl 0x8(%r13), %ecx
decl %ecx
movq %r15, %rdi
movl 0x4(%rsp), %esi
movq %r14, %rdx
xorl %r8d, %r8d
callq 0x1a237
movb $0x0, 0x2a9(%r12)
movq %r14, %rdi
callq 0x81c0
cmpl $0x0, 0x18(%r12)
jne 0x16cd6
movq (%r13), %rax
movl 0x1460(%rax), %esi
shll $0x2, %esi
leaq 0x78(%r12), %r14
movq %r14, %rdi
xorl %edx, %edx
callq 0x8bc7
testl %eax, %eax
je 0x16e75
movq 0xb8(%r12), %rsi
addq $-0x4, %rsi
movl $0x1, %edi
jmp 0x16ca9
movq %r14, %rdi
callq 0x8c00
movq (%r13), %r15
movl 0x1460(%r15), %ebp
testl %ebp, %ebp
jle 0x16eb2
addq $0x1460, %r15           # imm = 0x1460
movq %r14, %rdi
movl $0x1, %esi
callq 0x91d8
movq %r15, %rdi
movl $0x1, %esi
movl %ebp, %edx
movq %rax, %rcx
callq 0x90a5
cmpl $0x3, %ebx
jb 0x16cd6
movl $0x3, %edi
callq 0x1929e
cmpl $0x0, 0x18(%r12)
jne 0x16cd6
testq %rax, %rax
je 0x17001
movq 0x10(%rax), %rdi
addq $0x10, %rdi
movl 0x18(%rax), %esi
incl %esi
callq 0x91d8
movq (%r13), %rcx
movl 0x1480(%rcx), %edx
shll $0x2, %edx
movq %rax, %rdi
movl $0x1, %esi
callq 0x12023
leaq 0xe853(%rip), %r12      # 0x25760
cmpl $0x0, 0x18(%r12)
jne 0x16cd6
movl $0x3, %edi
callq 0x1943c
cmpl $0x0, 0x18(%r12)
jne 0x16cd6
movq %rax, %r14
movq 0x10(%rax), %r15
addq $0x10, %r15
movq %r15, %rdi
callq 0x8c00
testl %eax, %eax
je 0x16fca
movq 0xb8(%r12), %rsi
addq $-0x4, %rsi
movl %eax, %edi
jmp 0x16ca9
movq %rax, %r13
cmpl $0x0, 0x1c(%rax)
jle 0x16f93
movq 0x10(%r13), %rdi
addq $0x10, %rdi
callq 0x8c00
testl %eax, %eax
je 0x16fa0
movl $0xffffffff, 0x4(%rsp)  # imm = 0xFFFFFFFF
movl $0x1, %ebp
xorl %r15d, %r15d
leaq 0xe312(%rip), %r13      # 0x252a0
jmp 0x16dd2
movl $0xffffffff, 0x4(%rsp)  # imm = 0xFFFFFFFF
xorl %r15d, %r15d
jmp 0x16fbe
movq 0x10(%r13), %rdi
addq $0x10, %rdi
movl 0x18(%r13), %esi
incl %esi
callq 0x91d8
movq %rax, %r15
movl 0x1c(%r13), %eax
movl %eax, 0x4(%rsp)
leaq 0xe2db(%rip), %r13      # 0x252a0
jmp 0x16dce
movq (%r13), %r12
movl 0x1480(%r12), %ebp
testl %ebp, %ebp
jle 0x17001
addq $0x1480, %r12           # imm = 0x1480
movl 0x18(%r14), %esi
incl %esi
movq %r15, %rdi
callq 0x91d8
movq %r12, %rdi
movl $0x1, %esi
movl %ebp, %edx
movq %rax, %rcx
callq 0x90a5
cmpl $0x3, %ebx
leaq 0xe755(%rip), %r15      # 0x25760
je 0x16cd6
movl $0x4, %edi
callq 0x1929e
movq %rax, %rbx
cmpl $0x0, 0x18(%r15)
setne %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
jne 0x16cd6
movq 0x10(%rbx), %rdi
cmpl $0x4, 0xc4(%rdi)
jne 0x1713c
cmpl $0x1, 0xc8(%rdi)
jne 0x1713c
addq $0x10, %rdi
movl 0x18(%rbx), %esi
incl %esi
callq 0x91d8
movq 0x10(%rbx), %rdi
addq $0x10, %rdi
movl $0x1, %esi
callq 0x91d8
movq %rax, %rbx
movl 0xc(%rax), %r14d
movq (%r13), %rax
movl 0x14a0(%rax), %edx
movq %rbx, %rdi
movl $0x1, %esi
callq 0x12023
cmpl $0x0, 0x18(%r15)
jne 0x16cd6
movq (%rbx), %rax
testq %rax, %rax
je 0x16cd6
movq (%r13), %rcx
cmpl %r14d, 0x14a0(%rcx)
jle 0x16cd6
movq 0x10(%rax), %r15
addq $0x10, %r15
incl %r14d
movq (%rbx), %rax
movl 0x18(%rax), %esi
addl %r14d, %esi
movq %r15, %rdi
callq 0x91d8
movq %rax, %r12
movq (%r13), %rdi
movl $0x14a0, %eax           # imm = 0x14A0
addq %rax, %rdi
movl %r14d, %esi
callq 0x91d8
movq %r13, %rbp
movq %rax, %r13
movl 0x8(%rax), %edx
movq %r12, %rdi
movl $0x1, %esi
callq 0x12023
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
movq %rbp, %r13
callq 0x8fba
movq (%rbp), %rax
leal 0x1(%r14), %ecx
cmpl %r14d, 0x14a0(%rax)
movl %ecx, %r14d
jg 0x170c3
jmp 0x16cd6
movq 0xb8(%r15), %rsi
addq $-0x4, %rsi
movl $0x2e, %edi
jmp 0x16ca9