// File: /workspace/github_c_makefile_star2_O3/kobolt[P]curses-collection/playlist/ui.c
// Function: update_screen
static void update_screen(void)
{
  int n, i, maxy, maxx, playing;
  char *entry;

  getmaxyx(stdscr, maxy, maxx);
  maxy -= 2;
  erase();

  /* Draw entries. */
  for (n = 0; n < maxy; n++) {
    if ((n + scroll_offset) >= list_size_get())
      break;

    entry = list_get(n + scroll_offset, &playing);
    if (entry == NULL)
      break;

    if (n == (selected_entry - scroll_offset)) {
      attron(A_REVERSE);
      if (playing)
        attron(A_BOLD);
      mvaddnstr(n, 0, entry, maxx);
      for (i = strlen(entry); i < maxx; i++)
        mvaddch(n, i, ' ');
      if (playing)
        attroff(A_BOLD);
      attroff(A_REVERSE);
    } else {
      if (playing)
        attron(A_BOLD);
      mvaddnstr(n, 0, entry, maxx);
      if (playing)
        attroff(A_BOLD);
    }
  }

  /* Draw status bar and filter input, and let cursor rest there. */
  mvhline(maxy, 0, 0, maxx);
  mvprintw(maxy + 1, 0, "> %s", file_filter);

  if (help_hint_active) {
    attron(A_REVERSE);
    mvaddstr(maxy, 0, "Press F1 for help.");
    attroff(A_REVERSE);
  }

  if (help_window_active) {
    if (help_window == NULL) {
      help_window = subwin(stdscr, 13, maxx - 6, 3, 3);
    }
    werase(help_window);
    mvwaddstr(help_window, 1, 1, "F1 - Help");
    mvwaddstr(help_window, 2, 1, "F5 - Go to top (Same as Home key)");
    mvwaddstr(help_window, 3, 1, "F6 - Go to bottom (Same as End key)");
    mvwaddstr(help_window, 4, 1, "F7 - Move entry up");
    mvwaddstr(help_window, 5, 1, "F8 - Move entry down");
    mvwaddstr(help_window, 6, 1, "F9 - Shuffle list (Also if filtered)");
    mvwaddstr(help_window, 7, 1, "Escape - Quit");
    mvwaddstr(help_window, 9, 1,
      "Use Up/Down Arrow keys and Page Up/Down to scroll and move cursor.");
    mvwaddstr(help_window, 10, 1,
      "Use Left or Right Arrow keys to select entry under cursor.");
    mvwaddstr(help_window, 11, 1,
      "Use characters to enter a filter, and press Enter to apply it.");
    box(help_window, ACS_VLINE, ACS_HLINE);
  } else {
    if (help_window != NULL) {
      delwin(help_window);
      help_window = NULL;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x37a8(%rip), %r12      # 0x5fe0
movq (%r12), %rdi
testq %rdi, %rdi
je 0x29be
movswl 0x4(%rdi), %ebx
leal -0x1(%rbx), %r14d
movswl 0x6(%rdi), %r15d
leal 0x1(%r15), %eax
movl %eax, -0x2c(%rbp)
callq 0x2030
cmpl $0x2, %ebx
jl 0x29d0
movq %r15, -0x38(%rbp)
leal 0x1(%r15), %ebx
xorl %r15d, %r15d
movl 0x3943(%rip), %r13d     # 0x61bc
addl %r15d, %r13d
callq 0x2f4f
cmpl %eax, %r13d
jge 0x29d0
movl 0x392c(%rip), %edi      # 0x61bc
addl %r15d, %edi
leaq -0x30(%rbp), %rsi
callq 0x2f00
testq %rax, %rax
je 0x29d0
movq %rax, %r13
movl 0x390a(%rip), %eax      # 0x61b8
subl 0x3908(%rip), %eax      # 0x61bc
cmpl %eax, %r15d
jne 0x295e
movq (%r12), %rdi
movl $0x40000, %esi          # imm = 0x40000
xorl %edx, %edx
callq 0x2150
cmpl $0x0, -0x30(%rbp)
je 0x28e3
movq (%r12), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x2150
movq (%r12), %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x2250
cmpl $-0x1, %eax
je 0x2905
movq (%r12), %rdi
movq %r13, %rsi
movl -0x2c(%rbp), %edx
callq 0x22b0
movq %r13, %rdi
callq 0x20e0
movq %rax, %r13
cmpl %r13d, -0x38(%rbp)
jl 0x2940
movq (%r12), %rdi
movl %r15d, %esi
movl %r13d, %edx
callq 0x2250
cmpl $-0x1, %eax
je 0x2938
movq (%r12), %rdi
movl $0x20, %esi
callq 0x2270
incl %r13d
cmpl %r13d, %ebx
jne 0x2916
movl $0x40000, %r13d         # imm = 0x40000
cmpl $0x0, -0x30(%rbp)
je 0x29a2
movq (%r12), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x22f0
jmp 0x29a2
cmpl $0x0, -0x30(%rbp)
je 0x2974
movq (%r12), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x2150
movq (%r12), %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x2250
cmpl $-0x1, %eax
je 0x2996
movq (%r12), %rdi
movq %r13, %rsi
movl -0x2c(%rbp), %edx
callq 0x22b0
movl $0x200000, %r13d        # imm = 0x200000
cmpl $0x0, -0x30(%rbp)
je 0x29b0
movq (%r12), %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x22f0
incl %r15d
cmpl %r14d, %r15d
jne 0x2872
jmp 0x29d0
callq 0x2030
movl $0xfffffffd, %r14d      # imm = 0xFFFFFFFD
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
movq (%r12), %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0x2250
cmpl $-0x1, %eax
je 0x29f1
movq (%r12), %rdi
xorl %esi, %esi
movl -0x2c(%rbp), %edx
callq 0x22c0
leal 0x1(%r14), %edi
leaq 0x1671(%rip), %rdx      # 0x406d
leaq 0x37bd(%rip), %rcx      # 0x61c0
xorl %esi, %esi
xorl %eax, %eax
callq 0x2180
cmpb $0x0, 0x37a1(%rip)      # 0x61b4
jne 0x2a5d
movq (%r12), %rdi
movl $0x40000, %esi          # imm = 0x40000
xorl %edx, %edx
callq 0x2150
movq (%r12), %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0x2250
cmpl $-0x1, %eax
je 0x2a4d
movq (%r12), %rdi
leaq 0x162f(%rip), %rsi      # 0x4072
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x22b0
movq (%r12), %rdi
movl $0x40000, %esi          # imm = 0x40000
xorl %edx, %edx
callq 0x22f0
movq 0x3794(%rip), %rdi      # 0x61f8
cmpb $0x1, 0x3745(%rip)      # 0x61b0
jne 0x2cd8
testq %rdi, %rdi
jne 0x2a9f
movq (%r12), %rdi
movl -0x2c(%rbp), %edx
addl $-0x6, %edx
movl $0xd, %esi
movl $0x3, %ecx
movl $0x3, %r8d
callq 0x2200
movq %rax, %rdi
movq %rax, 0x3759(%rip)      # 0x61f8
callq 0x2030
movq 0x374d(%rip), %rdi      # 0x61f8
movl $0x1, %esi
movl $0x1, %edx
callq 0x2250
cmpl $-0x1, %eax
je 0x2ad7
movq 0x3732(%rip), %rdi      # 0x61f8
leaq 0x15b8(%rip), %rsi      # 0x4085
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x22b0
movq 0x371a(%rip), %rdi      # 0x61f8
movl $0x2, %esi
movl $0x1, %edx
callq 0x2250
cmpl $-0x1, %eax
je 0x2b0a
movq 0x36ff(%rip), %rdi      # 0x61f8
leaq 0x158f(%rip), %rsi      # 0x408f
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x22b0
movq 0x36e7(%rip), %rdi      # 0x61f8
movl $0x3, %esi
movl $0x1, %edx
callq 0x2250
cmpl $-0x1, %eax
je 0x2b3d
movq 0x36cc(%rip), %rdi      # 0x61f8
leaq 0x157e(%rip), %rsi      # 0x40b1
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x22b0
movq 0x36b4(%rip), %rdi      # 0x61f8
movl $0x4, %esi
movl $0x1, %edx
callq 0x2250
cmpl $-0x1, %eax
je 0x2b70
movq 0x3699(%rip), %rdi      # 0x61f8
leaq 0x156f(%rip), %rsi      # 0x40d5
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x22b0
movq 0x3681(%rip), %rdi      # 0x61f8
movl $0x5, %esi
movl $0x1, %edx
callq 0x2250
cmpl $-0x1, %eax
je 0x2ba3
movq 0x3666(%rip), %rdi      # 0x61f8
leaq 0x154f(%rip), %rsi      # 0x40e8
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x22b0
movq 0x364e(%rip), %rdi      # 0x61f8
movl $0x6, %esi
movl $0x1, %edx
callq 0x2250
cmpl $-0x1, %eax
je 0x2bd6
movq 0x3633(%rip), %rdi      # 0x61f8
leaq 0x1531(%rip), %rsi      # 0x40fd
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x22b0
movq 0x361b(%rip), %rdi      # 0x61f8
movl $0x7, %esi
movl $0x1, %edx
callq 0x2250
cmpl $-0x1, %eax
je 0x2c09
movq 0x3600(%rip), %rdi      # 0x61f8
leaq 0x1523(%rip), %rsi      # 0x4122
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x22b0
movq 0x35e8(%rip), %rdi      # 0x61f8
movl $0x9, %esi
movl $0x1, %edx
callq 0x2250
cmpl $-0x1, %eax
je 0x2c3c
movq 0x35cd(%rip), %rdi      # 0x61f8
leaq 0x14fe(%rip), %rsi      # 0x4130
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x22b0
movq 0x35b5(%rip), %rdi      # 0x61f8
movl $0xa, %esi
movl $0x1, %edx
callq 0x2250
cmpl $-0x1, %eax
je 0x2c6f
movq 0x359a(%rip), %rdi      # 0x61f8
leaq 0x150e(%rip), %rsi      # 0x4173
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x22b0
movq 0x3582(%rip), %rdi      # 0x61f8
movl $0xb, %esi
movl $0x1, %edx
callq 0x2250
cmpl $-0x1, %eax
je 0x2ca2
movq 0x3567(%rip), %rdi      # 0x61f8
leaq 0x1516(%rip), %rsi      # 0x41ae
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x22b0
movq 0x354f(%rip), %rdi      # 0x61f8
movq 0x3328(%rip), %rax      # 0x5fd8
movl 0x1c4(%rax), %ecx
movl 0x1e0(%rax), %edx
subq $0x8, %rsp
xorl %eax, %eax
movl %edx, %esi
movl %ecx, %r8d
xorl %r9d, %r9d
pushq %rax
pushq %rax
pushq %rax
callq 0x20b0
addq $0x20, %rsp
jmp 0x2ced
testq %rdi, %rdi
je 0x2ced
callq 0x21b0
movq $0x0, 0x350b(%rip) # 0x61f8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq