// File: /workspace/github_cpp_makefile_star2_O3/rofl0r[P]ascc/cc_script.cpp
// Function: ccScript::ccScript(ccScript const&)
ccScript::ccScript(const ccScript &src)
{
    globaldatasize = src.globaldatasize;
    if (globaldatasize > 0)
    {
        globaldata = (char*)malloc(globaldatasize);
        memcpy(globaldata, src.globaldata, globaldatasize);
    }
    else
    {
        globaldata = nullptr;
    }

    codesize = src.codesize;
    if (codesize > 0)
    {
        code = (int32_t*)malloc(codesize * sizeof(int32_t));
        memcpy(code, src.code, sizeof(int32_t) * codesize);
    }
    else
    {
        code = nullptr;
    }

    stringssize = src.stringssize;
    if (stringssize > 0)
    {
        strings = (char*)malloc(stringssize);
        memcpy(strings, src.strings, stringssize);
    }
    else
    {
        strings = nullptr;
    }

    numfixups = src.numfixups;
    if (numfixups > 0)
    {
        fixuptypes = (char*)malloc(numfixups);
        fixups = (int32_t*)malloc(numfixups * sizeof(int32_t));
        memcpy(fixuptypes, src.fixuptypes, numfixups);
        memcpy(fixups, src.fixups, numfixups * sizeof(int32_t));
    }
    else
    {
        fixups = nullptr;
        fixuptypes = nullptr;
    }

    importsCapacity = src.numimports;
    numimports = src.numimports;
    if (numimports > 0)
    {
        imports = (char**)malloc(sizeof(char*) * numimports);
        for (int i = 0; i < numimports; ++i)
            imports[i] = ags_strdup(src.imports[i]);
    }
    else
    {
        imports = nullptr;
    }

    exportsCapacity = src.numexports;
    numexports = src.numexports;
    if (numexports > 0)
    {
        exports = (char**)malloc(sizeof(char*) * numexports);
        export_addr = (int32_t*)malloc(sizeof(int32_t) * numexports);
        for (int i = 0; i < numexports; ++i)
        {
            exports[i] = ags_strdup(src.exports[i]);
            export_addr[i] = src.export_addr[i];
        }
    }
    else
    {
        exports = nullptr;
        export_addr = nullptr;
    }

    capacitySections = src.numSections;
    numSections = src.numSections;
    if (numSections > 0)
    {
        sectionNames = (char**)malloc(numSections * sizeof(char*));
        sectionOffsets = (int32_t*)malloc(numSections * sizeof(int32_t));
        for (int i = 0; i < numSections; ++i)
        {
            sectionNames[i] = ags_strdup(src.sectionNames[i]);
            sectionOffsets[i] = src.sectionOffsets[i];
        }
    }
    else
    {
        numSections = 0;
        sectionNames = nullptr;
        sectionOffsets = nullptr;
    }

    instances = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10874(%rip), %rax     # 0x24cd8
movq %rax, (%rdi)
movslq 0x10(%rsi), %r15
movl %r15d, 0x10(%rdi)
testq %r15, %r15
jle 0x14491
movq %r15, %rdi
callq 0x3440
movq %rax, 0x8(%rbx)
movq 0x8(%r14), %rsi
movq %rax, %rdi
movq %r15, %rdx
callq 0x3290
jmp 0x14499
movq $0x0, 0x8(%rbx)
movslq 0x20(%r14), %r15
movl %r15d, 0x20(%rbx)
testq %r15, %r15
jle 0x144c7
shlq $0x2, %r15
movq %r15, %rdi
callq 0x3440
movq %rax, 0x18(%rbx)
movq 0x18(%r14), %rsi
movq %rax, %rdi
movq %r15, %rdx
callq 0x3290
jmp 0x144cf
movq $0x0, 0x18(%rbx)
movslq 0x30(%r14), %r15
movl %r15d, 0x30(%rbx)
testq %r15, %r15
jle 0x144f9
movq %r15, %rdi
callq 0x3440
movq %rax, 0x28(%rbx)
movq 0x28(%r14), %rsi
movq %rax, %rdi
movq %r15, %rdx
callq 0x3290
jmp 0x14501
movq $0x0, 0x28(%rbx)
movslq 0x48(%r14), %r15
movl %r15d, 0x48(%rbx)
testq %r15, %r15
jle 0x14554
movq %r15, %rdi
callq 0x3440
movq %rax, %r12
movq %rax, 0x38(%rbx)
leaq (,%r15,4), %r13
movq %r13, %rdi
callq 0x3440
movq %rax, %rbp
movq %rax, 0x40(%rbx)
movq 0x38(%r14), %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0x3290
movq 0x40(%r14), %rsi
movq %rbp, %rdi
movq %r13, %rdx
callq 0x3290
jmp 0x1455b
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
movslq 0x58(%r14), %rdi
movl %edi, 0x4c(%rbx)
movl %edi, 0x58(%rbx)
testq %rdi, %rdi
jle 0x1459d
shlq $0x3, %rdi
callq 0x3440
movq %rax, 0x50(%rbx)
xorl %r15d, %r15d
movq 0x50(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x14bd4
movq 0x50(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
movslq 0x58(%rbx), %rax
cmpq %rax, %r15
jl 0x1457a
jmp 0x145a5
movq $0x0, 0x50(%rbx)
movslq 0x70(%r14), %r15
movl %r15d, 0x5c(%rbx)
movl %r15d, 0x70(%rbx)
testq %r15, %r15
jle 0x1460d
leaq (,%r15,8), %rdi
callq 0x3440
movq %rax, 0x60(%rbx)
shlq $0x2, %r15
movq %r15, %rdi
callq 0x3440
movq %rax, 0x68(%rbx)
xorl %r15d, %r15d
movq 0x60(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x14bd4
movq 0x60(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
movq 0x68(%r14), %rax
movl (%rax,%r15,4), %eax
movq 0x68(%rbx), %rcx
movl %eax, (%rcx,%r15,4)
incq %r15
movslq 0x70(%rbx), %rax
cmpq %rax, %r15
jl 0x145da
jmp 0x14614
xorps %xmm0, %xmm0
movups %xmm0, 0x60(%rbx)
movslq 0x88(%r14), %r15
movl %r15d, 0x8c(%rbx)
movl %r15d, 0x88(%rbx)
testq %r15, %r15
jle 0x14691
leaq (,%r15,8), %rdi
callq 0x3440
movq %rax, 0x78(%rbx)
shlq $0x2, %r15
movq %r15, %rdi
callq 0x3440
movq %rax, 0x80(%rbx)
xorl %r15d, %r15d
movq 0x78(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x14bd4
movq 0x78(%rbx), %rcx
movq %rax, (%rcx,%r15,8)
movq 0x80(%r14), %rax
movl (%rax,%r15,4), %eax
movq 0x80(%rbx), %rcx
movl %eax, (%rcx,%r15,4)
incq %r15
movslq 0x88(%rbx), %rax
cmpq %rax, %r15
jl 0x14655
jmp 0x146a2
xorps %xmm0, %xmm0
movups %xmm0, 0x78(%rbx)
movl $0x0, 0x88(%rbx)
movl $0x0, 0x74(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq