// File: jakubsvehla[P]hex/src/editor.cpp
// Function: Editor::Init()
void Editor::Init ()
{
  // Initialize curses
  initscr(); noecho(); cbreak();

  m_Config      = new Config();
  m_Config      -> LoadFromFile(".hexrc");

  m_File        = new File();
  m_FileView    = new FileView(LINES - 1);
  m_CmdLineView = new CmdLineView();
  m_CmdMode     = new CmdMode(this);
  m_NormalMode  = new NormalMode(this);
  m_InsertMode  = new InsertMode(this);

  m_FileView    -> Configure(m_Config);

  m_Mode        = m_NormalMode;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
callq 0x3480
callq 0x33a0
callq 0x3100
movl $0x8, %edi
callq 0x32c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x20(%rbp)
callq 0x7170
jmp 0x38ae
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq 0x8(%rax), %rdi
leaq 0x473f(%rip), %rsi      # 0x8004
callq 0x7190
movl $0x60, %edi
callq 0x32c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x30(%rbp)
callq 0x3dd0
jmp 0x38e5
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rcx, 0x10(%rax)
movl $0x60, %edi
callq 0x32c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x38(%rbp)
movq 0x86ac(%rip), %rax      # 0xbfb8
movl (%rax), %esi
decl %esi
xorl %r8d, %r8d
movl %r8d, %edx
movl %r8d, %ecx
callq 0x4d60
jmp 0x3920
movq -0x28(%rbp), %rax
movq -0x38(%rbp), %rcx
movq %rcx, 0x18(%rax)
movl $0x28, %edi
callq 0x32c0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
movq 0x8671(%rip), %rax      # 0xbfb8
movl (%rax), %ecx
decl %ecx
movl $0x1, %esi
xorl %r8d, %r8d
movl %r8d, %edx
callq 0x5540
jmp 0x395d
movq -0x28(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, 0x20(%rax)
movl $0x10, %edi
callq 0x32c0
movq -0x28(%rbp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x48(%rbp)
callq 0x6090
jmp 0x3988
movq -0x28(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rcx, 0x38(%rax)
movl $0x10, %edi
callq 0x32c0
movq -0x28(%rbp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x50(%rbp)
callq 0x56c0
jmp 0x39b3
movq -0x28(%rbp), %rax
movq -0x50(%rbp), %rcx
movq %rcx, 0x30(%rax)
movl $0x10, %edi
callq 0x32c0
movq -0x28(%rbp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x58(%rbp)
callq 0x63c0
jmp 0x39de
movq -0x28(%rbp), %rax
movq -0x58(%rbp), %rcx
movq %rcx, 0x40(%rax)
movq 0x18(%rax), %rdi
movq 0x8(%rax), %rsi
callq 0x4e00
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rcx
movq %rcx, 0x28(%rax)
addq $0x60, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl $0x8, %esi
callq 0x32d0
jmp 0x3ad1
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl $0x60, %esi
callq 0x32d0
jmp 0x3ad1
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl $0x60, %esi
callq 0x32d0
jmp 0x3ad1
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl $0x28, %esi
callq 0x32d0
jmp 0x3ad1
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl $0x10, %esi
callq 0x32d0
jmp 0x3ad1
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl $0x10, %esi
callq 0x32d0
jmp 0x3ad1
movq -0x58(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl $0x10, %esi
callq 0x32d0
movq -0x10(%rbp), %rdi
callq 0x3540
nopw (%rax,%rax)