// File: YerevaNN[P]pmi/pmi.cpp
// Function: model::dump(std::ostream&)
void model::dump(std::ostream& out){
    lock();
    
    report("Dumping...");
    report("\b\b\b Dictionary...");
    size dictionarySize = words.size();
    out.write((const char*)&dictionarySize, sizeof(dictionarySize));
    for(auto w : words) {
        std::string s = w;
        s.resize(wordMaxLength, 0);
        out.write(s.c_str(), wordMaxLength);
    }
    report("\b\b\b Matrix...");
    size matrixSize = lockedCount.size();
    out.write((const char *)&matrixSize, sizeof(matrixSize));
    for(auto i : lockedCount) {
        pair key = i.first;
        out.write((const char*)&key, sizeof(key));
        occurences val = i.second;
        out.write((const char*)&val, sizeof(val));
    }
    report("Done\n");
    return;
}

// Assembly:
subq $0xf8, %rsp
movq %rdi, 0xf0(%rsp)
movq %rsi, 0xe8(%rsp)
movq 0xf0(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x3b90
movq 0x151a8(%rip), %rax     # 0x18fc8
movq (%rax), %rdi
leaq 0xd23b(%rip), %rsi      # 0x11065
movb $0x0, %al
callq 0x21f0
movq 0x15190(%rip), %rax     # 0x18fc8
movq (%rax), %rdi
callq 0x2170
movq 0x15181(%rip), %rax     # 0x18fc8
movq (%rax), %rdi
leaq 0xd21f(%rip), %rsi      # 0x11070
movb $0x0, %al
callq 0x21f0
movq 0x15169(%rip), %rax     # 0x18fc8
movq (%rax), %rdi
callq 0x2170
movq 0x10(%rsp), %rdi
addq $0x40, %rdi
callq 0x48b0
movq %rax, 0xe0(%rsp)
movq 0xe8(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
movl $0x8, %edx
callq 0x21b0
movq 0x10(%rsp), %rax
addq $0x40, %rax
movq %rax, 0xd8(%rsp)
movq 0xd8(%rsp), %rdi
callq 0x48d0
movq %rax, 0xd0(%rsp)
movq 0xd8(%rsp), %rdi
callq 0x4900
movq %rax, 0xc8(%rsp)
leaq 0xd0(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x4930
testb $0x1, %al
jne 0x3ef0
jmp 0x3fd7
leaq 0xd0(%rsp), %rdi
callq 0x4970
movq %rax, %rsi
leaq 0xa8(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x2090
movq 0x8(%rsp), %rsi
leaq 0x88(%rsp), %rdi
callq 0x2090
jmp 0x3f26
leaq 0x88(%rsp), %rdi
movl $0x40, %esi
xorl %edx, %edx
callq 0x2050
jmp 0x3f3c
movq 0xe8(%rsp), %rax
movq %rax, (%rsp)
leaq 0x88(%rsp), %rdi
callq 0x2080
movq (%rsp), %rdi
movq %rax, %rsi
movl $0x40, %edx
callq 0x21b0
jmp 0x3f68
leaq 0x88(%rsp), %rdi
callq 0x20e0
leaq 0xa8(%rsp), %rdi
callq 0x20e0
leaq 0xd0(%rsp), %rdi
callq 0x4980
jmp 0x3ed2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
jmp 0x3fc5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x20e0
leaq 0xa8(%rsp), %rdi
callq 0x20e0
jmp 0x4111
movq 0x14fea(%rip), %rax     # 0x18fc8
movq (%rax), %rdi
leaq 0xd09a(%rip), %rsi      # 0x11082
movb $0x0, %al
callq 0x21f0
movq 0x14fd2(%rip), %rax     # 0x18fc8
movq (%rax), %rdi
callq 0x2170
movq 0x10(%rsp), %rdi
addq $0x90, %rdi
callq 0x49a0
movq %rax, 0x70(%rsp)
movq 0xe8(%rsp), %rdi
leaq 0x70(%rsp), %rsi
movl $0x8, %edx
callq 0x21b0
movq 0x10(%rsp), %rax
addq $0x90, %rax
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rdi
callq 0x4750
movq %rax, 0x60(%rsp)
movq 0x68(%rsp), %rdi
callq 0x4780
movq %rax, 0x58(%rsp)
leaq 0x60(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x49c0
testb $0x1, %al
jne 0x406e
jmp 0x40e2
leaq 0x60(%rsp), %rdi
callq 0x4a00
movaps (%rax), %xmm0
movaps 0x10(%rax), %xmm1
movaps %xmm1, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
movq %rcx, 0x28(%rsp)
movq %rax, 0x20(%rsp)
movq 0xe8(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movl $0x10, %edx
callq 0x21b0
movl 0x40(%rsp), %eax
movl %eax, 0x1c(%rsp)
movq 0xe8(%rsp), %rdi
leaq 0x1c(%rsp), %rsi
movl $0x4, %edx
callq 0x21b0
leaq 0x60(%rsp), %rdi
callq 0x4a10
jmp 0x4059
movq 0x14edf(%rip), %rax     # 0x18fc8
movq (%rax), %rdi
leaq 0xcf5f(%rip), %rsi      # 0x11052
movb $0x0, %al
callq 0x21f0
movq 0x14ec7(%rip), %rax     # 0x18fc8
movq (%rax), %rdi
callq 0x2170
addq $0xf8, %rsp
retq
movq 0x80(%rsp), %rdi
callq 0x2280
nop