// File: /workspace/github_cpp_makefile_star2_O3/IHorvalds[P]RomAna/./processing/InflexEngineUtil.cpp
// Function: InflexEngine::consumeInflexions(char const*, char const*)
void InflexEngine::consumeInflexions(const char* filename, const char* latinFilename) {
  std::ifstream infile(filename);
  std::ifstream latinInfile(latinFilename);
   
  // Read both variants
  unsigned latinTotalCountOfRoots, totalCountOfRoots;
  infile >> totalCountOfRoots;
  latinInfile >> latinTotalCountOfRoots;
  
  // Compare for equality of count of words
  assert(latinTotalCountOfRoots == totalCountOfRoots);
  
  // Function to extract the inflexions from each line
  auto extractInflexionsFromLine = [&](std::string& line) -> std::vector<std::string> {
    const std::string delimiter = ",";
    std::vector<std::string> inflexions;
    size_t pos = 0;
    while ((pos = line.find(delimiter)) != std::string::npos) {
      inflexions.push_back(line.substr(0, pos));
      line.erase(0, pos + delimiter.length());
    }
    // If the root-word is alone in the list
    if (inflexions.empty())
      inflexions.push_back(line);
    return inflexions;
  };
   
  // Personal getline
  auto __getline = [&](std::ifstream& file, std::string& result) {
    result.clear();
    char c;
    while ((file.get(c)) && (c != '\n'))
      result += c;
  };
  
  // Jump over the newline character
  std::string line, latinLine;
  __getline(infile, line);
  __getline(latinInfile, latinLine);
  
  // Read both files
  while (totalCountOfRoots--) {
    __getline(infile, line);
    __getline(latinInfile, latinLine);
    
    // Extract the inflexions from each line
    std::vector<std::string> inflexions = extractInflexionsFromLine(line), latinInflexions = extractInflexionsFromLine(latinLine);
    assert(inflexions.size() == latinInflexions.size());
    
    std::string root = specialChars::cleanUpWord(inflexions.front()), latinRoot = specialChars::cleanUpWord(latinInflexions.front());
    
    // Check if the root is indeed a romanian one
    bool isInLanguage = romanian::isRomanian(root);
    addRoot(isInLanguage ? root : latinRoot);
    
    // Iterate over the inflexions
    for (unsigned index = 1, limit = inflexions.size(); index < limit; ++index) {
      std::string inflexion = specialChars::cleanUpWord(inflexions[index]), latinInflexion = specialChars::cleanUpWord(latinInflexions[index]);
      
      // Does the root-word have characters outside the language?
      if (!isInLanguage) {
        // It could be the case that some of the inflexions do have all their characters in the language
        if (romanian::isRomanian(inflexion)) {
          addDerivated(latinRoot, inflexion);
        } else {
          addDerivated(latinRoot, latinInflexion);
        }
      } else {
        // This means, the root-word contains only characters from the language. Thus we are sure that the inflexion also does.
        addDerivated(root, inflexion);
      }
    }
  }
  infile.close();
  latinInfile.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x6b8, %rsp            # imm = 0x6B8
movq %rdx, %r14
movq %rdi, 0x28(%rsp)
leaq 0x4b0(%rsp), %rdi
movl $0x8, %edx
callq 0x34d0
leaq 0x2a8(%rsp), %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x34d0
leaq 0x4b0(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x34a0
leaq 0x2a8(%rsp), %rdi
leaq 0x34(%rsp), %rsi
callq 0x34a0
movl 0x34(%rsp), %eax
cmpl 0x4(%rsp), %eax
jne 0x52b7
leaq 0xa8(%rsp), %rcx
movq %rcx, -0x10(%rcx)
leaq 0x48(%rsp), %rdx
movq %rdx, -0x10(%rdx)
xorl %eax, %eax
movq %rax, -0x8(%rdx)
movb %al, (%rdx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x4b0(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3380
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
sete %cl
movb 0x8(%rsp), %al
cmpb $0xa, %al
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x4a93
leaq 0x98(%rsp), %r14
leaq 0x4b0(%rsp), %r15
leaq 0x8(%rsp), %r12
movsbl %al, %esi
movq %r14, %rdi
callq 0x3230
movq %r15, %rdi
movq %r12, %rsi
callq 0x3380
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4a93
movb 0x8(%rsp), %al
cmpb $0xa, %al
jne 0x4a67
movq $0x0, 0x40(%rsp)
movq 0x38(%rsp), %rax
movb $0x0, (%rax)
leaq 0x2a8(%rsp), %rdi
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0x3380
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
sete %cl
movb 0x8(%rsp), %al
cmpb $0xa, %al
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x4b16
leaq 0x38(%rsp), %r15
leaq 0x2a8(%rsp), %r12
leaq 0x8(%rsp), %r13
movsbl %al, %esi
movq %r15, %rdi
callq 0x3230
movq %r12, %rdi
movq %r13, %rsi
callq 0x3380
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4b16
movb 0x8(%rsp), %al
cmpb $0xa, %al
jne 0x4aea
subl $0x1, 0x4(%rsp)
jb 0x5211
leaq 0x218(%rsp), %r14
leaq 0x248(%rsp), %r15
leaq 0x228(%rsp), %r13
movq $0x0, 0xa0(%rsp)
movq 0x98(%rsp), %rax
movb $0x0, (%rax)
leaq 0x4b0(%rsp), %rdi
movq %rbx, %rsi
callq 0x3380
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
sete %cl
movb 0x8(%rsp), %al
cmpb $0xa, %al
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x4bb5
movsbl %al, %esi
leaq 0x98(%rsp), %rdi
callq 0x3230
leaq 0x4b0(%rsp), %rdi
movq %rbx, %rsi
callq 0x3380
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4bb5
movb 0x8(%rsp), %al
cmpb $0xa, %al
jne 0x4b7f
movq $0x0, 0x40(%rsp)
movq 0x38(%rsp), %rax
movb $0x0, (%rax)
leaq 0x2a8(%rsp), %rdi
movq %rbx, %rsi
callq 0x3380
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
sete %cl
movb 0x8(%rsp), %al
cmpb $0xa, %al
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x4c28
movsbl %al, %esi
leaq 0x38(%rsp), %rdi
callq 0x3230
leaq 0x2a8(%rsp), %rdi
movq %rbx, %rsi
callq 0x3380
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4c28
movb 0x8(%rsp), %al
cmpb $0xa, %al
jne 0x4bf5
leaq 0xb8(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x57e8
leaq 0x110(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x57e8
movq 0xb8(%rsp), %rax
movq 0xc0(%rsp), %rcx
subq %rax, %rcx
movq 0x118(%rsp), %rdx
subq 0x110(%rsp), %rdx
cmpq %rdx, %rcx
jne 0x5298
leaq 0x298(%rsp), %r12
movq %r12, 0x288(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x288(%rsp), %rbp
movq %rbp, %rdi
callq 0xafec
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x591c
movq 0x288(%rsp), %rdi
cmpq %r12, %rdi
je 0x4ccd
movq 0x298(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x110(%rsp), %rax
leaq 0x278(%rsp), %r12
movq %r12, 0x268(%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x268(%rsp), %rbp
movq %rbp, %rdi
callq 0xafec
leaq 0x78(%rsp), %rdi
movq %rbp, %rsi
callq 0x591c
movq 0x268(%rsp), %rdi
cmpq %r12, %rdi
je 0x4d29
movq 0x278(%rsp), %rsi
incq %rsi
callq 0x3290
movq %r14, 0x208(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x208(%rsp), %rdi
callq 0xafec
leaq 0x208(%rsp), %rdi
xorl %esi, %esi
callq 0x4058
movl %eax, %ebp
movq 0x208(%rsp), %rdi
cmpq %r14, %rdi
je 0x4d79
movq 0x218(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x100(%rsp), %rax
movq %rax, 0xf0(%rsp)
testb %bpl, %bpl
leaq 0x78(%rsp), %rax
cmovneq %rbx, %rax
movq (%rax), %rsi
leaq 0x80(%rsp), %rax
leaq 0x10(%rsp), %rcx
cmovneq %rcx, %rax
movq (%rax), %rdx
addq %rsi, %rdx
leaq 0xf0(%rsp), %rdi
callq 0xafec
movq 0x28(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x5646
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x4df3
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0xc0(%rsp), %rax
subq 0xb8(%rsp), %rax
movabsq $0x1fffffffc0, %rcx     # imm = 0x1FFFFFFFC0
testq %rcx, %rax
je 0x51a1
shrq $0x5, %rax
movl %eax, %r14d
decq %r14
movl $0x28, %ebx
movq 0xb8(%rsp), %rax
leaq 0x258(%rsp), %r12
movq %r12, 0x248(%rsp)
movq -0x8(%rax,%rbx), %rsi
movq (%rax,%rbx), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0xafec
leaq 0x58(%rsp), %rdi
movq %r15, %rsi
callq 0x591c
movq 0x248(%rsp), %rdi
cmpq %r12, %rdi
je 0x4e7b
movq 0x258(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x110(%rsp), %rax
leaq 0x238(%rsp), %r12
movq %r12, 0x228(%rsp)
movq -0x8(%rax,%rbx), %rsi
movq (%rax,%rbx), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0xafec
leaq 0x1e8(%rsp), %rdi
movq %r13, %rsi
callq 0x591c
movq 0x228(%rsp), %rdi
cmpq %r12, %rdi
je 0x4ed4
movq 0x238(%rsp), %rsi
incq %rsi
callq 0x3290
testb %bpl, %bpl
je 0x4f83
leaq 0x158(%rsp), %rax
movq %rax, 0x148(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x148(%rsp), %rdi
callq 0xafec
leaq 0x138(%rsp), %rax
movq %rax, 0x128(%rsp)
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
addq %rsi, %rdx
leaq 0x128(%rsp), %r12
movq %r12, %rdi
callq 0xafec
movq 0x28(%rsp), %rdi
leaq 0x148(%rsp), %rsi
movq %r12, %rdx
callq 0x56d2
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
cmpq %rax, %rdi
je 0x4f6e
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x148(%rsp), %rdi
leaq 0x158(%rsp), %rcx
jmp 0x5140
leaq 0xe0(%rsp), %rax
movq %rax, 0xd0(%rsp)
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
addq %rsi, %rdx
leaq 0xd0(%rsp), %rdi
callq 0xafec
leaq 0xd0(%rsp), %rdi
xorl %esi, %esi
callq 0x4058
movl %eax, %r12d
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x4fe4
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x3290
testb %r12b, %r12b
je 0x5096
leaq 0x1d8(%rsp), %rax
movq %rax, 0x1c8(%rsp)
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdx
addq %rsi, %rdx
leaq 0x1c8(%rsp), %rdi
callq 0xafec
leaq 0x1b8(%rsp), %rax
movq %rax, 0x1a8(%rsp)
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
addq %rsi, %rdx
leaq 0x1a8(%rsp), %r12
movq %r12, %rdi
callq 0xafec
movq 0x28(%rsp), %rdi
leaq 0x1c8(%rsp), %rsi
movq %r12, %rdx
callq 0x56d2
movq 0x1a8(%rsp), %rdi
leaq 0x1b8(%rsp), %rax
cmpq %rax, %rdi
je 0x5081
movq 0x1b8(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x1c8(%rsp), %rdi
leaq 0x1d8(%rsp), %rcx
jmp 0x5140
leaq 0x198(%rsp), %rax
movq %rax, 0x188(%rsp)
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdx
addq %rsi, %rdx
leaq 0x188(%rsp), %rdi
callq 0xafec
leaq 0x178(%rsp), %rax
movq %rax, 0x168(%rsp)
movq 0x1e8(%rsp), %rsi
movq 0x1f0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x168(%rsp), %r12
movq %r12, %rdi
callq 0xafec
movq 0x28(%rsp), %rdi
leaq 0x188(%rsp), %rsi
movq %r12, %rdx
callq 0x56d2
movq 0x168(%rsp), %rdi
leaq 0x178(%rsp), %rax
cmpq %rax, %rdi
je 0x5130
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x188(%rsp), %rdi
leaq 0x198(%rsp), %rcx
movq %rcx, %rax
cmpq %rcx, %rdi
je 0x5153
movq (%rax), %rsi
incq %rsi
callq 0x3290
movq 0x1e8(%rsp), %rdi
leaq 0x1f8(%rsp), %rax
cmpq %rax, %rdi
je 0x5178
movq 0x1f8(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x5194
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3290
addq $0x20, %rbx
decq %r14
jne 0x4e25
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x51c3
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
leaq 0x8(%rsp), %rbx
leaq 0x218(%rsp), %r14
je 0x51ec
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x110(%rsp), %rdi
callq 0x817e
leaq 0xb8(%rsp), %rdi
callq 0x817e
subl $0x1, 0x4(%rsp)
jae 0x4b39
leaq 0x4b0(%rsp), %rdi
callq 0x30a0
leaq 0x2a8(%rsp), %rdi
callq 0x30a0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x5247
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x526c
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x2a8(%rsp), %rdi
callq 0x30c0
leaq 0x4b0(%rsp), %rdi
callq 0x30c0
addq $0x6b8, %rsp            # imm = 0x6B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6e8b(%rip), %rdi      # 0xc12a
leaq 0x6dca(%rip), %rsi      # 0xc070
leaq 0x6e3c(%rip), %rcx      # 0xc0e9
movl $0x96, %edx
callq 0x3190
leaq 0x6dff(%rip), %rdi      # 0xc0bd
leaq 0x6dab(%rip), %rsi      # 0xc070
leaq 0x6e1d(%rip), %rcx      # 0xc0e9
movl $0x71, %edx
callq 0x3190
movq %rax, %rbx
jmp 0x557a
movq %rax, %rbx
jmp 0x556d
jmp 0x5529
jmp 0x5529
movq %rax, %rbx
jmp 0x5518
movq %rax, %rbx
jmp 0x550b
movq %rax, %rbx
jmp 0x54ef
movq %rax, %rbx
movq 0x208(%rsp), %rdi
cmpq %r14, %rdi
je 0x54cd
movq 0x218(%rsp), %rsi
jmp 0x54c5
movq %rax, %rbx
movq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rax
cmpq %rax, %rdi
je 0x54cd
movq 0x100(%rsp), %rsi
jmp 0x54c5
jmp 0x5484
jmp 0x5529
jmp 0x5529
jmp 0x5529
movq %rax, %rbx
movq 0x168(%rsp), %rdi
leaq 0x178(%rsp), %rax
cmpq %rax, %rdi
je 0x5393
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0x5393
movq %rax, %rbx
movq 0x188(%rsp), %rdi
leaq 0x198(%rsp), %rax
cmpq %rax, %rdi
je 0x548c
movq 0x198(%rsp), %rsi
jmp 0x5475
movq %rax, %rbx
movq 0x1a8(%rsp), %rdi
leaq 0x1b8(%rsp), %rax
cmpq %rax, %rdi
je 0x53e6
movq 0x1b8(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0x53e6
movq %rax, %rbx
movq 0x1c8(%rsp), %rdi
leaq 0x1d8(%rsp), %rax
cmpq %rax, %rdi
je 0x548c
movq 0x1d8(%rsp), %rsi
jmp 0x5475
movq %rax, %rbx
jmp 0x5458
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x548c
movq 0xe0(%rsp), %rsi
jmp 0x5475
movq %rax, %rbx
movq 0x128(%rsp), %rdi
leaq 0x138(%rsp), %rax
cmpq %rax, %rdi
je 0x5458
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x148(%rsp), %rdi
leaq 0x158(%rsp), %rax
cmpq %rax, %rdi
je 0x548c
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x3290
jmp 0x548c
movq %rax, %rbx
jmp 0x54b1
movq %rax, %rbx
jmp 0x54cd
movq %rax, %rbx
movq 0x1e8(%rsp), %rdi
leaq 0x1f8(%rsp), %rax
cmpq %rax, %rdi
je 0x54b1
movq 0x1f8(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x54cd
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x54ef
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x550b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x110(%rsp), %rdi
callq 0x817e
leaq 0xb8(%rsp), %rdi
callq 0x817e
jmp 0x552c
jmp 0x5529
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x5548
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3290
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x556d
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x3290
leaq 0x2a8(%rsp), %rdi
callq 0x30c0
leaq 0x4b0(%rsp), %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x34b0
nop