// File: /workspace/github_cpp_makefile_star2_O2/phillip-h[P]todo/src/draw.cpp
// Function: Draw::init()
void Draw::init()
{
    std::cout << "\033]0;" << "todo" << "\7" << std::flush; 
    initscr();
    raw();
    
    use_default_colors();
    if (useColors() && has_colors()){
        start_color();
        init_pair(TITLE_COLOR_PAIR, TITLE_FOREGROUND, TITLE_BACKGROUND);
        init_pair(GUTTER_COLOR_PAIR, GUTTER_FOREGROUND, GUTTER_BACKGROUND);
        init_pair(SELECT_COLOR_PAIR, SELECT_FOREGROUND, SELECT_BACKGROUND);
        init_pair(BORDER_COLOR_PAIR, BORDER_FOREGROUND, BORDER_BACKGROUND);
        init_pair(MARK_COLOR_PAIR, MARK_FOREGROUND, MARK_BACKGROUND);
        init_pair(MARK_COLOR_PAIR_DONE, MARK_FOREGROUND_DONE, 
                  MARK_BACKGROUND_DONE);
        colors = true;
    }
    Win::setColors(colors);
    
    mouseinterval(0);    
    keypad(stdscr, true);
    noecho();

    clear();
    refresh();

    curs_set(0);

    startX = listStartX;
    startY = listStartY;
    width = COLS - startX - 2;
    height = LINES * listHeight;

    int inHeight = inputHeight * LINES;
    inHeight = std::max(inHeight, 4);

    titleWin = new Win(0, 0, COLS, titleHeight, "title", false);
    taskWin = new Win(startX, startY, width, height, "tasks");
    controlWin = new Win(inputStartX, inputStartY, COLS - inputStartX - 2, 
                         inHeight, "controls");
    inputWin = new Win(inputStartX, inputStartY, COLS - inputStartX - 2, 
                         inHeight, "new task");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq 0x9248(%rip), %rdi      # 0xefd0
leaq 0x4701(%rip), %rsi      # 0xa490
callq 0x3290
leaq 0x4278(%rip), %rsi      # 0xa013
movq %rax, %rdi
callq 0x3290
leaq 0x46eb(%rip), %rsi      # 0xa495
movq %rax, %rdi
callq 0x3290
movq %rax, %rdi
callq 0x31f0
callq 0x3400
callq 0x3120
callq 0x31d0
callq 0x4f87
testb %al, %al
je 0x5e45
callq 0x3460
testb %al, %al
je 0x5e45
callq 0x30c0
pushq $0x1
popq %rbp
pushq $0x4
popq %r14
pushq $-0x1
popq %rbx
movl %ebp, %edi
movl %r14d, %esi
movl %ebx, %edx
callq 0x30a0
pushq $0x2
popq %r15
movl %r15d, %edi
movl %r15d, %esi
movl %ebx, %edx
callq 0x30a0
pushq $0x3
popq %rdi
pushq $0x6
popq %r12
movl %r12d, %esi
movl %ebx, %edx
callq 0x30a0
movl %r14d, %edi
movl %r14d, %esi
movl %ebx, %edx
callq 0x30a0
pushq $0x5
popq %rdi
movl %ebp, %esi
movl %ebx, %edx
callq 0x30a0
movl %r12d, %edi
movl %r15d, %esi
movl %ebx, %edx
callq 0x30a0
movb $0x1, 0x986f(%rip)      # 0xf6b4
movzbl 0x9868(%rip), %edi      # 0xf6b4
callq 0x8eb8
xorl %edi, %edi
callq 0x3480
movq 0x9169(%rip), %rax      # 0xefc8
movq (%rax), %rdi
pushq $0x1
popq %rsi
callq 0x3150
callq 0x3310
callq 0x3500
callq 0x34f0
xorl %edi, %edi
callq 0x3240
movl $0x2, 0x9806(%rip)      # 0xf690
movl $0x6, 0x9800(%rip)      # 0xf694
movq 0x910d(%rip), %rax      # 0xefa8
movl (%rax), %r14d
leal -0x4(%r14), %eax
movl %eax, 0x97f0(%rip)      # 0xf698
movq 0x90f1(%rip), %rax      # 0xefa0
cvtsi2ssl (%rax), %xmm0
movss 0x45cd(%rip), %xmm1     # 0xa488
mulss %xmm0, %xmm1
cvttss2si %xmm1, %eax
movl %eax, 0x97d3(%rip)      # 0xf69c
mulss 0x45bb(%rip), %xmm0     # 0xa48c
cvttss2si %xmm0, %eax
cmpl $0x5, %eax
pushq $0x4
popq %rbp
cmovgel %eax, %ebp
pushq $0x40
popq %rdi
callq 0x32a0
movq %rax, %rbx
leaq 0x45a7(%rip), %rsi      # 0xa497
leaq 0x78(%rsp), %rdi
leaq 0x17(%rsp), %rdx
callq 0x50f0
andl $0x0, (%rsp)
pushq $0x1
popq %r8
leaq 0x78(%rsp), %r9
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl %r14d, %ecx
callq 0x8df0
movq %rbx, 0x974e(%rip)      # 0xf670
leaq 0x78(%rsp), %rdi
callq 0x35a8
pushq $0x40
popq %rdi
callq 0x32a0
movq %rax, %rbx
movl 0x9752(%rip), %r14d     # 0xf690
movl 0x974f(%rip), %r15d     # 0xf694
movl 0x974c(%rip), %r12d     # 0xf698
movl 0x9749(%rip), %r13d     # 0xf69c
leaq 0x4543(%rip), %rsi      # 0xa49d
leaq 0x58(%rsp), %rdi
leaq 0x17(%rsp), %rdx
callq 0x50f0
movl $0x1, (%rsp)
leaq 0x58(%rsp), %r9
movq %rbx, %rdi
movl %r14d, %esi
movl %r15d, %edx
movl %r12d, %ecx
movl %r13d, %r8d
callq 0x8df0
movq %rbx, 0x96e8(%rip)      # 0xf678
leaq 0x58(%rsp), %rdi
callq 0x35a8
pushq $0x40
popq %rdi
callq 0x32a0
movq %rax, %rbx
movq 0x8ffc(%rip), %rax      # 0xefa8
movl (%rax), %r14d
leaq 0x44ed(%rip), %rsi      # 0xa4a3
leaq 0x38(%rsp), %rdi
leaq 0x17(%rsp), %rdx
callq 0x50f0
addl $-0x4, %r14d
movl $0x1, (%rsp)
pushq $0x2
popq %rdx
leaq 0x38(%rsp), %r9
movq %rbx, %rdi
movl %edx, %esi
movl %r14d, %ecx
movl %ebp, %r8d
callq 0x8df0
movq %rbx, 0x9691(%rip)      # 0xf680
leaq 0x38(%rsp), %rdi
callq 0x35a8
pushq $0x40
popq %rdi
callq 0x32a0
movq %rax, %rbx
movq 0x8f9d(%rip), %rax      # 0xefa8
movl (%rax), %r14d
leaq 0x4497(%rip), %rsi      # 0xa4ac
leaq 0x18(%rsp), %rdi
leaq 0x17(%rsp), %rdx
callq 0x50f0
addl $-0x4, %r14d
movl $0x1, (%rsp)
pushq $0x2
popq %rdx
leaq 0x18(%rsp), %r9
movq %rbx, %rdi
movl %edx, %esi
movl %r14d, %ecx
movl %ebp, %r8d
callq 0x8df0
movq %rbx, 0x963a(%rip)      # 0xf688
leaq 0x18(%rsp), %rdi
callq 0x35a8
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x18(%rsp), %rdi
jmp 0x6096
jmp 0x609d
movq %rax, %r14
leaq 0x38(%rsp), %rdi
jmp 0x6096
jmp 0x609d
movq %rax, %r14
leaq 0x58(%rsp), %rdi
jmp 0x6096
jmp 0x609d
movq %rax, %r14
leaq 0x78(%rsp), %rdi
callq 0x35a8
jmp 0x60a0
movq %rax, %r14
pushq $0x40
popq %rsi
movq %rbx, %rdi
callq 0x32b0
movq %r14, %rdi
callq 0x3510