// File: /workspace/github_c_makefile_star2_O2/heltilda[P]cicada/ccmain.c
// Function: initCicada
ccInt initCicada(ccInt *zeroCode, ccInt zeroCodeLength,
        char *fileName, ccInt fileNameLength, char *sourceCode, ccInt *opCharNum, ccInt sourceCodeLength)
{
    variable *varZero;
    ccInt zeroCodeIndex, *zeroCodeEntryPtr, rtrn;
    
    baseView.windowPtr = NULL;              // these can confuse addMemory if not initialized to NULL first
    searchView.windowPtr = NULL;            // to prevent an error on startup when addMemory checks baseView.windowPtr->variable_ptr
    topView.windowPtr = NULL;
    
    rtrn = newPLL(&VariableList, 0, sizeof(variable), LLFreeSpace);        // make space for variables & codes
    if (rtrn != passed)  return rtrn;
    rtrn = newPLL(&MasterCodeList, 0, sizeof(storedCodeType), LLFreeSpace);
    if (rtrn != passed)  return rtrn;
    rtrn = newStack(&PCStack, sizeof(view), 100, LLFreeSpace);
    if (rtrn != passed)  return rtrn;
    
    rtrn = addVariable(&varZero, composite_type, composite_type, 0, ccTrue);
    if (rtrn != passed)  return rtrn;
    rtrn = addWindow(varZero, 0, 1, &Zero, ccTrue);
    if (rtrn != passed)  return rtrn;
    rtrn = drawPath(&ZeroSuspensor, Zero, NULL, 1, 1);
    if (rtrn != passed)  return rtrn;
    
    rtrn = addCode(zeroCode, &zeroCodeEntryPtr, &zeroCodeIndex, zeroCodeLength,
                fileName, fileNameLength, sourceCode, opCharNum, sourceCodeLength);
    if (rtrn != passed)  return rtrn;
    rtrn = addCodeRef(&(varZero->codeList), ZeroSuspensor, zeroCodeEntryPtr, zeroCodeIndex);
    if (rtrn != passed)  return rtrn;
    PCCodeRef = *(code_ref *) element(&(varZero->codeList), 1);
    
    refWindow(Zero);
    refPath(ZeroSuspensor);
    
    pcCodePtr = zeroCodeEntryPtr;        // should immediately call checkBytecode()
    
    rtrn = newLinkedList(&(GL_Object.arrayDimList), 0, sizeof(ccInt), 2., ccFalse);
    if (rtrn != passed)  return rtrn;
    rtrn = newLinkedList(&codeRegister, 0, sizeof(code_ref), 0., ccFalse);      // used in bytecd.c to pass codes from code blocks
    if (rtrn != passed)  return rtrn;
    
    rtrn = newLinkedList(&stringRegister, 0, sizeof(char), 0., ccFalse);     // set up the string register
    if (rtrn != passed)  return rtrn;
    
    errCode = warningCode = passed;
    errIndex = 1;              // for now
    errScript.code_ptr = NULL;
    warningScript.code_ptr = NULL;
    
    recursionCounter = 0;
    pcSearchPath = NULL;
    BIF_argsView.windowPtr = NULL;
    argsView.windowPtr = NULL;
    returnView.windowPtr = NULL;
    thatView.windowPtr = NULL;
    
    extCallMode = ccFalse;
    doPrintError = ccFalse;
    
    return passed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, 0x40(%rsp)
movq %r8, %r15
leaq 0xc533(%rip), %rax      # 0x24760
andq $0x0, 0x140(%rax)
movl %ecx, %r12d
andq $0x0, 0x158(%rax)
movq %rdx, %r13
andq $0x0, 0x1d8(%rax)
movl %esi, %r14d
movq %rdi, %rbp
leaq 0x1a58(%rip), %rax      # 0x19cb0
movsd (%rax), %xmm0
leaq 0xc445(%rip), %rdi      # 0x246a8
addq $0x48, %rdi
xorl %esi, %esi
movl $0xf8, %edx
movsd %xmm0, 0x20(%rsp)
callq 0x90f6
testl %eax, %eax
jne 0x18442
movq %rbp, 0x30(%rsp)
movl %r14d, 0x14(%rsp)
movq %r13, 0x38(%rsp)
movl %r12d, 0x18(%rsp)
movq 0x40(%rsp), %rbp
leaq 0xc407(%rip), %rdi      # 0x246a8
pushq $0x20
popq %rdx
xorl %esi, %esi
movsd 0x20(%rsp), %xmm0
callq 0x90f6
testl %eax, %eax
jne 0x18442
movl $0x90, %edi
addq 0x8d0b(%rip), %rdi      # 0x20fd0
pushq $0x18
popq %rsi
pushq $0x64
popq %rdx
movsd 0x20(%rsp), %xmm0
callq 0x9269
testl %eax, %eax
jne 0x18442
leaq 0x8(%rsp), %rdi
pushq $0x5
popq %rdx
pushq $0x1
popq %r8
movl %edx, %esi
xorl %ecx, %ecx
callq 0xe55e
testl %eax, %eax
jne 0x18442
movq 0x8(%rsp), %rdi
leaq 0xc459(%rip), %r14      # 0x24760
pushq $0x1
popq %rdx
xorl %esi, %esi
movq %r14, %rcx
movl %edx, %r8d
callq 0xc718
testl %eax, %eax
jne 0x18442
movq (%r14), %rsi
leaq 0x10(%r14), %rdi
pushq $0x1
popq %rcx
xorl %edx, %edx
movl %ecx, %r8d
callq 0xecb1
testl %eax, %eax
jne 0x18442
movl 0x80(%rsp), %eax
subq $0x8, %rsp
leaq 0x30(%rsp), %rsi
leaq 0x24(%rsp), %rdx
movq 0x38(%rsp), %rdi
movl 0x1c(%rsp), %ecx
movq 0x40(%rsp), %r8
movl 0x20(%rsp), %r9d
pushq %rax
pushq %rbp
pushq %r15
callq 0xed3f
addq $0x20, %rsp
testl %eax, %eax
jne 0x18442
movl $0xd0, %r14d
movq 0x8(%rsp), %rdi
addq %r14, %rdi
leaq 0xc3d3(%rip), %r15      # 0x24760
movq 0x10(%r15), %rsi
movq 0x28(%rsp), %rdx
movl 0x1c(%rsp), %ecx
callq 0xef62
testl %eax, %eax
jne 0x18442
addq 0x8(%rsp), %r14
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x9088
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups %xmm0, 0x208(%r15)
movups %xmm1, 0x218(%r15)
movq (%r15), %rdi
callq 0xc7e1
movq 0x10(%r15), %rdi
callq 0xec75
movq 0x28(%rsp), %rax
movq %rax, 0xb8(%r15)
leaq 0xe0(%r15), %rdi
pushq $0x4
popq %rdx
movsd 0xc23(%rip), %xmm0      # 0x19020
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x83d5
testl %eax, %eax
jne 0x18442
movl $0x98, %edi
addq 0x8bca(%rip), %rdi      # 0x20fe0
pushq $0x20
popq %rdx
xorps %xmm0, %xmm0
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x83d5
testl %eax, %eax
jne 0x18442
leaq 0x78(%r15), %rdi
pushq $0x1
popq %rdx
xorl %ebx, %ebx
xorps %xmm0, %xmm0
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x83d5
testl %eax, %eax
je 0x18455
movl %eax, %ebx
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc304(%rip), %rcx      # 0x24760
andl $0x0, 0x20(%rcx)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x18(%rcx)
andq $0x0, 0x38(%rcx)
andq $0x0, 0x58(%rcx)
andl $0x0, 0x200(%rcx)
andq $0x0, 0x190(%rcx)
andq $0x0, 0x1a8(%rcx)
andq $0x0, 0x1c0(%rcx)
andw $0x0, 0x2a8(%rcx)
xorps %xmm0, %xmm0
movups %xmm0, 0x170(%rcx)
jmp 0x18444