// File: /workspace/github_cpp_makefile_star2_O2/rfotino[P]consolite-emulator/src/window.cpp
// Function: EmuWindow::_loadKeyMap(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void EmuWindow::_loadKeyMap(const std::string& keymap_filename) {
  std::ifstream keyMapFile(keymap_filename);
  if (!keyMapFile.good()) {
    std::cerr << "Error: Failed to open keymap '"
              << keymap_filename << "'." << std::endl;
    return;
  }
  // Key map should be in the form
  // KEY INPUT_ID
  std::string line;
  int line_num = 0;
  while (std::getline(keyMapFile, line)) {
    line_num++;
    std::istringstream iss(line);
    std::string keyStr;
    int inputId;
    if (!(iss >> keyStr >> inputId)) {
      continue;
    }
    KeySym keysym = XStringToKeysym(keyStr.c_str());
    if (!keysym) {
      std::cerr << "Warning: Key '" << keyStr << "' not recognized in "
                << keymap_filename << " on line " << line << "."
                << std::endl;
      continue;
    }
    _keyMap[inputId] = keysym;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3e8, %rsp            # imm = 0x3E8
movq %rdi, %r14
leaq 0x60(%rsp), %rbx
pushq $0x8
popq %rdx
movq %rbx, %rdi
movq %rsi, 0x10(%rsp)
callq 0x33b0
movq (%rbx), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x80(%rsp,%rax)
je 0x3d9e
movq 0x4287(%rip), %rdi      # 0x7ff0
leaq 0x13fe(%rip), %rsi      # 0x516e
callq 0x3280
movq %rax, %rdi
movq 0x10(%rsp), %rsi
callq 0x3220
leaq 0x1404(%rip), %rsi      # 0x518d
movq %rax, %rdi
callq 0x3280
movq %rax, %rdi
callq 0x3120
jmp 0x3ef6
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
addq $0x38, %r14
movq %r14, 0x18(%rsp)
leaq 0x60(%rsp), %r15
leaq 0x40(%rsp), %r12
leaq 0x268(%rsp), %r13
leaq 0x20(%rsp), %rbx
leaq 0xc(%rsp), %r14
movq %r15, %rdi
movq %r12, %rsi
callq 0x3050
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3eec
movq %r13, %rdi
movq %r12, %rsi
pushq $0x8
popq %rdx
callq 0x33e0
leaq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
andq $0x0, 0x28(%rsp)
movb $0x0, 0x30(%rsp)
movq %r13, %rdi
movq %rbx, %rsi
callq 0x3300
movq %rax, %rdi
movq %r14, %rsi
callq 0x3170
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3ed7
movq 0x20(%rsp), %rdi
callq 0x3430
movq %rax, %rbp
testq %rax, %rax
je 0x3e6c
movzwl 0xc(%rsp), %eax
movw %ax, 0xa(%rsp)
movq 0x18(%rsp), %rdi
leaq 0xa(%rsp), %rsi
callq 0x4228
movq %rbp, (%rax)
jmp 0x3ed7
movq 0x417d(%rip), %rdi      # 0x7ff0
leaq 0x1316(%rip), %rsi      # 0x5190
callq 0x3280
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3220
movq %rax, %rdi
leaq 0x130b(%rip), %rsi      # 0x519f
callq 0x3280
movq %rax, %rdi
movq 0x10(%rsp), %rsi
callq 0x3220
movq %rax, %rdi
leaq 0x1304(%rip), %rsi      # 0x51b4
callq 0x3280
movq %rax, %rdi
movq %r12, %rsi
callq 0x3220
movq %rax, %rdi
leaq 0x12c4(%rip), %rsi      # 0x518e
callq 0x3280
movq %rax, %rdi
callq 0x3120
movq %rbx, %rdi
callq 0x30f0
movq %r13, %rdi
callq 0x3110
jmp 0x3dd4
leaq 0x40(%rsp), %rdi
callq 0x30f0
leaq 0x60(%rsp), %rdi
callq 0x3060
addq $0x3e8, %rsp            # imm = 0x3E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x3f46
jmp 0x3f22
jmp 0x3f1b
movq %rax, %rbx
jmp 0x3f3c
jmp 0x3f22
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x30f0
leaq 0x268(%rsp), %rdi
callq 0x3110
leaq 0x40(%rsp), %rdi
callq 0x30f0
leaq 0x60(%rsp), %rdi
callq 0x3060
movq %rbx, %rdi
callq 0x3440