// File: /workspace/github_c_makefile_star2_O0/kobolt[P]curses-collection/menu/menu.c
// Function: update_screen
static void update_screen(void)
{
  int n, i, maxy, maxx;
  int scrollbar_size, scrollbar_pos;

  getmaxyx(stdscr, maxy, maxx);
  erase();

  /* Draw text lines. */
  for (n = 0; n < maxy; n++) {
    if ((n + scroll_offset) >= list_size)
      break;

    if (n == (selected_entry - scroll_offset)) {
      attron(A_REVERSE);
      mvaddstr(n, 0, list[n + scroll_offset]);
      for (i = strlen(list[n + scroll_offset]); i < maxx - 2; i++)
        mvaddch(n, i, ' ');
      attroff(A_REVERSE);
    } else {
      mvaddstr(n, 0, list[n + scroll_offset]);
    }
  }

  /* Draw scrollbar. */
  if (list_size <= maxy)
    scrollbar_size = maxy;
  else
    scrollbar_size = maxy / (list_size / (double)maxy);

  scrollbar_pos = selected_entry / (double)list_size * (maxy - scrollbar_size);
  attron(A_REVERSE);
  for (i = 0; i <= scrollbar_size; i++)
    mvaddch(i + scrollbar_pos, maxx - 1, ' ');
  attroff(A_REVERSE);

  mvvline(0, maxx - 2, 0, maxy);

  /* Place cursor at end of selected line. */
  move(selected_entry - scroll_offset, maxx - 3);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
xorl %eax, %eax
movq 0x285f(%rip), %rcx      # 0x3fe0
cmpq (%rcx), %rax
je 0x179c
movq 0x2853(%rip), %rax      # 0x3fe0
movq (%rax), %rax
movswl 0x4(%rax), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x17a6
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x1c(%rbp)
jmp 0x17a6
movl -0x1c(%rbp), %eax
movl %eax, -0xc(%rbp)
xorl %eax, %eax
movq 0x282b(%rip), %rcx      # 0x3fe0
cmpq (%rcx), %rax
je 0x17d0
movq 0x281f(%rip), %rax      # 0x3fe0
movq (%rax), %rax
movswl 0x6(%rax), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x17da
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x20(%rbp)
jmp 0x17da
movl -0x20(%rbp), %eax
movl %eax, -0x10(%rbp)
movq 0x27f9(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
callq 0x1030
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x196a
movl -0x4(%rbp), %eax
addl 0xa86d(%rip), %eax      # 0xc078
cmpl 0xa85f(%rip), %eax      # 0xc070
jl 0x1818
jmp 0x196a
movl -0x4(%rbp), %eax
movl 0xa853(%rip), %ecx      # 0xc074
subl 0xa851(%rip), %ecx      # 0xc078
cmpl %ecx, %eax
jne 0x1912
movq 0x27aa(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
movl $0x40000, %esi          # imm = 0x40000
xorl %eax, %eax
movl %eax, %edx
callq 0x10d0
movq 0x2792(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
movl -0x4(%rbp), %esi
xorl %edx, %edx
callq 0x1120
cmpl $-0x1, %eax
jne 0x1862
jmp 0x188f
movq 0x2777(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
movl -0x4(%rbp), %eax
addl 0xa803(%rip), %eax      # 0xc078
cltq
leaq 0x2872(%rip), %rsi      # 0x40f0
shlq $0x7, %rax
addq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1170
movl -0x4(%rbp), %eax
addl 0xa7e0(%rip), %eax      # 0xc078
cltq
leaq 0x284f(%rip), %rdi      # 0x40f0
shlq $0x7, %rax
addq %rax, %rdi
callq 0x1080
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
movl -0x10(%rbp), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0x18f8
movq 0x271c(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
movl -0x4(%rbp), %esi
movl -0x8(%rbp), %edx
callq 0x1120
cmpl $-0x1, %eax
jne 0x18d9
jmp 0x18ed
movq 0x2700(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
movl $0x20, %esi
callq 0x1140
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x18b0
movq 0x26e1(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
movl $0x40000, %esi          # imm = 0x40000
xorl %eax, %eax
movl %eax, %edx
callq 0x1180
jmp 0x195a
movq 0x26c7(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
movl -0x4(%rbp), %esi
xorl %edx, %edx
callq 0x1120
cmpl $-0x1, %eax
jne 0x192d
jmp 0x195a
movq 0x26ac(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
movl -0x4(%rbp), %eax
addl 0xa738(%rip), %eax      # 0xc078
cltq
leaq 0x27a7(%rip), %rsi      # 0x40f0
shlq $0x7, %rax
addq %rax, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1170
jmp 0x195c
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x17f6
movl 0xa700(%rip), %eax      # 0xc070
cmpl -0xc(%rbp), %eax
jg 0x197d
movl -0xc(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x199e
cvtsi2sdl -0xc(%rbp), %xmm0
cvtsi2sdl 0xa6e6(%rip), %xmm1 # 0xc070
cvtsi2sdl -0xc(%rbp), %xmm2
divsd %xmm2, %xmm1
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x14(%rbp)
cvtsi2sdl 0xa6ce(%rip), %xmm0 # 0xc074
cvtsi2sdl 0xa6c2(%rip), %xmm1 # 0xc070
divsd %xmm1, %xmm0
movl -0xc(%rbp), %eax
subl -0x14(%rbp), %eax
cvtsi2sd %eax, %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x18(%rbp)
movq 0x2612(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
movl $0x40000, %esi          # imm = 0x40000
xorl %eax, %eax
movl %eax, %edx
callq 0x10d0
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl -0x14(%rbp), %eax
jg 0x1a2f
movq 0x25eb(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
movl -0x8(%rbp), %esi
addl -0x18(%rbp), %esi
movl -0x10(%rbp), %edx
subl $0x1, %edx
callq 0x1120
cmpl $-0x1, %eax
jne 0x1a10
jmp 0x1a24
movq 0x25c9(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
movl $0x20, %esi
callq 0x1140
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x19e6
movq 0x25aa(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
movl $0x40000, %esi          # imm = 0x40000
xorl %eax, %eax
movl %eax, %edx
callq 0x1180
movq 0x2592(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
movl -0x10(%rbp), %edx
subl $0x2, %edx
xorl %esi, %esi
callq 0x1120
cmpl $-0x1, %eax
jne 0x1a65
jmp 0x1a79
movq 0x2574(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
movl -0xc(%rbp), %edx
xorl %esi, %esi
callq 0x1110
movq 0x2560(%rip), %rax      # 0x3fe0
movq (%rax), %rdi
movl 0xa5eb(%rip), %esi      # 0xc074
subl 0xa5e9(%rip), %esi      # 0xc078
movl -0x10(%rbp), %edx
subl $0x3, %edx
callq 0x1120
addq $0x20, %rsp
popq %rbp
retq