// File: /workspace/github_cpp_makefile_star2_O2/rofl0r[P]ascc/cc_script.cpp
// Function: ccScript::Write(FileWriteStream*)
void ccScript::Write(FileWriteStream *out) {
    int n;
    out->Write(scfilesig,4);
    out->WriteInt32(SCOM_VERSION);
    out->WriteInt32(globaldatasize);
    out->WriteInt32(codesize);
    out->WriteInt32(stringssize);
    if (globaldatasize > 0)
        out->WriteArray(globaldata,globaldatasize,1);
    if (codesize > 0)
        out->WriteArrayOfInt32(code,codesize);
    if (stringssize > 0)
        out->WriteArray(strings,stringssize,1);
    out->WriteInt32(numfixups);
    if (numfixups > 0) {
        out->WriteArray(fixuptypes,numfixups,1);
        out->WriteArrayOfInt32(fixups,numfixups);
    }
    out->WriteInt32(numimports);
    for (n=0;n<numimports;n++)
        out->WriteArray(imports[n],strlen(imports[n])+1,1);
    out->WriteInt32(numexports);
    for (n=0;n<numexports;n++) {
        out->WriteArray(exports[n],strlen(exports[n])+1,1);
        out->WriteInt32(export_addr[n]);
    }
    out->WriteInt32(numSections);
    for (n = 0; n < numSections; n++) {
        out->WriteArray(sectionNames[n], strlen(sectionNames[n]) + 1, 1);
        out->WriteInt32(sectionOffsets[n]);
    }
    out->WriteInt32(ENDFILESIG);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x7ee3(%rip), %rsi      # 0x1af84
pushq $0x4
popq %rdx
movq %rbx, %rdi
callq 0x1327e
pushq $0x5a
popq %rsi
movq %rbx, %rdi
callq 0x13290
movl 0x10(%r14), %esi
movq %rbx, %rdi
callq 0x13290
movl 0x20(%r14), %esi
movq %rbx, %rdi
callq 0x13290
movl 0x30(%r14), %esi
movq %rbx, %rdi
callq 0x13290
movslq 0x10(%r14), %rdx
testq %rdx, %rdx
jle 0x130f0
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x1327e
movslq 0x20(%r14), %rdx
testq %rdx, %rdx
jle 0x13105
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0x132be
movslq 0x30(%r14), %rdx
testq %rdx, %rdx
jle 0x1311a
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0x1327e
movl 0x48(%r14), %esi
movq %rbx, %rdi
callq 0x13290
movslq 0x48(%r14), %rdx
testq %rdx, %rdx
jle 0x1314b
movq 0x38(%r14), %rsi
movq %rbx, %rdi
callq 0x1327e
movq 0x40(%r14), %rsi
movslq 0x48(%r14), %rdx
movq %rbx, %rdi
callq 0x132be
movl 0x58(%r14), %esi
movq %rbx, %rdi
callq 0x13290
xorl %r12d, %r12d
movslq 0x58(%r14), %rax
cmpq %rax, %r12
jge 0x13187
movq 0x50(%r14), %rax
movq (%rax,%r12,8), %r15
movq %r15, %rdi
callq 0x3190
leaq 0x1(%rax), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1327e
incq %r12
jmp 0x1315a
movl 0x70(%r14), %esi
movq %rbx, %rdi
callq 0x13290
xorl %r12d, %r12d
movslq 0x70(%r14), %rax
cmpq %rax, %r12
jge 0x131d3
movq 0x60(%r14), %rax
movq (%rax,%r12,8), %r15
movq %r15, %rdi
callq 0x3190
leaq 0x1(%rax), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1327e
movq 0x68(%r14), %rax
movl (%rax,%r12,4), %esi
movq %rbx, %rdi
callq 0x13290
incq %r12
jmp 0x13196
movl 0x88(%r14), %esi
movq %rbx, %rdi
callq 0x13290
xorl %r12d, %r12d
movslq 0x88(%r14), %rax
cmpq %rax, %r12
jge 0x13228
movq 0x78(%r14), %rax
movq (%rax,%r12,8), %r15
movq %r15, %rdi
callq 0x3190
leaq 0x1(%rax), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1327e
movq 0x80(%r14), %rax
movl (%rax,%r12,4), %esi
movq %rbx, %rdi
callq 0x13290
incq %r12
jmp 0x131e5
movq %rbx, %rdi
movl $0xbeefcafe, %esi       # imm = 0xBEEFCAFE
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x13290