// File: /workspace/github_cpp_makefile_star2_O2/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 0x12000(%rip), %rax     # 0x24cd8
movq %rax, (%rdi)
movslq 0x10(%rsi), %r15
movl %r15d, 0x10(%rdi)
testq %r15, %r15
jle 0x12d05
movq %r15, %rdi
callq 0x3430
movq %rax, 0x8(%rbx)
movq 0x8(%r14), %rsi
movq %rax, %rdi
movq %r15, %rdx
callq 0x3280
jmp 0x12d0a
andq $0x0, 0x8(%rbx)
movslq 0x20(%r14), %r15
movl %r15d, 0x20(%rbx)
testq %r15, %r15
jle 0x12d38
shlq $0x2, %r15
movq %r15, %rdi
callq 0x3430
movq %rax, 0x18(%rbx)
movq 0x18(%r14), %rsi
movq %rax, %rdi
movq %r15, %rdx
callq 0x3280
jmp 0x12d3d
andq $0x0, 0x18(%rbx)
movslq 0x30(%r14), %r15
movl %r15d, 0x30(%rbx)
testq %r15, %r15
jle 0x12d67
movq %r15, %rdi
callq 0x3430
movq %rax, 0x28(%rbx)
movq 0x28(%r14), %rsi
movq %rax, %rdi
movq %r15, %rdx
callq 0x3280
jmp 0x12d6c
andq $0x0, 0x28(%rbx)
movslq 0x48(%r14), %r15
movl %r15d, 0x48(%rbx)
testq %r15, %r15
jle 0x12dbf
movq %r15, %rdi
callq 0x3430
movq %rax, %r12
movq %rax, 0x38(%rbx)
leaq (,%r15,4), %r13
movq %r13, %rdi
callq 0x3430
movq %rax, %rbp
movq %rax, 0x40(%rbx)
movq 0x38(%r14), %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0x3280
movq 0x40(%r14), %rsi
movq %rbp, %rdi
movq %r13, %rdx
callq 0x3280
jmp 0x12dc6
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
movslq 0x58(%r14), %r15
movl %r15d, 0x4c(%rbx)
movl %r15d, 0x58(%rbx)
testq %r15, %r15
jle 0x12e10
movq %r15, %rdi
shlq $0x3, %rdi
callq 0x3430
movq %rax, 0x50(%rbx)
xorl %r12d, %r12d
movslq %r15d, %rax
cmpq %rax, %r12
jge 0x12e15
movq 0x50(%r14), %rax
movq (%rax,%r12,8), %rdi
callq 0x13338
movq 0x50(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
incq %r12
movl 0x58(%rbx), %r15d
jmp 0x12dea
andq $0x0, 0x50(%rbx)
movslq 0x70(%r14), %r15
movl %r15d, 0x5c(%rbx)
movl %r15d, 0x70(%rbx)
testq %r15, %r15
jle 0x12e80
leaq (,%r15,8), %rdi
callq 0x3430
movq %rax, 0x60(%rbx)
movq %r15, %rdi
shlq $0x2, %rdi
callq 0x3430
movq %rax, 0x68(%rbx)
xorl %r12d, %r12d
movslq %r15d, %rax
cmpq %rax, %r12
jge 0x12e87
movq 0x60(%r14), %rax
movq (%rax,%r12,8), %rdi
callq 0x13338
movq 0x60(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
movq 0x68(%r14), %rax
movl (%rax,%r12,4), %eax
movq 0x68(%rbx), %rcx
movl %eax, (%rcx,%r12,4)
incq %r12
movl 0x70(%rbx), %r15d
jmp 0x12e4a
xorps %xmm0, %xmm0
movups %xmm0, 0x60(%rbx)
movslq 0x88(%r14), %r15
movl %r15d, 0x8c(%rbx)
movl %r15d, 0x88(%rbx)
testq %r15, %r15
jle 0x12f07
leaq (,%r15,8), %rdi
callq 0x3430
movq %rax, 0x78(%rbx)
movq %r15, %rdi
shlq $0x2, %rdi
callq 0x3430
movq %rax, 0x80(%rbx)
xorl %r12d, %r12d
movslq %r15d, %rax
cmpq %rax, %r12
jge 0x12f15
movq 0x78(%r14), %rax
movq (%rax,%r12,8), %rdi
callq 0x13338
movq 0x78(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
movq 0x80(%r14), %rax
movl (%rax,%r12,4), %eax
movq 0x80(%rbx), %rcx
movl %eax, (%rcx,%r12,4)
incq %r12
movl 0x88(%rbx), %r15d
jmp 0x12ec8
xorps %xmm0, %xmm0
movups %xmm0, 0x78(%rbx)
andl $0x0, 0x88(%rbx)
andl $0x0, 0x74(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq