// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x4570
movq 0xdbdd(%rip), %r13      # 0x12fb8
movq (%r13), %rdi
testq %rdi, %rdi
je 0x53ea
movswl 0x4(%rdi), %ebx
jmp 0x53ed
pushq $-0x2
popq %rbx
movl $0x220000, %esi         # imm = 0x220000
xorl %edx, %edx
callq 0x4170
leaq 0x7c64(%rip), %rdx      # 0xd064
pushq $0x1
popq %rbp
xorl %edi, %edi
movl %ebp, %esi
xorl %eax, %eax
callq 0x4410
movq (%r13), %rdi
movl $0x220000, %esi         # imm = 0x220000
xorl %edx, %edx
callq 0x43e0
leaq 0x7c62(%rip), %rdx      # 0xd087
pushq $0x6
popq %r14
movl %ebp, %edi
movl %r14d, %esi
xorl %eax, %eax
callq 0x4410
leaq 0x7c74(%rip), %rdx      # 0xd0b0
pushq $0x2
popq %rdi
movl %r14d, %esi
xorl %eax, %eax
callq 0x4410
leaq 0x7c7a(%rip), %rdx      # 0xd0ca
pushq $0x3
popq %rdi
movl %r14d, %esi
xorl %eax, %eax
callq 0x4410
leaq 0x7c84(%rip), %rdx      # 0xd0e8
pushq $0x4
popq %rdi
movl %r14d, %esi
xorl %eax, %eax
callq 0x4410
leaq 0x7c90(%rip), %rdx      # 0xd108
pushq $0x5
popq %rdi
movl %r14d, %esi
xorl %eax, %eax
callq 0x4410
movq (%r13), %rdi
movl $0x220000, %esi         # imm = 0x220000
xorl %edx, %edx
callq 0x4170
leaq 0x7c8a(%rip), %rdx      # 0xd126
pushq $0x7
popq %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x4410
movq (%r13), %rdi
movl $0x220000, %esi         # imm = 0x220000
xorl %edx, %edx
callq 0x43e0
leaq 0x7c7f(%rip), %rdx      # 0xd13e
pushq $0x8
popq %r15
movl %r15d, %edi
movl %r14d, %esi
xorl %eax, %eax
callq 0x4410
leaq 0x7cb0(%rip), %rdx      # 0xd187
pushq $0x9
popq %rdi
movl %r14d, %esi
xorl %eax, %eax
callq 0x4410
leaq 0x7cd2(%rip), %rdx      # 0xd1bd
pushq $0xa
popq %rdi
movl %r14d, %esi
xorl %eax, %eax
callq 0x4410
leaq 0x7cf9(%rip), %rdx      # 0xd1f8
pushq $0xb
popq %rdi
movl %r14d, %esi
xorl %eax, %eax
callq 0x4410
leaq 0x7d1d(%rip), %rdx      # 0xd230
pushq $0xc
popq %rdi
movl %r14d, %esi
xorl %eax, %eax
callq 0x4410
leaq 0x7d3e(%rip), %rdx      # 0xd265
pushq $0xd
popq %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x4410
leaq 0x7d6a(%rip), %rdx      # 0xd2a5
pushq $0xe
popq %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x4410
leaq 0x7d99(%rip), %rdx      # 0xd2e8
pushq $0xf
popq %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x4410
leaq 0x7db2(%rip), %rdx      # 0xd315
pushq $0x10
popq %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x4410
leaq 0x7db5(%rip), %rdx      # 0xd32c
pushq $0x11
popq %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x4410
leaq 0x7dc5(%rip), %rdx      # 0xd350
pushq $0x12
popq %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x4410
leaq 0x7dd2(%rip), %rdx      # 0xd371
pushq $0x13
popq %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x4410
leaq 0x7dec(%rip), %rdx      # 0xd39f
pushq $0x14
popq %r12
movl %r12d, %edi
movl %r15d, %esi
xorl %eax, %eax
callq 0x4410
leaq 0x7de2(%rip), %rdx      # 0xd3ad
pushq $0x15
popq %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x4410
leaq 0x7ddc(%rip), %rdx      # 0xd3bb
pushq $0x16
popq %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x4410
leaq 0x7de4(%rip), %rdx      # 0xd3d7
pushq $0x18
popq %rdi
movl %r14d, %esi
xorl %eax, %eax
callq 0x4410
leaq 0x7e15(%rip), %rdx      # 0xd41c
pushq $0x19
popq %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x4410
movq (%r13), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x4360
leaq 0x7e19(%rip), %rdx      # 0xd442
movl %ebx, %edi
movl %ebp, %esi
xorl %eax, %eax
callq 0x4410
leaq 0x7e1a(%rip), %rdx      # 0xd455
movl %ebx, %edi
movl %r12d, %esi
xorl %eax, %eax
callq 0x4410
movq (%r13), %rdi
movl $0x100, %esi            # imm = 0x100
xorl %edx, %edx
callq 0x43e0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4550