// File: /workspace/github_cpp_makefile_star2_O2/hanhwi[P]SimPoint/analysiscode/Simpoint.cpp
// Function: Simpoint::savePreClusteringData()
void Simpoint::savePreClusteringData() {
    if (options.saveVectorsTxtFmtName != "") {
        Logger::log() << "  Saving Simpoint-format vector data to text file '" 
            << options.saveVectorsTxtFmtName << "'\n";
        ofstream output(options.saveVectorsTxtFmtName.c_str());
        Utilities::check(output.is_open(), "Simpoint::savePreClusteringData(): could not open file " +
                                options.saveVectorsTxtFmtName);
        wholeDataset->write(output);
        output.close();
    }

    if (options.saveVectorsBinFmtName != "") {
        Logger::log() << "  Saving Simpoint-format vector data to binary file '" 
            << options.saveVectorsBinFmtName << "'\n";
        ofstream output(options.saveVectorsBinFmtName.c_str());
        Utilities::check(output.is_open(), "Simpoint::savePreClusteringData(): could not open file " +
                                options.saveVectorsBinFmtName);
        wholeDataset->writeBinary(output);
        output.close();
    }

    if (options.saveVectorWeightsName != "") {
        Logger::log() << "  Saving weights of each input vector to file '" 
            << options.saveVectorWeightsName << "'\n";

        ofstream output(options.saveVectorWeightsName.c_str());
        Utilities::check(output.is_open(), "Simpoint::saveVectorWeights(): could not open file " +
                                options.saveVectorWeightsName);
        output.precision(20);
        for (unsigned int i = 0; i < wholeDataset->numRows(); i++) {
            output << wholeDataset->getWeight(i) << endl;
        }
        output.close();
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x220, %rsp            # imm = 0x220
movq %rdi, %rbx
leaq 0x1e0(%rdi), %r14
leaq 0xb155(%rip), %rsi      # 0x151ff
movq %r14, %rdi
callq 0x5556
testb %al, %al
je 0xa157
leaq 0x17257(%rip), %rax     # 0x21318
movl (%rax), %ecx
shrl $0x1f, %ecx
movq 0x8(%rax,%rcx,8), %rdi
leaq 0xb946(%rip), %rsi      # 0x15a18
callq 0x4290
movq %rax, %rdi
movq %r14, %rsi
callq 0x4270
leaq 0xb54e(%rip), %rsi      # 0x15637
movq %rax, %rdi
callq 0x4290
movq (%r14), %rsi
leaq 0x20(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0x42f0
leaq 0x90(%rsp), %rdi
callq 0x40a0
movl %eax, %ebp
leaq 0xb935(%rip), %rsi      # 0x15a4c
movq %rsp, %rdi
movq %r14, %rdx
callq 0x54af
movzbl %bpl, %edi
movq %rsp, %rsi
callq 0x5364
movq %rsp, %rdi
callq 0x45e8
movq (%rbx), %rdi
leaq 0x20(%rsp), %rsi
callq 0x637c
leaq 0x20(%rsp), %rdi
callq 0x4400
leaq 0x20(%rsp), %rdi
callq 0x4440
leaq 0x200(%rbx), %r14
leaq 0xb09a(%rip), %rsi      # 0x151ff
movq %r14, %rdi
callq 0x5556
testb %al, %al
je 0xa212
leaq 0x1719c(%rip), %rax     # 0x21318
movl (%rax), %ecx
shrl $0x1f, %ecx
movq 0x8(%rax,%rcx,8), %rdi
leaq 0xb8f7(%rip), %rsi      # 0x15a84
callq 0x4290
movq %rax, %rdi
movq %r14, %rsi
callq 0x4270
leaq 0xb493(%rip), %rsi      # 0x15637
movq %rax, %rdi
callq 0x4290
movq (%r14), %rsi
leaq 0x20(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0x42f0
leaq 0x90(%rsp), %rdi
callq 0x40a0
movl %eax, %ebp
leaq 0xb87a(%rip), %rsi      # 0x15a4c
movq %rsp, %rdi
movq %r14, %rdx
callq 0x54af
movzbl %bpl, %edi
movq %rsp, %rsi
callq 0x5364
movq %rsp, %rdi
callq 0x45e8
movq (%rbx), %rdi
leaq 0x20(%rsp), %rsi
callq 0x67cc
leaq 0x20(%rsp), %rdi
callq 0x4400
leaq 0x20(%rsp), %rdi
callq 0x4440
leaq 0x160(%rbx), %r14
leaq 0xafdf(%rip), %rsi      # 0x151ff
movq %r14, %rdi
callq 0x5556
testb %al, %al
je 0xa311
leaq 0x170e1(%rip), %rax     # 0x21318
movl (%rax), %ecx
shrl $0x1f, %ecx
movq 0x8(%rax,%rcx,8), %rdi
leaq 0xb872(%rip), %rsi      # 0x15aba
callq 0x4290
movq %rax, %rdi
movq %r14, %rsi
callq 0x4270
leaq 0xb3d8(%rip), %rsi      # 0x15637
movq %rax, %rdi
callq 0x4290
movq (%r14), %rsi
leaq 0x20(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0x42f0
leaq 0x90(%rsp), %rdi
callq 0x40a0
movl %eax, %ebp
leaq 0xb85d(%rip), %rsi      # 0x15aea
movq %rsp, %rdi
movq %r14, %rdx
callq 0x54af
movzbl %bpl, %edi
movq %rsp, %rsi
callq 0x5364
movq %rsp, %rdi
callq 0x45e8
leaq 0x20(%rsp), %r14
movq (%r14), %rax
movq -0x18(%rax), %rax
movq $0x14, 0x28(%rsp,%rax)
xorl %r15d, %r15d
pushq $0x18
popq %r12
movq (%rbx), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
cqto
idivq %r12
movl %eax, %eax
cmpq %rax, %r15
jae 0xa2fd
movq 0x18(%rcx), %rax
movsd (%rax,%r15,8), %xmm0
movq %r14, %rdi
callq 0x44d0
movq %rax, %rdi
callq 0x4180
incq %r15
jmp 0xa2c8
leaq 0x20(%rsp), %rdi
callq 0x4400
leaq 0x20(%rsp), %rdi
callq 0x4440
addq $0x220, %rsp            # imm = 0x220
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa33e
jmp 0xa32b
jmp 0xa33e
jmp 0xa32b
jmp 0xa33e
movq %rax, %rbx
movq %rsp, %rdi
callq 0x45e8
jmp 0xa341
jmp 0xa33e
jmp 0xa33e
jmp 0xa33e
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4440
movq %rbx, %rdi
callq 0x4530
nop