// File: havluj[P]spreadsheet/src/CHelpController.cpp
// Function: CHelpController::redraw()
void CHelpController::redraw() {
    clear();

    int maxY, maxX;
    getmaxyx(stdscr, maxY, maxX);

    const int SUBHELP = 6;

    attron(A_BOLD | A_UNDERLINE);
    mvprintw(0, 1, "NAVIGATING AROUND THE SPREADSHEET:");
    attroff(A_BOLD | A_UNDERLINE);
    mvprintw(1, SUBHELP, "E - edit / finish editing the expression");
    mvprintw(2, SUBHELP, "UP KEY - move one cell up");
    mvprintw(3, SUBHELP, "DOWN KEY - move one cell down");
    mvprintw(4, SUBHELP, "RIGHT KEY - move one cell right");
    mvprintw(5, SUBHELP, "LEFT KEY - move one cell left");

    attron(A_BOLD | A_UNDERLINE);
    mvprintw(7, 1, "EDITING THE EXPRESSION:");
    attroff(A_BOLD | A_UNDERLINE);
    mvprintw(8, SUBHELP, "If you want to input math expressions, make your first character is '='.");
    mvprintw(9, SUBHELP, "Otherwise, the input will be interpreted as a string.");
    mvprintw(10, SUBHELP, "Trying to compute with a string will lead to ERROR output.");
    mvprintw(11, SUBHELP, "For example: '= 150' is a number but '150' is a string.");
    mvprintw(12, SUBHELP, "To compute expressions, you can use these functions:");
    mvprintw(13, SUBHELP + 2, "avg(row,col:row,col) -> returns an average value of these cells");
    mvprintw(14, SUBHELP + 2, "sum(row,col:row,col) -> returns a sum of the values of these cells");
    mvprintw(15, SUBHELP + 2, "cell(row,col) -> returns a value of the cell");
    mvprintw(16, SUBHELP + 2, "sin(x), cos(x), tan(x)");
    mvprintw(17, SUBHELP + 2, "ln(x) -> natural logarithm (base e)");
    mvprintw(18, SUBHELP + 2, "log(x) -> logarithm with base 10");
    mvprintw(19, SUBHELP + 2, "sqrt(x) -> returns a square root of the value");
    mvprintw(20, SUBHELP + 2, "pow(x) == x^2");
    mvprintw(21, SUBHELP + 2, "exp(x) == e^x");
    mvprintw(22, SUBHELP + 2, "operators: +, -, *, /, %, ^");
    mvprintw(24, SUBHELP, "You can combine the expressions above however you like. For example:");
    mvprintw(25, SUBHELP + 2, "= ((sin(30) + 5) * 20) / avg(1,1:5,5)");

    attrset(COLOR_PAIR(1));
    mvprintw(maxY - 1, 1, " F3 - spreadsheet ");
    mvprintw(maxY - 1, 20, " F4 - exit ");
    attroff(COLOR_PAIR(1));

    refresh();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
callq 0x5710
xorl %eax, %eax
movq 0x201be(%rip), %rcx     # 0x27fb8
cmpq (%rcx), %rax
je 0x7e15
movq 0x201b2(%rip), %rax     # 0x27fb8
movq (%rax), %rax
movswl 0x4(%rax), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x7e1f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x18(%rbp)
jmp 0x7e1f
movl -0x18(%rbp), %eax
movl %eax, -0xc(%rbp)
xorl %eax, %eax
movq 0x2018a(%rip), %rcx     # 0x27fb8
cmpq (%rcx), %rax
je 0x7e49
movq 0x2017e(%rip), %rax     # 0x27fb8
movq (%rax), %rax
movswl 0x6(%rax), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x7e53
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x1c(%rbp)
jmp 0x7e53
movl -0x1c(%rbp), %eax
movl %eax, -0x10(%rbp)
movl $0x6, -0x14(%rbp)
movq 0x20151(%rip), %rax     # 0x27fb8
movq (%rax), %rdi
movl $0x220000, %esi         # imm = 0x220000
xorl %eax, %eax
movl %eax, %edx
callq 0x51f0
xorl %edi, %edi
movl $0x1, %esi
leaq 0x141de(%rip), %rdx     # 0x1c064
movb $0x0, %al
callq 0x5570
movq 0x20124(%rip), %rax     # 0x27fb8
movq (%rax), %rdi
movl $0x220000, %esi         # imm = 0x220000
xorl %eax, %eax
movl %eax, %edx
callq 0x5550
movl $0x1, %edi
movl $0x6, %esi
leaq 0x141d1(%rip), %rdx     # 0x1c087
movb $0x0, %al
callq 0x5570
movl $0x2, %edi
movl $0x6, %esi
leaq 0x141e2(%rip), %rdx     # 0x1c0b0
movb $0x0, %al
callq 0x5570
movl $0x3, %edi
movl $0x6, %esi
leaq 0x141e4(%rip), %rdx     # 0x1c0ca
movb $0x0, %al
callq 0x5570
movl $0x4, %edi
movl $0x6, %esi
leaq 0x141ea(%rip), %rdx     # 0x1c0e8
movb $0x0, %al
callq 0x5570
movl $0x5, %edi
movl $0x6, %esi
leaq 0x141f2(%rip), %rdx     # 0x1c108
movb $0x0, %al
callq 0x5570
movq 0x20094(%rip), %rax     # 0x27fb8
movq (%rax), %rdi
movl $0x220000, %esi         # imm = 0x220000
xorl %eax, %eax
movl %eax, %edx
callq 0x51f0
movl $0x7, %edi
movl $0x1, %esi
leaq 0x141e0(%rip), %rdx     # 0x1c126
movb $0x0, %al
callq 0x5570
movq 0x20064(%rip), %rax     # 0x27fb8
movq (%rax), %rdi
movl $0x220000, %esi         # imm = 0x220000
xorl %eax, %eax
movl %eax, %edx
callq 0x5550
movl $0x8, %edi
movl $0x6, %esi
leaq 0x141c8(%rip), %rdx     # 0x1c13e
movb $0x0, %al
callq 0x5570
movl $0x9, %edi
movl $0x6, %esi
leaq 0x141f9(%rip), %rdx     # 0x1c187
movb $0x0, %al
callq 0x5570
movl $0xa, %edi
movl $0x6, %esi
leaq 0x14217(%rip), %rdx     # 0x1c1bd
movb $0x0, %al
callq 0x5570
movl $0xb, %edi
movl $0x6, %esi
leaq 0x1423a(%rip), %rdx     # 0x1c1f8
movb $0x0, %al
callq 0x5570
movl $0xc, %edi
movl $0x6, %esi
leaq 0x1425a(%rip), %rdx     # 0x1c230
movb $0x0, %al
callq 0x5570
movl $0xd, %edi
movl $0x8, %esi
leaq 0x14277(%rip), %rdx     # 0x1c265
movb $0x0, %al
callq 0x5570
movl $0xe, %edi
movl $0x8, %esi
leaq 0x1429f(%rip), %rdx     # 0x1c2a5
movb $0x0, %al
callq 0x5570
movl $0xf, %edi
movl $0x8, %esi
leaq 0x142ca(%rip), %rdx     # 0x1c2e8
movb $0x0, %al
callq 0x5570
movl $0x10, %edi
movl $0x8, %esi
leaq 0x142df(%rip), %rdx     # 0x1c315
movb $0x0, %al
callq 0x5570
movl $0x11, %edi
movl $0x8, %esi
leaq 0x142de(%rip), %rdx     # 0x1c32c
movb $0x0, %al
callq 0x5570
movl $0x12, %edi
movl $0x8, %esi
leaq 0x142ea(%rip), %rdx     # 0x1c350
movb $0x0, %al
callq 0x5570
movl $0x13, %edi
movl $0x8, %esi
leaq 0x142f3(%rip), %rdx     # 0x1c371
movb $0x0, %al
callq 0x5570
movl $0x14, %edi
movl $0x8, %esi
leaq 0x14309(%rip), %rdx     # 0x1c39f
movb $0x0, %al
callq 0x5570
movl $0x15, %edi
movl $0x8, %esi
leaq 0x142ff(%rip), %rdx     # 0x1c3ad
movb $0x0, %al
callq 0x5570
movl $0x16, %edi
movl $0x8, %esi
leaq 0x142f5(%rip), %rdx     # 0x1c3bb
movb $0x0, %al
callq 0x5570
movl $0x18, %edi
movl $0x6, %esi
leaq 0x142f9(%rip), %rdx     # 0x1c3d7
movb $0x0, %al
callq 0x5570
movl $0x19, %edi
movl $0x8, %esi
leaq 0x14326(%rip), %rdx     # 0x1c41c
movb $0x0, %al
callq 0x5570
movq 0x1feb4(%rip), %rax     # 0x27fb8
movq (%rax), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x5490
movl -0xc(%rbp), %edi
subl $0x1, %edi
movl $0x1, %esi
leaq 0x1431f(%rip), %rdx     # 0x1c442
movb $0x0, %al
callq 0x5570
movl -0xc(%rbp), %edi
subl $0x1, %edi
movl $0x14, %esi
leaq 0x14319(%rip), %rdx     # 0x1c455
movb $0x0, %al
callq 0x5570
movq 0x1fe6e(%rip), %rax     # 0x27fb8
movq (%rax), %rdi
movl $0x100, %esi            # imm = 0x100
xorl %eax, %eax
movl %eax, %edx
callq 0x5550
callq 0x56e0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)