// File: /workspace/github_cpp_makefile_star2_O1/IHorvalds[P]RomAna/./processing/analyze_poet.hpp
// Function: PoetAnalyzer::processPoems()
void processPoems() {
    std::string filename = "poets/poems/" + poet + "_list_poems.txt";
    std::ifstream in;
    
    // Compute the number of poems
    in.open(filename);
    uint32_t totalCountOfPoems = 0;
    std::string str;
    while (in >> str)
      ++totalCountOfPoems;
    in.close();
    
    // Don't alloc the dictionary
    InflexEngine dict(InflexEngine::Read);
    
    // Read each poem from the list
    in.open(filename);
    std::string currPoem; 
    std::cout << "Start the analysis of " << this->poet << std::endl;
    while (in >> currPoem) {
      ++countPoems;
      
      std::cout << "[" << static_cast<unsigned>(100 * (double)(countPoems - 1) / totalCountOfPoems) << "%]" << ":  currently analyzing '" << currPoem << "'" << std::endl;
      
      // Read the poetry from the html file
      receivePoem(currPoem);
      
      // Reset the InflexEngine with the initial dictionary
      dict.reset("dict.bin");
      
      // Parse the poetry and save the frequencies into InflexEngine
      dictionaryTask(dict, "parsed.txt");
    
      // Get the frequencies of inflections
      std::vector<std::pair<uint32_t, std::string>> freqs = dict.getFrequencies();
    
      // Compute the size of the current poem and store it
      uint32_t poemSize = 0;
      for (auto e : freqs)
        poemSize += e.first;
      assert(poemSize);
      sizeOfPoems.push_back(poemSize);
    
      // Update the map with frequencies per word
      for (auto iter: freqs) {
        std::string word = iter.second;
        uint32_t currFreq = iter.first;
        
        // Store the index of the poem along the absolute frequency
        wordToFreqs[word].push_back(std::make_pair(currFreq, countPoems - 1));
      }
    }
    std::cout << "[100%]: " << this->poet << " is finished" << std::endl;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x348, %rsp            # imm = 0x348
movq %rdi, %rbx
leaq 0x10(%rdi), %rdx
leaq 0x2e47(%rip), %rsi      # 0xc5e2
leaq 0x140(%rsp), %r14
movq %r14, %rdi
callq 0x8342
leaq 0x2e3d(%rip), %rsi      # 0xc5ef
movq %r14, %rdi
callq 0x34f0
leaq 0x68(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x97e1
movq %rdx, 0x58(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x68(%rsp)
jmp 0x97e9
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x60(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x150(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9822
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x140(%rsp), %rdi
callq 0x32e0
leaq 0x140(%rsp), %rdi
leaq 0x58(%rsp), %rsi
movl $0x8, %edx
callq 0x3240
leaq 0xe0(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
xorl %ebp, %ebp
leaq 0x140(%rsp), %r14
leaq 0xd0(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x3340
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x988c
incl %ebp
jmp 0x986f
leaq 0x140(%rsp), %rdi
callq 0x30a0
xorl %eax, %eax
movl %eax, 0xf0(%rsp)
movl %eax, 0x10c(%rsp)
movq $0x0, 0x100(%rsp)
movl %eax, 0x118(%rsp)
leaq 0x140(%rsp), %rdi
leaq 0x58(%rsp), %rsi
movl $0x8, %edx
callq 0x3240
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x66e2(%rip), %rdi      # 0xffd0
leaq 0x2d0a(%rip), %rsi      # 0xc5ff
movl $0x16, %edx
callq 0x32f0
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
movq 0x66c2(%rip), %rdi      # 0xffd0
callq 0x32f0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
movl %ebp, %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0xb8(%rsp)
leaq 0x28(%rsp), %r13
leaq 0x30(%rbx), %rax
movq %rax, 0xb0(%rsp)
leaq 0x130(%rsp), %rbp
leaq 0x48(%rbx), %rax
movq %rax, 0xc0(%rsp)
leaq 0xf0(%rsp), %r15
movq %rbx, 0x8(%rsp)
leaq 0x140(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x3340
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x9cae
incl (%rbx)
movl $0x1, %edx
movq 0x661f(%rip), %rdi      # 0xffd0
leaq 0x2c5e(%rip), %rsi      # 0xc616
callq 0x32f0
movl (%rbx), %eax
decl %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x2637(%rip), %xmm0     # 0xc008
divsd 0xb8(%rsp), %xmm0
cvttsd2si %xmm0, %rax
movl %eax, %esi
movq 0x65e8(%rip), %rdi      # 0xffd0
callq 0x31a0
movq %rax, %r14
movl $0x2, %edx
movq %rax, %rdi
leaq 0x2c19(%rip), %rsi      # 0xc618
callq 0x32f0
movl $0x18, %edx
movq %r14, %rdi
leaq 0x2c08(%rip), %rsi      # 0xc61b
callq 0x32f0
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq %r14, %rdi
callq 0x32f0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x2bf6(%rip), %rsi      # 0xc632
callq 0x32f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
leaq 0x88(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
addq %rsi, %rdx
leaq 0x78(%rsp), %rdi
callq 0xb0ae
movq %rbx, %rdi
leaq 0x78(%rsp), %rsi
callq 0x9fe4
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x9abb
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x3290
movq %r15, %rdi
callq 0x55de
movl $0x1, 0xf0(%rsp)
movl $0x0, 0x10c(%rsp)
movq $0x0, 0x100(%rsp)
movq %r15, %rdi
leaq 0x2b45(%rip), %rsi      # 0xc634
callq 0x47f6
movq %rbx, %rdi
movq %r15, %rsi
leaq 0x2b3c(%rip), %rdx      # 0xc63d
callq 0xa04e
leaq 0x98(%rsp), %rdi
movq %r15, %rsi
callq 0x5f68
movl $0x0, 0x4(%rsp)
movq 0x98(%rsp), %rbx
movq 0xa0(%rsp), %r14
cmpq %r14, %rbx
je 0x9b78
movl (%rbx), %eax
movl %eax, 0x10(%rsp)
movq %r13, 0x18(%rsp)
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
addq %rsi, %rdx
leaq 0x18(%rsp), %rdi
callq 0xb0ae
movl 0x10(%rsp), %eax
addl %eax, 0x4(%rsp)
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0x9b72
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3290
addq $0x28, %rbx
jmp 0x9b2e
movl 0x4(%rsp), %eax
testl %eax, %eax
je 0x9da1
movq 0x8(%rsp), %rcx
movq 0x38(%rcx), %rsi
cmpq 0x40(%rcx), %rsi
je 0x9b9f
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x38(%rcx)
jmp 0x9bb1
movq 0xb0(%rsp), %rdi
leaq 0x4(%rsp), %rdx
callq 0xa5ca
movq 0x98(%rsp), %r14
movq 0xa0(%rsp), %rbx
cmpq %rbx, %r14
je 0x9c8f
movl (%r14), %eax
movl %eax, 0x10(%rsp)
movq %r13, 0x18(%rsp)
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
addq %rsi, %rdx
leaq 0x18(%rsp), %rdi
callq 0xb0ae
movq %rbp, 0x120(%rsp)
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
addq %rsi, %rdx
leaq 0x120(%rsp), %r12
movq %r12, %rdi
callq 0xb0ae
movq %rbp, %r15
movl 0x10(%rsp), %ebp
movq 0xc0(%rsp), %rdi
movq %r12, %rsi
callq 0xa54e
movq 0x8(%rsp), %rcx
movl (%rcx), %ecx
decl %ecx
shlq $0x20, %rcx
orq %rbp, %rcx
movq %rcx, 0xc8(%rsp)
movq %rax, %rdi
leaq 0xc8(%rsp), %rsi
callq 0xaa80
movq 0x120(%rsp), %rdi
movq %r15, %rbp
cmpq %r15, %rdi
je 0x9c6f
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0x9c86
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3290
addq $0x28, %r14
jmp 0x9bc1
leaq 0x98(%rsp), %rdi
callq 0x8266
movq 0x8(%rsp), %rbx
leaq 0xf0(%rsp), %r15
jmp 0x997f
movq 0x631b(%rip), %rdi      # 0xffd0
leaq 0x29d5(%rip), %rsi      # 0xc691
movl $0x8, %edx
callq 0x32f0
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %rdx
movq 0x62fb(%rip), %rdi      # 0xffd0
callq 0x32f0
movq %rax, %rbx
leaq 0x29b6(%rip), %rsi      # 0xc69a
movl $0xc, %edx
movq %rax, %rdi
callq 0x32f0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3260
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x9d34
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0xf0(%rsp), %rdi
callq 0x55de
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x9d66
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x140(%rsp), %rdi
callq 0x30c0
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x9d8f
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3290
addq $0x348, %rsp            # imm = 0x348
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x28a0(%rip), %rdi      # 0xc648
leaq 0x28a2(%rip), %rsi      # 0xc651
leaq 0x28b9(%rip), %rcx      # 0xc66f
movl $0x5e, %edx
callq 0x3190
jmp 0x9f0f
movq %rax, %rbx
jmp 0x9eac
jmp 0x9e31
movq %rax, %rbx
jmp 0x9ede
movq %rax, %rbx
jmp 0x9eeb
movq %rax, %rbx
leaq 0x150(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9f07
movq 0x150(%rsp), %rsi
jmp 0x9eff
jmp 0x9e39
jmp 0x9e80
jmp 0x9e39
movq %rax, %rbx
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x9e90
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0x9e90
movq %rax, %rbx
jmp 0x9eb9
movq %rax, %rbx
jmp 0x9e90
jmp 0x9e40
movq %rax, %rbx
movq 0x120(%rsp), %rdi
cmpq %r15, %rdi
je 0x9e67
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0x9e67
jmp 0x9e80
movq %rax, %rbx
movq 0x18(%rsp), %rdi
cmpq %r13, %rdi
je 0x9e83
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0x9e83
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x8266
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x9eac
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0xf0(%rsp), %rdi
callq 0x55de
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x9ede
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x140(%rsp), %rdi
callq 0x30c0
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x9f07
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3290
movq %rbx, %rdi
callq 0x34b0
movq %rax, %rdi
callq 0x81ff
nop