// File: havluj[P]spreadsheet/src/CRuntime.cpp
// Function: CRuntime::CRuntime()
CRuntime::CRuntime() : m_currentView(-1) {
    m_controller = NULL;

    initscr();
    keypad(stdscr, TRUE);
    if (has_colors()) {
	  start_color();
    }
    init_pair(1, COLOR_BLACK, COLOR_WHITE);

    m_controllers.insert(std::make_pair((int) SPLASHSCREEN_VIEW, new CSplashscreenController()));
    m_controllers.insert(std::make_pair((int) WELCOME_VIEW, new CWelcomeController()));
    m_controllers.insert(std::make_pair((int) TABLE_VIEW, new CTableController()));
    m_controllers.insert(std::make_pair((int) HELP_VIEW, new CHelpController()));

    try {
	  changeView(WELCOME_VIEW);
    } catch (const std::invalid_argument& e) {
	  throw e;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
leaq 0x17e2f(%rip), %rax     # 0x27c70
movq %rax, (%rdi)
addq $0x8, %rdi
movq %rdi, -0xf0(%rbp)
callq 0x10860
movq -0xe8(%rbp), %rax
movl $0xffffffff, 0x38(%rax) # imm = 0xFFFFFFFF
movq $0x0, 0x40(%rax)
callq 0x5600
jmp 0xfe71
movq 0x18140(%rip), %rax     # 0x27fb8
movq (%rax), %rdi
movl $0x1, %esi
callq 0x5160
jmp 0xfe87
callq 0x5640
movb %al, -0xf1(%rbp)
jmp 0xfe94
movb -0xf1(%rbp), %al
testb $0x1, %al
jne 0xfea0
jmp 0xfeba
callq 0x50d0
jmp 0xfea7
jmp 0xfeba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
jmp 0x1026b
movl $0x1, %edi
xorl %esi, %esi
movl $0x7, %edx
callq 0x5070
jmp 0xfecd
movq -0xe8(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x108(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x8, %edi
callq 0x5420
movq %rax, -0x100(%rbp)
jmp 0xfef9
movq -0x100(%rbp), %rdi
movq $0x0, (%rdi)
callq 0x108f0
movq -0x100(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq -0x2c(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x108c0
movq %rdx, -0x118(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0xff33
movq -0x108(%rbp), %rdi
movq -0x118(%rbp), %rax
movl -0x10c(%rbp), %ecx
movl %ecx, -0x28(%rbp)
movq %rax, -0x20(%rbp)
leaq -0x28(%rbp), %rsi
callq 0x10880
movb %dl, -0x121(%rbp)
movq %rax, -0x120(%rbp)
jmp 0xff66
movq -0xe8(%rbp), %rax
movb -0x121(%rbp), %cl
movq -0x120(%rbp), %rdx
movq %rdx, -0x48(%rbp)
movb %cl, -0x40(%rbp)
addq $0x8, %rax
movq %rax, -0x138(%rbp)
movl $0x1, -0x5c(%rbp)
movl $0x8, %edi
callq 0x5420
movq %rax, -0x130(%rbp)
jmp 0xffa6
movq -0x130(%rbp), %rdi
movq $0x0, (%rdi)
callq 0x109a0
movq -0x130(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x5c(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x10970
movq %rdx, -0x148(%rbp)
movl %eax, -0x13c(%rbp)
jmp 0xffe0
movq -0x138(%rbp), %rdi
movq -0x148(%rbp), %rax
movl -0x13c(%rbp), %ecx
movl %ecx, -0x58(%rbp)
movq %rax, -0x50(%rbp)
leaq -0x58(%rbp), %rsi
callq 0x10930
movb %dl, -0x151(%rbp)
movq %rax, -0x150(%rbp)
jmp 0x10013
movq -0xe8(%rbp), %rax
movb -0x151(%rbp), %cl
movq -0x150(%rbp), %rdx
movq %rdx, -0x78(%rbp)
movb %cl, -0x70(%rbp)
addq $0x8, %rax
movq %rax, -0x168(%rbp)
movl $0x2, -0x8c(%rbp)
movl $0x88, %edi
callq 0x5420
movq %rax, -0x160(%rbp)
jmp 0x10056
movq -0x160(%rbp), %rdi
callq 0x12c80
jmp 0x10064
movq -0x160(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x8c(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x10a20
movq %rdx, -0x178(%rbp)
movl %eax, -0x16c(%rbp)
jmp 0x10094
movq -0x168(%rbp), %rdi
movq -0x178(%rbp), %rax
movl -0x16c(%rbp), %ecx
movl %ecx, -0x88(%rbp)
movq %rax, -0x80(%rbp)
leaq -0x88(%rbp), %rsi
callq 0x109e0
movb %dl, -0x181(%rbp)
movq %rax, -0x180(%rbp)
jmp 0x100cd
movq -0xe8(%rbp), %rax
movb -0x181(%rbp), %cl
movq -0x180(%rbp), %rdx
movq %rdx, -0xa8(%rbp)
movb %cl, -0xa0(%rbp)
addq $0x8, %rax
movq %rax, -0x198(%rbp)
movl $0x3, -0xbc(%rbp)
movl $0x8, %edi
callq 0x5420
movq %rax, -0x190(%rbp)
jmp 0x10116
movq -0x190(%rbp), %rdi
movq $0x0, (%rdi)
callq 0x10ac0
movq -0x190(%rbp), %rax
movq %rax, -0xc8(%rbp)
leaq -0xbc(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x10a90
movq %rdx, -0x1a8(%rbp)
movl %eax, -0x19c(%rbp)
jmp 0x10159
movq -0x198(%rbp), %rdi
movq -0x1a8(%rbp), %rax
movl -0x19c(%rbp), %ecx
movl %ecx, -0xb8(%rbp)
movq %rax, -0xb0(%rbp)
leaq -0xb8(%rbp), %rsi
callq 0x10a50
movb %dl, -0x1b1(%rbp)
movq %rax, -0x1b0(%rbp)
jmp 0x10195
movq -0xe8(%rbp), %rdi
movb -0x1b1(%rbp), %al
movq -0x1b0(%rbp), %rcx
movq %rcx, -0xd8(%rbp)
movb %al, -0xd0(%rbp)
movl $0x1, %esi
callq 0x10290
jmp 0x101c2
jmp 0x10262
movq -0x160(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl $0x88, %esi
callq 0x5430
jmp 0x1026b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1026b
movq -0x10(%rbp), %rdi
callq 0x5180
movq %rax, -0xe0(%rbp)
movl $0x10, %edi
callq 0x5200
movq %rax, %rdi
movq %rdi, -0x1c0(%rbp)
movq -0xe0(%rbp), %rsi
callq 0x10b00
movq -0x1c0(%rbp), %rdi
movq 0x17da1(%rip), %rsi     # 0x27fe0
movq 0x17d82(%rip), %rdx     # 0x27fc8
callq 0x56f0
jmp 0x10288
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
callq 0x5690
jmp 0x10260
jmp 0x1026b
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
movq -0xf0(%rbp), %rdi
callq 0x10b40
movq -0x10(%rbp), %rdi
callq 0x5730
movq %rax, %rdi
callq 0x7670
nopl (%rax,%rax)