// File: /workspace/github_cpp_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rsi), %rcx
leaq 0x8710(%rip), %rdi      # 0x1cf73
movl $0x1, %esi
movl $0x4, %edx
callq 0x35c0
leaq 0xc(%rsp), %r15
movl $0x5a, (%r15)
movq (%rbx), %rcx
movl $0x1, %esi
movl $0x4, %edx
movq %r15, %rdi
callq 0x35c0
movl 0x10(%r14), %eax
movl %eax, (%r15)
movq (%rbx), %rcx
leaq 0xc(%rsp), %r15
movl $0x1, %esi
movl $0x4, %edx
movq %r15, %rdi
callq 0x35c0
movl 0x20(%r14), %eax
movl %eax, (%r15)
movq (%rbx), %rcx
leaq 0xc(%rsp), %r15
movl $0x1, %esi
movl $0x4, %edx
movq %r15, %rdi
callq 0x35c0
movl 0x30(%r14), %eax
movl %eax, (%r15)
movq (%rbx), %rcx
leaq 0xc(%rsp), %rdi
movl $0x1, %esi
movl $0x4, %edx
callq 0x35c0
movslq 0x10(%r14), %rdx
testq %rdx, %rdx
jle 0x1490d
movq 0x8(%r14), %rdi
movq (%rbx), %rcx
movl $0x1, %esi
callq 0x35c0
movslq 0x20(%r14), %rdx
testq %rdx, %rdx
jle 0x1492b
movq 0x18(%r14), %rdi
shlq $0x2, %rdx
movq (%rbx), %rcx
movl $0x1, %esi
callq 0x35c0
movslq 0x30(%r14), %rdx
testq %rdx, %rdx
jle 0x14945
movq 0x28(%r14), %rdi
movq (%rbx), %rcx
movl $0x1, %esi
callq 0x35c0
movl 0x48(%r14), %eax
leaq 0xc(%rsp), %rdi
movl %eax, (%rdi)
movq (%rbx), %rcx
movl $0x1, %esi
movl $0x4, %edx
callq 0x35c0
movslq 0x48(%r14), %rdx
testq %rdx, %rdx
jle 0x14995
movq 0x38(%r14), %rdi
movq (%rbx), %rcx
movl $0x1, %esi
callq 0x35c0
movq 0x40(%r14), %rdi
movslq 0x48(%r14), %rdx
shlq $0x2, %rdx
movq (%rbx), %rcx
movl $0x1, %esi
callq 0x35c0
movl 0x58(%r14), %eax
leaq 0xc(%rsp), %rdi
movl %eax, (%rdi)
movq (%rbx), %rcx
movl $0x1, %esi
movl $0x4, %edx
callq 0x35c0
cmpl $0x0, 0x58(%r14)
jle 0x149ec
xorl %r12d, %r12d
movq 0x50(%r14), %rax
movq (%rax,%r12,8), %r15
movq %r15, %rdi
callq 0x31a0
leaq 0x1(%rax), %rdx
movq (%rbx), %rcx
movl $0x1, %esi
movq %r15, %rdi
callq 0x35c0
incq %r12
movslq 0x58(%r14), %rax
cmpq %rax, %r12
jl 0x149bc
movl 0x70(%r14), %eax
leaq 0xc(%rsp), %rdi
movl %eax, (%rdi)
movq (%rbx), %rcx
movl $0x1, %esi
movl $0x4, %edx
callq 0x35c0
cmpl $0x0, 0x70(%r14)
jle 0x14a69
xorl %r13d, %r13d
leaq 0xc(%rsp), %r15
movq 0x60(%r14), %rax
movq (%rax,%r13,8), %r12
movq %r12, %rdi
callq 0x31a0
leaq 0x1(%rax), %rdx
movq (%rbx), %rcx
movl $0x1, %esi
movq %r12, %rdi
callq 0x35c0
movq 0x68(%r14), %rax
movl (%rax,%r13,4), %eax
movl %eax, 0xc(%rsp)
movq (%rbx), %rcx
movl $0x1, %esi
movl $0x4, %edx
movq %r15, %rdi
callq 0x35c0
incq %r13
movslq 0x70(%r14), %rax
cmpq %rax, %r13
jl 0x14a18
movl 0x88(%r14), %eax
leaq 0xc(%rsp), %rdi
movl %eax, (%rdi)
movq (%rbx), %rcx
movl $0x1, %esi
movl $0x4, %edx
callq 0x35c0
cmpl $0x0, 0x88(%r14)
jle 0x14af2
xorl %r13d, %r13d
leaq 0xc(%rsp), %r15
movq 0x78(%r14), %rax
movq (%rax,%r13,8), %r12
movq %r12, %rdi
callq 0x31a0
leaq 0x1(%rax), %rdx
movq (%rbx), %rcx
movl $0x1, %esi
movq %r12, %rdi
callq 0x35c0
movq 0x80(%r14), %rax
movl (%rax,%r13,4), %eax
movl %eax, 0xc(%rsp)
movq (%rbx), %rcx
movl $0x1, %esi
movl $0x4, %edx
movq %r15, %rdi
callq 0x35c0
incq %r13
movslq 0x88(%r14), %rax
cmpq %rax, %r13
jl 0x14a9b
leaq 0xc(%rsp), %rdi
movl $0xbeefcafe, (%rdi)     # imm = 0xBEEFCAFE
movq (%rbx), %rcx
movl $0x1, %esi
movl $0x4, %edx
callq 0x35c0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop