// File: /workspace/github_cpp_makefile_star2_O3/mapequation[P]partition-validation/./partition-validation.h
// Function: Partitions::printClusters()
void Partitions::printClusters() {
    cout << "--> Writing " << nClusters << " clusters..." << flush;

    my_ofstream ofs;
    ofs.open(outFileName.c_str());

    int i = 1;
    ofs << "# Clustered " << nTrainingPartitions << " partitions into " << clusters.size() << " clusters." << endl;
    ofs << "ClusterId PartitionId" << endl;
    for (auto &cluster: clusters) {
        for (auto &partition: cluster) {
            ofs << i << " " << partition->partitionId + 1 << endl;
        }
        i++;
    }

    ofs.close();

    string distanceOutFileName = outFileName;
    size_t periodPos = distanceOutFileName.find_last_of('.');

    if (periodPos == string::npos) {
        distanceOutFileName += "_distances";
    } else {
        distanceOutFileName.insert(periodPos, "_distances");
    }

    ofs.open(distanceOutFileName.c_str());
    i = 1;

    ofs << "# Clustered " << nTrainingPartitions << " partitions into " << clusters.size() << " clusters." << endl;
    ofs << "ClusterId1 ClusterId2 Distance" << endl;

    for (auto cluster1 = begin(clusters); cluster1 != end(clusters); cluster1++) {
        auto j = i + 1;
        for (auto cluster2 = next(cluster1); cluster2 != end(clusters); cluster2++) {
            auto partition1 = *cluster1->begin();
            auto partition2 = *cluster2->begin();
            ofs << i << " " << j << " " << wpJaccardDist(partition1, partition2) << endl;
            j++;
        }
        i++;
    }

    ofs.close();
    cout << "done!" << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x248, %rsp            # imm = 0x248
movq %rdi, %r14
movq 0x92b3(%rip), %rbx      # 0xdfd8
leaq 0x54d6(%rip), %rsi      # 0xa202
movl $0xc, %edx
movq %rbx, %rdi
callq 0x32a0
movl 0x4e0(%r14), %esi
movq %rbx, %rdi
callq 0x33d0
movq %rax, %rbx
leaq 0x54bd(%rip), %rsi      # 0xa20f
movl $0xc, %edx
movq %rax, %rdi
callq 0x32a0
movq %rbx, %rdi
callq 0x3170
leaq 0x48(%rsp), %rbx
movl $0xf, %esi
movq %rbx, %rdi
callq 0x6a9c
movq %r14, 0x8(%rsp)
movq 0x70(%r14), %rsi
movq %rbx, %rdi
movl $0x10, %edx
callq 0x3050
leaq 0x5486(%rip), %rsi      # 0xa21c
leaq 0x48(%rsp), %rdi
movl $0xc, %edx
callq 0x32a0
movq 0x8(%rsp), %rax
movl 0x4e4(%rax), %esi
leaq 0x48(%rsp), %rdi
callq 0x33d0
movq %rax, %rbx
leaq 0x5465(%rip), %rsi      # 0xa229
movl $0x11, %edx
movq %rax, %rdi
callq 0x32a0
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rsi
subq 0x38(%rax), %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rsi
movq %rbx, %rdi
callq 0x3160
movq %rax, %rbx
leaq 0x5439(%rip), %rsi      # 0xa23b
movl $0xa, %edx
movq %rax, %rdi
callq 0x32a0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3170
leaq 0x5409(%rip), %rsi      # 0xa246
leaq 0x48(%rsp), %rbx
movl $0x15, %edx
movq %rbx, %rdi
callq 0x32a0
movq 0x48(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
leaq 0x48(%rsp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3170
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rcx
movq 0x40(%rax), %rax
movq %rax, 0x10(%rsp)
cmpq %rax, %rcx
je 0x4f26
movl $0x1, %ebp
leaq 0x48(%rsp), %r14
leaq 0x5266(%rip), %r15      # 0xa10c
movq (%rcx), %r12
movq %rcx, 0x18(%rsp)
movq 0x8(%rcx), %r13
cmpq %r13, %r12
je 0x4f14
movq %r14, %rdi
movl %ebp, %esi
callq 0x33d0
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x32a0
movq (%r12), %rax
movl (%rax), %esi
incl %esi
movq %rbx, %rdi
callq 0x33d0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3170
addq $0x8, %r12
jmp 0x4eb2
incl %ebp
movq 0x18(%rsp), %rcx
addq $0x18, %rcx
cmpq 0x10(%rsp), %rcx
jne 0x4ea6
leaq 0x48(%rsp), %rdi
callq 0x3320
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x8(%rsp), %rax
movq 0x70(%rax), %rsi
movq 0x78(%rax), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x799e
leaq 0x28(%rsp), %rdi
movl $0x2e, %esi
movq $-0x1, %rdx
callq 0x3420
cmpq $-0x1, %rax
je 0x4f8d
leaq 0x52e6(%rip), %rcx      # 0xa25c
leaq 0x28(%rsp), %rdi
movl $0xa, %r8d
movq %rax, %rsi
xorl %edx, %edx
callq 0x3280
jmp 0x4f9e
leaq 0x52c8(%rip), %rsi      # 0xa25c
leaq 0x28(%rsp), %rdi
callq 0x3410
movq 0x28(%rsp), %rsi
leaq 0x48(%rsp), %rdi
movl $0x10, %edx
callq 0x3050
leaq 0x5263(%rip), %rsi      # 0xa21c
leaq 0x48(%rsp), %rdi
movl $0xc, %edx
callq 0x32a0
movq 0x8(%rsp), %rax
movl 0x4e4(%rax), %esi
leaq 0x48(%rsp), %rdi
callq 0x33d0
movq %rax, %rbx
leaq 0x5242(%rip), %rsi      # 0xa229
movl $0x11, %edx
movq %rax, %rdi
callq 0x32a0
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rsi
subq 0x38(%rax), %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rsi
movq %rbx, %rdi
callq 0x3160
movq %rax, %rbx
leaq 0x5216(%rip), %rsi      # 0xa23b
movl $0xa, %edx
movq %rax, %rdi
callq 0x32a0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3170
leaq 0x5207(%rip), %rsi      # 0xa267
leaq 0x48(%rsp), %rbx
movl $0x1e, %edx
movq %rbx, %rdi
callq 0x32a0
movq 0x48(%rsp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
leaq 0x48(%rsp), %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3170
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rcx
movq 0x40(%rax), %r15
cmpq %r15, %rcx
je 0x51a6
movl $0x1, 0x10(%rsp)
movl 0x10(%rsp), %eax
movl %eax, %r12d
leal 0x1(%r12), %eax
movl %eax, 0x10(%rsp)
movq %rcx, 0x18(%rsp)
leaq 0x18(%rcx), %rax
movq %rax, 0x20(%rsp)
cmpq %r15, %rax
je 0x5198
movl 0x10(%rsp), %ebp
movq 0x20(%rsp), %r15
movq 0x18(%rsp), %rax
movq (%rax), %rax
movq (%rax), %r13
movq (%r15), %rax
movq (%rax), %rbx
leaq 0x48(%rsp), %rdi
movl %r12d, %esi
callq 0x33d0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x4ff1(%rip), %rsi      # 0xa10c
callq 0x32a0
movq %r14, %rdi
movl %ebp, %esi
callq 0x33d0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x4fd0(%rip), %rsi      # 0xa10c
callq 0x32a0
movq 0x8(%rsp), %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x37fc
movq %r14, %rdi
callq 0x3380
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3170
incl %ebp
addq $0x18, %r15
movq 0x8(%rsp), %rax
cmpq 0x40(%rax), %r15
jne 0x50eb
movq 0x20(%rsp), %rcx
cmpq %r15, %rcx
jne 0x50bb
leaq 0x48(%rsp), %rdi
callq 0x3320
movq 0x8e21(%rip), %rbx      # 0xdfd8
leaq 0x503e(%rip), %rsi      # 0xa1fc
movl $0x5, %edx
movq %rbx, %rdi
callq 0x32a0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq 0x8def(%rip), %rdi      # 0xdfd8
callq 0x3030
movq %rax, %rdi
callq 0x3170
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x5212
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3250
leaq 0x8ae7(%rip), %rax      # 0xdd00
leaq 0x140(%rsp), %rbx
movq %rax, -0xf8(%rbx)
leaq 0x8af9(%rip), %rax      # 0xdd28
movq %rax, (%rbx)
leaq 0x50(%rsp), %rdi
callq 0x31f0
movq %rbx, %rdi
callq 0x30d0
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x525e
jmp 0x525e
jmp 0x525e
jmp 0x5263
movq %rax, %rbx
jmp 0x5282
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x5282
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3250
leaq 0x48(%rsp), %rdi
callq 0x6b38
movq %rbx, %rdi
callq 0x33e0