// File: /workspace/github_cpp_makefile_star2_O3/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 %r14
pushq %rbx
pushq %rax
callq 0x4570
movq 0xdba0(%rip), %r14      # 0x12fb8
movq (%r14), %rdi
testq %rdi, %rdi
je 0x5426
movswl 0x4(%rdi), %ebx
jmp 0x542b
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
movl $0x220000, %esi         # imm = 0x220000
xorl %edx, %edx
callq 0x4140
leaq 0x8c18(%rip), %rdx      # 0xe056
xorl %edi, %edi
movl $0x1, %esi
xorl %eax, %eax
callq 0x43d0
movq (%r14), %rdi
movl $0x220000, %esi         # imm = 0x220000
xorl %edx, %edx
callq 0x43b0
leaq 0x8c17(%rip), %rdx      # 0xe079
movl $0x1, %edi
movl $0x6, %esi
xorl %eax, %eax
callq 0x43d0
leaq 0x8c28(%rip), %rdx      # 0xe0a2
movl $0x2, %edi
movl $0x6, %esi
xorl %eax, %eax
callq 0x43d0
leaq 0x8c2a(%rip), %rdx      # 0xe0bc
movl $0x3, %edi
movl $0x6, %esi
xorl %eax, %eax
callq 0x43d0
leaq 0x8c30(%rip), %rdx      # 0xe0da
movl $0x4, %edi
movl $0x6, %esi
xorl %eax, %eax
callq 0x43d0
leaq 0x8c38(%rip), %rdx      # 0xe0fa
movl $0x5, %edi
movl $0x6, %esi
xorl %eax, %eax
callq 0x43d0
movq (%r14), %rdi
movl $0x220000, %esi         # imm = 0x220000
xorl %edx, %edx
callq 0x4140
leaq 0x8c2f(%rip), %rdx      # 0xe118
movl $0x7, %edi
movl $0x1, %esi
xorl %eax, %eax
callq 0x43d0
movq (%r14), %rdi
movl $0x220000, %esi         # imm = 0x220000
xorl %edx, %edx
callq 0x43b0
leaq 0x8c20(%rip), %rdx      # 0xe130
movl $0x8, %edi
movl $0x6, %esi
xorl %eax, %eax
callq 0x43d0
leaq 0x8c51(%rip), %rdx      # 0xe179
movl $0x9, %edi
movl $0x6, %esi
xorl %eax, %eax
callq 0x43d0
leaq 0x8c6f(%rip), %rdx      # 0xe1af
movl $0xa, %edi
movl $0x6, %esi
xorl %eax, %eax
callq 0x43d0
leaq 0x8c92(%rip), %rdx      # 0xe1ea
movl $0xb, %edi
movl $0x6, %esi
xorl %eax, %eax
callq 0x43d0
leaq 0x8cb2(%rip), %rdx      # 0xe222
movl $0xc, %edi
movl $0x6, %esi
xorl %eax, %eax
callq 0x43d0
leaq 0x8ccf(%rip), %rdx      # 0xe257
movl $0xd, %edi
movl $0x8, %esi
xorl %eax, %eax
callq 0x43d0
leaq 0x8cf7(%rip), %rdx      # 0xe297
movl $0xe, %edi
movl $0x8, %esi
xorl %eax, %eax
callq 0x43d0
leaq 0x8d22(%rip), %rdx      # 0xe2da
movl $0xf, %edi
movl $0x8, %esi
xorl %eax, %eax
callq 0x43d0
leaq 0x8d37(%rip), %rdx      # 0xe307
movl $0x10, %edi
movl $0x8, %esi
xorl %eax, %eax
callq 0x43d0
leaq 0x8d36(%rip), %rdx      # 0xe31e
movl $0x11, %edi
movl $0x8, %esi
xorl %eax, %eax
callq 0x43d0
leaq 0x8d42(%rip), %rdx      # 0xe342
movl $0x12, %edi
movl $0x8, %esi
xorl %eax, %eax
callq 0x43d0
leaq 0x8d4b(%rip), %rdx      # 0xe363
movl $0x13, %edi
movl $0x8, %esi
xorl %eax, %eax
callq 0x43d0
leaq 0x8d61(%rip), %rdx      # 0xe391
movl $0x14, %edi
movl $0x8, %esi
xorl %eax, %eax
callq 0x43d0
leaq 0x8d57(%rip), %rdx      # 0xe39f
movl $0x15, %edi
movl $0x8, %esi
xorl %eax, %eax
callq 0x43d0
leaq 0x8d4d(%rip), %rdx      # 0xe3ad
movl $0x16, %edi
movl $0x8, %esi
xorl %eax, %eax
callq 0x43d0
leaq 0x8d51(%rip), %rdx      # 0xe3c9
movl $0x18, %edi
movl $0x6, %esi
xorl %eax, %eax
callq 0x43d0
leaq 0x8d7e(%rip), %rdx      # 0xe40e
movl $0x19, %edi
movl $0x8, %esi
xorl %eax, %eax
callq 0x43d0
movq (%r14), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x4310
leaq 0x8d7f(%rip), %rdx      # 0xe434
movl %ebx, %edi
movl $0x1, %esi
xorl %eax, %eax
callq 0x43d0
leaq 0x8d7d(%rip), %rdx      # 0xe447
movl %ebx, %edi
movl $0x14, %esi
xorl %eax, %eax
callq 0x43d0
movq (%r14), %rdi
movl $0x100, %esi            # imm = 0x100
xorl %edx, %edx
callq 0x43b0
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4550
nop