// File: jkom-cloud[P]mmseg/src/Mmseg.h
// Function: mmsegSpace::MMSeg::Chunk::Chunk(std::vector<std::pair<__gnu_cxx::__normal_iterator<char16_t const*, std::__cxx11::basic_string<char16_t, std::char_traits<char16_t>, std::allocator<char16_t>>>, __gnu_cxx::__normal_iterator<char16_t const*, std::__cxx11::basic_string<char16_t, std::char_traits<char16_t>, std::allocator<char16_t>>>>, std::allocator<std::pair<__gnu_cxx::__normal_iterator<char16_t const*, std::__cxx11::basic_string<char16_t, std::char_traits<char16_t>, std::allocator<char16_t>>>, __gnu_cxx::__normal_iterator<char16_t const*, std::__cxx11::basic_string<char16_t, std::char_traits<char16_t>, std::allocator<char16_t>>>>>>, std::vector<int, std::allocator<int>>, std::unordered_map<char16_t, int, std::hash<char16_t>, std::equal_to<char16_t>, std::allocator<std::pair<char16_t const, int>>> const&)
Chunk(std::vector<StringP> words, std::vector<int> inDict, const std::unordered_map<Char, int>& chars) : inDict_(std::move(inDict)),words_(std::move(words)) {
          length_ = std::accumulate(words_.begin(), words_.end(), size_t(0), [&](size_t n, const StringP& w) { return n + length(w); });
          mean_ = float(length_) / words_.size();
          var_ = - std::accumulate(words_.begin(), words_.end(), float(0), [&](size_t n, const StringP& w) { return  n + (length(w) - mean_) * (length(w) - mean_); }) / words_.size();

          // sum of degree of morphemic freedom of one-character words
          for (auto& w: words_) {
            if (length(w) != 1) continue;
            auto it = chars.find(*w.first);
            if (it != chars.end())
              degree_ += log(float(it->second));
          }
        }

// Assembly:
subq $0xf8, %rsp
movq %rdx, 0x38(%rsp)
movq %rsi, %rax
movq 0x38(%rsp), %rsi
movq %rax, 0x48(%rsp)
movq %rdi, 0xf0(%rsp)
movq %rax, 0xe8(%rsp)
movq %rsi, 0xe0(%rsp)
movq %rcx, 0xd8(%rsp)
movq 0xf0(%rsp), %rdi
movq %rdi, 0x50(%rsp)
movq %rdi, %rax
movq %rax, 0x40(%rsp)
callq 0xa020
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdi
addq $0x18, %rdi
movq %rdi, 0x58(%rsp)
callq 0x9ff0
movq 0x50(%rsp), %rax
movq 0x58(%rsp), %rdi
movq $0x0, 0x30(%rax)
movl $0x0, 0x38(%rax)
movl $0x0, 0x3c(%rax)
movl $0x0, 0x40(%rax)
callq 0xa290
movq 0x58(%rsp), %rdi
movq %rax, 0xd0(%rsp)
callq 0xa2c0
movq %rax, 0xc8(%rsp)
movq 0xd0(%rsp), %rdi
movq 0xc8(%rsp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xadf0
movq %rax, 0x60(%rsp)
jmp 0xab91
movq 0x40(%rsp), %rdi
movq 0x60(%rsp), %rax
movq %rax, 0x30(%rdi)
vcvtusi2ssq 0x30(%rdi), %xmm0, %xmm0
vmovss %xmm0, 0x24(%rsp)
addq $0x18, %rdi
movq %rdi, 0x28(%rsp)
callq 0xae60
vmovss 0x24(%rsp), %xmm0
movq 0x28(%rsp), %rdi
movq %rax, %rcx
movq 0x40(%rsp), %rax
vcvtusi2ss %rcx, %xmm1, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss %xmm0, 0x38(%rax)
callq 0xa290
movq 0x28(%rsp), %rdi
movq %rax, 0xa8(%rsp)
callq 0xa2c0
movq %rax, %rcx
movq 0x40(%rsp), %rax
movq %rcx, 0xa0(%rsp)
movq %rax, 0x98(%rsp)
movq 0xa8(%rsp), %rdi
movq 0xa0(%rsp), %rsi
movq 0x98(%rsp), %rdx
vpxor %xmm0, %xmm0, %xmm0
callq 0xae80
vmovss %xmm0, 0x34(%rsp)
jmp 0xac34
movq 0x40(%rsp), %rdi
vmovss 0x34(%rsp), %xmm0
vmovd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
vmovd %eax, %xmm0
vmovss %xmm0, 0x20(%rsp)
addq $0x18, %rdi
callq 0xae60
vmovss 0x20(%rsp), %xmm0
movq %rax, %rcx
movq 0x40(%rsp), %rax
vcvtusi2ss %rcx, %xmm1, %xmm1
vdivss %xmm1, %xmm0, %xmm0
vmovss %xmm0, 0x3c(%rax)
addq $0x18, %rax
movq %rax, 0x90(%rsp)
movq 0x90(%rsp), %rdi
callq 0xa290
movq %rax, 0x88(%rsp)
movq 0x90(%rsp), %rdi
callq 0xa2c0
movq %rax, 0x80(%rsp)
leaq 0x88(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0xa2f0
testb $0x1, %al
jne 0xaccc
jmp 0xadcd
leaq 0x88(%rsp), %rdi
callq 0xa330
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rdi
callq 0x5760
movq %rax, 0x18(%rsp)
jmp 0xacef
movq 0x18(%rsp), %rax
cmpq $0x1, %rax
je 0xad2c
jmp 0xadbb
movq 0x58(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
callq 0x5410
movq 0x50(%rsp), %rdi
callq 0x53b0
jmp 0xadd5
movq 0xd8(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x78(%rsp), %rdi
callq 0x6ed0
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0xaf00
movq %rax, 0x10(%rsp)
jmp 0xad57
movq 0x10(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0xd8(%rsp), %rdi
callq 0xaf50
movq %rax, 0x68(%rsp)
leaq 0x70(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0xaf30
testb $0x1, %al
jne 0xad88
jmp 0xadb9
leaq 0x70(%rsp), %rdi
callq 0xafa0
vcvtsi2ssl 0x4(%rax), %xmm0, %xmm0
callq 0xaf80
vmovss %xmm0, 0x4(%rsp)
jmp 0xada4
movq 0x40(%rsp), %rax
vmovss 0x4(%rsp), %xmm0
vaddss 0x40(%rax), %xmm0, %xmm0
vmovss %xmm0, 0x40(%rax)
jmp 0xadbb
leaq 0x88(%rsp), %rdi
callq 0xa660
jmp 0xacae
addq $0xf8, %rsp
retq
movq 0xb8(%rsp), %rdi
callq 0x3470
nopw %cs:(%rax,%rax)
nopl (%rax)