// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movl 0x20(%rbp), %eax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq %r8, -0x30(%rbp)
movl %r9d, -0x34(%rbp)
movq -0x20(%rbp), %rdx
leaq 0x18d93(%rip), %rdi     # 0x2c698
leaq -0x40(%rbp), %rsi
callq 0x98a0
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
je 0x13923
movl $0x1, -0x4(%rbp)
jmp 0x13abc
movq -0x40(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x40(%rbp), %rax
movq $0x0, (%rax)
movq -0x40(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x40(%rbp), %rax
movq $0x0, 0x18(%rax)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x81d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x13984
movl $0x1, -0x4(%rbp)
jmp 0x13abc
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
movslq -0x24(%rbp), %rdx
shlq $0x2, %rdx
callq 0x8120
movq -0x18(%rbp), %rax
movq (%rax), %rax
movslq -0x24(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
cmpq $0x0, -0x30(%rbp)
je 0x13a14
movslq -0x34(%rbp), %rdi
addq $0x1, %rdi
callq 0x81d0
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x139f1
movl $0x1, -0x4(%rbp)
jmp 0x13abc
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movq -0x30(%rbp), %rsi
movslq -0x34(%rbp), %rdx
callq 0x8120
movq -0x40(%rbp), %rax
movq (%rax), %rax
movslq -0x34(%rbp), %rcx
movb $0x0, (%rax,%rcx)
cmpq $0x0, 0x10(%rbp)
je 0x13ab5
movslq 0x20(%rbp), %rdi
addq $0x1, %rdi
callq 0x81d0
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x13a4b
movl $0x1, -0x4(%rbp)
jmp 0x13abc
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rbp), %rsi
movslq 0x20(%rbp), %rdx
callq 0x8120
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movslq 0x20(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movslq -0x24(%rbp), %rdi
shlq $0x2, %rdi
callq 0x81d0
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x40(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x13a9c
movl $0x1, -0x4(%rbp)
jmp 0x13abc
movq -0x40(%rbp), %rax
movq 0x18(%rax), %rdi
movq 0x18(%rbp), %rsi
movslq -0x24(%rbp), %rdx
shlq $0x2, %rdx
callq 0x8120
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)