// File: IHorvalds[P]RomAna/gui.cpp
// Function: dictionaryTask(InflexEngine&, char*)
void dictionaryTask(InflexEngine& dict, char* textName) {
  // Open the normal file
  text txt(textName);
  
  // Open the latin_file
  std::string tmp = textName;
  std::string pythonCommand = "python3 processing/convert_into_latin.py " + tmp;
  int warning = system(pythonCommand.data());
  tmp = "latin_" + tmp;
  text latin_txt(tmp); 

  // Read the first words
  std::string word = txt.serveWord();
  std::string latin_word = latin_txt.serveWord();
  
  // Continue parsing the text until its end
  while ((word != " <EOF> ") && (latin_word != " <EOF> ")) {
    // Update the frequencies
    dict.updateFreq(word, latin_word);
    word = txt.serveWord();
    latin_word = latin_txt.serveWord();
  }
}

// Assembly:
subq $0xe18, %rsp            # imm = 0xE18
movq %rdi, 0xe10(%rsp)
movq %rsi, 0xe08(%rsp)
movq 0xe08(%rsp), %rax
movq %rax, 0x40(%rsp)
leaq 0x7cf(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x4630
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
leaq 0x7d0(%rsp), %rdi
callq 0xacb0
jmp 0x815f
leaq 0x7f0(%rsp), %rdi
leaq 0x7d0(%rsp), %rsi
callq 0xb220
jmp 0x8176
leaq 0x7d0(%rsp), %rdi
callq 0x4200
leaq 0x7cf(%rsp), %rdi
callq 0x43b0
movq 0xe08(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x797(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x4630
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
leaq 0x798(%rsp), %rdi
callq 0xacb0
jmp 0x81c8
leaq 0x797(%rsp), %rdi
callq 0x43b0
leaq 0xd016(%rip), %rsi      # 0x151f2
leaq 0x770(%rsp), %rdi
leaq 0x798(%rsp), %rdx
callq 0xb330
jmp 0x81f3
leaq 0x770(%rsp), %rdi
callq 0x41d0
movq %rax, %rdi
callq 0x42d0
movl %eax, 0x2c(%rsp)
jmp 0x820e
movl 0x2c(%rsp), %eax
movl %eax, 0x76c(%rsp)
leaq 0xd308(%rip), %rsi      # 0x15528
leaq 0x748(%rsp), %rdi
leaq 0x798(%rsp), %rdx
callq 0xb330
jmp 0x8237
leaq 0x798(%rsp), %rdi
movq %rdi, 0x20(%rsp)
leaq 0x748(%rsp), %rsi
movq %rsi, 0x18(%rsp)
callq 0x4410
movq 0x18(%rsp), %rdi
callq 0x4200
movq 0x20(%rsp), %rsi
leaq 0x110(%rsp), %rdi
callq 0x4170
jmp 0x8274
leaq 0x130(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0xb220
jmp 0x828b
leaq 0x110(%rsp), %rdi
callq 0x4200
leaq 0xf0(%rsp), %rdi
leaq 0x7f0(%rsp), %rsi
callq 0xb460
jmp 0x82af
leaq 0xd0(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0xb460
jmp 0x82c6
jmp 0x82c8
leaq 0xcf4d(%rip), %rsi      # 0x1521c
leaq 0xf0(%rsp), %rdi
callq 0xb6a0
movb %al, 0x17(%rsp)
jmp 0x82e2
movb 0x17(%rsp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, 0x16(%rsp)
jne 0x82f3
jmp 0x8317
leaq 0xcf22(%rip), %rsi      # 0x1521c
leaq 0xd0(%rsp), %rdi
callq 0xb6a0
movb %al, 0x15(%rsp)
jmp 0x830d
movb 0x15(%rsp), %al
movb %al, 0x16(%rsp)
jmp 0x8317
movb 0x16(%rsp), %al
testb $0x1, %al
jne 0x8324
jmp 0x8555
movq 0xe10(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0xb0(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x4170
jmp 0x8348
leaq 0x90(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x4170
jmp 0x835f
movq 0x8(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0x90(%rsp), %rdx
callq 0x5620
jmp 0x837b
leaq 0x90(%rsp), %rdi
callq 0x4200
leaq 0xb0(%rsp), %rdi
callq 0x4200
leaq 0x70(%rsp), %rdi
leaq 0x7f0(%rsp), %rsi
callq 0xb460
jmp 0x83a9
leaq 0xf0(%rsp), %rdi
leaq 0x70(%rsp), %rsi
movq %rsi, (%rsp)
callq 0x4410
movq (%rsp), %rdi
callq 0x4200
leaq 0x50(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0xb460
jmp 0x83dc
leaq 0xd0(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x4410
leaq 0x50(%rsp), %rdi
callq 0x4200
jmp 0x82c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c0(%rsp)
movl %eax, 0x7bc(%rsp)
jmp 0x8434
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c0(%rsp)
movl %eax, 0x7bc(%rsp)
leaq 0x7d0(%rsp), %rdi
callq 0x4200
leaq 0x7cf(%rsp), %rdi
callq 0x43b0
jmp 0x85f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c0(%rsp)
movl %eax, 0x7bc(%rsp)
leaq 0x797(%rsp), %rdi
callq 0x43b0
jmp 0x85ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c0(%rsp)
movl %eax, 0x7bc(%rsp)
jmp 0x85df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c0(%rsp)
movl %eax, 0x7bc(%rsp)
jmp 0x85d2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c0(%rsp)
movl %eax, 0x7bc(%rsp)
leaq 0x110(%rsp), %rdi
callq 0x4200
jmp 0x85d2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c0(%rsp)
movl %eax, 0x7bc(%rsp)
jmp 0x85c5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c0(%rsp)
movl %eax, 0x7bc(%rsp)
jmp 0x85b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c0(%rsp)
movl %eax, 0x7bc(%rsp)
jmp 0x85ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c0(%rsp)
movl %eax, 0x7bc(%rsp)
jmp 0x8546
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x7c0(%rsp)
movl %eax, 0x7bc(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x4200
leaq 0xb0(%rsp), %rdi
callq 0x4200
jmp 0x85ab
leaq 0xd0(%rsp), %rdi
callq 0x4200
leaq 0xf0(%rsp), %rdi
callq 0x4200
leaq 0x130(%rsp), %rdi
callq 0xb6d0
leaq 0x770(%rsp), %rdi
callq 0x4200
leaq 0x798(%rsp), %rdi
callq 0x4200
leaq 0x7f0(%rsp), %rdi
callq 0xb6d0
addq $0xe18, %rsp            # imm = 0xE18
retq
leaq 0xd0(%rsp), %rdi
callq 0x4200
leaq 0xf0(%rsp), %rdi
callq 0x4200
leaq 0x130(%rsp), %rdi
callq 0xb6d0
leaq 0x770(%rsp), %rdi
callq 0x4200
leaq 0x798(%rsp), %rdi
callq 0x4200
leaq 0x7f0(%rsp), %rdi
callq 0xb6d0
movq 0x7c0(%rsp), %rdi
callq 0x4620
nopw %cs:(%rax,%rax)