// File: /workspace/github_c_makefile_star2_O1/heltilda[P]cicada/intrpt.c
// Function: addCode
ccInt addCode(ccInt *codeSource, ccInt **newCodePtr, ccInt *newCodeElement, ccInt codeLength,
        char *fileName, ccInt fileNameLength, char *sourceCode, ccInt *opCharNum, ccInt sourceCodeLength)
{
    ccInt rtrn;
    storedCodeType *newCodeEntry;
    
    rtrn = addPLLElement(&MasterCodeList, (void **) &newCodeEntry, newCodeElement);
    if (rtrn != passed)  return out_of_memory_err;
    
    
        // the code copy is stored in a buffer, not a linked list, since it can't be resized
    
    newCodeEntry->fileName = newCodeEntry->sourceCode = NULL;
    newCodeEntry->opCharNum = newCodeEntry->bytecode = NULL;
    
    *newCodePtr = (ccInt *) malloc((codeLength+1)*sizeof(ccInt));
    if (*newCodePtr == NULL)  return out_of_memory_err;
    newCodeEntry->bytecode = *newCodePtr;
    memcpy((void *) *newCodePtr, codeSource, codeLength*sizeof(ccInt));
    (*newCodePtr)[codeLength] = 0;
    
    if (fileName != NULL)  {
        newCodeEntry->fileName = (char *) malloc((size_t) fileNameLength+1);
        if (newCodeEntry->fileName == NULL)  return out_of_memory_err;
        memcpy((void *) newCodeEntry->fileName, (void *) fileName, fileNameLength);
        newCodeEntry->fileName[fileNameLength] = 0;     }
    
    if (sourceCode != NULL)  {
        newCodeEntry->sourceCode = (char *) malloc((size_t) sourceCodeLength+1);
        if (newCodeEntry->sourceCode == NULL)  return out_of_memory_err;
        memcpy((void *) newCodeEntry->sourceCode, (void *) sourceCode, sourceCodeLength);
        newCodeEntry->sourceCode[sourceCodeLength] = 0;
        
        newCodeEntry->opCharNum = (ccInt *) malloc((size_t) codeLength*sizeof(ccInt));
        if (newCodeEntry->opCharNum == NULL)  return out_of_memory_err;
        memcpy((void *) newCodeEntry->opCharNum, (void *) opCharNum, codeLength*sizeof(ccInt));       }
    
    return passed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %ebp
movq %r8, %r15
movl %ecx, %r14d
movq %rsi, %r12
movq %rdi, %r13
leaq 0x15b51(%rip), %rdi     # 0x256a8
leaq 0x8(%rsp), %rsi
callq 0x9220
movl $0x1, %ebx
testl %eax, %eax
je 0xfb7b
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, 0x10(%rsp)
movq 0x8(%rsp), %r15
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movslq %r14d, %r14
leaq 0x4(,%r14,4), %rdi
callq 0x81d0
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r15)
movq %rax, (%r12)
testq %rax, %rax
je 0xfb6a
addq $0x10, %r15
movq %rax, (%r15)
movq (%r12), %rdi
leaq (,%r14,4), %r15
movq %r13, %rsi
movq %r15, %rdx
callq 0x8110
movq (%r12), %rax
movl $0x0, (%rax,%r14,4)
cmpq $0x0, 0x10(%rsp)
je 0xfc1f
movslq %ebp, %r12
leaq 0x1(%r12), %rdi
callq 0x81d0
movq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movq 0x8(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0xfb6a
movq 0x10(%rsp), %rsi
movq %r12, %rdx
callq 0x8110
movq 0x8(%rsp), %rax
movq (%rax), %rax
movb $0x0, (%rax,%r12)
movq 0x50(%rsp), %r12
testq %r12, %r12
je 0xfc90
movq %r15, %r13
movslq 0x60(%rsp), %r15
leaq 0x1(%r15), %rdi
callq 0x81d0
movq 0x8(%rsp), %r14
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0xfb6a
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x8110
movq 0x8(%r14), %rax
movb $0x0, (%rax,%r15)
movq %r13, %r14
movq %r13, %rdi
callq 0x81d0
movq 0x8(%rsp), %rcx
movq %rax, 0x18(%rcx)
testq %rax, %rax
je 0xfb6a
movq 0x58(%rsp), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0x8110
xorl %ebx, %ebx
jmp 0xfb6a